LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
hit::HitAnaAlg Class Reference

#include "HitAnaAlg.h"

Public Member Functions

 HitAnaAlg ()
 
void SetWireDataTree (TTree *)
 
void SetHitDataTree (std::vector< TTree * > &trees)
 
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)
 
void LoadHitAssocPair (std::vector< recob::Hit > const &, std::vector< std::vector< int >> const &, std::string const &)
 
void ClearHitModules ()
 

Private Types

typedef std::pair< const std::vector< recob::Hit > &, const std::vector< std::vector< int > > & > HitAssocPair
 

Private Member Functions

void InitWireData (unsigned int, unsigned int)
 
void ClearWireDataHitInfo ()
 
void FillHitInfo (recob::Hit const &, std::vector< HitInfo > &)
 
void FillWireInfo (recob::Wire const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)
 
void ProcessROI (lar::sparse_vector< float >::datarange_t const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)
 
void ROIInfo (lar::sparse_vector< float >::datarange_t const &, float &, float &, float &)
 
void FindAndStoreHitsInRange (std::vector< recob::Hit > const &, std::vector< int > const &, size_t, size_t, size_t)
 
void FindAndStoreMCHitsInRange (std::vector< sim::MCHitCollection > const &, std::vector< int > const &, size_t, size_t, detinfo::DetectorClocksData const &)
 
void SetupWireDataTree ()
 

Private Attributes

WireROIInfo wireData
 
std::vector< recob::Hit * > hitData
 
std::vector< std::string > HitModuleLabels
 
std::vector< HitAssocPairHitProcessingQueue
 
TTree * wireDataTree
 
std::vector< TTree * > hitDataTree
 

Friends

class HitAnaAlgTest
 

Detailed Description

Definition at line 105 of file HitAnaAlg.h.

Member Typedef Documentation

typedef std::pair<const std::vector<recob::Hit>&, const std::vector<std::vector<int> >&> hit::HitAnaAlg::HitAssocPair
private

Definition at line 108 of file HitAnaAlg.h.

Constructor & Destructor Documentation

hit::HitAnaAlg::HitAnaAlg ( )

Title: HitAnaModule Author: wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov Inputs: recob::Wire (calibrated), recob::Hit, Assns<recob::Wire, recob::Hit> Outputs: validation histograms

Description: This module is intended to be yet another hit analyzer module. Its intention is (1) to compare hit-finding modules against each other, and eventually (2) to compare those to truth

Definition at line 21 of file HitAnaAlg.cxx.

References hit::WireROIInfo::NHitModules, and wireData.

22 {
24 }
WireROIInfo wireData
Definition: HitAnaAlg.h:161

Member Function Documentation

void hit::HitAnaAlg::AnalyzeWires ( std::vector< recob::Wire > const &  WireVector,
std::vector< sim::MCHitCollection > const &  MCHitCollectionVector,
std::vector< std::vector< int >> const &  AssocVector,
detinfo::DetectorClocksData const &  clock_data,
unsigned int  event,
unsigned int  run 
)

Definition at line 103 of file HitAnaAlg.cxx.

References FillWireInfo(), and InitWireData().

Referenced by hit::HitAnaModule::analyze().

109 {
110 
111  InitWireData(event, run);
112  for (size_t iwire = 0; iwire < WireVector.size(); iwire++)
113  FillWireInfo(WireVector[iwire], iwire, MCHitCollectionVector, AssocVector[iwire], clock_data);
114 }
void InitWireData(unsigned int, unsigned int)
Definition: HitAnaAlg.cxx:116
Event finding and building.
void FillWireInfo(recob::Wire const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)
Definition: HitAnaAlg.cxx:147
void hit::HitAnaAlg::ClearHitModules ( )

Definition at line 85 of file HitAnaAlg.cxx.

References HitModuleLabels, HitProcessingQueue, hit::WireROIInfo::NHitModules, and wireData.

Referenced by hit::HitAnaModule::analyze().

