TwoCRTReco_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: TwoCRTReco
3 // Plugin Type: Analyzer (art v2_11_02)
4 // File: TwoCRTReco_module.cc
5 //
6 // Written by: Richard Diurba
7 // Adapted from MCC Code by: Arbin Timilsina
8 // CRT Trigger Architecture by: Andrew Olivier
9 ////////////////////////////////////////////////////////////////////////
10 
11 //Framework includes
13 //#include "art/Framework/Core/EDAnalyzer.h"
21 #include "fhiclcpp/ParameterSet.h"
24 #include "canvas/Persistency/Common/FindManyP.h"
25 #include "art_root_io/TFileService.h"
26 
27 //LArSoft includes
28 
32 #include "nug4/ParticleNavigation/ParticleList.h"
33 
34 
42 
43 
46 
49 
51 
52 
53 //Local includes
55 
56 
57 
58 //ROOT includes
59 #include "TH1.h"
60 #include "TH2.h"
61 #include "TCanvas.h"
62 #include "TImage.h"
63 #include "TTree.h"
64 #include "TH1D.h"
65 #include "TStyle.h"
66 #include "TString.h"
67 
68 //c++ includes
69 #include <numeric> //std::accumulate was moved from <algorithm> to <numeric> in c++14
70 #include <iostream>
71 #include <cmath>
72 #include <vector>
73 #include <fstream>
74 #include "TPaveStats.h"
75 #include <iostream>
76 #include <string>
77 #include "math.h"
78 #include "stdio.h"
79 #include <iterator>
80 using namespace std; // Namespaces established to make life easier
81 using namespace ROOT::Math;
82 namespace CRT {
83  class TwoCRTReco;
84 }
85 
86 
88  public: // Setup functions and variables
90  const & p);
91  std::string fTrackModuleLabel = "pandoraTrack";
92  //std::string fTrackModuleLabel = "pmtrack";
93  // The compiler-generated destructor is fine for non-base
94  // classes without bare pointers or other resource use.
95  // Plugins should not be copied or assigned.
97  const & ) = delete;
98  TwoCRTReco(TwoCRTReco && ) = delete;
99  TwoCRTReco & operator = (TwoCRTReco
100  const & ) = delete;
101  TwoCRTReco & operator = (TwoCRTReco && ) = delete;
102  void analyze(art::Event const & e) override;
103  //bool filter(art::Event const & e) override;
104 // Declare functions and variables for validation
105  bool moduleMatcher(int module1, int module2);
106  void beginJob() override;
107  void endJob() override;
108  void createPNG(TH1D * histo);
109  double setAngle(double angle);
110 int moduletoCTB(int module2, int module1);
111  int nEvents = 0;
112  int nHaloMuons = 0;
113  int nHitsPerEvent=0;
114  int nMCCMuons=0;
115  private: ofstream logFile;
116 
117  //Parameters for reading in CRT::Triggers and associated AuxDetSimChannels.
118  art::InputTag fCRTLabel; //Label for the module that analyzed
120  TTree * fCRTTree;
121 
122  int run, subRun;
130 
131 
132  //double averageSignedDistanceXY;
133 
134  int adcX_F, adcX_B, adcY_F, adcY_B;
135  double X_F, X_B, Y_F, Y_B, Z_F, Z_B;
136  //double trackX1, trackX2, trackY1, trackY2, trackZ1, trackZ2;
137  int moduleX_F, moduleX_B, moduleY_F, moduleY_B;
138  int stripX_F, stripX_B, stripY_F, stripY_B;
139  double measuredT0;
140  double CRT_TOF;
141  long long timeStamp;
142  int eventNum;
143  typedef struct // Structures for arrays to move hits from raw to reco to validation
144  {
145 
146  int channel;
147  int module;
149  int adc;
152  }
153  tempHits;
154 
155  typedef struct {
156  int tempId;
157  int adcX;
158  int adcY;
159 
160  double hitPositionX;
161  double hitPositionY;
162  double hitPositionZ;
163  double timeAvg;
164  int geoX;
165  int geoY;
166  int stripX;
167  int stripY;
170  }
171  recoHits;
172 
173 
174 
175  typedef struct // These are displacement metrics for track and hit reco
176  {
177  int tempId;
178  int recoId;
179  int adcX1;
180  int adcY1;
181  int adcX2;
182  int adcY2;
183 
184  double X1;
185  double Y1;
186  double Z1;
187  double X2;
188  double Y2;
189  double Z2;
190  int trackID;
191  double timeDiff;
192  double t0;
193  double xOffset;
194  }
195  tracksPair;
196 
197 
198 
199 
200 
201  std::vector < recoHits > primaryHits_F;
202  std::vector < recoHits > primaryHits_B;
203 
204  std::vector < tempHits > tempHits_F;
205  std::vector < tempHits > tempHits_B;
206  std::vector < tracksPair > allTracksPair;
207 
208 };
209 
211  const & p):
212  EDAnalyzer(p), fCRTLabel(p.get < art::InputTag > ("CRTLabel")), fCTBLabel(p.get<art::InputTag>("CTBLabel")) {
213  consumes < std::vector < CRT::Trigger >> (fCRTLabel);
214  consumes < std::vector < art::Assns < sim::AuxDetSimChannel, CRT::Trigger >>> (fCRTLabel);
215  fMCCSwitch=(p.get<bool>("MCC"));
216  fCTBTriggerOnly=(p.get<bool>("CTBOnly"));
217  fSCECorrection=(p.get<bool>("SCECorrection"));
218  }
219 
220 
221 
222 
223 // v6 Geo Channel Map
224 bool CRT::TwoCRTReco::moduleMatcher(int module1, int module2) {
225  // Function checking if two hits could reasonably be matched into a 2D hit
226  if ((module1 == 6 && (module2 == 10 || module2 == 11)) || (module1 == 14 && (module2 == 10 || module2 == 11)) || (module1 == 19 && (module2 == 26 || module2 == 27)) || (module1 == 31 && (module2 == 26 || module2 == 27)) || (module1 == 7 && (module2 == 12 || module2 == 13)) || (module1 == 15 && (module2 == 12 || module2 == 13)) || (module1 == 18 && (module2 == 24 || module2 == 25)) || (module1 == 30 && (module2 == 24 || module2 == 25)) || (module1 == 1 && (module2 == 4 || module2 == 5)) || (module1 == 9 && (module2 == 4 || module2 == 5)) || (module1 == 16 && (module2 == 20 || module2 == 21)) || (module1 == 28 && (module2 == 20 || module2 == 21)) || (module1 == 0 && (module2 == 2 || module2 == 3)) || (module1 == 8 && (module2 == 2 || module2 == 3)) || (module1 == 17 && (module2 == 22 || module2 == 23)) || (module1 == 29 && (module2 == 22 || module2 == 23))) return 1;
227  else return 0;
228 
229 }
230 
231 
232 int CRT::TwoCRTReco::moduletoCTB(int module2, int module1){
233  if (module1 == 15 && module2 == 12 ) return 15;
234  else if (module1 == 15 && module2 == 13) return 10;
235  else if (module1 == 7 && module2 == 12) return 8;
236  else if (module1 == 7 && module2 == 13) return 9;
237  else if (module1 == 19 && module2 == 26) return 4;
238  else if (module1 == 19 && module2 == 27) return 13;
239  else if (module1 == 31 && module2 == 26) return 3;
240  else if (module1 == 31 && module2 == 27) return 2;
241  else if (module1 == 30 && module2 == 24) return 1;
242  else if (module1 == 30 && module2 == 25) return 0;
243  else if (module1 == 18 && module2 == 24) return 12;
244  else if (module1 == 18 && module2 == 25) return 11;
245  else if (module1 == 6 && module2 == 11) return 7;
246  else if (module1 == 6 && module2 == 10) return 6;
247  else if (module1 == 14 && module2 == 11) return 14;
248  else if (module1 == 14 && module2 == 10) return 5;
249  else if (module1 == 0 && module2 == 3) return 25;
250  else if (module1 == 0 && module2 == 2) return 24;
251  else if (module1 == 8 && module2 == 3) return 26;
252  else if (module1 == 8 && module2 == 2) return 30;
253  else if (module1 == 17 && module2 == 23) return 27;
254  else if (module1 == 17 && module2 == 22) return 28;
255  else if (module1 == 29 && module2 == 23) return 16;
256  else if (module1 == 29 && module2 == 22) return 17;
257  else if (module1 == 28 && module2 == 21) return 18;
258  else if (module1 == 28 && module2 == 20) return 19;
259  else if (module1 == 16 && module2 == 21) return 29;
260  else if (module1 == 16 && module2 == 20) return 20;
261  else if (module1 == 9 && module2 == 5) return 31;
262  else if (module1 == 9 && module2 == 4) return 21;
263  else if (module1 == 1 && module2 == 5) return 23;
264  else if (module1 == 1 && module2 == 4) return 22;
265  else return -1;
266 }
267 
268 
269 void CRT::TwoCRTReco::createPNG(TH1D * histo) {
270  //Save important histograms as PNG
271  TCanvas * c = new TCanvas;
272  TH1D * h = histo;
273  h -> Draw();
274  TImage * img = TImage::Create();
275  img -> FromPad(c);
276  img -> WriteImage((std::string(histo -> GetName()) + ".png").c_str());
277  delete h;
278  delete c;
279  delete img;
280 
281 }
282 double CRT::TwoCRTReco::setAngle(double angle) {
283  if (angle < 0) {
284  angle += 3.14159265359;
285  }
286  angle *= 180.00 / 3.14159265359;
287  return angle;
288 }
289 
290 //bool CRT::TwoCRTReco::filter(art::Event const & event)
292  const & event) // Analysis module
293 
294 {
295 
296  nEvents++;
297  eventNum=event.event();
298  run=event.run();
299  subRun=event.subRun();
300  if (fMCCSwitch){
301  fModuleSwitch=1;
302  fADCThreshold=800;
305 
306 }
307  else {
308  fModuleSwitch=0;
309  fADCThreshold=20;
312  art::ValidHandle<std::vector<raw::RDTimeStamp>> timingHandle = event.getValidHandle<std::vector<raw::RDTimeStamp>>("timingrawdecoder:daq");
313  timeStamp=timingHandle->at(0).GetTimeStamp();
314 
315 }
316 
317 
318 
319  if(!fMCCSwitch){
320  //const auto& pdspctbs = event.getValidHandle<std::vector<raw::ctb::pdspctb>>(fCTB_tag);
321  art::ValidHandle<std::vector<raw::RDTimeStamp>> timingHandle = event.getValidHandle<std::vector<raw::RDTimeStamp>>("timingrawdecoder:daq");
322 
323  const raw::RDTimeStamp& timeStamp = timingHandle->at(0);
324  if (fCTBTriggerOnly){
325  if(timeStamp.GetFlags()!= 13) return;}
326  }
327  int nHits = 0;
328 
329 
330 
331 
332  //Detector properties service
333  primaryHits_F.clear();
334  primaryHits_B.clear();
335  allTracksPair.clear();
336  tempHits_F.clear();
337  tempHits_B.clear(); // Arrays to compile hits and move them through
338 
339 
340  //Get triggers
341  cout << "Getting triggers" << endl;
342  const auto & triggers = event.getValidHandle < std::vector < CRT::Trigger >> (fCRTLabel);
343 
344  art::FindManyP < sim::AuxDetSimChannel > trigToSim(triggers, event, fCRTLabel);
345 
346  //Get a handle to the Geometry service to look up AuxDetGeos from module numbers
348 
349 
350 
351  //Mapping from channel to trigger
352  std::unordered_map < size_t, double > prevTimes;
353  int hitID = 0;
354  cout << "Looking for hits in Triggers" << endl;
355 
356  // Find CTB pixels
357  int pixel0 = -1;
358  int pixel1 = -1;
359  if (!fMCCSwitch)
360  {
361  const auto& pdspctbs = *event.getValidHandle<std::vector<raw::ctb::pdspctb>>(fCTBLabel);
362  std::vector<int> uS, dS;
363  const size_t npdspctbs = pdspctbs.size();
364  for(size_t j=0;j<npdspctbs;++j)
365  {
366  const std::vector<raw::ctb::Trigger> HLTriggers = pdspctbs[j].GetHLTriggers();
367  const std::vector<raw::ctb::ChStatus> chs = pdspctbs[j].GetChStatusAfterHLTs();
368 for (size_t k=0; k<HLTriggers.size(); ++k)
369  {
370  //cout<<chs[k].timestamp<<endl;
371  int num = chs[k].crt;
372  //cout<<num<<endl;
373 
374  const std::string binary = std::bitset<32>(num).to_string();
375  const auto crtmask=chs[k].crt;
376  pixel0 = -1;
377  pixel1 = -1;
378  //cout<<crtmask<<endl;
379  for (int i = 0; i<32; ++i){
380  if (crtmask & (1<<i)){
381  if (i<16){
382  pixel0 = i;
383  }
384  else {
385  pixel1 = i;
386  }
387  }
388  }
389  if (pixel0!=-1 && pixel1!=-1) {
390  //cout<<nEvents<<" TJYang Pixels: "<<pixel0<<","<<pixel1<<endl;
391  }
392  else if (fCTBTriggerOnly) return;
393  }
394  }
395  }
396 
397  int trigID=0;
398  for (const auto & trigger: * triggers) {
399  const auto & hits = trigger.Hits();
400  for (const auto & hit: hits) { // Collect hits on all modules
401  //cout<<hits.size()<<','<<hit.ADC()<<endl;
402  if (hit.ADC() > fADCThreshold) { // Keep if they are above threshold
403 
404  tempHits tHits;
405  if (!fMCCSwitch){
406 
407  tHits.module = trigger.Channel(); // Values to add to array
408  tHits.channel=hit.Channel();
409  tHits.adc = hit.ADC();
410  tHits.triggerTime=trigger.Timestamp()-timeStamp;
411  }
412  else{
413  tHits.module = trigger.Channel(); // Values to add to array
414  tHits.channel=hit.Channel();
415  tHits.adc = hit.ADC();
416  tHits.triggerTime=trigger.Timestamp();
417  }
418  //cout<<trigger.Channel()<<','<<hit.Channel()<<','<<hit.ADC()<<endl;
419  nHits++;
420  tHits.triggerNumber=trigID;
421  const auto & trigGeo = geom -> AuxDet(trigger.Channel()); // Get geo
422  const auto & csens = trigGeo.SensitiveVolume(hit.Channel());
423  const auto center = csens.GetCenter();
424  if (center.Z() < 100) tempHits_F.push_back(tHits); // Sort F/B from Z
425  else tempHits_B.push_back(tHits);
426  hitID++;
427  }
428  }
429  trigID++;
430  }
431  nHitsPerEvent=nHits;
432  cout << "Hits compiled for event: " << nEvents << endl;
433  cout << "Number of Hits above Threshold: " << hitID << endl;
434 
435  for (unsigned int f = 0; f < tempHits_F.size(); f++) {
436  for (unsigned int f_test = 0; f_test < tempHits_F.size(); f_test++) {
437  if (fabs(tempHits_F[f_test].triggerTime-tempHits_F[f].triggerTime)>fModuletoModuleTimingCut) continue;
438  const auto & trigGeo = geom -> AuxDet(tempHits_F[f].module);
439  const auto & trigGeo2 = geom -> AuxDet(tempHits_F[f_test].module);
440 
441  const auto & hit1Geo = trigGeo.SensitiveVolume(tempHits_F[f].channel);
442  const auto hit1Center = hit1Geo.GetCenter();
443  // Create 2D hits from geo of the Y and X modules
444  const auto & hit2Geo = trigGeo2.SensitiveVolume(tempHits_F[f_test].channel);
445  const auto hit2Center = hit2Geo.GetCenter();
446  bool moduleMatched;
447  moduleMatched=moduleMatcher(tempHits_F[f_test].module, tempHits_F[f].module);
448  if (moduleMatched) {
449  // Get the center of the hits (CRT_Res=2.5 cm)
450  double hitX = hit1Center.X();
451  for (unsigned int a = 0; a < tempHits_F.size(); a++)
452  {
453  if(tempHits_F[a].module==tempHits_F[f].module && (tempHits_F[a].channel-1)==tempHits_F[f].channel) hitX=hit1Center.X()+1.25;
454  }
455  double hitYPrelim=hit2Center.Y();
456  for (unsigned int a = 0; a < tempHits_F.size(); a++)
457  {
458  if(tempHits_F[a].module==tempHits_F[f_test].module && (tempHits_F[a].channel-1)==tempHits_F[f_test].channel) hitYPrelim=hit2Center.Y()+1.25;
459  }
460 
461 
462 
463  double hitY=hitYPrelim;
464  double hitZ = (hit1Center.Z() + hit2Center.Z()) / 2.f;
465 
466  recoHits rHits;
467  rHits.hitPositionX = hitX;
468  rHits.hitPositionY = hitY;
469  rHits.hitPositionZ = hitZ;
470  rHits.geoX=tempHits_F[f].module;
471  rHits.geoY=tempHits_F[f_test].module;
472  rHits.stripX=tempHits_F[f].channel;
473  rHits.stripY=tempHits_F[f_test].channel;
474 
475  rHits.adcX=tempHits_F[f].adc;
476  rHits.adcY=tempHits_F[f_test].adc;
477  rHits.trigNumberX=tempHits_F[f].triggerNumber;
478  rHits.trigNumberY=tempHits_F[f_test].triggerNumber;
479  rHits.timeAvg = (tempHits_F[f_test].triggerTime+tempHits_F[f].triggerTime)/2.0;
480  primaryHits_F.push_back(rHits); // Add array
481  }
482  }
483  }
484  for (unsigned int f = 0; f < tempHits_B.size(); f++) {
485  for (unsigned int f_test = 0; f_test < tempHits_B.size(); f_test++) { // Same as above but for back CRT
486  if (fabs(tempHits_B[f_test].triggerTime-tempHits_B[f].triggerTime)>fModuletoModuleTimingCut) continue;
487 
488  const auto & trigGeo = geom -> AuxDet(tempHits_B[f].module);
489  const auto & trigGeo2 = geom -> AuxDet(tempHits_B[f_test].module);
490  const auto & hit1Geo = trigGeo.SensitiveVolume(tempHits_B[f].channel);
491  const auto hit1Center = hit1Geo.GetCenter();
492 
493  const auto & hit2Geo = trigGeo2.SensitiveVolume(tempHits_B[f_test].channel);
494  const auto hit2Center = hit2Geo.GetCenter();
495  bool moduleMatched;
496  moduleMatched=moduleMatcher(tempHits_B[f_test].module, tempHits_B[f].module);
497 
498  if (moduleMatched) {
499  double hitX = hit1Center.X();
500 
501 
502  for (unsigned int a = 0; a < tempHits_B.size(); a++)
503  {
504  if(tempHits_B[a].module==tempHits_B[f].module && (tempHits_B[a].channel-1)==tempHits_B[f].channel) hitX=hit1Center.X()+1.25;
505  }
506 
507  double hitYPrelim = hit2Center.Y();
508 
509  for (unsigned int a = 0; a < tempHits_B.size(); a++)
510  {
511  if(tempHits_B[a].module==tempHits_B[f_test].module && (tempHits_B[a].channel-1)==tempHits_B[f_test].channel) hitYPrelim=hit2Center.Y()+1.25;
512  }
513  double hitY=hitYPrelim;
514 
515 
516  double hitZ = (hit1Center.Z() + hit2Center.Z()) / 2.f;
517 
518  recoHits rHits;
519  rHits.hitPositionX = hitX;
520  rHits.hitPositionY = hitY;
521  rHits.hitPositionZ = hitZ;
522  rHits.geoX=tempHits_B[f].module;
523  rHits.geoY=tempHits_B[f_test].module;
524  rHits.adcX=tempHits_B[f].adc;
525  rHits.adcY=tempHits_B[f_test].adc;
526  rHits.stripX=tempHits_B[f].channel;
527  rHits.stripY=tempHits_B[f_test].channel;
528  rHits.trigNumberX=tempHits_B[f].triggerNumber;
529  rHits.trigNumberY=tempHits_B[f_test].triggerNumber;
530  rHits.timeAvg = (tempHits_B[f_test].triggerTime+tempHits_B[f].triggerTime)/2.0;
531  primaryHits_B.push_back(rHits);
532 
533  }
534  }
535  }
536 
537  std::cout<<"Number of Hits: "<<primaryHits_F.size()<<','<<primaryHits_B.size()<<std::endl;
538 
539  std::cout<<"CTB Pixes: "<<pixel0<<','<<pixel1<<std::endl;
540  int tempId = 0;
541  adcX_F=0;
542  adcX_B=0;
543  adcY_F=0;
544  adcY_B=0;
545  int crtPixel0=-1;
546  int crtPixel1=-1;
547  for (unsigned int f = 0; f < primaryHits_F.size(); f++) {
548  if (pixel0==-1 || pixel1==-1) break;
549  for (unsigned int b = 0; b < primaryHits_B.size(); b++) {
550  if (fabs(primaryHits_F[f].timeAvg-primaryHits_B[b].timeAvg)>fFronttoBackTimingCut) continue;
551  crtPixel0=moduletoCTB(primaryHits_F[f].geoX,primaryHits_F[f].geoY);
552  crtPixel1=moduletoCTB(primaryHits_B[b].geoX, primaryHits_B[b].geoY);
553  if (crtPixel0!=pixel0 || crtPixel1!=pixel1) continue;
554  //std::cout<<"HEY"<<std::endl;
555  if (adcX_F<primaryHits_F[f].adcX && adcY_F<primaryHits_F[f].adcY && adcX_B<primaryHits_B[b].adcX && adcY_B<primaryHits_B[b].adcY){
556  X_F = primaryHits_F[f].hitPositionX;
557  Y_F = primaryHits_F[f].hitPositionY;
558  Z_F = primaryHits_F[f].hitPositionZ;
559  X_B = primaryHits_B[b].hitPositionX;
560  Y_B = primaryHits_B[b].hitPositionY;
561  Z_B= primaryHits_B[b].hitPositionZ;
562  adcX_F=primaryHits_F[f].adcX;
563  adcX_B=primaryHits_B[b].adcX;
564  adcY_F=primaryHits_F[f].adcY;
565  adcY_B=primaryHits_B[b].adcY;
566  moduleX_F=primaryHits_F[f].geoX;
567  moduleY_F=primaryHits_F[f].geoY;
568  moduleX_B=primaryHits_B[b].geoX;
569  moduleY_B=primaryHits_B[b].geoY;
570 
571  stripX_F=primaryHits_F[f].stripX;
572  stripY_F=primaryHits_F[f].stripY;
573  stripX_B=primaryHits_B[b].stripX;
574  stripY_B=primaryHits_B[b].stripY;
575  //std::cout<<"FOUND A COMBO"<<std::endl;
576  measuredT0=(primaryHits_F[f].timeAvg+primaryHits_B[b].timeAvg)/2.f;
577  CRT_TOF=(primaryHits_F[f].timeAvg-primaryHits_B[b].timeAvg);
578  tempId++;
579 
580  }
581  }
582  }
583  if (adcX_F>0) fCRTTree->Fill();
584  // Filter return if (adcX_F==0) return false;
585  // Filter return
586  // return true;
587  }
588 
589 
590 // Setup CRT
592  art::ServiceHandle<art::TFileService> fileServiceHandle;
593  fCRTTree = fileServiceHandle->make<TTree>("CRTCandidate", "track by track info");
594 
595  fCRTTree->Branch("nEvents", &nEvents, "fnEvents/I");
596  fCRTTree->Branch("hRun", &run, "run/I");
597  fCRTTree->Branch("hEvent",&eventNum,"eventNum/I");
598 
599 
600  fCRTTree->Branch("hX_F", &X_F, "X_F/D");
601  fCRTTree->Branch("hX_B", &X_B, "X_B/D");
602  fCRTTree->Branch("hY_F", &Y_F, "Y_F/D");
603  fCRTTree->Branch("hY_B", &Y_B, "Y_B/D");
604  fCRTTree->Branch("hZ_F", &Z_F, "Z_F/D");
605  fCRTTree->Branch("hZ_B", &Z_B, "Z_B/D");
606 
607 
608  fCRTTree->Branch("CRT_TOF", &CRT_TOF, "CRT_TOF/D");
609 
610  fCRTTree->Branch("hmoduleX_F", &moduleX_F, "moduleX_F/I");
611  fCRTTree->Branch("hmoduleX_B", &moduleX_B, "moduleX_B/I");
612  fCRTTree->Branch("hmoduleY_F", &moduleY_F, "moduleY_F/I");
613  fCRTTree->Branch("hmoduleY_B", &moduleY_B, "moduleY_B/I");
614 
615  fCRTTree->Branch("hstripX_F", &stripX_F, "stripX_F/I");
616  fCRTTree->Branch("hstripX_B", &stripX_B, "stripX_B/I");
617  fCRTTree->Branch("hstripY_F", &stripY_F, "stripY_F/I");
618  fCRTTree->Branch("hstripY_B", &stripY_B, "stripY_B/I");
619 
620  fCRTTree->Branch("hadcX_F", &adcX_F, "adcX_F/I");
621  fCRTTree->Branch("hadcY_F", &adcY_F, "adcY_F/I");
622  fCRTTree->Branch("hadcX_B", &adcX_B, "adcX_B/I");
623  fCRTTree->Branch("hadcY_B", &adcY_B, "adcY_B/I");
624 
625  fCRTTree->Branch("hmeasuredT0", &measuredT0, "measuredT0/D");
626 
627 
628 
629 
630 
631 }
632 // Endjob actions
634 {
635 
636 
637 
638 }
639 
640 
641 
642 
643 
644 
645 
646 
647 
648 
649 
650 
651 
652 
def analyze(root, level, gtrees, gbranches, doprint)
Definition: rootstat.py:69
std::vector< recoHits > primaryHits_B
double setAngle(double angle)
std::string string
Definition: nybbler.cc:12
art::InputTag fCRTLabel
void beginJob() override
std::vector< tempHits > tempHits_B
std::vector< recoHits > primaryHits_F
STL namespace.
uint8_t channel
Definition: CRTFragment.hh:201
void analyze(art::Event const &e) override
Particle class.
std::vector< tempHits > tempHits_F
art framework interface to geometry description
int moduletoCTB(int module2, int module1)
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
void beginJob()
Definition: Breakpoints.cc:14
const double a
T get(std::string const &key) const
Definition: ParameterSet.h:271
TwoCRTReco(fhicl::ParameterSet const &p)
std::vector< tracksPair > allTracksPair
p
Definition: test.py:223
void Draw(const char *plot, const char *title)
Definition: gXSecComp.cxx:580
Detector simulation of raw signals on wires.
bool moduleMatcher(int module1, int module2)
Declaration of signal hit object.
def center(depos, point)
Definition: depos.py:117
Provides recob::Track data product.
void endJob() override
art::InputTag fCTBLabel
static bool * b
Definition: config.cpp:1043
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
void createPNG(TH1D *histo)
QTextStream & endl(QTextStream &s)
Event finding and building.