LArSoft
v06_85_00
Liquid Argon Software toolkit - http://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 | |
template<typename ModuleType > | |
HitCollectionAssociator (ModuleType &producer, art::Event &event, std::string instance_name, art::InputTag const &WireModuleLabel, art::InputTag const &RawDigitModuleLabel) | |
Constructor: sets instance name and whether to build associations. More... | |
template<typename ModuleType > | |
HitCollectionAssociator (ModuleType &producer, art::Event &event, art::InputTag const &WireModuleLabel, art::InputTag const &RawDigitModuleLabel) | |
Constructor: sets instance name and whether to build associations. More... | |
template<typename ModuleType > | |
HitCollectionAssociator (ModuleType &producer, art::Event &event, std::string instance_name, art::InputTag const &WireModuleLabel, bool doRawDigitAssns) | |
Constructor: sets instance name and whether to build associations. More... | |
template<typename ModuleType > | |
HitCollectionAssociator (ModuleType &producer, art::Event &event, art::InputTag const &WireModuleLabel, bool doRawDigitAssns) | |
Constructor: sets instance name and whether to build associations. More... | |
Static Public Member Functions | |
template<typename ModuleType > | |
static void | declare_products (ModuleType &producer, 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 | wires_label |
Label of the collection of wires to associate. More... | |
art::InputTag | digits_label |
Label of raw digits collection to associate. 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 collection of recob::Hit
and you simply want the hits associated to the wire and digit with the same channel.
Definition at line 703 of file HitCreator.h.
|
protectedinherited |
Type of art pointer to Hit.
Definition at line 462 of file HitCreator.h.
recob::HitCollectionAssociator::HitCollectionAssociator | ( | ModuleType & | producer, |
art::Event & | event, | ||
std::string | instance_name, | ||
art::InputTag const & | WireModuleLabel, | ||
art::InputTag const & | RawDigitModuleLabel | ||
) |
Constructor: sets instance name and whether to build associations.
ModuleType | type of producing module (EDProducer or EDFilter ) |
producer | the module producing the data products |
event | the event the products are going to be put into |
instance_name | name of the instance for all data products |
WireModuleLabel | label of the module used to create wires |
RawDigitModuleLabel | label of the module used to create raw digits |
All the data products (hit collection and associations) will have the specified product instance name.
If a label is empty, the corresponding association will not be produced.
Definition at line 1175 of file HitCreator.h.
References recob::HitAndAssociationsWriterBase::hits.
|
inline |
Constructor: sets instance name and whether to build associations.
ModuleType | type of producing module (EDProducer or EDFilter ) |
producer | the module producing the data products |
event | the event the products are going to be put into |
WireModuleLabel | label of the module used to create wires |
RawDigitModuleLabel | label of the module used to create raw digits |
All the data products (hit collection and associations) will have a default, empty product instance name.
If a label is empty, the corresponding association will not be produced.
Definition at line 743 of file HitCreator.h.
recob::HitCollectionAssociator::HitCollectionAssociator | ( | ModuleType & | producer, |
art::Event & | event, | ||
std::string | instance_name, | ||
art::InputTag const & | WireModuleLabel, | ||
bool | doRawDigitAssns | ||
) |
Constructor: sets instance name and whether to build associations.
ModuleType | type of producing module (EDProducer or EDFilter ) |
producer | the module producing the data products |
event | the event the products are going to be put into |
instance_name | name of the instance for all data products |
WireModuleLabel | label of the module used to create wires |
doRawDigitAssns | whether to write associations with raw digits |
All the data products (hit collection and associations) will have the specified product instance name.
The raw digit association is built out of their existing associations with wires, rather than by directly using the raw digits data product.
Definition at line 1194 of file HitCreator.h.
References recob::HitAndAssociationsWriterManager< Writer, ModuleType >::HitAndAssociationsWriterManager(), recob::HitAndAssociationsWriterBase::hits, art::errors::LogicError, recob::HitAndAssociationsWriterBase::RawDigitAssns, and recob::HitAndAssociationsWriterBase::WireAssns.
|
inline |
Constructor: sets instance name and whether to build associations.
ModuleType | type of producing module (EDProducer or EDFilter ) |
producer | the module producing the data products |
event | the event the products are going to be put into |
WireModuleLabel | label of the module used to create wires |
doRawDigitAssns | whether to write associations with raw digits |
All the data products (hit collection and associations) will have the default, empty product instance name.
The raw digit association is built out of their existing associations with wires, rather than by directly using the raw digits data product.
Definition at line 790 of file HitCreator.h.
|
inlineprotectedinherited |
Creates an art pointer to the hit with the specified index.
Definition at line 499 of file HitCreator.h.
|
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 1117 of file HitCreator.h.
Referenced by apa::APAHitFinder::APAHitFinder(), cluster::ClusterCrawler::ClusterCrawler(), CRHitRemoval::CRHitRemoval(), recob::HitAndAssociationsWriterManager< Writer, ModuleType >::declareProducts(), 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 433 of file HitCreator.h.
References hits().
|
protected |
Finds out the associations for the specified hits.
Definition at line 321 of file HitCreator.cxx.
References raw::RawDigit::Channel(), recob::Wire::Channel(), art::Ptr< T >::isNull(), art::errors::LogicError, util::MakeIndex(), max, and recob::HitRefinerAssociator::use_hits().
|
inlineprotected |
Finds out the associations for the current hits.
Definition at line 846 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 824 of file HitCreator.h.
References put_into().
Referenced by hit::HitFinder::produce(), hit::RFFHitFinder::produce(), cluster::ClusterCrawler::produce(), and put_into().
void recob::HitCollectionAssociator::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 313 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 408 of file HitCreator.h.
References hits().
void recob::HitCollectionAssociator::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 306 of file HitCreator.cxx.
References hits().
Referenced by recob::HitCollectionCreator::CreateAssociationsToLastHit(), hit::HitFinder::produce(), hit::RFFHitFinder::produce(), and cluster::ClusterCrawler::produce().
|
protected |
Label of raw digits collection to associate.
Definition at line 840 of file HitCreator.h.
|
protectedinherited |
Pointer to the event we are using.
Definition at line 473 of file HitCreator.h.
Referenced by recob::HitAndAssociationsWriterManager< Writer, ModuleType >::collectionWriter().
|
protectedinherited |
Tool to create hit pointers,.
Definition at line 475 of file HitCreator.h.
|
protectedinherited |
Collection of hits.
Definition at line 467 of file HitCreator.h.
Referenced by HitCollectionAssociator(), recob::HitCollectionCreator::HitCollectionCreator(), and recob::HitRefinerAssociator::HitRefinerAssociator().
|
protectedinherited |
Tame of the instance for data products.
Definition at line 464 of file HitCreator.h.
|
protectedinherited |
Associations with raw digits.
Definition at line 471 of file HitCreator.h.
Referenced by HitCollectionAssociator().
|
protectedinherited |
Associations with wires.
Definition at line 469 of file HitCreator.h.
Referenced by HitCollectionAssociator().
|
protected |
Label of the collection of wires to associate.
Definition at line 838 of file HitCreator.h.