86 {
87  HitModuleLabels.clear();
88  HitProcessingQueue.clear();
90 }
std::vector< std::string > HitModuleLabels
Definition: HitAnaAlg.h:164
WireROIInfo wireData
Definition: HitAnaAlg.h:161
std::vector< HitAssocPair > HitProcessingQueue
Definition: HitAnaAlg.h:165
void hit::HitAnaAlg::ClearWireDataHitInfo ( )
private

Definition at line 125 of file HitAnaAlg.cxx.

References hit::WireROIInfo::Hits, hit::WireROIInfo::Hits_AverageCharge, hit::WireROIInfo::Hits_IntegratedCharge, hit::WireROIInfo::Hits_MeanMultiplicity, hit::WireROIInfo::Hits_PeakCharge, hit::WireROIInfo::Hits_PeakTime, hit::WireROIInfo::Hits_wAverageCharge, hit::WireROIInfo::Hits_wAverageTime, hit::WireROIInfo::MCHits_AverageCharge, hit::WireROIInfo::MCHits_IntegratedCharge, hit::WireROIInfo::MCHits_PeakCharge, hit::WireROIInfo::MCHits_PeakTime, hit::WireROIInfo::MCHits_wAverageCharge, hit::WireROIInfo::MCHits_wAverageTime, hit::WireROIInfo::NHitModules, hit::WireROIInfo::NHits, hit::WireROIInfo::NMCHits, and wireData.

Referenced by FillWireInfo().

126 {
127  wireData.NMCHits = 0;
134 
135  wireData.NHits.assign(wireData.NHitModules, 0);
143  wireData.Hits.clear();
145 }
WireROIInfo wireData
Definition: HitAnaAlg.h:161
std::vector< float > Hits_wAverageCharge
Definition: HitAnaAlg.h:88
std::vector< float > Hits_MeanMultiplicity
Definition: HitAnaAlg.h:90
std::vector< float > Hits_PeakTime
Definition: HitAnaAlg.h:87
float MCHits_wAverageTime
Definition: HitAnaAlg.h:98
std::vector< float > Hits_PeakCharge
Definition: HitAnaAlg.h:86
std::vector< int > NHits
Definition: HitAnaAlg.h:83
float MCHits_IntegratedCharge
Definition: HitAnaAlg.h:93
float MCHits_wAverageCharge
Definition: HitAnaAlg.h:97
std::vector< float > Hits_AverageCharge
Definition: HitAnaAlg.h:85
std::vector< float > Hits_wAverageTime
Definition: HitAnaAlg.h:89
float MCHits_PeakCharge
Definition: HitAnaAlg.h:95
float MCHits_PeakTime
Definition: HitAnaAlg.h:96
std::vector< float > Hits_IntegratedCharge
Definition: HitAnaAlg.h:84
std::vector< std::vector< HitInfo > > Hits
Definition: HitAnaAlg.h:91
float MCHits_AverageCharge
Definition: HitAnaAlg.h:94
void hit::HitAnaAlg::FillHitInfo ( recob::Hit const &  hit,
std::vector< HitInfo > &  HitInfoVector 
)
private

Definition at line 312 of file HitAnaAlg.cxx.

References recob::Hit::EndTick(), recob::Hit::GoodnessOfFit(), recob::Hit::Integral(), recob::Hit::PeakAmplitude(), recob::Hit::PeakTime(), recob::Hit::RMS(), recob::Hit::SigmaIntegral(), recob::Hit::SigmaPeakAmplitude(), recob::Hit::SigmaPeakTime(), and recob::Hit::StartTick().

Referenced by FindAndStoreHitsInRange().

313 {
314  HitInfoVector.emplace_back(hit.PeakTime(),
315  hit.SigmaPeakTime(),
316  hit.RMS(),
317  hit.StartTick(),
318  hit.EndTick(),
319  hit.Integral(),
320  hit.SigmaIntegral(),
321  hit.PeakAmplitude(),
322  hit.SigmaPeakAmplitude(),
323  hit.GoodnessOfFit());
324 }
Detector simulation of raw signals on wires.
void hit::HitAnaAlg::FillWireInfo ( recob::Wire const &  wire,
int  WireIndex,
std::vector< sim::MCHitCollection > const &  MCHitCollectionVector,
std::vector< int > const &  thisAssocVector,
detinfo::DetectorClocksData const &  clock_data 
)
private

