LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
SpacePointAna_module.cc
Go to the documentation of this file.
1 //
2 // Name: SpacePointAna_module.cc
3 //
4 // Purpose: Module SpacePointAna.
5 //
6 //
7 // Configuration parameters.
8 //
9 // HitModuleLabel: Hit module label.
10 // UseClusterHits: If true, use clustered hits (otherwise all hits).
11 // ClusterModuleLabel: Cluster module label.
12 // UseMC: Use MC truth information.
13 // SpacePointAlgTime: SpacePointAlg configuration (loose time cuts).
14 // SpacePointAlgSep: SpacePointAlg configuration (loose separation cuts).
15 // SpacePointAlgDefault: SpacePointAlg configuration (default cuts).
16 //
17 // Created: 2-Aug-2011 H. Greenlee
18 //
19 
24 #include "art_root_io/TFileService.h"
27 
40 
41 #include "TH1F.h"
42 #include "TH2F.h"
43 
44 #include "range/v3/view.hpp"
45 
46 using lar::to_element;
47 using ranges::views::transform;
48 
49 namespace trkf {
50 
51  class SpacePointAna : public art::EDAnalyzer {
52  public:
53  explicit SpacePointAna(fhicl::ParameterSet const& pset);
54 
55  private:
56  void analyze(const art::Event& evt) override;
57 
58  void bookHistograms(bool mc);
59 
60  // Fcl Attributes.
61 
62  const SpacePointAlg fSptalgTime; // Algorithm object (increased time cut).
63  const SpacePointAlg fSptalgSep; // Algorithm object (increased sepataion cut).
64  const SpacePointAlg fSptalgDefault; // Algorithm object (default cuts).
65  std::string fHitModuleLabel;
67  std::string fClusterModuleLabel;
68  bool fUseMC;
69  double fMinX; // Minimum x.
70  double fMaxX; // Maximum x.
71  double fMinY; // Minimum y.
72  double fMaxY; // Maximum y.
73  double fMinZ; // Minimum z.
74  double fMaxZ; // Maximum z.
75 
76  // Histograms.
77 
78  bool fBooked{false}; // Have histograms been booked yet?
79  TH1F* fHDTUE{nullptr}; // U-drift electrons time difference.
80  TH1F* fHDTVE{nullptr}; // V-drift electrons time difference.
81  TH1F* fHDTWE{nullptr}; // W-drift electrons time difference.
82  TH1F* fHDTUPull{nullptr}; // U-drift electrons time pull.
83  TH1F* fHDTVPull{nullptr}; // V-drift electrons time pull.
84  TH1F* fHDTWPull{nullptr}; // W-drift electrons time pull.
85  TH1F* fHDTUV{nullptr}; // U-V time difference.
86  TH1F* fHDTVW{nullptr}; // V-W time difference.
87  TH1F* fHDTWU{nullptr}; // W-U time difference.
88  TH2F* fHDTUVU{nullptr}; // U-V time difference vs. U.
89  TH2F* fHDTUVV{nullptr}; // U-V time difference vs. V.
90  TH2F* fHDTVWV{nullptr}; // V-W time difference vs. V.
91  TH2F* fHDTVWW{nullptr}; // V-W time difference vs. W.
92  TH2F* fHDTWUW{nullptr}; // W-U time difference vs. W.
93  TH2F* fHDTWUU{nullptr}; // W-U time difference vs. U.
94  TH1F* fHS{nullptr}; // Spatial separation.
95  TH1F* fHchisq{nullptr}; // Space point chisquare.
96  TH1F* fHx{nullptr}; // X position.
97  TH1F* fHy{nullptr}; // Y position.
98  TH1F* fHz{nullptr}; // Z position.
99  TH1F* fHAmpU{nullptr}; // U hit amplitude.
100  TH1F* fHAmpV{nullptr}; // V hit amplitude.
101  TH1F* fHAmpW{nullptr}; // W hit amplitude.
102  TH1F* fHAreaU{nullptr}; // U hit area.
103  TH1F* fHAreaV{nullptr}; // V hit area.
104  TH1F* fHAreaW{nullptr}; // W hit area.
105  TH1F* fHSumU{nullptr}; // U hit sum ADC.
106  TH1F* fHSumV{nullptr}; // V hit sum ADC.
107  TH1F* fHSumW{nullptr}; // W hit sum ADC.
108  TH1F* fHMCdx{nullptr}; // X residual (reco vs. mc truth).
109  TH1F* fHMCdy{nullptr}; // Y residual (reco vs. mc truth).
110  TH1F* fHMCdz{nullptr}; // Z residual (reco vs. mc truth).
111  TH1F* fHMCxpull{nullptr}; // X pull (reco vs. mc truth).
112  TH1F* fHMCypull{nullptr}; // Y pull (reco vs. mc truth).
113  TH1F* fHMCzpull{nullptr}; // Z pull (reco vs. mc truth).
114 
115  // Statistics.
116 
117  int fNumEvent{0};
118  };
119 
121 
122  SpacePointAna::SpacePointAna(const fhicl::ParameterSet& pset)
123  : EDAnalyzer(pset)
124  , fSptalgTime(pset.get<fhicl::ParameterSet>("SpacePointAlgTime"))
125  , fSptalgSep(pset.get<fhicl::ParameterSet>("SpacePointAlgSep"))
126  , fSptalgDefault(pset.get<fhicl::ParameterSet>("SpacePointAlgDefault"))
127  , fHitModuleLabel(pset.get<std::string>("HitModuleLabel"))
128  , fUseClusterHits(pset.get<bool>("UseClusterHits"))
129  , fClusterModuleLabel(pset.get<std::string>("ClusterModuleLabel"))
130  , fUseMC(pset.get<bool>("UseMC"))
131  , fMinX(pset.get<double>("MinX", -1.e10))
132  , fMaxX(pset.get<double>("MaxX", 1.e10))
133  , fMinY(pset.get<double>("MinY", -1.e10))
134  , fMaxY(pset.get<double>("MaxY", 1.e10))
135  , fMinZ(pset.get<double>("MinZ", -1.e10))
136  , fMaxZ(pset.get<double>("MaxZ", 1.e10))
137  {
138  mf::LogInfo("SpacePointAna") << "SpacePointAna configured with the following parameters:\n"
139  << " HitModuleLabel = " << fHitModuleLabel << "\n"
140  << " UseClusterHits = " << fUseClusterHits << "\n"
141  << " ClusterModuleLabel = " << fClusterModuleLabel << "\n"
142  << " UseMC = " << fUseMC;
143  }
144 
146  {
147  if (!fBooked) {
148  fBooked = true;
149 
151  auto const& tpc = geom->TPC({0, 0});
153  art::TFileDirectory dir = tfs->mkdir("sptana", "SpacePointAna histograms");
154 
155  unsigned int nwiresU = 0, nwiresV = 0, nwiresW = 0;
156 
157  // Figure out the number of wires in U, V, and W planes.
158 
159  // Loop over cryostats, tpcs, and planes.
160 
161  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
162  for (auto const& pgeom : wireReadoutGeom.Iterate<geo::PlaneGeo>()) {
163  unsigned int const nwires = pgeom.Nwires();
164  switch (pgeom.View()) {
165  case geo::kU: nwiresU = nwires; break;
166  case geo::kV: nwiresV = nwires; break;
167  case geo::kZ: nwiresW = nwires; break;
168  default: {
169  }
170  }
171  }
172 
173  if (mc && fUseMC) {
174  fHDTUE = dir.make<TH1F>("MCDTUE", "U-Drift Electrons Time Difference", 100, -5., 5.);
175  fHDTVE = dir.make<TH1F>("MCDTVE", "V-Drift Electrons Time Difference", 100, -5., 5.);
176  fHDTWE = dir.make<TH1F>("MCDTWE", "W-Drift Electrons Time Difference", 100, -5., 5.);
177  fHDTUPull = dir.make<TH1F>("MCDTUPull", "U-Drift Electrons Time Pull", 100, -50., 50.);
178  fHDTVPull = dir.make<TH1F>("MCDTVPull", "V-Drift Electrons Time Pull", 100, -50., 50.);
179  fHDTWPull = dir.make<TH1F>("MCDTWPull", "W-Drift Electrons Time Pull", 100, -50., 50.);
180  }
181  if (!fSptalgTime.merge()) {
182  fHDTUV = dir.make<TH1F>("DTUV", "U-V time difference", 100, -20., 20.);
183  fHDTVW = dir.make<TH1F>("DTVW", "V-W time difference", 100, -20., 20.);
184  fHDTWU = dir.make<TH1F>("DTWU", "W-U time difference", 100, -20., 20.);
185  fHDTUVU = dir.make<TH2F>(
186  "DTUVU", "U-V time difference vs. U", 100, 0., double(nwiresU), 100, -20., 20.);
187  fHDTUVV = dir.make<TH2F>(
188  "DTUVV", "U-V time difference vs. V", 100, 0., double(nwiresV), 100, -20., 20.);
189  fHDTVWV = dir.make<TH2F>(
190  "DTVWV", "V-W time difference vs. V", 100, 0., double(nwiresV), 100, -20., 20.);
191  fHDTVWW = dir.make<TH2F>(
192  "DTVWW", "V-W time difference vs. W", 100, 0., double(nwiresW), 100, -20., 20.);
193  fHDTWUW = dir.make<TH2F>(
194  "DTWUW", "W-U time difference vs. W", 100, 0., double(nwiresW), 100, -20., 20.);
195  fHDTWUU = dir.make<TH2F>(
196  "DTWUU", "W-U time difference vs. U", 100, 0., double(nwiresU), 100, -20., 20.);
197  fHS = dir.make<TH1F>("DS", "Spatial Separation", 100, -2., 2.);
198  }
199  fHchisq = dir.make<TH1F>("chisq", "Chisquare", 100, 0., 20.);
200 
201  fHx = dir.make<TH1F>("xpos", "X Position", 100, 0., 2. * tpc.HalfWidth());
202  fHy = dir.make<TH1F>("ypos", "Y Position", 100, -tpc.HalfHeight(), tpc.HalfHeight());
203  fHz = dir.make<TH1F>("zpos", "Z Position", 100, 0., tpc.Length());
204  fHAmpU = dir.make<TH1F>("ampU", "U Hit Amplitude", 50, 0., 50.);
205  fHAmpV = dir.make<TH1F>("ampV", "V Hit Amplitude", 50, 0., 50.);
206  fHAmpW = dir.make<TH1F>("ampW", "W Hit Amplitude", 50, 0., 50.);
207  fHAreaU = dir.make<TH1F>("areaU", "U Hit Area", 100, 0., 500.);
208  fHAreaV = dir.make<TH1F>("areaV", "V Hit Area", 100, 0., 500.);
209  fHAreaW = dir.make<TH1F>("areaW", "W Hit Area", 100, 0., 500.);
210  fHSumU = dir.make<TH1F>("sumU", "U Hit Sum ADC", 100, 0., 500.);
211  fHSumV = dir.make<TH1F>("sumV", "V Hit Sum ADC", 100, 0., 500.);
212  fHSumW = dir.make<TH1F>("sumW", "W Hit Sum ADC", 100, 0., 500.);
213  if (mc && fUseMC) {
214  fHMCdx = dir.make<TH1F>("MCdx", "X MC Residual", 100, -1., 1.);
215  fHMCdy = dir.make<TH1F>("MCdy", "Y MC Residual", 100, -1., 1.);
216  fHMCdz = dir.make<TH1F>("MCdz", "Z MC Residual", 100, -1., 1.);
217  fHMCxpull = dir.make<TH1F>("MCxpull", "X MC Pull", 100, -50., 50.);
218  fHMCypull = dir.make<TH1F>("MCypull", "Y MC Pull", 100, -50., 50.);
219  fHMCzpull = dir.make<TH1F>("MCzpull", "Z MC Pull", 100, -50., 50.);
220  }
221  }
222  }
223 
225  {
226  ++fNumEvent;
227 
228  // Make sure histograms are booked.
229 
230  bool mc = !evt.isRealData();
231  bookHistograms(mc);
232 
233  // Get Services.
234 
236 
237  // Get Hits.
238 
240 
241  if (fUseClusterHits) {
242 
243  // Get clusters.
244 
246  evt.getByLabel(fClusterModuleLabel, clusterh);
247 
248  // Get hits from all clusters.
250 
251  if (clusterh.isValid()) {
252  int nclus = clusterh->size();
253 
254  for (int i = 0; i < nclus; ++i) {
255  art::Ptr<recob::Cluster> pclus(clusterh, i);
256  std::vector<art::Ptr<recob::Hit>> clushits = fm.at(i);
257  int nhits = clushits.size();
258  hits.reserve(hits.size() + nhits);
259 
260  for (std::vector<art::Ptr<recob::Hit>>::const_iterator ihit = clushits.begin();
261  ihit != clushits.end();
262  ++ihit) {
263  hits.push_back(*ihit);
264  }
265  }
266  }
267  }
268  else {
269 
270  // Get unclustered hits.
271 
273  evt.getByLabel(fHitModuleLabel, hith);
274  if (hith.isValid()) {
275  int nhits = hith->size();
276  hits.reserve(nhits);
277 
278  for (int i = 0; i < nhits; ++i)
279  hits.push_back(art::Ptr<recob::Hit>(hith, i));
280  }
281  }
282 
283  // Fill histograms that don't depend on space points.
284 
285  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
286  auto const detProp =
288 
289  if (mc && fUseMC) {
290 
292 
293  // Loop over hits and fill hit-electron time difference histogram.
294 
295  for (auto const& hitPtr : hits) {
296  const recob::Hit& hit = *hitPtr;
297 
298  double tpeak = hit.PeakTime();
299  double terr = hit.SigmaPeakTime();
300 
301  bool tav_ok = true;
302  double tav = 0.;
303  try {
304  std::vector<double> hitxyz = bt_serv->HitToXYZ(clockData, hit);
305  tav = detProp.ConvertXToTicks(
306  hitxyz[0], hit.WireID().Plane, hit.WireID().TPC, hit.WireID().Cryostat);
307  }
308  catch (cet::exception& x) {
309  tav_ok = false;
310  }
311  if (tav_ok) {
312  if (hit.View() == geo::kU) {
313  fHDTUE->Fill(tpeak - tav);
314  fHDTUPull->Fill((tpeak - tav) / terr);
315  }
316  else if (hit.View() == geo::kV) {
317  fHDTVE->Fill(tpeak - tav);
318  fHDTVPull->Fill((tpeak - tav) / terr);
319  }
320  else if (hit.View() == geo::kZ) {
321  fHDTWE->Fill(tpeak - tav);
322  fHDTWPull->Fill((tpeak - tav) / terr);
323  }
324  else
325  throw cet::exception("SpacePointAna") << "Bad view = " << hit.View() << "\n";
326  }
327  }
328  }
329 
330  std::vector<recob::SpacePoint> spts1; // For time histograms.
331  std::vector<recob::SpacePoint> spts2; // For separation histogram.
332  std::vector<recob::SpacePoint> spts3; // Default cuts.
333 
334  // If nonzero time cut is specified, make space points using that
335  // time cut (for time histograms).
336 
337  if (!fSptalgTime.merge()) {
338  if (mc && fUseMC)
339  fSptalgTime.makeMCTruthSpacePoints(clockData, detProp, hits, spts1);
340  else
341  fSptalgTime.makeSpacePoints(clockData, detProp, hits, spts1);
342 
343  // Report number of space points.
344 
345  MF_LOG_DEBUG("SpacePointAna")
346  << "Found " << spts1.size() << " space points using special time cut.";
347  }
348 
349  // If nonzero separation cut is specified, make space points using that
350  // separation cut (for separation histogram).
351 
352  if (!fSptalgSep.merge()) {
353  if (mc && fUseMC)
354  fSptalgSep.makeMCTruthSpacePoints(clockData, detProp, hits, spts2);
355  else
356  fSptalgSep.makeSpacePoints(clockData, detProp, hits, spts2);
357 
358  // Report number of space points.
359 
360  MF_LOG_DEBUG("SpacePointAna")
361  << "Found " << spts2.size() << " space points using special seperation cut.";
362  }
363 
364  // Make space points using default cuts.
365 
366  if (mc && fUseMC)
367  fSptalgDefault.makeMCTruthSpacePoints(clockData, detProp, hits, spts3);
368  else
369  fSptalgDefault.makeSpacePoints(clockData, detProp, hits, spts3);
370 
371  // Report number of space points.
372 
373  MF_LOG_DEBUG("SpacePointAna") << "Found " << spts3.size()
374  << " space points using default cuts.";
375 
376  if (!fSptalgTime.merge()) {
377 
378  // Loop over space points and fill time histograms.
379 
380  for (auto const& spt : spts1) {
381  if (spt.XYZ()[0] < fMinX || spt.XYZ()[0] > fMaxX || spt.XYZ()[1] < fMinY ||
382  spt.XYZ()[1] > fMaxY || spt.XYZ()[2] < fMinZ || spt.XYZ()[2] > fMaxZ)
383  continue;
384 
385  // Get hits associated with this SpacePoint.
386 
388 
389  // Make a double loop over hits and fill hit time difference histograms.
390 
391  for (auto const& hit1 : spthits | transform(to_element)) {
392  geo::WireID hit1WireID = hit1.WireID();
393  unsigned int tpc1 = hit1WireID.TPC;
394  unsigned int plane1 = hit1WireID.Plane;
395  unsigned int wire1 = hit1WireID.Wire;
396 
397  geo::View_t view1 = hit1.View();
398  double t1 = fSptalgTime.correctedTime(detProp, hit1);
399 
400  for (auto const& hit2 : spthits | transform(to_element)) {
401  geo::WireID hit2WireID = hit2.WireID();
402  unsigned int tpc2 = hit2WireID.TPC;
403  unsigned int plane2 = hit2WireID.Plane;
404  unsigned int wire2 = hit2WireID.Wire;
405 
406  // Require same tpc, different view.
407 
408  if (tpc1 == tpc2 && plane1 != plane2) {
409 
410  geo::View_t view2 = hit2.View();
411  double t2 = fSptalgTime.correctedTime(detProp, hit2);
412 
413  if (view1 == geo::kU) {
414  if (view2 == geo::kV) {
415  fHDTUV->Fill(t1 - t2);
416  fHDTUVU->Fill(double(wire1), t1 - t2);
417  fHDTUVV->Fill(double(wire2), t1 - t2);
418  }
419  if (view2 == geo::kZ) {
420  fHDTWU->Fill(t2 - t1);
421  fHDTWUW->Fill(double(wire2), t2 - t1);
422  fHDTWUU->Fill(double(wire1), t2 - t1);
423  }
424  }
425  if (view1 == geo::kV) {
426  if (view2 == geo::kZ) {
427  fHDTVW->Fill(t1 - t2);
428  fHDTVWV->Fill(double(wire1), t1 - t2);
429  fHDTVWW->Fill(double(wire2), t1 - t2);
430  }
431  if (view2 == geo::kU) {
432  fHDTUV->Fill(t2 - t1);
433  fHDTUVU->Fill(double(wire2), t2 - t1);
434  fHDTUVV->Fill(double(wire1), t2 - t1);
435  }
436  }
437  if (view1 == geo::kZ) {
438  if (view2 == geo::kU) {
439  fHDTWU->Fill(t1 - t2);
440  fHDTWUW->Fill(double(wire1), t1 - t2);
441  fHDTWUU->Fill(double(wire2), t1 - t2);
442  }
443  if (view2 == geo::kV) {
444  fHDTVW->Fill(t2 - t1);
445  fHDTVWV->Fill(double(wire2), t2 - t1);
446  fHDTVWW->Fill(double(wire1), t2 - t1);
447  }
448  }
449  }
450  }
451  }
452  }
453 
454  // Loop over space points and fill seperation histograms.
455 
456  for (auto const& spt : spts2) {
457  if (spt.XYZ()[0] < fMinX || spt.XYZ()[0] > fMaxX || spt.XYZ()[1] < fMinY ||
458  spt.XYZ()[1] > fMaxY || spt.XYZ()[2] < fMinZ || spt.XYZ()[2] > fMaxZ)
459  continue;
460 
461  // Get hits associated with this SpacePoint.
462 
464 
465  // Fill separation histogram.
466 
467  double sep = fSptalgSep.separation(spthits);
468  fHS->Fill(sep);
469  }
470  }
471 
472  // Loop over default space points and fill histograms.
473 
474  for (auto const& spt : spts3) {
475  if (spt.XYZ()[0] < fMinX || spt.XYZ()[0] > fMaxX || spt.XYZ()[1] < fMinY ||
476  spt.XYZ()[1] > fMaxY || spt.XYZ()[2] < fMinZ || spt.XYZ()[2] > fMaxZ)
477  continue;
478 
479  fHchisq->Fill(spt.Chisq());
480  fHx->Fill(spt.XYZ()[0]);
481  fHy->Fill(spt.XYZ()[1]);
482  fHz->Fill(spt.XYZ()[2]);
483 
484  // Get hits associated with this SpacePoint.
485 
486  std::vector<art::Ptr<recob::Hit>> spthits;
488  for (auto const& ptr : av_spthits) {
489  spthits.push_back(ptr);
490  }
491 
492  // Fill single hit histograms.
493 
494  for (auto const& hitPtr : spthits) {
495  const recob::Hit& hit = *hitPtr;
496 
497  geo::View_t view = hit.View();
498 
499  if (view == geo::kU) {
500  fHAmpU->Fill(hit.PeakAmplitude());
501  fHAreaU->Fill(hit.Integral());
502  fHSumU->Fill(hit.ROISummedADC());
503  }
504  if (view == geo::kV) {
505  fHAmpV->Fill(hit.PeakAmplitude());
506  fHAreaV->Fill(hit.Integral());
507  fHSumV->Fill(hit.ROISummedADC());
508  }
509  if (view == geo::kZ) {
510  fHAmpW->Fill(hit.PeakAmplitude());
511  fHAreaW->Fill(hit.Integral());
512  fHSumW->Fill(hit.ROISummedADC());
513  }
514  }
515 
516  if (mc && fUseMC) {
517 
519 
520  try {
521  std::vector<double> mcxyz = bt_serv->SpacePointHitsToWeightedXYZ(clockData, spthits);
522  fHMCdx->Fill(spt.XYZ()[0] - mcxyz[0]);
523  fHMCdy->Fill(spt.XYZ()[1] - mcxyz[1]);
524  fHMCdz->Fill(spt.XYZ()[2] - mcxyz[2]);
525  if (spt.ErrXYZ()[0] > 0.)
526  fHMCxpull->Fill((spt.XYZ()[0] - mcxyz[0]) / std::sqrt(spt.ErrXYZ()[0]));
527  if (spt.ErrXYZ()[2] > 0.)
528  fHMCypull->Fill((spt.XYZ()[1] - mcxyz[1]) / std::sqrt(spt.ErrXYZ()[2]));
529  if (spt.ErrXYZ()[5] > 0.)
530  fHMCzpull->Fill((spt.XYZ()[2] - mcxyz[2]) / std::sqrt(spt.ErrXYZ()[5]));
531  }
532  catch (cet::exception&) {
533  }
534  }
535  }
536  }
537 }
Float_t x
Definition: compare.C:6
void reserve(size_type n)
Definition: PtrVector.h:337
constexpr to_element_t to_element
Definition: ToElement.h:25
TTree * t1
Definition: plottest35.C:26
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Planes which measure V.
Definition: geo_types.h:132
Declaration of signal hit object.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:195
STL namespace.
Planes which measure Z direction.
Definition: geo_types.h:134
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:254
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:286
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:430
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:290
bool isRealData() const
Definition: Event.cc:53
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
const SpacePointAlg fSptalgSep
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:238
void makeMCTruthSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
double separation(const art::PtrVector< recob::Hit > &hits) const
bool isValid() const noexcept
Definition: Handle.h:203
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Planes which measure U.
Definition: geo_types.h:131
void hits()
Definition: readHits.C:15
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
parameter set interface
void makeSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:67
void analyze(const art::Event &evt) override
bool merge() const noexcept
Definition: SpacePointAlg.h:87
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
double correctedTime(detinfo::DetectorPropertiesData const &detProp, const recob::Hit &hit) const
Declaration of cluster object.
size_type size() const
Definition: PtrVector.h:302
Detector simulation of raw signals on wires.
TTree * t2
Definition: plottest35.C:36
float ROISummedADC() const
The sum of calibrated ADC counts of the ROI (0. by default)
Definition: Hit.h:246
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:226
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Definition: StdUtils.h:120
SpacePointAna(fhicl::ParameterSet const &pset)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Encapsulate the construction of a single detector plane .
const SpacePointAlg fSptalgTime
TDirectory * dir
Definition: macro.C:5
std::vector< double > SpacePointHitsToWeightedXYZ(detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit >> const &hits) const
#define MF_LOG_DEBUG(id)
const SpacePointAlg fSptalgDefault
constexpr WireID()=default
Default constructor: an invalid TPC ID.
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Definition: Hit.h:230
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
TCEvent evt
Definition: DataStructs.cxx:8
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:315
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:448
Algorithm for generating space points from hits.
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Encapsulate the construction of a single detector plane .