LArSoft
v09_90_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 | |
size_t | size () const |
Returns the number of hits currently in the collection. More... | |
void | reserve (size_t new_size) |
Prepares the collection to host at least new_size hits. More... | |
void | put_into (art::Event &) |
Moves the data into an event. More... | |
void | put_into () |
Moves the data into the event. More... | |
std::vector< recob::Hit > const & | peek () const |
Returns a read-only reference to the current list of hits. More... | |
Constructors | |
HitCollectionCreator (art::Event &event, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true) | |
Constructor: sets instance name and whether to build associations. More... | |
HitCollectionCreator (art::Event &event, bool doWireAssns, bool doRawDigitAssns) | |
Constructor: no product instance name. More... | |
Addition of hits | |
void | emplace_back (recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >()) |
Adds the specified hit to the data collection. More... | |
void | emplace_back (recob::Hit const &hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >()) |
Adds the specified hit to the data collection. More... | |
void | emplace_back (HitCreator &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >()) |
Adds the specified hit to the data collection. More... | |
void | emplace_back (recob::Hit &&hit, art::Ptr< raw::RawDigit > const &digits) |
Adds the specified hit to the data collection. More... | |
void | emplace_back (HitCreator &&hit, art::Ptr< raw::RawDigit > const &digits) |
Adds the specified hit to the data collection. More... | |
void | emplace_back (HitCreator const &hit, art::Ptr< raw::RawDigit > const &digits) |
Adds the specified hit to the data collection. 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 = HitAndAssociationsWriterBase::HitPtr_t |
Protected Member Functions | |
HitPtr_t | CreatePtrToLastHit () const |
Creates an art pointer to the hit with the last index. More... | |
void | CreateAssociationsToLastHit (art::Ptr< recob::Wire > const &wire, art::Ptr< raw::RawDigit > const &digits) |
Creates associations between the last hit and the specified pointers. More... | |
HitPtr_t | CreatePtr (size_t index) const |
Creates an art pointer to the hit with the specified index. More... | |
Protected Attributes | |
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.
Instead of creating a collection of hits, one for its association with wires and one for its association with raw digits, one can push hits into this object, and then move it into the event.
Definition at line 481 of file HitCreator.h.
|
protected |
Definition at line 629 of file HitCreator.h.
recob::HitCollectionCreator::HitCollectionCreator | ( | art::Event & | event, |
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 |
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 275 of file HitCreator.cxx.
References recob::HitAndAssociationsWriterBase::hits.
|
inline |
Constructor: no product instance name.
event | the event the products are going to be put into |
doWireAssns | whether to enable associations to wires |
doRawDigitAssns | whether to enable associations to raw digits |
Definition at line 506 of file HitCreator.h.
|
protected |
Creates associations between the last hit and the specified pointers.
Definition at line 321 of file HitCreator.cxx.
References CreatePtrToLastHit(), art::Ptr< T >::isNonnull(), recob::HitAndAssociationsWriterBase::RawDigitAssns, and recob::HitAndAssociationsWriterBase::WireAssns.
Referenced by emplace_back().
|
inlineprotectedinherited |
Creates an art pointer to the hit with the specified index.
Definition at line 470 of file HitCreator.h.
Referenced by recob::HitCollectionAssociator::prepare_associations(), and recob::HitRefinerAssociator::prepare_associations().
|
inlineprotected |
Creates an art pointer to the hit with the last index.
Definition at line 632 of file HitCreator.h.
References hits().
Referenced by CreateAssociationsToLastHit().
|
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 248 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().
void recob::HitCollectionCreator::emplace_back | ( | recob::Hit && | hit, |
art::Ptr< recob::Wire > const & | wire = art::Ptr<recob::Wire>() , |
||
art::Ptr< raw::RawDigit > const & | digits = art::Ptr<raw::RawDigit>() |
||
) |
Adds the specified hit to the data collection.
hit | the hit that will be moved into the collection |
wire | art pointer to the wire to be associated to this hit |
digits | art pointer to the raw digits to be associated to this hit |
After this call, hit will be invalid. If a art pointer is not valid, that association will not be stored.
Definition at line 286 of file HitCreator.cxx.
References CreateAssociationsToLastHit(), and recob::HitAndAssociationsWriterBase::hits.
Referenced by CRHitRemoval::copyAllHits(), CRHitRemoval::copyInTimeHits(), hit::DisambigCheater::MakeDisambigHit(), hit::TTHitFinder::produce(), hit::RawHitFinder::produce(), apa::APAHitFinder::produce(), hit::FFTHitFinder::produce(), hit::HitCheater::produce(), hit::GausHitFinder::produce(), and hit::DPRawHitFinder::produce().
void recob::HitCollectionCreator::emplace_back | ( | recob::Hit const & | hit, |
art::Ptr< recob::Wire > const & | wire = art::Ptr<recob::Wire>() , |
||
art::Ptr< raw::RawDigit > const & | digits = art::Ptr<raw::RawDigit>() |
||
) |
Adds the specified hit to the data collection.
hit | the hit that will be copied into the collection |
wire | art pointer to the wire to be associated to this hit |
digits | art pointer to the raw digits to be associated to this hit |
If a art pointer is not valid, that association will not be stored.
Definition at line 298 of file HitCreator.cxx.
References CreateAssociationsToLastHit(), and recob::HitAndAssociationsWriterBase::hits.
|
inline |
Adds the specified hit to the data collection.
hit | the HitCreator object containing the hit |
wire | art pointer to the wire to be associated to this hit |
digits | art pointer to the raw digits to be associated to this hit |
After this call, the hit creator will be empty. If a art pointer is not valid, that association will not be stored.
Definition at line 550 of file HitCreator.h.
|
inline |
Adds the specified hit to the data collection.
hit | the hit that will be moved into the collection |
digits | art pointer to the raw digits to be associated to this hit |
After this call, hit will be invalid. If the digit pointer is not valid, its association will not be stored.
Definition at line 565 of file HitCreator.h.
|
inline |
Adds the specified hit to the data collection.
hit | the HitCreator object containing the hit |
digits | art pointer to the raw digits to be associated to this hit |
After this call, the hit creator will be empty. If the digit pointer is not valid, its association will not be stored.
Definition at line 578 of file HitCreator.h.
|
inline |
Adds the specified hit to the data collection.
hit | the HitCreator object containing the hit |
digits | art pointer to the raw digits to be associated to this hit |
If the digit pointer is not valid, its association will not be stored.
Definition at line 590 of file HitCreator.h.
References recob::HitCreator::copy().
|
inline |
Returns a read-only reference to the current list of hits.
Definition at line 626 of file HitCreator.h.
References hits().
|
inline |
Moves the data into an 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 614 of file HitCreator.h.
References put_into().
Referenced by hit::DisambigCheater::produce(), hit::TTHitFinder::produce(), hit::RawHitFinder::produce(), apa::APAHitFinder::produce(), hit::FFTHitFinder::produce(), hit::HitCheater::produce(), hit::GausHitFinder::produce(), hit::DPRawHitFinder::produce(), and put_into().
void recob::HitCollectionCreator::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 310 of file HitCreator.cxx.
References recob::HitAndAssociationsWriterBase::hits, art::errors::LogicError, and recob::HitAndAssociationsWriterBase::put_into().
|
inline |
Prepares the collection to host at least new_size
hits.
Definition at line 600 of file HitCreator.h.
References hits().
Referenced by hit::RawHitFinder::produce().
|
inline |
Returns the number of hits currently in the collection.
Definition at line 597 of file HitCreator.h.
References hits().
Referenced by hit::TTHitFinder::produce(), and hit::HitCheater::produce().
|
protectedinherited |
Pointer to the event we are using.
Definition at line 450 of file HitCreator.h.
|
protectedinherited |
Tool to create hit pointers,.
Definition at line 452 of file HitCreator.h.
|
protectedinherited |
Collection of hits.
Definition at line 444 of file HitCreator.h.
Referenced by emplace_back(), recob::HitCollectionAssociator::HitCollectionAssociator(), HitCollectionCreator(), recob::HitRefinerAssociator::HitRefinerAssociator(), recob::HitAndAssociationsWriterBase::put_into(), put_into(), recob::HitCollectionAssociator::use_hits(), and recob::HitRefinerAssociator::use_hits().
|
protectedinherited |
Tame of the instance for data products.
Definition at line 441 of file HitCreator.h.
Referenced by recob::HitAndAssociationsWriterBase::put_into().
|
protectedinherited |
Associations with raw digits.
Definition at line 448 of file HitCreator.h.
Referenced by CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), recob::HitRefinerAssociator::prepare_associations(), and recob::HitAndAssociationsWriterBase::put_into().
|
protectedinherited |
Associations with wires.
Definition at line 446 of file HitCreator.h.
Referenced by CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), recob::HitRefinerAssociator::prepare_associations(), and recob::HitAndAssociationsWriterBase::put_into().