10 #ifndef LARDATA_ARTDATAHELPERS_HITCREATOR_H 11 #define LARDATA_ARTDATAHELPERS_HITCREATOR_H 35 class EDProductGetter;
122 float sigma_peak_time,
123 float peak_amplitude,
124 float sigma_peak_amplitude,
126 float hit_sigma_integral,
128 short int multiplicity,
129 short int local_index,
130 float goodness_of_fit,
166 float sigma_peak_time,
167 float peak_amplitude,
168 float sigma_peak_amplitude,
170 float hit_sigma_integral,
172 short int multiplicity,
173 short int local_index,
174 float goodness_of_fit,
212 float sigma_peak_time,
213 float peak_amplitude,
214 float sigma_peak_amplitude,
216 float hit_sigma_integral,
217 short int multiplicity,
218 short int local_index,
219 float goodness_of_fit,
255 float sigma_peak_time,
256 float peak_amplitude,
257 float sigma_peak_amplitude,
259 float hit_sigma_integral,
261 short int multiplicity,
262 short int local_index,
263 float goodness_of_fit,
300 float sigma_peak_time,
301 float peak_amplitude,
302 float sigma_peak_amplitude,
304 float hit_sigma_integral,
306 short int multiplicity,
307 short int local_index,
308 float goodness_of_fit,
433 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
455 template <
typename ModuleType>
456 static void declare_products(
457 ModuleType& producer, std::string instance_name =
"",
458 bool doWireAssns =
true,
bool doRawDigitAssns =
true 467 std::unique_ptr<std::vector<recob::Hit>>
hits;
469 std::unique_ptr<art::Assns<recob::Wire, recob::Hit>>
WireAssns;
490 template <
typename ModuleType>
493 std::string instance_name,
494 bool doWireAssns,
bool doRawDigitAssns
530 template <
typename ModuleType>
533 std::string instance_name =
"",
534 bool doWireAssns =
true,
bool doRawDigitAssns =
true 546 template <
typename ModuleType>
549 bool doWireAssns,
bool doRawDigitAssns
606 { emplace_back(hit.move(), wire, digits); }
676 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
687 void CreateAssociationsToLastHit(
721 template <
typename ModuleType>
724 std::string instance_name,
742 template <
typename ModuleType>
749 (producer, event,
"", WireModuleLabel, RawDigitModuleLabel)
767 template <
typename ModuleType>
770 std::string instance_name,
789 template <
typename ModuleType>
796 (producer, event,
"", WireModuleLabel, doRawDigitAssns)
812 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
843 void prepare_associations(std::vector<recob::Hit>
const& srchits);
883 template <
typename ModuleType>
887 std::string instance_name =
"",
888 bool doWireAssns =
true,
bool doRawDigitAssns =
true 903 template <
typename ModuleType>
907 bool doWireAssns,
bool doRawDigitAssns =
true 910 (producer, event, HitModuleLabel,
"", doWireAssns, doRawDigitAssns)
926 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
955 void prepare_associations(std::vector<recob::Hit>
const& srchits);
1006 template <
typename Writer,
typename ModuleType = art::EDProducer>
1032 Module_t& callingProducer, std::string instanceName =
"",
1033 bool doWireAssns =
true,
bool doRawDigitAssns =
true 1054 void declareProducts(
1055 Module_t& callingProducer, std::string instanceName =
"",
1056 bool doWireAssns =
true,
bool doRawDigitAssns =
true 1075 bool hasRawDigitAssns =
true;
1078 bool hasWireAssns =
true;
1084 template <
typename ModuleType = art::EDProducer>
1096 template <
typename ModuleType>
1099 std::string instance_name,
bool doWireAssns,
bool doRawDigitAssns
1101 : prod_instance(instance_name)
1106 (doRawDigitAssns? new
art::Assns<
raw::RawDigit,
recob::
Hit>: nullptr)
1108 , hitPtrMaker(*(this->event), producer, prod_instance)
1116 template <
typename ModuleType>
1119 std::string instance_name ,
1120 bool doWireAssns ,
bool doRawDigitAssns
1122 producer.template produces<std::vector<recob::Hit>>(instance_name);
1126 producer.template produces<art::Assns<recob::Wire, recob::Hit>>
1129 if (doRawDigitAssns) {
1130 producer.template produces<art::Assns<raw::RawDigit, recob::Hit>>
1140 template <
typename ModuleType>
1144 std::string instance_name ,
1145 bool doWireAssns ,
bool doRawDigitAssns
1148 (producer, event, instance_name, doWireAssns, doRawDigitAssns)
1149 , hits_label(HitModuleLabel)
1151 hits.reset(
new std::vector<recob::Hit>);
1158 template <
typename ModuleType>
1161 std::string instance_name ,
1162 bool doWireAssns ,
bool doRawDigitAssns
1165 (producer, event, instance_name, doWireAssns, doRawDigitAssns)
1167 hits.reset(
new std::vector<recob::Hit>);
1174 template <
typename ModuleType>
1177 std::string instance_name,
1182 producer, event, instance_name,
1183 WireModuleLabel !=
"", RawDigitModuleLabel !=
"" 1185 , wires_label(WireModuleLabel)
1186 , digits_label(RawDigitModuleLabel)
1188 hits.reset(
new std::vector<recob::Hit>);
1193 template <
typename ModuleType>
1196 std::string instance_name,
1198 bool doRawDigitAssns
1201 producer, event, instance_name,
1202 WireModuleLabel !=
"", doRawDigitAssns
1209 <<
"HitCollectionAssociator can't create hit <--> raw digit" 1210 " associations through wires, without wires!\n";
1212 hits.reset(
new std::vector<recob::Hit>);
1219 template <
typename Writer,
typename ModuleType >
1223 Module_t& callingProducer, std::string instanceName ,
1224 bool doWireAssns ,
bool doRawDigitAssns
1228 (callingProducer, instanceName, doWireAssns, doRawDigitAssns);
1233 template <
typename Writer,
typename ModuleType >
1236 Module_t& callingProducer, std::string instanceName ,
1237 bool doWireAssns ,
bool doRawDigitAssns
1244 <<
"HitAndAssociationsWriter<> has already declared its products.";
1246 producer = &callingProducer;
1247 prodInstance = instanceName;
1248 hasWireAssns = doWireAssns;
1249 hasRawDigitAssns = doRawDigitAssns;
1251 (callingProducer, prodInstance, hasWireAssns, hasRawDigitAssns);
1256 template <
typename Writer,
typename ModuleType >
1265 <<
"HitAndAssociationsWriter<>::collectionWriter() called" 1266 " before products are declared.";
1269 { *producer,
event, prodInstance, hasWireAssns, hasRawDigitAssns };
1275 #endif // LARDATA_ARTDATAHELPERS_HITCREATOR_H
HitAndAssociationsWriterManager()=default
Constructor: does not declare anything.
size_t size() const
Returns the number of hits currently in the collection.
HitPtr_t CreatePtrToLastHit() const
Creates an art pointer to the hit with the last index.
HitCollectionAssociator(ModuleType &producer, art::Event &event, art::InputTag const &WireModuleLabel, art::InputTag const &RawDigitModuleLabel)
Constructor: sets instance name and whether to build associations.
Collection of charge vs time digitized from a single readout channel.
Reconstruction base classes.
void put_into(art::Event &)
Moves the data into the event.
Writer Writer_t
Type of managed hit collection writer.
recob::Hit const & copy() const
Returns the constructed wire.
void prepare_associations()
Finds out the associations for the current hits.
HitCollectionAssociator(ModuleType &producer, art::Event &event, art::InputTag const &WireModuleLabel, bool doRawDigitAssns)
Constructor: sets instance name and whether to build associations.
std::string prod_instance
Tame of the instance for data products.
art::PtrMaker< recob::Hit > hitPtrMaker
Tool to create hit pointers,.
art::InputTag wires_label
Label of the collection of wires to associate.
Declaration of signal hit object.
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.
A helper to centralise creation of a hit collection data product.
std::unique_ptr< art::Assns< recob::Wire, recob::Hit > > WireAssns
Associations with wires.
Definition of basic raw digits.
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.
HitRefinerAssociator(ModuleType &producer, art::Event &event, art::InputTag const &HitModuleLabel, bool doWireAssns, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
art::Event * event
Pointer to the event we are using.
recob::Hit hit
Local instance of the hit being constructed.
int TDCtick_t
Type representing a TDC tick.
Class managing the creation of a new recob::Hit object.
void emplace_back(HitCreator &&hit, art::Ptr< raw::RawDigit > const &digits)
Adds the specified hit to the data collection.
A class handling a collection of hits and its associations.
void prepare_associations()
Finds out the associations for the current hits.
HitAndAssociationsWriterBase(ModuleType &producer, art::Event &event, std::string instance_name, bool doWireAssns, bool doRawDigitAssns)
Constructor: sets instance name and whether to build associations.
void reserve(size_t new_size)
Prepares the collection to host at least new_size hits.
void declareProducts(Module_t &callingProducer, std::string instanceName="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
void put_into(art::Event &)
Moves the data into the event.
HitRefinerAssociator(ModuleType &producer, art::Event &event, art::InputTag const &HitModuleLabel, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
A class handling a collection of hits and its associations.
HitPtr_t CreatePtr(size_t index) const
Creates an art pointer to the hit with the specified index.
A class handling a collection of hits and its associations.
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.
void put_into(art::Event &)
Moves the data into an event.
Detector simulation of raw signals on wires.
art::InputTag hits_label
Label of the collection of hits.
HitCollectionCreator(ModuleType &producer, art::Event &event, bool doWireAssns, bool doRawDigitAssns)
Constructor: no product instance name.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
size_t size() const
Returns the number of hits currently in the collection.
void put_into(art::Event &)
Moves the data into the event.
bool ready() const
Returns whether the class is fully configured.
Class holding the deconvoluted signals from a channel.
art::InputTag digits_label
Label of raw digits collection to associate.
std::vector< recob::Hit > const & peek() const
Returns a read-only reference to the current list of hits.
ModuleType Module_t
Type of producing module.
Declaration of basic channel signal object.
std::unique_ptr< art::Assns< raw::RawDigit, recob::Hit > > RawDigitAssns
Associations with raw digits.
std::string instanceName() const
Returns the configured product instance name.
2D representation of charge deposited in the TDC/wire plane
HitCollectionCreator(ModuleType &producer, art::Event &event, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
Writer_t collectionWriter(art::Event &event) const
Returns a new writer already configured.
std::vector< recob::Hit > const & peek() const
Returns a read-only reference to the current list of hits.
recob::Wire::RegionsOfInterest_t::datarange_t RegionOfInterest_t
Type of one region of interest.
std::unique_ptr< std::vector< recob::Hit > > hits
Collection of hits.
recob::Hit && move()
Prepares the constructed hit to be moved away.
Base class handling a collection of hits and its associations.
void emplace_back(recob::Hit &&hit, art::Ptr< raw::RawDigit > const &digits)
Adds the specified hit to the data collection.
Event finding and building.
std::string prodInstance
Tame of the instance for data products.