Definition at line 147 of file HitAnaAlg.cxx.

References hit::WireROIInfo::channel, recob::Wire::Channel(), ClearWireDataHitInfo(), lar::sparse_vector< T >::get_ranges(), hit::WireROIInfo::plane, ProcessROI(), hit::WireROIInfo::range_index, hit::WireROIInfo::range_size, hit::WireROIInfo::range_start, recob::Wire::SignalROI(), recob::Wire::View(), and wireData.

Referenced by AnalyzeWires().

152 {
153 
154  wireData.channel = wire.Channel();
155  wireData.plane = wire.View();
156  unsigned int range_index = 0;
157 
158  for (auto const& range : wire.SignalROI().get_ranges()) {
159 
160  wireData.range_index = range_index;
161  wireData.range_start = range.begin_index();
162  wireData.range_size = range.size();
163 
165 
166  ProcessROI(range, WireIndex, MCHitCollectionVector, thisAssocVector, clock_data);
167  range_index++;
168 
169  } //end loop over roi ranges
170 }
unsigned int range_index
Definition: HitAnaAlg.h:75
void ProcessROI(lar::sparse_vector< float >::datarange_t const &, int, std::vector< sim::MCHitCollection > const &, std::vector< int > const &, detinfo::DetectorClocksData const &)
Definition: HitAnaAlg.cxx:192
WireROIInfo wireData
Definition: HitAnaAlg.h:161
void ClearWireDataHitInfo()
Definition: HitAnaAlg.cxx:125
unsigned int range_start
Definition: HitAnaAlg.h:76
unsigned int channel
Definition: HitAnaAlg.h:73
size_t range_size
Definition: HitAnaAlg.h:77
unsigned int plane
Definition: HitAnaAlg.h:74
void hit::HitAnaAlg::FindAndStoreHitsInRange ( std::vector< recob::Hit > const &  HitVector,
std::vector< int > const &  HitsOnWire,
size_t  hitmodule_iter,
size_t  begin_wire_tdc,
size_t  end_wire_tdc 
)
private

Definition at line 222 of file HitAnaAlg.cxx.

References Fill(), FillHitInfo(), hitData, hitDataTree, hit::WireROIInfo::Hits, hit::WireROIInfo::Hits_AverageCharge, hit::WireROIInfo::Hits_IntegratedCharge, hit::WireROIInfo::Hits_MeanMultiplicity, hit::WireROIInfo::Hits_PeakCharge, hit::WireROIInfo::Hits_PeakTime, hit::WireROIInfo::Hits_wAverageCharge, hit::WireROIInfo::Hits_wAverageTime, recob::Hit::Integral(), recob::Hit::Multiplicity(), hit::WireROIInfo::NHits, recob::Hit::PeakAmplitude(), recob::Hit::PeakTime(), recob::Hit::PeakTimeMinusRMS(), recob::Hit::PeakTimePlusRMS(), and wireData.

Referenced by ProcessROI().

