10 #ifndef LARDATA_ARTDATAHELPERS_HITCREATOR_H 11 #define LARDATA_ARTDATAHELPERS_HITCREATOR_H 38 class ProducesCollector;
124 float sigma_peak_time,
125 float peak_amplitude,
126 float sigma_peak_amplitude,
128 float hit_sigma_integral,
130 short int multiplicity,
131 short int local_index,
132 float goodness_of_fit,
165 float sigma_peak_time,
166 float peak_amplitude,
167 float sigma_peak_amplitude,
169 float hit_sigma_integral,
171 short int multiplicity,
172 short int local_index,
173 float goodness_of_fit,
208 float sigma_peak_time,
209 float peak_amplitude,
210 float sigma_peak_amplitude,
212 float hit_sigma_integral,
213 short int multiplicity,
214 short int local_index,
215 float goodness_of_fit,
248 float sigma_peak_time,
249 float peak_amplitude,
250 float sigma_peak_amplitude,
252 float hit_sigma_integral,
254 short int multiplicity,
255 short int local_index,
256 float goodness_of_fit,
290 float sigma_peak_time,
291 float peak_amplitude,
292 float sigma_peak_amplitude,
294 float hit_sigma_integral,
296 short int multiplicity,
297 short int local_index,
298 float goodness_of_fit,
412 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
434 std::string instance_name =
"",
435 bool doWireAssns =
true,
436 bool doRawDigitAssns =
true);
444 std::unique_ptr<std::vector<recob::Hit>>
hits;
446 std::unique_ptr<art::Assns<recob::Wire, recob::Hit>>
WireAssns;
465 std::string instance_name,
467 bool doRawDigitAssns);
496 std::string instance_name =
"",
497 bool doWireAssns =
true,
498 bool doRawDigitAssns =
true);
554 emplace_back(hit.move(), wire, digits);
626 std::vector<recob::Hit>
const&
peek()
const {
return *
hits; }
667 std::string instance_name,
702 std::string instance_name,
704 bool doRawDigitAssns);
720 bool doRawDigitAssns)
737 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
766 void prepare_associations(std::vector<recob::Hit>
const& srchits);
804 std::string instance_name =
"",
805 bool doWireAssns =
true,
806 bool doRawDigitAssns =
true);
821 bool doRawDigitAssns =
true)
838 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
865 void prepare_associations(std::vector<recob::Hit>
const& srchits);
916 template <
typename Writer>
941 std::string instanceName =
"",
942 bool doWireAssns =
true,
943 bool doRawDigitAssns =
true);
964 std::string instanceName =
"",
965 bool doWireAssns =
true,
966 bool doRawDigitAssns =
true);
975 bool ready() const noexcept {
return collector_p !=
nullptr; }
983 bool hasRawDigitAssns =
true;
986 bool hasWireAssns =
true;
1003 template <
typename Writer>
1006 std::string instanceName ,
1008 bool doRawDigitAssns
1011 declareProducts(collector, instanceName, doWireAssns, doRawDigitAssns);
1015 template <
typename Writer>
1018 std::string instanceName ,
1020 bool doRawDigitAssns
1027 <<
"HitAndAssociationsWriter<> has already declared its products.";
1029 collector_p = &collector;
1030 prodInstance = instanceName;
1031 hasWireAssns = doWireAssns;
1032 hasRawDigitAssns = doRawDigitAssns;
1033 HitAndAssociationsWriterBase::declare_products(
1034 collector, prodInstance, hasWireAssns, hasRawDigitAssns);
1038 template <
typename Writer>
1046 <<
"HitAndAssociationsWriter<>::collectionWriter() called" 1047 " before products are declared.";
1049 return {event, prodInstance, hasWireAssns, hasRawDigitAssns};
1054 #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.