LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Base 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 | put_into (art::Event &) |
Moves the data into the 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... | |
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 | |
HitAndAssociationsWriterBase (art::Event &event, std::string instance_name, bool doWireAssns, bool doRawDigitAssns) | |
Constructor: sets instance name and whether to build associations. 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... | |
Base 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 use a class derived from this one:
HitCollectionCreator
: push new hits one by oneHitCollectionAssociator
: push a complete collection of hitsHitRefinerAssociator
: push a complete collection of hits deriving their associations from other hits Using put_into()
will transfer into the event the data.The typical usage is to have the constructor of the module call the static function
(this example declares a collection with empty instance name and that we want associations to both wires and raw digits), and then in produce()
:
Definition at line 383 of file HitCreator.h.
|
protected |
Type of art pointer to Hit.
Definition at line 439 of file HitCreator.h.
|
protected |
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 235 of file HitCreator.cxx.
|
inlineprotected |
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().
|
static |
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().
|
inline |
Returns a read-only reference to the current list of hits.
Definition at line 412 of file HitCreator.h.
References hits().
|
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 400 of file HitCreator.h.
References put_into().
Referenced by put_into().
void recob::HitAndAssociationsWriterBase::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 264 of file HitCreator.cxx.
References hits, prod_instance, RawDigitAssns, and WireAssns.
Referenced by recob::HitCollectionCreator::put_into(), recob::HitCollectionAssociator::put_into(), and recob::HitRefinerAssociator::put_into().
|
inline |
Returns the number of hits currently in the collection.
Definition at line 389 of file HitCreator.h.
References hits().
|
protected |
Pointer to the event we are using.
Definition at line 450 of file HitCreator.h.
|
protected |
Tool to create hit pointers,.
Definition at line 452 of file HitCreator.h.
|
protected |
Collection of hits.
Definition at line 444 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::emplace_back(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionCreator::HitCollectionCreator(), recob::HitRefinerAssociator::HitRefinerAssociator(), put_into(), recob::HitCollectionCreator::put_into(), recob::HitCollectionAssociator::use_hits(), and recob::HitRefinerAssociator::use_hits().
|
protected |
Tame of the instance for data products.
Definition at line 441 of file HitCreator.h.
Referenced by put_into().
|
protected |
Associations with raw digits.
Definition at line 448 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), recob::HitRefinerAssociator::prepare_associations(), and put_into().
|
protected |
Associations with wires.
Definition at line 446 of file HitCreator.h.
Referenced by recob::HitCollectionCreator::CreateAssociationsToLastHit(), recob::HitCollectionAssociator::HitCollectionAssociator(), recob::HitCollectionAssociator::prepare_associations(), recob::HitRefinerAssociator::prepare_associations(), and put_into().