227 {
228 
229  wireData.Hits_PeakCharge[hitmodule_iter] = -999;
230 
231  for (auto const& hit_index : HitsOnWire) {
232  recob::Hit const& thishit = HitVector.at(hit_index);
233 
234  //check if this hit is on this ROI
235  if (thishit.PeakTimeMinusRMS() < begin_wire_tdc || thishit.PeakTimePlusRMS() > end_wire_tdc)
236  continue;
237 
238  FillHitInfo(thishit, wireData.Hits[hitmodule_iter]);
239  wireData.NHits[hitmodule_iter]++;
240  wireData.Hits_IntegratedCharge[hitmodule_iter] += thishit.Integral();
241 
242  if (thishit.PeakAmplitude() > wireData.Hits_PeakCharge[hitmodule_iter]) {
243  wireData.Hits_PeakCharge[hitmodule_iter] = thishit.PeakAmplitude();
244  wireData.Hits_PeakTime[hitmodule_iter] = thishit.PeakTime();
245  }
246 
247  wireData.Hits_wAverageCharge[hitmodule_iter] += thishit.Integral() * thishit.Integral();
248  wireData.Hits_wAverageTime[hitmodule_iter] += thishit.Integral() * thishit.PeakTime();
249  wireData.Hits_MeanMultiplicity[hitmodule_iter] += thishit.Multiplicity();
250 
251  *(hitData.at(hitmodule_iter)) = thishit;
252  (hitDataTree.at(hitmodule_iter))->Fill();
253  }
254 
255  wireData.Hits_AverageCharge[hitmodule_iter] =
256  wireData.Hits_IntegratedCharge[hitmodule_iter] / wireData.NHits[hitmodule_iter];
257  wireData.Hits_wAverageCharge[hitmodule_iter] =
258  wireData.Hits_wAverageCharge[hitmodule_iter] / wireData.Hits_IntegratedCharge[hitmodule_iter];
259  wireData.Hits_wAverageTime[hitmodule_iter] =
260  wireData.Hits_wAverageTime[hitmodule_iter] / wireData.Hits_IntegratedCharge[hitmodule_iter];
261 
262  wireData.Hits_MeanMultiplicity[hitmodule_iter] /= wireData.NHits[hitmodule_iter];
263 }
WireROIInfo wireData
Definition: HitAnaAlg.h:161
void FillHitInfo(recob::Hit const &, std::vector< HitInfo > &)
Definition: HitAnaAlg.cxx:312
std::vector< float > Hits_wAverageCharge
Definition: HitAnaAlg.h:88
std::vector< float > Hits_MeanMultiplicity
Definition: HitAnaAlg.h:90
std::vector< recob::Hit * > hitData
Definition: HitAnaAlg.h:162
TNtupleSim Fill(f1, f2, f3, f4)
std::vector< float > Hits_PeakTime
Definition: HitAnaAlg.h:87
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:244
short int Multiplicity() const
How many hits could this one be shared with.
Definition: Hit.h:252
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:232
std::vector< float > Hits_PeakCharge
Definition: HitAnaAlg.h:86
std::vector< int > NHits
Definition: HitAnaAlg.h:83
std::vector< float > Hits_AverageCharge
Definition: HitAnaAlg.h:85
std::vector< float > Hits_wAverageTime
Definition: HitAnaAlg.h:89
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:290
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:220
std::vector< float > Hits_IntegratedCharge
Definition: HitAnaAlg.h:84
std::vector< TTree * > hitDataTree
Definition: HitAnaAlg.h:170
std::vector< std::vector< HitInfo > > Hits
Definition: HitAnaAlg.h:91
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:285
void hit::HitAnaAlg::FindAndStoreMCHitsInRange ( std::vector< sim::MCHitCollection > const &  MCHitCollectionVector,
std::vector< int > const &  HitsOnWire,
size_t  begin_wire_tdc,
size_t  end_wire_tdc,
detinfo::DetectorClocksData const &  clock_data 
)
private

Definition at line 265 of file HitAnaAlg.cxx.

References hit::WireROIInfo::MCHits_AverageCharge, hit::WireROIInfo::MCHits_IntegratedCharge, hit::WireROIInfo::MCHits_PeakCharge, hit::WireROIInfo::MCHits_PeakTime, hit::WireROIInfo::MCHits_wAverageCharge, hit::WireROIInfo::MCHits_wAverageTime, hit::WireROIInfo::NMCHits, detinfo::DetectorClocksData::TPCTDC2Tick(), and wireData.

Referenced by ProcessROI().

