10 #ifndef LARDATA_ARTDATAHELPERS_HITCREATOR_H 11 #define LARDATA_ARTDATAHELPERS_HITCREATOR_H 32 namespace raw {
class RawDigit; }
34 class ProducesCollector;
121 float sigma_peak_time,
122 float peak_amplitude,
123 float sigma_peak_amplitude,
125 float hit_sigma_integral,
127 short int multiplicity,
128 short int local_index,
129 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,
211 float sigma_peak_time,
212 float peak_amplitude,
213 float sigma_peak_amplitude,
215 float hit_sigma_integral,
216 short int multiplicity,
217 short int local_index,
218 float goodness_of_fit,
254 float sigma_peak_time,
255 float peak_amplitude,
256 float sigma_peak_amplitude,
258 float hit_sigma_integral,
260 short int multiplicity,
261 short int local_index,
262 float goodness_of_fit,
299 float sigma_peak_time,
300 float peak_amplitude,
301 float sigma_peak_amplitude,
303 float hit_sigma_integral,
305 short int multiplicity,
306 short int local_index,
307 float goodness_of_fit,
407 size_t size()
const {
return hits? hits->size(): 0; }
432 std::vector<recob::Hit>
const&
peek()
const {
return *hits; }
454 static void declare_products(
456 bool doWireAssns =
true,
bool doRawDigitAssns =
true 465 std::unique_ptr<std::vector<recob::Hit>>
hits;
467 std::unique_ptr<art::Assns<recob::Wire, recob::Hit>>
WireAssns;
489 bool doWireAssns,
bool doRawDigitAssns
526 bool doWireAssns =
true,
bool doRawDigitAssns =
true 538 bool doWireAssns,
bool doRawDigitAssns
595 { emplace_back(hit.move(), wire, digits); }
636 size_t size()
const {
return hits->size(); }
640 void reserve(
size_t new_size) {
if (hits) hits->reserve(new_size); }
665 std::vector<recob::Hit>
const&
peek()
const {
return *hits; }
673 {
return hits->empty()?
HitPtr_t(): CreatePtr(hits->size() - 1); }
676 void CreateAssociationsToLastHit(
732 (event,
"", WireModuleLabel, RawDigitModuleLabel)
773 (event,
"", WireModuleLabel, doRawDigitAssns)
789 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
820 void prepare_associations(std::vector<recob::Hit>
const& srchits);
861 bool doWireAssns =
true,
bool doRawDigitAssns =
true 876 bool doWireAssns,
bool doRawDigitAssns =
true 879 (event, HitModuleLabel,
"", doWireAssns, doRawDigitAssns)
895 void use_hits(std::unique_ptr<std::vector<recob::Hit>>&& srchits);
924 void prepare_associations(std::vector<recob::Hit>
const& srchits);
976 template <
typename Writer>
1002 bool doWireAssns =
true,
bool doRawDigitAssns =
true 1023 void declareProducts(
1025 bool doWireAssns =
true,
bool doRawDigitAssns =
true 1044 bool hasRawDigitAssns =
true;
1047 bool hasWireAssns =
true;
1066 template <
typename Writer>
1071 bool doWireAssns ,
bool doRawDigitAssns
1075 (collector, instanceName, doWireAssns, doRawDigitAssns);
1080 template <
typename Writer>
1084 bool doWireAssns ,
bool doRawDigitAssns
1091 <<
"HitAndAssociationsWriter<> has already declared its products.";
1093 collector_p = &collector;
1094 prodInstance = instanceName;
1095 hasWireAssns = doWireAssns;
1096 hasRawDigitAssns = doRawDigitAssns;
1097 HitAndAssociationsWriterBase::declare_products
1098 (collector, prodInstance, hasWireAssns, hasRawDigitAssns);
1103 template <
typename Writer>
1112 <<
"HitAndAssociationsWriter<>::collectionWriter() called" 1113 " before products are declared.";
1116 {
event, prodInstance, hasWireAssns, hasRawDigitAssns };
1122 #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.
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
void prepare_associations()
Finds out the associations for the current hits.
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.
A helper to centralise creation of a hit collection data product.
std::unique_ptr< art::Assns< recob::Wire, recob::Hit > > WireAssns
Associations with wires.
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.
Declaration of signal hit object.
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.
LArSoft geometry interface.
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.