All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
icaruscode/icaruscode/CRT/CRTUtils/CRTBackTracker.cc
Go to the documentation of this file.
2 
3 namespace icarus{
4  namespace crt{
5 
7  this->reconfigure(config);
8  }
9 
12 
13  //------------------------------------------------------------------------------
14  void CRTBackTracker::reconfigure(const Config& config){
15 
17  fCRTDataLabel = config.CRTDataLabel();
19  fCRTTrackLabel = config.CRTTrackLabel();
21 
22  return;
23  }
24 
25  //-----------------------------------------------------------------------------
26  void CRTBackTracker::Initialize(const art::Event& event){
27 
28  bool findData = false, findSimHit = false;
29 
30  // Clear those data structures!
31  fTrueHitTrueIds.clear();
32  fDataTrueIds.clear();
33  fSimHitTrueIds.clear();
34  fTrackTrueIds.clear();
35 
36  //CRTTrueHit
37  art::Handle< std::vector<CRTHit>> crtTrueHitHandle;
38  std::vector<art::Ptr<CRTHit> > crtTrueHitList;
39  if (event.getByLabel(fCRTTrueHitLabel, crtTrueHitHandle)){
40  art::fill_ptr_vector(crtTrueHitList, crtTrueHitHandle);
41 
42  art::FindManyP<sim::AuxDetIDE> findManyIdes(crtTrueHitHandle, event, fCRTTrueHitLabel);
43  std::map<art::Ptr<CRTHit>, int> trueHitPtrMap;
44 
45  for(size_t hit_i = 0; hit_i < crtTrueHitList.size(); hit_i++){
46 
47  trueHitPtrMap[crtTrueHitList[hit_i]] = hit_i;
48  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(hit_i);
49 
50  for(size_t i = 0; i < ides.size(); i++){
51 
52  int id = ides[i]->trackID;
53  if(fRollupUnsavedIds) id = std::abs(id);
54  fTrueHitTrueIds[hit_i][id] += ides[i]->energyDeposited;
55  }
56  }
57  }//if CRTTrueHit found
58  else
59  mf::LogWarning("CRTBackTracker") << "no CRTTrueHit products found";
60 
61  //CRTData
62  art::Handle< std::vector<CRTData>> crtDataHandle;
63  std::vector<art::Ptr<CRTData> > crtDataList;
64  std::map<art::Ptr<CRTData>, int> dataPtrMap;
65 
66  if (event.getByLabel(fCRTDataLabel, crtDataHandle)) {
67  art::fill_ptr_vector(crtDataList, crtDataHandle);
68  art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event, fCRTDataLabel);
69 
70  for(size_t data_i = 0; data_i < crtDataList.size(); data_i++){
71 
72  dataPtrMap[crtDataList[data_i]] = data_i;
73  // Get all the true IDs from all the IDEs in the hit
74  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
75 
76  for(size_t i = 0; i < ides.size(); i++){
77 
78  int id = ides[i]->trackID;
79  if(fRollupUnsavedIds) id = std::abs(id);
80  fDataTrueIds[data_i][id] += ides[i]->energyDeposited;
81  }
82  }
83  findData = true;
84  }//if CRTData found
85  else
86  mf::LogWarning("CRTBackTracker") << "no CRTData products found";
87 
88  //CRTSimHit
89  art::Handle< std::vector<CRTHit>> crtSimHitHandle;
90  std::vector<art::Ptr<CRTHit> > crtSimHitList;
91  std::map<art::Ptr<CRTHit>, int> simHitPtrMap;
92  if (event.getByLabel(fCRTSimHitLabel, crtSimHitHandle)){
93 
94  if(!findData)
95  mf::LogError("CRTBackTracker")
96  << "no CRTData products found when some were expected (CRTSimHits found)";
97 
98  art::fill_ptr_vector(crtSimHitList, crtSimHitHandle);
99  art::FindManyP<CRTData> findManyData(crtSimHitHandle, event, fCRTSimHitLabel);
100 
101  for(size_t hit_i = 0; hit_i < crtSimHitList.size(); hit_i++){
102 
103  simHitPtrMap[crtSimHitList[hit_i]] = hit_i;
104  std::vector<art::Ptr<CRTData>> data = findManyData.at(hit_i);
105 
106  for(size_t data_i = 0; data_i < data.size(); data_i++){
107 
108  int dataID = dataPtrMap[data[data_i]];
109 
110  for(auto const& di : fDataTrueIds[dataID]){
111  fSimHitTrueIds[hit_i][di.first] += di.second;
112  }
113  }
114  }
115  findSimHit = true;
116  }//if CRTSimHit found
117  else
118  mf::LogWarning("CRTBackTracker") << "no CRTSimHit products found";
119 
120  //CRTTracks
121  art::Handle< std::vector<CRTTrack>> crtTrackHandle;
122  std::vector<art::Ptr<CRTTrack> > crtTrackList;
123 
124  if (event.getByLabel(fCRTTrackLabel, crtTrackHandle)) {
125 
126  if(!findSimHit)
127  mf::LogError("CRTBackTracker")
128  << "no CRTSimHit products found when some were expected (CRTTracks found)";
129 
130  art::fill_ptr_vector(crtTrackList, crtTrackHandle);
131  art::FindManyP<CRTHit> findManyHits(crtTrackHandle, event, fCRTTrackLabel);
132 
133  for(size_t track_i = 0; track_i < crtTrackList.size(); track_i++){
134 
135  std::vector<art::Ptr<CRTHit>> hits = findManyHits.at(track_i);
136  for(size_t hit_i = 0; hit_i < hits.size(); hit_i++){
137 
138  int hitID = simHitPtrMap[hits[hit_i]];
139  for(auto const& hi : fSimHitTrueIds[hitID]){
140 
141  fTrackTrueIds[track_i][hi.first] += hi.second;
142  }
143  }
144  }
145  }//if CRTrack product found
146  else
147  mf::LogWarning("CRTBackTracker") << "no CRTTrack products found";
148 
149  }//Initialize
150 
151  // ---------------------------------------------------------------------------------------
152  // Check that two CRT data products are the same
153  bool CRTBackTracker::DataCompare(const CRTData& data1, const CRTData& data2){
154 
155  if(data1.fMac5 != data2.fMac5) return false;
156  if(data1.fTs0 != data2.fTs0) return false;
157  if(data1.fTs1 != data2.fTs1) return false;
158  if(data1.fEntry != data2.fEntry) return false;
159  for(int ch=0; ch<64; ch++) {
160  if(data1.fAdc[ch] != data2.fAdc[ch]) return false;
161  }
162 
163  return true;
164  }
165 
166  // ----------------------------------------------------------------------------------------
167  // Check that two CRT hits are the same
168  bool CRTBackTracker::HitCompare(const CRTHit& hit1, const CRTHit& hit2){
169 
170  if(hit1.ts1_ns != hit2.ts1_ns) return false;
171  if(hit1.plane != hit2.plane) return false;
172  if(hit1.x_pos != hit2.x_pos) return false;
173  if(hit1.y_pos != hit2.y_pos) return false;
174  if(hit1.z_pos != hit2.z_pos) return false;
175  if(hit1.x_err != hit2.x_err) return false;
176  if(hit1.y_err != hit2.y_err) return false;
177  if(hit1.z_err != hit2.z_err) return false;
178  if(hit1.tagger != hit2.tagger) return false;
179 
180  return true;
181  }
182 
183  // -----------------------------------------------------------------------------------------
184  // Check that two CRT tracks are the same
185  bool CRTBackTracker::TrackCompare(const CRTTrack& track1, const CRTTrack& track2){
186 
187  if(track1.ts1_ns != track2.ts1_ns) return false;
188  if(track1.plane1 != track2.plane1) return false;
189  if(track1.x1_pos != track2.x1_pos) return false;
190  if(track1.y1_pos != track2.y1_pos) return false;
191  if(track1.z1_pos != track2.z1_pos) return false;
192  if(track1.x1_err != track2.x1_err) return false;
193  if(track1.y1_err != track2.y1_err) return false;
194  if(track1.z1_err != track2.z1_err) return false;
195  if(track1.plane2 != track2.plane2) return false;
196  if(track1.x2_pos != track2.x2_pos) return false;
197  if(track1.y2_pos != track2.y2_pos) return false;
198  if(track1.z2_pos != track2.z2_pos) return false;
199  if(track1.x2_err != track2.x2_err) return false;
200  if(track1.y2_err != track2.y2_err) return false;
201  if(track1.z2_err != track2.z2_err) return false;
202 
203  return true;
204  }
205 
206  // --------------------------------------------------------------------------------------------
207  // Get all the true particle IDs that contributed to the CRT data product
208  std::vector<int> CRTBackTracker::AllTrueIds(const art::Event& event, const CRTData& data){
209 
210  std::vector<int> ids;
211 
212  // Get a handle to the CRT data in the event
213  auto crtDataHandle = event.getValidHandle<std::vector<CRTData>>(fCRTDataLabel);
214  art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event, fCRTDataLabel);
215 
216  // Find which one matches the data passed to the function
217  int data_i = 0, index = 0;
218 
219  int nmatch=0;
220  for(auto const& crtData : (*crtDataHandle)){
221 
222  if(DataCompare(crtData, data)) {
223  data_i = index;
224  nmatch++;
225  }
226 
227  index++;
228  }
229  if(nmatch==0)
230  mf::LogError("CRTBackTracker::AllTrueIds") << "no matches for provided CRTData product found!";
231  if(nmatch>1)
232  mf::LogError("CRTBackTracker::AllTrueIds") << "multiple matches for given CRTData product found!";
233 
234  // Get all the true IDs from all the IDEs in the hit
235  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
236 
237  for(size_t i = 0; i < ides.size(); i++){
238 
239  int id = ides[i]->trackID;
240 
241  if(fRollupUnsavedIds) id = std::abs(id);
242 
243  ids.push_back(id);
244  }
245 
246  // Remove any repeated IDs
247  std::sort(ids.begin(), ids.end());
248  ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
249 
250  return ids;
251  }
252 
253  // ---------------------------------------------------------------------------------------------
254  // Get all the true particle IDs that contributed to the sim CRT hit
255  std::vector<int> CRTBackTracker::AllTrueIds(const art::Event& event, const CRTHit& hit){
256 
257  std::vector<int> ids;
258 
259  // Get a handle to the CRT hits in the event
260  art::Handle< std::vector<CRTHit> > crtSimHitHandle;
261  art::Handle< std::vector<CRTHit> > crtTrueHitHandle;
262 
263  // Find which one matches the hit passed to the function
264  int hit_i = -1, tmp_hit_i = -1, index = 0;
265  bool sim=false, findsim=false, findtrue=false;
266 
267  //try to get a handle to CRTSimHits
268  if(event.getByLabel(fCRTSimHitLabel,crtSimHitHandle)) {
269  findsim = true;
270  //find vector index matching the passed CRTHit
271  for(auto const& crtHit : (*crtSimHitHandle)){
272 
273  if(HitCompare(crtHit, hit)) tmp_hit_i = index;
274  index++;
275  }
276 
277  if(tmp_hit_i!=-1) {
278  hit_i = tmp_hit_i;
279  tmp_hit_i=-1;
280  sim=true;
281  }
282  }
283 
284  //try to get handle to CRTTrueHits
285  if(event.getByLabel(fCRTTrueHitLabel,crtTrueHitHandle)) {
286  findtrue = true;
287  index=0;
288  //find vector index matching the passed CRTHit
289  for(auto const& crtHit : (*crtTrueHitHandle)){
290 
291  if(HitCompare(crtHit, hit)) tmp_hit_i = index;
292  index++;
293  }
294  if(tmp_hit_i!=-1){
295  if(hit_i!=-1) {
296  mf::LogError("CRTBackTracker::AllTrueIds") << "True/Sim CRTHit ID ambiguity!";
297  return ids;
298  }
299  hit_i=tmp_hit_i;
300  }
301  }
302  if(hit_i==-1) {
303  mf::LogError("CRTBackTracker::AllTrueIds") << "no match for passed CRTHit found!";
304  return ids;
305  }
306  if(!findsim && !findtrue) {
307  mf::LogError("CRTBackTracker::AllTrueIds") << "no handle to CRTHits could be found!";
308  return ids;
309  }
310 
311  // Get the crt data associated to that hit and the IDEs associate to the data
312  std::vector<art::Ptr<sim::AuxDetIDE>> ides;
313 
314  // Get all the true IDs from all the IDEs in the hit
315  if(sim) {
316  art::FindManyP<CRTData> findManyData(crtSimHitHandle, event, fCRTSimHitLabel);
317  std::vector<art::Ptr<CRTData>> data;
318  data = findManyData.at(hit_i);
319  art::FindManyP<sim::AuxDetIDE> findManySimIdes(data, event, fCRTDataLabel);
320  for(size_t i = 0; i < data.size(); i++){
321 
322  ides = findManySimIdes.at(i);
323  for(size_t j = 0; j < ides.size(); j++){
324 
325  int id = ides[j]->trackID;
326  if(fRollupUnsavedIds) id = std::abs(id);
327  ids.push_back(id);
328  }
329  }
330  }//if sim
331  else {
332  art::FindManyP<sim::AuxDetIDE> findManyTrueIdes(crtTrueHitHandle, event, fCRTTrueHitLabel);
333  ides = findManyTrueIdes.at(hit_i);
334  for(auto const& ide : ides) {
335  int id = ide->trackID;
336  if(fRollupUnsavedIds) id = std::abs(id);
337  ids.push_back(id);
338  }
339  }//else true
340 
341  // Remove any repeated IDs
342  std::sort(ids.begin(), ids.end());
343  ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
344 
345  return ids;
346  }
347 
348  //-----------------------------------------------------------------------------------------------
349  // Get all the true particle IDs that contributed to the CRT track
350  std::vector<int> CRTBackTracker::AllTrueIds(const art::Event& event, const CRTTrack& track){
351 
352  std::vector<int> ids;
353  // Get a handle to the CRT tracks in the event
354  auto crtTrackHandle = event.getValidHandle<std::vector<CRTTrack>>(fCRTTrackLabel);
355  art::FindManyP<CRTHit> findManyHits(crtTrackHandle, event, fCRTTrackLabel);
356  // Find which one matches the track passed to the function
357  int track_i = 0, index = 0;
358 
359  for(auto const& crtTrack : (*crtTrackHandle)){
360 
361  if(TrackCompare(crtTrack, track)) track_i = index;
362  index++;
363  }
364 
365  // Get the crt hits associated to that hit and the data associate to the hits
366  std::vector<art::Ptr<CRTHit>> hits = findManyHits.at(track_i);
367  art::FindManyP<CRTData> findManyData(hits, event, fCRTSimHitLabel);
368 
369  // Get all the true IDs from all the IDEs in the track
370  for(size_t i = 0; i < hits.size(); i++){
371 
372  std::vector<art::Ptr<CRTData>> data = findManyData.at(i);
373  art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event, fCRTDataLabel);
374  for(size_t j = 0; j < data.size(); j++){
375 
376  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(j);
377  for(size_t k = 0; k < ides.size(); k++){
378 
379  int id = ides[k]->trackID;
380  if(fRollupUnsavedIds) id = std::abs(id);
381  ids.push_back(id);
382 
383  }
384  }
385  }
386 
387  // Remove any repeated IDs
388  std::sort(ids.begin(), ids.end());
389  ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
390 
391  return ids;
392  }
393 
394  //------------------------------------------------------------------------------------------
395  // Get the true particle ID that contributed the most energy to the CRT data product
396  int CRTBackTracker::TrueIdFromTotalEnergy(const art::Event& event, const CRTData& data){
397 
398  std::map<int, double> ids;
399 
400  // Get a handle to the CRT data in the event
401  auto crtDataHandle = event.getValidHandle<std::vector<CRTData>>(fCRTDataLabel);
402  art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event, fCRTDataLabel);
403 
404  // Find which one matches the data passed to the function
405  int data_i = 0, index = 0;
406 
407  for(auto const& crtData : (*crtDataHandle)){
408 
409  if(DataCompare(crtData, data)) data_i = index;
410  index++;
411  }
412 
413  // Get all the true IDs from all the IDEs in the hit
414  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
415 
416  for(size_t i = 0; i < ides.size(); i++){
417 
418  int id = ides[i]->trackID;
419  if(fRollupUnsavedIds) id = std::abs(id);
420  ids[id] += ides[i]->energyDeposited;
421  }
422 
423  // Find the true ID that contributed the most energy
424  double maxEnergy = -1;
425  int trueId = -99999;
426 
427  for(auto &id : ids){
428 
429  if(id.second > maxEnergy){
430 
431  maxEnergy = id.second;
432  trueId = id.first;
433  }
434  }
435 
436  return trueId;
437  }
438 
439  //-------------------------------------------------------------------------------------------
440  int CRTBackTracker::TrueIdFromDataId(const art::Event& event, int data_i){
441 
442  if(fDataTrueIds.find(data_i) != fDataTrueIds.end()){
443 
444  double maxEnergy = -1;
445  int trueId = -99999;
446 
447  for(auto &id : fDataTrueIds[data_i]){
448 
449  if(id.second > maxEnergy){
450 
451  maxEnergy = id.second;
452  trueId = id.first;
453  }
454  }
455 
456  return trueId;
457  }
458 
459  return -99999;
460  }
461 
462  //--------------------------------------------------------------------------------------------
463  // Get the true particle ID that contributed the most energy to the CRT hit
464  int CRTBackTracker::TrueIdFromTotalEnergy(const art::Event& event, const CRTHit& hit){
465 
466  std::map<int, double> ids;
467 
468  // Get a handle to the CRT hits in the event
469  auto crtHitHandle = event.getValidHandle<std::vector<CRTHit>>(fCRTSimHitLabel);
470  art::FindManyP<CRTData> findManyData(crtHitHandle, event, fCRTSimHitLabel);
471 
472  // Find which one matches the hit passed to the function
473  int hit_i = 0, index = 0;
474 
475  for(auto const& crtHit : (*crtHitHandle)){
476 
477  if(HitCompare(crtHit, hit)) hit_i = index;
478  index++;
479  }
480 
481  // Get the crt data associated to that hit and the IDEs associate to the data
482  std::vector<art::Ptr<CRTData>> data = findManyData.at(hit_i);
483  art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event, fCRTDataLabel);
484 
485  // Get all the true IDs from all the IDEs in the hit
486  for(size_t i = 0; i < data.size(); i++){
487 
488  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(i);
489 
490  for(size_t j = 0; j < ides.size(); j++){
491 
492  int id = ides[j]->trackID;
493  if(fRollupUnsavedIds) id = std::abs(id);
494  ids[id] += ides[j]->energyDeposited;
495  }
496  }
497 
498  // Find the true ID that contributed the most energy
499  double maxEnergy = -1;
500  int trueId = -99999;
501 
502  for(auto &id : ids){
503 
504  if(id.second > maxEnergy){
505 
506  maxEnergy = id.second;
507  trueId = id.first;
508 
509  }
510  }
511 
512  return trueId;
513 
514  }
515 
516  //-----------------------------------------------------------------------------------------
517  int CRTBackTracker::TrueIdFromHitId(const art::Event& event, int hit_i){
518 
519  if(fSimHitTrueIds.find(hit_i) != fSimHitTrueIds.end()){
520 
521  double maxEnergy = -1;
522  int trueId = -99999;
523 
524  for(auto &id : fSimHitTrueIds[hit_i]){
525 
526  if(id.second > maxEnergy){
527 
528  maxEnergy = id.second;
529  trueId = id.first;
530  }
531  }
532 
533  return trueId;
534 
535  }
536 
537  return -99999;
538 
539  }
540 
541  //--------------------------------------------------------------------------------------------
542  // Get the true particle ID that contributed the most energy to the CRT track
543  int CRTBackTracker::TrueIdFromTotalEnergy(const art::Event& event, const CRTTrack& track){
544 
545  std::map<int, double> ids;
546 
547  // Get a handle to the CRT tracks in the event
548  auto crtTrackHandle = event.getValidHandle<std::vector<CRTTrack>>(fCRTTrackLabel);
549  art::FindManyP<CRTHit> findManyHits(crtTrackHandle, event, fCRTTrackLabel);
550 
551  // Find which one matches the track passed to the function
552  int track_i = 0, index = 0;
553 
554  for(auto const& crtTrack : (*crtTrackHandle)){
555 
556  if(TrackCompare(crtTrack, track)) track_i = index;
557  index++;
558  }
559 
560  // Get the crt hits associated to that hit and the data associate to the hits
561  std::vector<art::Ptr<CRTHit>> hits = findManyHits.at(track_i);
562  art::FindManyP<CRTData> findManyData(hits, event, fCRTSimHitLabel);
563 
564  // Get all the true IDs from all the IDEs in the track
565  for(size_t i = 0; i < hits.size(); i++){
566 
567  std::vector<art::Ptr<CRTData>> data = findManyData.at(i);
568  art::FindManyP<sim::AuxDetIDE> findManyIdes(data, event, fCRTDataLabel);
569 
570  for(size_t j = 0; j < data.size(); j++){
571 
572  std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(j);
573 
574  for(size_t k = 0; k < ides.size(); k++){
575 
576  int id = ides[k]->trackID;
577  if(fRollupUnsavedIds) id = std::abs(id);
578  ids[id] += ides[k]->energyDeposited;
579  }
580  }
581 
582  }
583 
584  // Find the true ID that contributed the most energy
585  double maxEnergy = -1;
586  int trueId = -99999;
587 
588  for(auto &id : ids){
589 
590  if(id.second > maxEnergy){
591 
592  maxEnergy = id.second;
593  trueId = id.first;
594  }
595  }
596 
597  return trueId;
598  }
599 
600  //--------------------------------------------------------------------------
601  int CRTBackTracker::TrueIdFromTrackId(const art::Event& event, int track_i){
602 
603  if(fTrackTrueIds.find(track_i) != fTrackTrueIds.end()){
604 
605  double maxEnergy = -1;
606 
607  int trueId = -99999;
608 
609  for(auto &id : fTrackTrueIds[track_i]){
610 
611  if(id.second > maxEnergy){
612 
613  maxEnergy = id.second;
614  trueId = id.first;
615  }
616  }
617 
618  return trueId;
619  }
620  return -99999;
621  }
622 
623  }//namespace crt
624 }//namespace icarus
625 
uint8_t fMac5
FEB address following numbering convention common for both data and MC.
float z_err
position uncertainty in z-direction (cm).
Definition: CRTHit.hh:43
bool HitCompare(const CRTHit &hit1, const CRTHit &hit2)
float x_err
position uncertainty in x-direction (cm).
Definition: CRTHit.hh:39
std::map< int, std::map< int, double > > fTrueHitTrueIds
double ts1_ns
Timestamp T1 ([signal time w.r.t. Trigger time]), in UTC absolute time scale in nanoseconds from the ...
Definition: CRTHit.hh:34
int plane
Name of the CRT wall (in the form of numbers).
Definition: CRTHit.hh:36
float y_err
position uncertainty in y-direction (cm).
Definition: CRTHit.hh:41
std::map< int, std::map< int, double > > fDataTrueIds
float x1_pos
X position of first CRTHit.
Definition: CRTTrack.hh:33
uint32_t fEntry
Hit index for given FEB in an event (starts from 0 for each event).
int TrueIdFromDataId(const art::Event &event, int data_i)
process_name use argoneut_mc_hitfinder track
int TrueIdFromTrackId(const art::Event &event, int track_i)
std::map< int, std::map< int, double > > fTrackTrueIds
bool DataCompare(const CRTData &data1, const CRTData &data2)
process_name hit
Definition: cheaterreco.fcl:51
float y1_err
Y position error of first CRTHit.
Definition: CRTTrack.hh:36
float z_pos
position in z-direction (cm).
Definition: CRTHit.hh:42
T abs(T value)
float z1_err
Z position error of first CRTHit.
Definition: CRTTrack.hh:38
float y2_err
Y position error of second CRTHit.
Definition: CRTTrack.hh:42
double ts1_ns
Average T1 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:28
Single hit (self trigger) of a CRT board.
float z1_pos
Z position of first CRTHit.
Definition: CRTTrack.hh:37
float y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
bool TrackCompare(const CRTTrack &track1, const CRTTrack &track2)
uint16_t fAdc[64]
ADC readout for each channel. CAEN (Bern) CRT FEBs use only indices 0-31.
int TrueIdFromHitId(const art::Event &event, int hit_i)
int plane1
Plane ID of first CRTHit.
Definition: CRTTrack.hh:30
float z2_pos
Z position of second CRTHit.
Definition: CRTTrack.hh:43
float x_pos
position in x-direction (cm).
Definition: CRTHit.hh:38
float y2_pos
Y position of second CRTHit.
Definition: CRTTrack.hh:41
float y1_pos
Y position of first CRTHit.
Definition: CRTTrack.hh:35
std::vector< int > AllTrueIds(const art::Event &event, const CRTData &data)
float x2_pos
X position of second CRTHit.
Definition: CRTTrack.hh:39
int TrueIdFromTotalEnergy(const art::Event &event, const CRTData &data)
pdgs k
Definition: selectors.fcl:22
float x1_err
X position error of first CRTHit.
Definition: CRTTrack.hh:34
std::map< int, std::map< int, double > > fSimHitTrueIds
process_name crt
std::string tagger
Name of the CRT wall (in the form of strings).
Definition: CRTHit.hh:45
int plane2
Plane ID of second CRTHit.
Definition: CRTTrack.hh:31
float z2_err
Z position error of second CRTHit.
Definition: CRTTrack.hh:44
float x2_err
X position error of second CRTHit.
Definition: CRTTrack.hh:40
uint64_t fTs0
Absolute hit timestamp [ns].
uint64_t fTs1
Trigger time, not well defined as of Apr 14, 2021.