271 {
272 
274 
275  for (auto const& hit_index : HitsOnWire) {
276  sim::MCHitCollection const& thismchitcol = MCHitCollectionVector.at(hit_index);
277 
278  //let's have a map to keep track of the number of total particles
279  std::unordered_map<int, unsigned int> nmchits_per_trackID_map;
280  for (auto const& thishit : thismchitcol) {
281 
282  //std::cout << "\t************************************************************" << std::endl;
283  //std::cout << "\t\tMCHit begin: " << ts->TPCTDC2Tick( thishit.PeakTime()-thishit.PeakWidth() ) << std::endl;
284  //std::cout << "\t\tMCHit end: " << ts->TPCTDC2Tick( thishit.PeakTime()+thishit.PeakWidth() ) << std::endl;
285 
286  //check if this hit is on this ROI
287  if (clock_data.TPCTDC2Tick(thishit.PeakTime() - thishit.PeakWidth()) < begin_wire_tdc ||
288  clock_data.TPCTDC2Tick(thishit.PeakTime() + thishit.PeakWidth()) > end_wire_tdc)
289  continue;
290 
291  nmchits_per_trackID_map[thishit.PartTrackId()] += 1;
292  wireData.MCHits_IntegratedCharge += thishit.Charge();
293 
294  if (thishit.Charge(true) > wireData.MCHits_PeakCharge) {
295  wireData.MCHits_PeakCharge = thishit.Charge(true);
296  wireData.MCHits_PeakTime = clock_data.TPCTDC2Tick(thishit.PeakTime());
297  }
298 
299  wireData.MCHits_wAverageCharge += thishit.Charge() * thishit.Charge();
300  wireData.MCHits_wAverageTime += thishit.Charge() * clock_data.TPCTDC2Tick(thishit.PeakTime());
301  }
302 
303  wireData.NMCHits = nmchits_per_trackID_map.size();
304 
309  }
310 }
WireROIInfo wireData
Definition: HitAnaAlg.h:161
float MCHits_wAverageTime
Definition: HitAnaAlg.h:98
float MCHits_IntegratedCharge
Definition: HitAnaAlg.h:93
float MCHits_wAverageCharge
Definition: HitAnaAlg.h:97
float MCHits_PeakCharge
Definition: HitAnaAlg.h:95
float MCHits_PeakTime
Definition: HitAnaAlg.h:96
float MCHits_AverageCharge
Definition: HitAnaAlg.h:94
void hit::HitAnaAlg::InitWireData ( unsigned int  event,
unsigned int  run 
)
private

Definition at line 116 of file HitAnaAlg.cxx.

References hit::WireROIInfo::event, hit::WireROIInfo::HitModuleLabels, HitModuleLabels, hit::WireROIInfo::NHitModules, hit::WireROIInfo::run, and wireData.

Referenced by AnalyzeWires().

117 {
118 
119  wireData.event = event;
120  wireData.run = run;
123 }
std::vector< std::string > HitModuleLabels
Definition: HitAnaAlg.h:164
unsigned int event
Definition: HitAnaAlg.h:71
WireROIInfo wireData
Definition: HitAnaAlg.h:161
std::vector< std::string > HitModuleLabels
Definition: HitAnaAlg.h:82
unsigned int run
Definition: HitAnaAlg.h:72
Event finding and building.
void hit::HitAnaAlg::LoadHitAssocPair ( std::vector< recob::Hit > const &  HitVector,
std::vector< std::vector< int >> const &  AssocVector,
std::string const &  HitModuleLabel 
)

Definition at line 92 of file HitAnaAlg.cxx.

References hit::hitanaalgexception, HitModuleLabels, and HitProcessingQueue.

Referenced by hit::HitAnaModule::analyze().

95 {
96 
97  HitProcessingQueue.push_back(std::make_pair(std::cref(HitVector), std::cref(AssocVector)));
98  HitModuleLabels.push_back(HitModuleLabel);
99 
100  if (HitProcessingQueue.size() != HitModuleLabels.size()) throw hitanaalgexception;
101 }
std::vector< std::string > HitModuleLabels
Definition: HitAnaAlg.h:164
hit::HitAnaAlgException hitanaalgexception
std::vector< HitAssocPair > HitProcessingQueue
Definition: HitAnaAlg.h:165
void hit::HitAnaAlg::ProcessROI ( lar::sparse_vector< float >::datarange_t const &  range,
int  WireIndex,
std::vector< sim::MCHitCollection > const &  MCHitCollectionVector,
std::vector< int > const &  thisAssocVector,
detinfo::DetectorClocksData const &  clock_data 
)
private

