![]() |
LArSoft
v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
|
A class handling a collection of hits and its associations. More...
#include "HitCreator.h"
Public Member Functions | |
void | use_hits (std::unique_ptr< std::vector< recob::Hit >> &&srchits) |
Uses the specified collection as data product. More... | |
void | put_into (art::Event &) |
Moves the data into the event. More... | |
void | put_into () |
Moves the data into the event. More... | |
size_t | size () const |
Returns the number of hits currently in the collection. More... | |
std::vector< recob::Hit > const & | peek () const |
Returns a read-only reference to the current list of hits. More... | |
Constructors | |
HitRefinerAssociator (art::Event &event, art::InputTag const &HitModuleLabel, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true) | |
Constructor: sets instance name and whether to build associations. More... | |
HitRefinerAssociator (art::Event &event, art::InputTag const &HitModuleLabel, bool doWireAssns, bool doRawDigitAssns=true) | |
Constructor: sets instance name and whether to build associations. More... | |
Static Public Member Functions | |
static void | declare_products (art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true) |
Declares the hit products we are going to fill. More... | |
Protected Types | |
using | HitPtr_t = art::Ptr< recob::Hit > |
Type of art pointer to Hit. More... | |
Protected Member Functions | |
void | prepare_associations (std::vector< recob::Hit > const &srchits) |
Finds out the associations for the specified hits. More... | |
void | prepare_associations () |
Finds out the associations for the current hits. More... | |
HitPtr_t | CreatePtr (size_t index) const |
Creates an art pointer to the hit with the specified index. More... | |
Protected Attributes | |
art::InputTag | hits_label |
Label of the collection of hits. More... | |
std::string | prod_instance |
Tame of the instance for data products. More... | |
std::unique_ptr< std::vector< recob::Hit > > | hits |
Collection of hits. More... | |
std::unique_ptr< art::Assns< recob::Wire, recob::Hit > > | WireAssns |
Associations with wires. More... | |
std::unique_ptr< art::Assns< raw::RawDigit, recob::Hit > > | RawDigitAssns |
Associations with raw digits. More... | |
art::Event * | event = nullptr |
Pointer to the event we are using. More... | |
art::PtrMaker< recob::Hit > | hitPtrMaker |
Tool to create hit pointers,. More... | |
A class handling a collection of hits and its associations.
Use this object if you already have a recob::Hit
data product and another collection that is going to become a data product, and you simply want the new hits associated to the wire and digit with the same channel. No hit-to-hit association is attempted (that would be, incidentally, not supported by art): the data product is used to get all the associated wires and digits, then they are associated to the new hits by channel ID. If a channel is not available, a warning is produced. If different hits on the same channel are associated to different wires or raw digits, an exception is thrown.
Definition at line 795 of file HitCreator.h.
|
protectedinherited |
Type of art pointer to Hit.
Definition at line 447 of file HitCreator.h.
recob::HitRefinerAssociator::HitRefinerAssociator | ( | art::Event & | event, |
art::InputTag const & | HitModuleLabel, | ||
std::string | instance_name = "" , |
||
bool | doWireAssns = true , |
||
bool | doRawDigitAssns = true |
||
) |
Constructor: sets instance name and whether to build associations.
event | the event the products are going to be put into |
HitModuleLabel | label of the module used to create hits |
instance_name | name of the instance for all data products |
doWireAssns | whether to enable associations to wires |
doRawDigitAssns | whether to enable associations to raw digits |
All the data products (hit collection and associations) will have the specified product instance name.
Definition at line 508 of file HitCreator.cxx.
References recob::HitAndAssociationsWriterBase::hits.
|
inline |
Constructor: sets instance name and whether to build associations.
event | the event the products are going to be put into |
HitModuleLabel | label of the module used to create hits |
doWireAssns | whether to enable associations to wires |
doRawDigitAssns | whether to enable associations to raw digits |
All the data products (hit collection and associations) will have an empty product instance name.
Definition at line 826 of file HitCreator.h.
|
inlineprotectedinherited |
Creates an art pointer to the hit with the specified index.
Definition at line 478 of file HitCreator.h.
Referenced by recob::HitCollectionAssociator::prepare_associations(), and prepare_associations().
|
staticinherited |
Declares the hit products we are going to fill.
ModuleType | type of producing module (EDProducer or EDFilter ) |
producer | the module producing the data products |
instance_name | name of the instance for all data products |
doWireAssns | whether to enable associations to wires |
doRawDigitAssns | whether to enable associations to raw digits |
This declaration must be given in the constructor of producer. It is equivalent to manually declare the relevant among these products:
in the producer constructor. All the data products (hit collection and associations) will have the specified product instance name.
Definition at line 261 of file HitCreator.cxx.
References art::ProducesCollector::produces().
Referenced by apa::APAHitFinder::APAHitFinder(), cluster::ClusterCrawler::ClusterCrawler(), CRHitRemoval::CRHitRemoval(), hit::DisambigCheater::DisambigCheater(), hit::DPRawHitFinder::DPRawHitFinder(), hit::FFTHitFinder::FFTHitFinder(), hit::GausHitFinder::GausHitFinder(), hit::HitCheater::HitCheater(), hit::HitFinder::HitFinder(), cluster::LineCluster::LineCluster(), hit::RawHitFinder::RawHitFinder(), hit::RFFHitFinder::RFFHitFinder(), cluster::TrajCluster::TrajCluster(), and hit::TTHitFinder::TTHitFinder().
|
inlineinherited |
Returns a read-only reference to the current list of hits.
Definition at line 420 of file HitCreator.h.
References hits().
|
protected |
Finds out the associations for the specified hits.
Definition at line 534 of file HitCreator.cxx.
References raw::RawDigit::Channel(), recob::Hit::Channel(), recob::Wire::Channel(), recob::HitAndAssociationsWriterBase::CreatePtr(), hits_label, art::Ptr< T >::isNull(), art::errors::ProductNotFound, recob::HitAndAssociationsWriterBase::RawDigitAssns, and recob::HitAndAssociationsWriterBase::WireAssns.
|
inlineprotected |
Finds out the associations for the current hits.
Definition at line 876 of file HitCreator.h.
References hits(), and prepare_associations().
Referenced by prepare_associations(), and put_into().
|
inline |
Moves the data into the event.
The calling module must have already declared the production of these products with the proper instance name. After the move, the collections in this object are empty.
Definition at line 858 of file HitCreator.h.
References put_into().
Referenced by lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), cluster::LineCluster::produce(), cluster::TrajCluster::produce(), and put_into().
void recob::HitRefinerAssociator::put_into | ( | ) |
Moves the data into the event.
The calling module must have already declared the production of these products with the proper instance name. After the move, the collections in this object are empty.
Definition at line 527 of file HitCreator.cxx.
References prepare_associations(), and recob::HitAndAssociationsWriterBase::put_into().
|
inlineinherited |
Returns the number of hits currently in the collection.
Definition at line 397 of file HitCreator.h.
References hits().
void recob::HitRefinerAssociator::use_hits | ( | std::unique_ptr< std::vector< recob::Hit >> && | srchits | ) |
Uses the specified collection as data product.
srchits | the collection to be used as data product |
The very same collection is put into the event. This object will temporary own the collection until the hits are put into the event. If there were previous hits in the object, they are lost.
Definition at line 521 of file HitCreator.cxx.
References recob::HitAndAssociationsWriterBase::hits.
Referenced by lar_cluster3d::SpacePointHit3DBuilder::Hit3DBuilder(), cluster::LineCluster::produce(), and cluster::TrajCluster::produce().
|
protectedinherited |
Pointer to the event we are using.
Definition at line 458 of file HitCreator.h.
|
protectedinherited |
Tool to create hit pointers,.
Definition at line 460 of file HitCreator.h.
|
protectedinherited |
Collection of hits.
Definition at line 452 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::emplace_back(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionCreator::HitCollectionCreator(), HitRefinerAssociator(), recob::HitAndAssociationsWriterBase::put_into(), recob::HitCollectionCreator::put_into(), recob::HitCollectionAssociator::use_hits(), and use_hits().
|
protected |
Label of the collection of hits.
Definition at line 870 of file HitCreator.h.
Referenced by prepare_associations().
|
protectedinherited |
Tame of the instance for data products.
Definition at line 449 of file HitCreator.h.
Referenced by recob::HitAndAssociationsWriterBase::put_into().
|
protectedinherited |
Associations with raw digits.
Definition at line 456 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), prepare_associations(), and recob::HitAndAssociationsWriterBase::put_into().
|
protectedinherited |
Associations with wires.
Definition at line 454 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), prepare_associations(), and recob::HitAndAssociationsWriterBase::put_into().