T0RecoAnodePiercers_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: T0RecoAnodePiercers
3 // Module Type: producer
4 // File: T0RecoAnodePiercers.cc
5 //
6 // Joshua Thompson - joshualt@fnal.gov
7 // developed from work by Hannah Rogers - hannah.rogers@colostate.edu
8 // based on uboonecode modules by David Caratelli and Chris Barnes
9 ////////////////////////////////////////////////////////////////////////
10 
18 #include "fhiclcpp/ParameterSet.h"
20 #include "art_root_io/TFileService.h"
21 
22 // services etc...
26 
27 // data-products
34 //#include "duneprototypes/Protodune/singlephase/DataUtils/ProtoDUNEPFParticleUtils.h"
35 //#include "duneprototypes/Protodune/singlephase/DataUtils/ProtoDUNETrackUtils.h"
36 
37 // ROOT
38 #include "TVector3.h"
39 
40 // C++
41 #include <memory>
42 #include <iostream>
43 #include <utility>
44 
46 
48  public:
49  explicit T0RecoAnodePiercers(fhicl::ParameterSet const & p);
50  // The destructor generated by the compiler is fine for classes
51  // without bare pointers or other resource use.
52 
53  // Plugins should not be copied or assigned.
54  T0RecoAnodePiercers(T0RecoAnodePiercers const &) = delete;
58 
59  //Required functions.
60 
61  void produce(art::Event& event);
62 
63  private:
64 
65  // Functions to be used throughout module
66 
67  void SortTrackPoints (const recob::Track& track, std::vector<TVector3>& sorted_trk);
68 
69  size_t FlashMatch (const double reco_time, std::vector<double> op_times_v);
70 
71  // Declare member data here
72 
77 
81 
82  double fEdgeWidth; // [cm]
84 
85  int fMinPE;
87 
90 
91  bool fDebug;
92 
93  double fMinDtData;
94  double fMaxDtData;
95 
96  double fMinDtMC;
97  double fMaxDtMC;
98 
99  double DriftVelocity; // [cm/us]
100  unsigned int ReadoutWindow;
101 
102  double det_top;
103  double det_bottom;
104  double det_front;
105  double det_back;
106  double det_width; // [cm]
107 
108  std::vector<double> op_times;
109 
110  std::vector<size_t> flash_id_v;
112 
113  bool MC;
114 
115  // Track parameters
117  double length;
118  double rc_xs, rc_xe;
119  //double rc_xs_corr, rc_xe_corr;
120  double rc_ys, rc_ye;
121  double rc_zs, rc_ze;
122 
123  // Flash parameters
126  //double matched_flash_time_width;
127 
129  //double matched_flash_centre_y;
130  //double matched_flash_centre_z;
131  //double matched_flash_max_pe_det_x;
132  //double matched_flash_max_pe_det_y;
133  //double matched_flash_max_pe_det_z;
134  //double matched_flash_width_y;
135  //double matched_flash_width_z;
136 
137  // Reco results
139 
140  // Track info
145  //bool cathode_crossing_track;
146 
147  double dtMin;
148  double dtMax;
149  };
150 
152  :
153  EDProducer(fcl) {
154 
155  fDebug = fcl.get<bool> ("Debug" );
156 
157  fPFPProducer = fcl.get<std::string> ("PFPProducer" );
158  fTrackProducer = fcl.get<std::string> ("TrackProducer" );
159  fHitProducer = fcl.get<std::string> ("HitProducer" );
160 
161  fTriggerProducer = fcl.get<std::string> ("TriggerProducer" );
162 
163  fFlashProducerData = fcl.get<std::string> ("DataFlashProducer" );
164  fFlashProducerMC = fcl.get<std::string> ("MCFlashProducer" );
165 
166  fEdgeWidth = fcl.get<double> ("EdgeWidth" );
167  fReadoutEdgeTicks = fcl.get<int> ("ReadoutEdgeTicks" );
168 
169  fMinPE = fcl.get<double> ("MinPE" );
170  fMinTrackLength = fcl.get<double> ("MinTrackLength" );
171 
172  fMinDtData = fcl.get<double> ("MinDtFlashRecoData" );
173  fMaxDtData = fcl.get<double> ("MaxDtFlashRecoData" );
174 
175  fMinDtMC = fcl.get<double> ("MinDtFlashRecoMC" );
176  fMaxDtMC = fcl.get<double> ("MaxDtFlashRecoMC" );
177 
178  fFlashScaleFactor = fcl.get<double> ("FlashScaleFactor" );
179  fFlashTPCOffset = fcl.get<double> ("FlashTPCOffset" );
180 
181  // get boundaries based on detector bounds
182  auto const* geom = lar::providerFrom<geo::Geometry>();
183 
188 
189  for (geo::TPCID const& tID: geom->IterateTPCIDs()) {
190  geo::TPCGeo const& TPC = geom->TPC(tID);
191 
192  if(TPC.DriftDistance() < 25.0) continue;
193 
194  double origin[3] = {0.};
195  double center[3] = {0.};
196  TPC.LocalToWorld(origin, center);
197 
198  double tpc_top = center[1] + TPC.HalfHeight();
199  double tpc_bottom = center[1] - TPC.HalfHeight();
200  double tpc_front = center[2] - TPC.HalfLength();
201  double tpc_back = center[2] + TPC.HalfLength();
202 
203  if (tpc_top > det_top) det_top = tpc_top;
204  if (tpc_bottom < det_bottom) det_bottom = tpc_bottom;
205  if (tpc_front < det_front) det_front = tpc_front;
206  if (tpc_back > det_back) det_back = tpc_back;
207 
208  det_width = TPC.DriftDistance();
209  }
210 
211  // Use 'detp' to find 'efield' and 'temp'
212  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
213  double efield = detProp.Efield();
214  if(fDebug) std::cout << "Nominal electric field is: " << efield << " V/cm" << std::endl;
215 
216  double temp = detProp.Temperature();
217  if(fDebug) std::cout << "LAr temperature is: " << temp << " K" << std::endl;
218 
219  // Determine the drift velocity from 'efield' and 'temp'
220  DriftVelocity = detProp.DriftVelocity(efield,temp);
221  if(fDebug) std::cout << "Drift velocity is: " << DriftVelocity << " cm/us" << std::endl;
222 
223  // Get Readout window length
224 
225  ReadoutWindow = detProp.ReadOutWindowSize();
226  if(fDebug) std::cout << "Readout window is: " << ReadoutWindow << " us" << std::endl;
227 
228  // Declare what the module produces
229 
230  produces < std::vector<anab::T0> >();
231  produces < art::Assns<recob::PFParticle, anab::T0> >();
232  }
233 
235 
236  MC = !(event.isRealData());
237 
238  if(MC) {
239  dtMin = fMinDtMC; //us
240  dtMax = fMaxDtMC; //us
241  }
242  else {
243  dtMin = fMinDtData; //us
244  dtMax = fMaxDtData; //us
245  }
246 
247  if(fDebug) std::cout << "\tAnode piercing tracks selected by cuts.\n\t\t Min length: "
248  << fMinTrackLength << ", Min PE: " << fMinPE <<
249  " and flash-reco time difference between " << dtMin << " and "
250  << dtMax << " us." << std::endl;
251 
252  auto t0_v = std::make_unique<std::vector<anab::T0>>();
253  auto pfp_t0 = std::make_unique<art::Assns<recob::PFParticle, anab::T0>>();
254 
255  int track_number = 0;
256 
257  // Load detector clocks for later
258  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);;
259 
260  double TPC_trigger_offset = 0.0;
261 
262  //std::cout << "Event number: " << event.event() << std::endl;
263  if(fDebug) std::cout << "Set event number: " << event.event() << "\nTop: "
264  << det_top << "\nBottom: " << det_bottom << "\nFront: " << det_front
265  << "\nBack: " << det_back << "\nEdge width: " << fEdgeWidth << std::endl;
266 
267  op_times.clear();
268  flash_id_v.clear();
269  flash_h.clear();
270 
271  //Set flash producer to MC or data
272 
275 
276  // load Flashes
277  if (fDebug) std::cout << "Loading flash from producer " << fFlashProducer << std::endl;
278 
279  flash_h = event.getHandle<std::vector<recob::OpFlash> >(fFlashProducer);
280 
281  // make sure flashes look good
282  if(!flash_h.isValid()) {
283  std::cerr<<"\033[93m[ERROR]\033[00m ... could not locate Flash!"<<std::endl;
284  throw std::exception();
285  }
286 
287  double trigger_time = 0;
288 
289  if(!MC){
290  auto trigger_h = event.getHandle<std::vector<recob::OpFlash> >(fTriggerProducer);
291 
292  if( (!trigger_h) || trigger_h->empty()) {
293  if(fDebug) std::cout << "\tTrigger not found. Skipping." << std::endl;
294  event.put(std::move(t0_v));
295  event.put(std::move(pfp_t0));
296  return;
297  }
298 
299  if(fDebug) std::cout << "Loading trigger time from producer "
301 
302  trigger_time = trigger_h->at(0).Time();
303  }
304 
305 
306  // load PFParticles
307 
308  auto reco_particles_h = event.getValidHandle<std::vector<recob::PFParticle>>(fPFPProducer);
309  const art::FindManyP<recob::Track> findTracks(reco_particles_h,event,fTrackProducer);
310  auto reco_tracks_h = event.getValidHandle<std::vector<recob::Track>>(fTrackProducer);
311  art::FindManyP<recob::Hit> findHits(reco_tracks_h, event, fTrackProducer);
312 
313  if(!reco_particles_h.isValid()) {
314  std::cerr<<"\033[93m[ERROR]\033[00m ... could not locate PFParticles!"<<std::endl;
315  throw std::exception();
316  }
317 
318  // Utilities for PFParticles and tracks
319  //protoana::ProtoDUNEPFParticleUtils pfpUtil;
320  //protoana::ProtoDUNETrackUtils trackUtil;
321 
322  // Get trigger to TPC Offset
323 
324  TPC_trigger_offset = clockData.TriggerOffsetTPC();
325  if(fDebug) std::cout << "TPC time offset from trigger: "
326  << TPC_trigger_offset << " us" << std::endl;
327 
328  // Prepare a vector of optical flash times, if flash above some PE cut value
329 
330  size_t flash_ctr = 0;
331  for (auto const& flash : *flash_h){
332  if (flash.TotalPE() > fMinPE){
333  double op_flash_time;
334  if(!MC) op_flash_time = flash.Time() - trigger_time;
335  if(MC) op_flash_time = flash.Time() - trigger_time - TPC_trigger_offset;
336  op_times.push_back(op_flash_time);
337  flash_id_v.push_back(flash_ctr);
338  if (fDebug) std::cout << "\t Flash: " << flash_ctr << " has time : "
339  << op_flash_time << ", PE : " << flash.TotalPE() << std::endl;
340  }
341  flash_ctr++;
342  } // for all flashes
343 
344  if(fDebug) std::cout << "Selected a total of " << op_times.size() << " OpFlashes" << std::endl;
345 
346  // LOOP THROUGH RECONSTRUCTED PFPARTICLES
347 
348  size_t ev_particle_ctr = 0;
349 
350  for(unsigned int particle = 0; particle < reco_particles_h->size(); ++particle){
351 
352  const recob::PFParticle &pfparticle = (*reco_particles_h)[particle];
353 
354  // Only consider primary particles
355  if(!pfparticle.IsPrimary()) continue;
356 
357  ev_particle_ctr++;
358 
359 
360  //Replacing this with the hardcoded method to remove util dependency
361  //const recob::Track* track = pfpUtil.GetPFParticleTrack(pfparticle,event,fPFPProducer,fTrackProducer);
362  const recob::Track* track = 0x0;
363  const std::vector<art::Ptr<recob::Track>> pfpTracks = findTracks.at(pfparticle.Self());
364  if( pfpTracks.size() != 0 ){
365  track = (pfpTracks.at(0)).get();
366  }
367  if(track == 0x0) {
368  if(fDebug) std::cout << "\tPFParticle " << ev_particle_ctr << " is not track like" << std::endl;
369  continue;
370  }
371 
372  if (fDebug) std::cout << "\tLooping through reco PFParticle " << ev_particle_ctr << std::endl;
373 
374  //Replacing this with the hardcoded method to remove util dependency
375  //const std::vector<const recob::Hit*>& hit_v = trackUtil.GetRecoTrackHits(*track,event,fTrackProducer);
376  std::vector<art::Ptr<recob::Hit>> inputHits = findHits.at(track->ID());
377  std::vector<const recob::Hit*> hit_v;
378  for(const art::Ptr<recob::Hit> hit : inputHits){
379  hit_v.push_back(hit.get());
380  }
381 
382 
384 
385  length = 0.;
386  rc_xs = ReadoutWindow/10.;
387  rc_xe = -ReadoutWindow/10.;
388  //rc_xs_corr = 399.;
389  //rc_xe_corr = -399.;
390  rc_ys = -99.;
391  rc_ye = -99.;
392  rc_zs = -99.;
393  rc_ze = -99.;
394 
397  //matched_flash_time_width = -1.;
398 
399  matched_flash_pe = 0.;
400  //matched_flash_centre_y = -99.;
401  //matched_flash_centre_z = -99.;
402  //matched_flash_width_y = -99.;
403  //matched_flash_width_z = -99.;
404  //matched_flash_max_pe_det_x = 0.;
405  //matched_flash_max_pe_det_y = -99.;
406  //matched_flash_max_pe_det_z = -99.;
407 
408  dt_flash_reco = 999;
409 
410  anode_piercing_candidate = false;
411  //cathode_crossing_track = false;
412 
413  // Get sorted points for the track object [assuming downwards going]
414 
415  std::vector<TVector3> sorted_trk;
416  SortTrackPoints(*track,sorted_trk);
417 
418  TVector3 track_start = sorted_trk.at(0);
419  TVector3 track_end = sorted_trk.at(sorted_trk.size() - 1);
420 
421  if(fDebug) std::cout << "\t\tTrack goes from (" << track_start.X() << ", "
422  << track_start.Y() << ", " << track_start.Z() << ") --> (" << track_end.X() << ", "
423  << track_end.Y() << ", " << track_end.Z() << ")" << std::endl;
424 
425  if(track->Length() < fMinTrackLength ) {
426  if(fDebug) std::cout << "\t\t\tParticle track too short. Skipping." << std::endl;
427  continue;
428  }
429 
430  auto const* geom = lar::providerFrom<geo::Geometry>();
431  auto const* first_hit = hit_v.at(0);
432  const geo::WireID wireID_start = first_hit->WireID();
433  const auto TPCGeoObject_start = geom->TPC(wireID_start.TPC,wireID_start.Cryostat);
434  short int driftDir_start = TPCGeoObject_start.DetectDriftDirection();
435 
436  short int driftDir_end = 0;
437  //cathode_crossing_track = false;
438 
439  for (size_t ii = 1; ii < hit_v.size(); ii++) {
440  const geo::WireID wireID_end = hit_v.at(ii)->WireID();
441  const auto TPCGeoObject_end = geom->TPC(wireID_end.TPC,wireID_end.Cryostat);
442  driftDir_end = TPCGeoObject_end.DetectDriftDirection();
443 
444  if(driftDir_end + driftDir_start == 0){
445  //cathode_crossing_track = true;
446  ii = hit_v.size();
447  }
448  }
449  // ------------------------------------------------------------------------------------
450  // ANODE PIERCERS
451 
452  if(fDebug) std::cout << "\t\tThis track starts in TPC " << wireID_start.TPC
453  << " which has a drift direction of " << driftDir_start << std::endl;
454 
455  // create root trees variables
456 
457  rc_xs = track_start.X();
458  rc_ys = track_start.Y();
459  rc_zs = track_start.Z();
460  rc_xe = track_end.X();
461  rc_ye = track_end.Y();
462  rc_ze = track_end.Z();
463  length = track->Length();
464 
465  // Determine if track hits edge of readout window
466  // NECESSARY TO REMOVE TRACKS THAT AREN'T FINISHED WHEN WINDOW CLOSES
467  // AS WELL AS TRACKS THAT WERE BEING COLLECTED BEFORE THE WINDOW OPENED
468 
469  readout_edge = false;
470  for (auto& hits : hit_v) {
471  auto hit_tick = hits->PeakTime();
472  if(hit_tick < fReadoutEdgeTicks || hit_tick > (ReadoutWindow - fReadoutEdgeTicks)){
473  readout_edge = true;
474  if(fDebug) std::cout << "\tTrack hits edge of readout window. "
475  "Skipping." << std::endl;
476  continue;
477  }
478 
479  double hit_time = clockData.TPCTick2TrigTime(hit_tick);
480 
481  // If track within window, get reco time from earliest hit time
482  if (hit_time < anode_rc_time) anode_rc_time = hit_time;
483  }
484 
485  if(readout_edge) continue;
486 
487  TPC_entering_candidate = false;
488  TPC_exiting_candidate = false;
489 
490  // Tracks which may enter TPC through an APA
491  if (rc_ys < (det_top - fEdgeWidth) && rc_zs > (det_front + fEdgeWidth)
492  && rc_zs < (det_back - fEdgeWidth)) {
493 
494  // reconstruct track T0 w.r.t. trigger time
495  if( ( rc_xs > rc_xe && driftDir_start>0 ) ||
496  ( rc_xs < rc_xe && driftDir_start<0 ) ) {
497  TPC_entering_candidate = true;
498  if(fDebug) std::cout << "\t\tTrack may enter TPC through "
499  "anode. Reco t0: " << anode_rc_time << " us" << std::endl;
500  }
501  }
502 
503  // Tracks which may exit TPC through an APA
505  && rc_ze < (det_back - fEdgeWidth)) {
506 
507  // reconstruct track T0 w.r.t. trigger time
508  if( ( rc_xe > rc_xs && driftDir_end>0 ) ||
509  ( rc_xe < rc_xs && driftDir_end<0 ) ) {
510  TPC_exiting_candidate = true;
511  if(fDebug) std::cout << "\t\tTrack may exit TPC through "
512  "anode. Reco t0:" << anode_rc_time << " us" << std::endl;
513  }
514  }
515 
518 
520  if(fDebug) std::cout << "\t\tTrack does not pierce anode." << std::endl;
521  continue;
522  }
523 
525  if(fDebug) std::cout << "\t\tTrack neither enters nor exits"
526  " through non-anode TPC face. No useful end point for SCE"
527  " measurement." << std::endl;
528  continue;
529  }
530 
531  //rc_xs_corr = rc_xs + driftDir_start*anode_rc_time*DriftVelocity;
532  //rc_xe_corr = rc_xe + driftDir_end*anode_rc_time*DriftVelocity;
533 
534  // FLASH MATCHING
535 
536  size_t op_match_result = FlashMatch((anode_rc_time),op_times);
537 
538  if(op_match_result==99999) {
539  if(fDebug) std::cout << "Unable to match flash to track." << std::endl;
540  continue;
541  }
542 
543  const art::Ptr<recob::OpFlash> flash_ptr(flash_h, op_match_result);
544 
545  matched_flash_time = flash_ptr->Time() - trigger_time;
547  if(MC) corrected_matched_flash_time = fFlashScaleFactor*matched_flash_time + fFlashTPCOffset - TPC_trigger_offset;
548  //matched_flash_time_width = flash_ptr->TimeWidth();
549 
551 
552  matched_flash_pe = flash_ptr->TotalPE();
553 
554  //matched_flash_centre_y = flash_ptr->YCenter();
555  //matched_flash_centre_z = flash_ptr->ZCenter();
556  //matched_flash_width_y = flash_ptr->YWidth();
557  //matched_flash_width_z = flash_ptr->ZWidth();
558 
559  /*unsigned int max_pe_channel = 9999;
560  double max_pe = 0;
561  unsigned int pd_ch;
562  for(pd_ch = 0; pd_ch <= geom->MaxOpChannel(); pd_ch++) {
563  double channel_i_pe = flash_ptr->PE(pd_ch);
564  if(channel_i_pe > max_pe) {
565  max_pe = channel_i_pe;
566  max_pe_channel = pd_ch;
567  }
568  }
569 
570  if(max_pe_channel==9999||max_pe==0) continue;
571 
572  matched_flash_max_pe_det_x = -det_width;
573  if(max_pe_channel>143) matched_flash_max_pe_det_x = det_width;
574  */
575  /*double max_pe_det_v[3];
576  geom->OpDetGeoFromOpChannel(max_pe_channel).GetCenter(max_pe_det_v);
577  matched_flash_max_pe_det_x = max_pe_det_v[0];
578  matched_flash_max_pe_det_y = max_pe_det_v[1];
579  matched_flash_max_pe_det_z = max_pe_det_v[2];
580  */
581 
582  /*if(fDebug) std::cout << "\t\tOpChannel " << max_pe_channel <<
583  " has maximum PE, and is located at: (" <<
584  matched_flash_max_pe_det_x << ", " <<
585  matched_flash_max_pe_det_y << ", " <<
586  matched_flash_max_pe_det_z << ")" << std::endl; */
587 
588  if(fDebug) std::cout << "\t\t Matched to flash w/ index " << op_match_result
589  << " w/ PE " << matched_flash_pe << ", corrected time " <<
590  corrected_matched_flash_time << " us vs corrected reco time " <<
591  anode_rc_time << " us" << std::endl;
592 
593  // ---------------------------------------------------------------
594  // CREATE T0 OBJECT AND ASSIGN TO PFPARTICLE
595 
598  if(fDebug) std::cout << "\t\tPFParticle: " << particle <<
599  " has a matched flash and passes cuts. Assigning T0: "
600  << anode_rc_time << " us." << std::endl;
601 
602  anab::T0 anode_t0 = anab::T0((anode_rc_time*1000), 0, 1, flash_ptr.key());
603  t0_v->push_back(anode_t0);
604 
605  // Use the association utility
606  // Need to convert our recob::PFParticle to an art::Ptr<recob::PFParticle
607  art::Ptr<recob::PFParticle> pfp_ptr(reco_particles_h,particle);
608 
609  util::CreateAssn(*this, event, *t0_v, pfp_ptr, *pfp_t0);
610  }
611 
612 
613  track_number++;
614 
615  }
616 
617  event.put(std::move(t0_v));
618  event.put(std::move(pfp_t0));
619 
620  }
621 
622 void T0RecoAnodePiercers::SortTrackPoints(const recob::Track& track, std::vector<TVector3>& sorted_trk)
623 {
624  sorted_trk.clear();
625 
626  TVector3 track_start, track_end;
627  double start_y = det_bottom - fEdgeWidth;
628  double end_y = det_top + fEdgeWidth;
629 
630  for (size_t ii = 0; ii < track.NumberTrajectoryPoints(); ii++){
631  auto const& trk_loc = track.LocationAtPoint(ii);
632 
633  if ((trk_loc.X() < -998.)||(trk_loc.Y() < -998.)||(trk_loc.Z() < -998)) continue;
634 
635  if (trk_loc.Y() < end_y){
636  end_y = trk_loc.Y();
637  track_end = {trk_loc.X(), trk_loc.Y(), trk_loc.Z()};
638  }
639 
640  if (trk_loc.Y() > start_y){
641  start_y = trk_loc.Y();
642  track_start = {trk_loc.X(), trk_loc.Y(), trk_loc.Z()};
643  }
644  }
645 
646  sorted_trk.push_back(track_start);
647  sorted_trk.push_back(track_end);
648  }
649 
650 size_t T0RecoAnodePiercers::FlashMatch(const double reco_time, std::vector<double> op_times_v)
651 {
652  // loop through all reco'd flash times and see if one matches
653  // the time from the track/particle
654 
655  double dt_min = 9999999.;
656  size_t matched_op_id = 99999;
657 
658  for (size_t i=0; i < op_times_v.size(); i++){
659  double op_time_i = op_times_v[i];
660  double corrected_op_time_i = op_time_i*fFlashScaleFactor + fFlashTPCOffset;
661  double corrected_flash_reco_time_diff = corrected_op_time_i - reco_time;
662  if (fabs(corrected_flash_reco_time_diff) < dt_min){
663  dt_min = fabs(corrected_flash_reco_time_diff);
664  matched_op_id = flash_id_v[i];
665  }
666  }
667 
668  return matched_op_id;
669  }
670 
void SortTrackPoints(const recob::Track &track, std::vector< TVector3 > &sorted_trk)
std::vector< size_t > flash_id_v
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
std::string string
Definition: nybbler.cc:12
Point_t const & LocationAtPoint(size_t i) const
Definition: Track.h:126
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
Geometry information for a single TPC.
Definition: TPCGeo.h:38
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
double HalfLength() const
Length is associated with z coordinate [cm].
Definition: TPCGeo.h:117
Definition: T0.h:16
art framework interface to geometry description
bool isValid() const noexcept
Definition: Handle.h:191
timescale_traits< TriggerTimeCategory >::time_point_t trigger_time
A point in time on the trigger time scale.
double Time() const
Definition: OpFlash.h:106
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
def move(depos, offset)
Definition: depos.py:107
key_type key() const noexcept
Definition: Ptr.h:216
T get(std::string const &key) const
Definition: ParameterSet.h:271
T0RecoAnodePiercers(fhicl::ParameterSet const &p)
p
Definition: test.py:223
void produce(art::Event &event)
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:86
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Detector simulation of raw signals on wires.
double HalfHeight() const
Height is associated with y coordinate [cm].
Definition: TPCGeo.h:111
int ID() const
Definition: Track.h:198
Declaration of signal hit object.
T0RecoAnodePiercers & operator=(T0RecoAnodePiercers const &)=delete
double DriftDistance() const
Definition: TPCGeo.h:155
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
art::Handle< std::vector< recob::OpFlash > > flash_h
void clear()
Definition: Handle.h:236
def center(depos, point)
Definition: depos.py:117
Provides recob::Track data product.
std::vector< double > op_times
constexpr WireID()=default
Default constructor: an invalid TPC ID.
double TotalPE() const
Definition: OpFlash.cxx:68
size_t FlashMatch(const double reco_time, std::vector< double > op_times_v)
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:563
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
Event finding and building.