Definition at line 192 of file HitAnaAlg.cxx.

References lar::range_t< SIZE >::begin_index(), FindAndStoreHitsInRange(), FindAndStoreMCHitsInRange(), HitProcessingQueue, hit::WireROIInfo::integrated_charge, hit::WireROIInfo::peak_charge, hit::WireROIInfo::peak_time, ROIInfo(), lar::range_t< SIZE >::size(), wireData, and wireDataTree.

Referenced by FillWireInfo().

197 {
198 
200 
201  //std::cout << "----------------------------------------------------------------" << std::endl;
202  //std::cout << "WireIndex = " << WireIndex << std::endl;
203  //std::cout << "\tRange begin: " << range.begin_index() << std::endl;
204  //std::cout << "\tRange end: " << range.begin_index()+range.size() << std::endl;
205 
206  for (size_t iter = 0; iter < HitProcessingQueue.size(); iter++)
208  HitProcessingQueue[iter].second.at(WireIndex),
209  iter,
210  range.begin_index(),
211  range.begin_index() + range.size());
212 
213  FindAndStoreMCHitsInRange(MCHitCollectionVector,
214  thisAssocVector,
215  range.begin_index(),
216  range.begin_index() + range.size(),
217  clock_data);
218 
219  wireDataTree->Fill();
220 }
TTree * wireDataTree
Definition: HitAnaAlg.h:168
WireROIInfo wireData
Definition: HitAnaAlg.h:161
size_type size() const
Returns the size of the vector.
float peak_charge
Definition: HitAnaAlg.h:79
float integrated_charge
Definition: HitAnaAlg.h:78
void FindAndStoreHitsInRange(std::vector< recob::Hit > const &, std::vector< int > const &, size_t, size_t, size_t)
Definition: HitAnaAlg.cxx:222
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
std::vector< HitAssocPair > HitProcessingQueue
Definition: HitAnaAlg.h:165
void ROIInfo(lar::sparse_vector< float >::datarange_t const &, float &, float &, float &)
Definition: HitAnaAlg.cxx:172
void FindAndStoreMCHitsInRange(std::vector< sim::MCHitCollection > const &, std::vector< int > const &, size_t, size_t, detinfo::DetectorClocksData const &)
Definition: HitAnaAlg.cxx:265
void hit::HitAnaAlg::ROIInfo ( lar::sparse_vector< float >::datarange_t const &  range,
float &  charge_sum,
float &  charge_peak,
float &  charge_peak_time 
)
private

Definition at line 172 of file HitAnaAlg.cxx.

References lar::range_t< SIZE >::begin_index(), util::counter(), and value.

Referenced by ProcessROI().

176 {
177 
178  charge_sum = 0;
179  charge_peak = -999;
180  unsigned int counter = range.begin_index();
181 
182  for (auto const& value : range) {
183  charge_sum += value;
184  if (value > charge_peak) {
185  charge_peak = value;
186  charge_peak_time = (float)counter;
187  }
188  counter++;
189  }
190 }
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:295
double value
Definition: spectrum.C:18
void hit::HitAnaAlg::SetHitDataTree ( std::vector< TTree * > &  trees)

Definition at line 32 of file HitAnaAlg.cxx.

References hitData, and hitDataTree.

Referenced by hit::HitAnaModule::beginJob().

33 {
34 
35  hitDataTree.clear();
36  hitData.clear();
37 
38  hitDataTree.reserve(trees.size());
39  // This is particularly important: to establish the hitData memory -- all before
40  // individually making the tree->Branch() calls, specifying those addresses.
41  hitData.reserve(trees.size());
42 
43  // Construct the local attribute data container
44  for (auto const& t : trees) {
45  hitDataTree.push_back(t);
46  hitData.push_back(new recob::Hit);
47  }
48 
49  for (size_t i = 0; i < hitData.size(); ++i)
50  hitDataTree[i]->Branch(hitDataTree[i]->GetName(), "recob::Hit", &(hitData[i]));
51 }
std::vector< recob::Hit * > hitData
Definition: HitAnaAlg.h:162
std::vector< TTree * > hitDataTree
Definition: HitAnaAlg.h:170
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
void hit::HitAnaAlg::SetupWireDataTree ( )
private

