10 #ifndef LARDATA_ARTDATAHELPERS_HITCREATOR_H 11 #define LARDATA_ARTDATAHELPERS_HITCREATOR_H 38 class ProducesCollector;
125 float sigma_peak_time,
126 float peak_amplitude,
127 float sigma_peak_amplitude,
129 float hit_sigma_integral,
132 short int multiplicity,
133 short int local_index,
134 float goodness_of_fit,
168 float sigma_peak_time,
169 float peak_amplitude,
170 float sigma_peak_amplitude,
172 float hit_sigma_integral,
175 short int multiplicity,
176 short int local_index,
177 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,
253 float sigma_peak_time,
254 float peak_amplitude,
255 float sigma_peak_amplitude,
257 float hit_sigma_integral,
260 short int multiplicity,
261 short int local_index,
262 float goodness_of_fit,
297 float sigma_peak_time,
298 float peak_amplitude,
299 float sigma_peak_amplitude,
301 float hit_sigma_integral,
304 short int multiplicity,
305 short int local_index,
306 float goodness_of_fit,
420 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
442 std::string instance_name =
"",
443 bool doWireAssns =
true,
444 bool doRawDigitAssns =
true);
452 std::unique_ptr<std::vector<recob::Hit>>
hits;
454 std::unique_ptr<art::Assns<recob::Wire, recob::Hit>>
WireAssns;
473 std::string instance_name,
475 bool doRawDigitAssns);
504 std::string instance_name =
"",
505 bool doWireAssns =
true,
506 bool doRawDigitAssns =
true);
562 emplace_back(hit.move(), wire, digits);
634 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
675 std::string instance_name,
710 std::string instance_name,
712 bool doRawDigitAssns);
728 bool doRawDigitAssns)
745 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
774 void prepare_associations(std::vector<recob::Hit>
const& srchits);
812 std::string instance_name =
"",
813 bool doWireAssns =
true,
814 bool doRawDigitAssns =
true);
829 bool doRawDigitAssns =
true)
846 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
873 void prepare_associations(std::vector<recob::Hit>
const& srchits);
924 template <
typename Writer>
949 std::string instanceName =
"",
950 bool doWireAssns =
true,
951 bool doRawDigitAssns =
true);
972 std::string instanceName =
"",
973 bool doWireAssns =
true,
974 bool doRawDigitAssns =
true);
983 bool ready() const noexcept {
return collector_p !=
nullptr; }
991 bool hasRawDigitAssns =
true;
994 bool hasWireAssns =
true;
1011 template <
typename Writer>
1014 std::string instanceName ,
1016 bool doRawDigitAssns
1019 declareProducts(collector, instanceName, doWireAssns, doRawDigitAssns);
1023 template <
typename Writer>
1026 std::string instanceName ,
1028 bool doRawDigitAssns
1035 <<
"HitAndAssociationsWriter<> has already declared its products.";
1037 collector_p = &collector;
1038 prodInstance = instanceName;
1039 hasWireAssns = doWireAssns;
1040 hasRawDigitAssns = doRawDigitAssns;
1041 HitAndAssociationsWriterBase::declare_products(
1042 collector, prodInstance, hasWireAssns, hasRawDigitAssns);
1046 template <
typename Writer>
1054 <<
"HitAndAssociationsWriter<>::collectionWriter() called" 1055 " before products are declared.";
1057 return {event, prodInstance, hasWireAssns, hasRawDigitAssns};
1062 #endif // LARDATA_ARTDATAHELPERS_HITCREATOR_H
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.
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.
recob::Hit const & copy() const
Returns the constructed wire.
void prepare_associations()
Finds out the associations for the current hits.
void emplace_back(HitCreator const &hit, art::Ptr< raw::RawDigit > const &digits)
Adds the specified hit to the data collection.
std::string prod_instance
Tame of the instance for data products.
art::PtrMaker< recob::Hit > hitPtrMaker
Tool to create hit pointers,.
Writer_t collectionWriter(art::Event &event) const
Returns a new writer already configured.
art::InputTag wires_label
Label of the collection of wires to associate.
Declaration of signal hit object.
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.
recob::Hit hit
Local instance of the hit being constructed.
int TDCtick_t
Type representing a TDC tick.
HitRefinerAssociator(art::Event &event, art::InputTag const &HitModuleLabel, bool doWireAssns, bool doRawDigitAssns=true)
Constructor: sets instance name and whether to build associations.
Class managing the creation of a new recob::Hit object.
bool ready() const noexcept
Returns whether the class is fully configured.
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.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void prepare_associations()
Finds out the associations for the current hits.
void reserve(size_t new_size)
Prepares the collection to host at least new_size hits.
void put_into(art::Event &)
Moves the data into the event.
void declareProducts(art::ProducesCollector &collector, std::string instanceName="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
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.
HitCollectionCreator(art::Event &event, bool doWireAssns, bool doRawDigitAssns)
Constructor: no product instance name.
Writer Writer_t
Type of managed hit collection writer.
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.
HitCollectionAssociator(art::Event &event, art::InputTag const &WireModuleLabel, bool doRawDigitAssns)
Constructor: sets instance name and whether to build associations.
art::InputTag hits_label
Label of the collection of hits.
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.
Class holding the regions of interest of signal 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.
Declaration of basic channel signal object.
std::unique_ptr< art::Assns< raw::RawDigit, recob::Hit > > RawDigitAssns
Associations with raw digits.
HitCollectionAssociator(art::Event &event, art::InputTag const &WireModuleLabel, art::InputTag const &RawDigitModuleLabel)
Constructor: sets instance name and whether to build associations.
std::string prodInstance
Tame of the instance for data products.
2D representation of charge deposited in the TDC/wire plane
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.
Namespace collecting geometry-related classes utilities.
std::string instanceName() const
Returns the configured product instance name.
HitAndAssociationsWriterManager()=default
Constructor: does not declare anything.
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.