LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
A helper to centralise creation of a hit collection data product. More...
#include "HitCreator.h"
Public Types | |
using | Writer_t = Writer |
Type of managed hit collection writer. More... | |
using | Module_t = ModuleType |
Type of producing module. More... | |
Public Member Functions | |
HitAndAssociationsWriterManager ()=default | |
Constructor: does not declare anything. More... | |
HitAndAssociationsWriterManager (Module_t &callingProducer, std::string instanceName="", bool doWireAssns=true, bool doRawDigitAssns=true) | |
Declares the hit products we are going to fill. More... | |
void | declareProducts (Module_t &callingProducer, std::string instanceName="", bool doWireAssns=true, bool doRawDigitAssns=true) |
Declares the hit products we are going to fill. More... | |
Writer_t | collectionWriter (art::Event &event) const |
Returns a new writer already configured. More... | |
std::string | instanceName () const |
Returns the configured product instance name. More... | |
bool | ready () const |
Returns whether the class is fully configured. More... | |
Protected Attributes | |
Module_t * | producer = nullptr |
Producer this manager is bound to. More... | |
std::string | prodInstance |
Tame of the instance for data products. More... | |
bool | hasRawDigitAssns = true |
Whether we produce hit-digit associations. More... | |
bool | hasWireAssns = true |
Whether we produce hit-wire associations. More... | |
A helper to centralise creation of a hit collection data product.
Writer | writer class to manage |
ModuleType | owning module: art::EDProducer or art::EDFilter |
This class adds an indirection layer to the model relying on HitAndAssociationsWriter
. In that one, two different steps are required, one in the constructor of the module, where data products are declared, and one in the place where hits are actually assembled. These two steps need consistent setup, but they are separate and formally independent. The "manager" approach consists of an object performing the first step directly, and delivering an already configured object for the second step.
An example of usage in a module:
Definition at line 1007 of file HitCreator.h.
using recob::HitAndAssociationsWriterManager< Writer, ModuleType >::Module_t = ModuleType |
Type of producing module.
Definition at line 1011 of file HitCreator.h.
using recob::HitAndAssociationsWriterManager< Writer, ModuleType >::Writer_t = Writer |
Type of managed hit collection writer.
Definition at line 1010 of file HitCreator.h.
|
default |
Constructor: does not declare anything.
This constructor does not declare products. Calling declare_products()
explicitly is then required in the module constructor.
Referenced by recob::HitCollectionAssociator::HitCollectionAssociator().
recob::HitAndAssociationsWriterManager< Writer, ModuleType >::HitAndAssociationsWriterManager | ( | Module_t & | callingProducer, |
std::string | instanceName = "" , |
||
bool | doWireAssns = true , |
||
bool | doRawDigitAssns = true |
||
) |
Declares the hit products we are going to fill.
callingProducer | the module this manager is bound to |
instanceName | name of the instance for all data products |
doWireAssns | whether to enable associations to wires |
doRawDigitAssns | whether to enable associations to raw digits |
This constructor calls declareProducts()
.
Definition at line 1222 of file HitCreator.h.
References recob::HitAndAssociationsWriterManager< Writer, ModuleType >::declareProducts().
recob::HitAndAssociationsWriterManager< Writer, ModuleType >::Writer_t recob::HitAndAssociationsWriterManager< Writer, ModuleType >::collectionWriter | ( | art::Event & | event | ) | const |
Returns a new writer already configured.
Definition at line 1259 of file HitCreator.h.
References recob::HitAndAssociationsWriterBase::event, and art::errors::LogicError.
Referenced by recob::HitAndAssociationsWriterManager< Writer, ModuleType >::declareProducts().
void recob::HitAndAssociationsWriterManager< Writer, ModuleType >::declareProducts | ( | Module_t & | callingProducer, |
std::string | instanceName = "" , |
||
bool | doWireAssns = true , |
||
bool | doRawDigitAssns = true |
||
) |
Declares the hit products we are going to fill.
callingProducer | the module this manager is bound to |
instanceName | 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 made 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 1235 of file HitCreator.h.
References recob::HitAndAssociationsWriterManager< Writer, ModuleType >::collectionWriter(), recob::HitAndAssociationsWriterBase::declare_products(), and art::errors::LogicError.
Referenced by recob::HitAndAssociationsWriterManager< Writer, ModuleType >::HitAndAssociationsWriterManager().
|
inline |
Returns the configured product instance name.
Definition at line 1064 of file HitCreator.h.
|
inline |
Returns whether the class is fully configured.
Definition at line 1067 of file HitCreator.h.
|
protected |
Whether we produce hit-digit associations.
Definition at line 1075 of file HitCreator.h.
|
protected |
Whether we produce hit-wire associations.
Definition at line 1078 of file HitCreator.h.
|
protected |
Tame of the instance for data products.
Definition at line 1072 of file HitCreator.h.
|
protected |
Producer this manager is bound to.
Definition at line 1070 of file HitCreator.h.