Definition at line 53 of file HitAnaAlg.cxx.

References hit::WireROIInfo::channel, hit::WireROIInfo::event, hit::WireROIInfo::HitModuleLabels, hit::WireROIInfo::Hits_AverageCharge, hit::WireROIInfo::Hits_IntegratedCharge, hit::WireROIInfo::Hits_MeanMultiplicity, hit::WireROIInfo::Hits_PeakCharge, hit::WireROIInfo::Hits_PeakTime, hit::WireROIInfo::Hits_wAverageCharge, hit::WireROIInfo::Hits_wAverageTime, hit::WireROIInfo::integrated_charge, hit::WireROIInfo::MCHits_AverageCharge, hit::WireROIInfo::MCHits_IntegratedCharge, hit::WireROIInfo::MCHits_PeakCharge, hit::WireROIInfo::MCHits_PeakTime, hit::WireROIInfo::MCHits_wAverageCharge, hit::WireROIInfo::MCHits_wAverageTime, hit::WireROIInfo::NHitModules, hit::WireROIInfo::NHits, hit::WireROIInfo::NMCHits, hit::WireROIInfo::peak_charge, hit::WireROIInfo::peak_time, hit::WireROIInfo::plane, hit::WireROIInfo::range_index, hit::WireROIInfo::range_size, hit::WireROIInfo::range_start, hit::WireROIInfo::run, wireData, and wireDataTree.

Referenced by SetWireDataTree().

