17 #include <unordered_map> 44 for (
auto const& t : trees) {
49 for (
size_t i = 0; i <
hitData.size(); ++i)
94 std::string
const& HitModuleLabel)
97 HitProcessingQueue.push_back(std::make_pair(std::cref(HitVector), std::cref(AssocVector)));
104 std::vector<sim::MCHitCollection>
const& MCHitCollectionVector,
112 for (
size_t iwire = 0; iwire < WireVector.size(); iwire++)
113 FillWireInfo(WireVector[iwire], iwire, MCHitCollectionVector, AssocVector[iwire], clock_data);
149 std::vector<sim::MCHitCollection>
const& MCHitCollectionVector,
150 std::vector<int>
const& thisAssocVector,
156 unsigned int range_index = 0;
166 ProcessROI(range, WireIndex, MCHitCollectionVector, thisAssocVector, clock_data);
175 float& charge_peak_time)
182 for (
auto const&
value : range) {
184 if (
value > charge_peak) {
186 charge_peak_time = (float)counter;
194 std::vector<sim::MCHitCollection>
const& MCHitCollectionVector,
195 std::vector<int>
const& thisAssocVector,
223 std::vector<int>
const& HitsOnWire,
224 size_t hitmodule_iter,
225 size_t begin_wire_tdc,
231 for (
auto const& hit_index : HitsOnWire) {
232 recob::Hit const& thishit = HitVector.at(hit_index);
251 *(
hitData.at(hitmodule_iter)) = thishit;
266 std::vector<sim::MCHitCollection>
const& MCHitCollectionVector,
267 std::vector<int>
const& HitsOnWire,
268 size_t begin_wire_tdc,
275 for (
auto const& hit_index : HitsOnWire) {
279 std::unordered_map<int, unsigned int> nmchits_per_trackID_map;
280 for (
auto const& thishit : thismchitcol) {
287 if (clock_data.
TPCTDC2Tick(thishit.PeakTime() - thishit.PeakWidth()) < begin_wire_tdc ||
288 clock_data.
TPCTDC2Tick(thishit.PeakTime() + thishit.PeakWidth()) > end_wire_tdc)
291 nmchits_per_trackID_map[thishit.PartTrackId()] += 1;
314 HitInfoVector.emplace_back(hit.
PeakTime(),
std::vector< std::string > HitModuleLabels
void LoadHitAssocPair(std::vector< recob::Hit > const &, std::vector< std::vector< int >> const &, std::string const &)
void SetHitDataTree(std::vector< TTree * > &trees)
void ProcessROI(lar::sparse_vector< float >::datarange_t const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)
void FillHitInfo(recob::Hit const &, std::vector< HitInfo > &)
std::vector< float > Hits_wAverageCharge
std::vector< float > Hits_MeanMultiplicity
float RMS() const
RMS of the hit shape, in tick units.
hit::HitAnaAlgException hitanaalgexception
std::vector< recob::Hit * > hitData
TNtupleSim Fill(f1, f2, f3, f4)
void ClearWireDataHitInfo()
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
float SigmaIntegral() const
Initial tdc tick for hit.
std::vector< float > Hits_PeakTime
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
size_type begin_index() const
Returns the first absolute index included in the range.
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
short int Multiplicity() const
How many hits could this one be shared with.
double TPCTDC2Tick(double const tdc) const
Given electronics clock count [tdc] returns TPC time-tick.
pure virtual base interface for detector clocks
void SetWireDataTree(TTree *)
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
std::vector< std::string > HitModuleLabels
geo::View_t View() const
Returns the view the channel belongs to.
float MCHits_wAverageTime
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< float > Hits_PeakCharge
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
float MCHits_IntegratedCharge
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
float MCHits_wAverageCharge
std::vector< float > Hits_AverageCharge
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
void AnalyzeWires(std::vector< recob::Wire > const &, std::vector< sim::MCHitCollection > const &, std::vector< std::vector< int >> const &, detinfo::DetectorClocksData const &, unsigned int, unsigned int)
std::vector< float > Hits_wAverageTime
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Detector simulation of raw signals on wires.
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
float PeakTime() const
Time of the signal peak, in tick units.
std::vector< art::Ptr< recob::Hit > > HitVector
size_type size() const
Returns the size of the range.
void InitWireData(unsigned int, unsigned int)
Contains all timing reference information for the detector.
std::vector< art::Ptr< recob::Wire > > WireVector
std::vector< float > Hits_IntegratedCharge
std::vector< TTree * > hitDataTree
std::vector< std::vector< HitInfo > > Hits
Class holding the regions of interest of signal from a channel.
Range class, with range and data.
float MCHits_AverageCharge
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
2D representation of charge deposited in the TDC/wire plane
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
void FindAndStoreHitsInRange(std::vector< recob::Hit > const &, std::vector< int > const &, size_t, size_t, size_t)
second_as<> second
Type of time stored in seconds, in double precision.
std::vector< HitAssocPair > HitProcessingQueue
void ROIInfo(lar::sparse_vector< float >::datarange_t const &, float &, float &, float &)
void FindAndStoreMCHitsInRange(std::vector< sim::MCHitCollection > const &, std::vector< int > const &, size_t, size_t, detinfo::DetectorClocksData const &)
Event finding and building.
void FillWireInfo(recob::Wire const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)