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... | |
Public Member Functions | |
HitAndAssociationsWriterManager ()=default | |
Constructor: does not declare anything. More... | |
HitAndAssociationsWriterManager (art::ProducesCollector &collector, std::string instanceName="", bool doWireAssns=true, bool doRawDigitAssns=true) | |
Declares the hit products we are going to fill. More... | |
void | declareProducts (art::ProducesCollector &collector, 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 noexcept |
Returns whether the class is fully configured. More... | |
Protected Attributes | |
art::ProducesCollector * | collector_p = nullptr |
Collector 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 977 of file HitCreator.h.
using recob::HitAndAssociationsWriterManager< Writer >::Writer_t = Writer |
Type of managed hit collection writer.
Definition at line 980 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.
recob::HitAndAssociationsWriterManager< Writer >::HitAndAssociationsWriterManager | ( | art::ProducesCollector & | collector, |
std::string | instanceName = "" , |
||
bool | doWireAssns = true , |
||
bool | doRawDigitAssns = true |
||
) |
Declares the hit products we are going to fill.
collector | 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 1069 of file HitCreator.h.
recob::HitAndAssociationsWriterManager< Writer >::Writer_t recob::HitAndAssociationsWriterManager< Writer >::collectionWriter | ( | art::Event & | event | ) | const |
Returns a new writer already configured.
Definition at line 1106 of file HitCreator.h.
void recob::HitAndAssociationsWriterManager< Writer >::declareProducts | ( | art::ProducesCollector & | collector, |
std::string | instanceName = "" , |
||
bool | doWireAssns = true , |
||
bool | doRawDigitAssns = true |
||
) |
Declares the hit products we are going to fill.
collector | 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 1082 of file HitCreator.h.
|
inline |
Returns the configured product instance name.
Definition at line 1033 of file HitCreator.h.
|
inlinenoexcept |
Returns whether the class is fully configured.
Definition at line 1036 of file HitCreator.h.
|
protected |
Collector this manager is bound to.
Definition at line 1039 of file HitCreator.h.
|
protected |
Whether we produce hit-digit associations.
Definition at line 1044 of file HitCreator.h.
|
protected |
Whether we produce hit-wire associations.
Definition at line 1047 of file HitCreator.h.
|
protected |
Tame of the instance for data products.
Definition at line 1041 of file HitCreator.h.