54 {
55  wireDataTree->Branch("event", &wireData.event, "event/i");
56  wireDataTree->Branch("run", &wireData.run, "run/i");
57  wireDataTree->Branch("channel", &wireData.channel, "channel/i");
58  wireDataTree->Branch("plane", &wireData.plane, "plane/i");
59  wireDataTree->Branch("roi_index", &wireData.range_index, "roi_index/i");
60  wireDataTree->Branch("roi_start", &wireData.range_start, "roi_start/i");
61  wireDataTree->Branch("roi_size", &wireData.range_size, "roi_size/i");
62  wireDataTree->Branch("roi_charge", &wireData.integrated_charge, "roi_charge/F");
63  wireDataTree->Branch("roi_peak_charge", &wireData.peak_charge, "roi_peak_charge/F");
64  wireDataTree->Branch("roi_peak_time", &wireData.peak_time, "roi_peak_time/F");
65  wireDataTree->Branch("nHitModules", &wireData.NHitModules, "nHitModules/I");
66  wireDataTree->Branch("HitModuleLabels", &wireData.HitModuleLabels);
67  wireDataTree->Branch("NHits", &wireData.NHits);
68  wireDataTree->Branch("Hits_IntegratedCharge", &wireData.Hits_IntegratedCharge);
69  wireDataTree->Branch("Hits_AverageCharge", &wireData.Hits_AverageCharge);
70  wireDataTree->Branch("Hits_PeakCharge", &wireData.Hits_PeakCharge);
71  wireDataTree->Branch("Hits_Peak", &wireData.Hits_PeakTime);
72  wireDataTree->Branch("Hits_wAverageCharge", &wireData.Hits_wAverageCharge);
73  wireDataTree->Branch("Hits_wAverageTime", &wireData.Hits_wAverageTime);
74  wireDataTree->Branch("Hits_MeanMultiplicity", &wireData.Hits_MeanMultiplicity);
75 
76  wireDataTree->Branch("NMCHits", &wireData.NMCHits);
77  wireDataTree->Branch("MCHits_IntegratedCharge", &wireData.MCHits_IntegratedCharge);
78  wireDataTree->Branch("MCHits_AverageCharge", &wireData.MCHits_AverageCharge);
79  wireDataTree->Branch("MCHits_PeakCharge", &wireData.MCHits_PeakCharge);
80  wireDataTree->Branch("MCHits_Peak", &wireData.MCHits_PeakTime);
81  wireDataTree->Branch("MCHits_wAverageCharge", &wireData.MCHits_wAverageCharge);
82  wireDataTree->Branch("MCHits_wAverageTime", &wireData.MCHits_wAverageTime);
83 }
TTree * wireDataTree
Definition: HitAnaAlg.h:168
unsigned int range_index
Definition: HitAnaAlg.h:75
unsigned int event
Definition: HitAnaAlg.h:71
WireROIInfo wireData
Definition: HitAnaAlg.h:161
std::vector< float > Hits_wAverageCharge
Definition: HitAnaAlg.h:88
std::vector< float > Hits_MeanMultiplicity
Definition: HitAnaAlg.h:90
std::vector< float > Hits_PeakTime
Definition: HitAnaAlg.h:87
unsigned int range_start
Definition: HitAnaAlg.h:76
std::vector< std::string > HitModuleLabels
Definition: HitAnaAlg.h:82
float MCHits_wAverageTime
Definition: HitAnaAlg.h:98
unsigned int run
Definition: HitAnaAlg.h:72
std::vector< float > Hits_PeakCharge
Definition: HitAnaAlg.h:86
std::vector< int > NHits
Definition: HitAnaAlg.h:83
float MCHits_IntegratedCharge
Definition: HitAnaAlg.h:93
float MCHits_wAverageCharge
Definition: HitAnaAlg.h:97
float peak_charge
Definition: HitAnaAlg.h:79
std::vector< float > Hits_AverageCharge
Definition: HitAnaAlg.h:85
std::vector< float > Hits_wAverageTime
Definition: HitAnaAlg.h:89
unsigned int channel
Definition: HitAnaAlg.h:73
float MCHits_PeakCharge
Definition: HitAnaAlg.h:95
size_t range_size
Definition: HitAnaAlg.h:77
float MCHits_PeakTime
Definition: HitAnaAlg.h:96
unsigned int plane
Definition: HitAnaAlg.h:74
std::vector< float > Hits_IntegratedCharge
Definition: HitAnaAlg.h:84
float integrated_charge
Definition: HitAnaAlg.h:78
float MCHits_AverageCharge
Definition: HitAnaAlg.h:94
void hit::HitAnaAlg::SetWireDataTree ( TTree *  wdt)

Definition at line 26 of file HitAnaAlg.cxx.

References SetupWireDataTree(), and wireDataTree.

Referenced by hit::HitAnaModule::beginJob().

27 {
28  wireDataTree = wdt;
30 }
TTree * wireDataTree
Definition: HitAnaAlg.h:168
void SetupWireDataTree()
Definition: HitAnaAlg.cxx:53

Friends And Related Function Documentation

friend class HitAnaAlgTest
friend

Definition at line 173 of file HitAnaAlg.h.

Member Data Documentation

std::vector<recob::Hit*> hit::HitAnaAlg::hitData
private

Definition at line 162 of file HitAnaAlg.h.

Referenced by FindAndStoreHitsInRange(), and SetHitDataTree().

std::vector<TTree*> hit::HitAnaAlg::hitDataTree
private

Definition at line 170 of file HitAnaAlg.h.

Referenced by FindAndStoreHitsInRange(), and SetHitDataTree().

std::vector<std::string> hit::HitAnaAlg::HitModuleLabels
private

Definition at line 164 of file HitAnaAlg.h.

Referenced by ClearHitModules(), InitWireData(), and LoadHitAssocPair().

std::vector<HitAssocPair> hit::HitAnaAlg::HitProcessingQueue
private

Definition at line 165 of file HitAnaAlg.h.

Referenced by ClearHitModules(), LoadHitAssocPair(), and ProcessROI().

TTree* hit::HitAnaAlg::wireDataTree
private

Definition at line 168 of file HitAnaAlg.h.

Referenced by ProcessROI(), SetupWireDataTree(), and SetWireDataTree().


The documentation for this class was generated from the following files: