All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/CRT/CRTTrackProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: CRTSimpleTrackProducer
3 // Module Type: producer
4 // File: CRTSimpleTrackProducer_module.cc
5 // Description: Module for constructiong over-simplified CRT tracks.
6 // Copied from CRTTrackProducer by David Lorca Galindo
7 // Edited by Michelle Stancari April 3, 2018
8 // Added some SBND specific stuff - Tom Brooks
9 ////////////////////////////////////////////////////////////////////////
10 
11 #include "art/Framework/Core/EDProducer.h"
12 #include "art/Framework/Core/ModuleMacros.h"
13 #include "art/Framework/Principal/Event.h"
14 #include "art/Framework/Principal/Handle.h"
15 #include "art/Framework/Principal/Run.h"
16 #include "art/Framework/Principal/SubRun.h"
17 #include "canvas/Utilities/InputTag.h"
18 #include "canvas/Persistency/Common/FindManyP.h"
19 #include "canvas/Persistency/Common/Ptr.h"
20 #include "canvas/Persistency/Common/PtrVector.h"
21 #include "fhiclcpp/ParameterSet.h"
22 #include "messagefacility/MessageLogger/MessageLogger.h"
23 #include "art_root_io/TFileService.h"
24 #include "art/Persistency/Common/PtrMaker.h"
25 
30 
31 #include "TTree.h"
32 #include "TVector3.h"
33 
34 #include <iostream>
35 #include <stdio.h>
36 #include <sstream>
37 #include <vector>
38 #include <map>
39 #include <utility>
40 #include <cmath>
41 #include <memory>
42 #include <numeric> // std::accumulate
43 
44 namespace sbnd {
45 
46 
47 class CRTTrackProducer : public art::EDProducer {
48 
49 public:
50 
51  explicit CRTTrackProducer(fhicl::ParameterSet const & p);
52 
53  // The destructor generated by the compiler is fine for classes
54  // without bare pointers or other resource use.
55  // Plugins should not be copied or assigned.
56  CRTTrackProducer(CRTTrackProducer const &) = delete;
58  CRTTrackProducer & operator = (CRTTrackProducer const &) = delete;
60 
61  // Required functions.
62  void produce(art::Event & e) override;
63 
64  // Selected optional functions.
65  void beginJob() override;
66  void endJob() override;
67 
68 private:
69 
70  // Declare member data here.
71  std::string fDataLabelHits;
72  std::string fDataLabelTZeros;
75 
77 
78 }; // class CRTTrackProducer
79 
80 
81 // Function to calculate average and rms from a vector of values
82 void vmanip(std::vector<float> v, float* ave, float* rms);
83 
84 
85 // Average crt hit structure
86 struct CRTavehit{
87  uint32_t ts0_ns;
88  uint16_t ts0_ns_err;
89  int32_t ts1_ns;
90  uint16_t ts1_ns_err;
91 
92  float x_pos;
93  float x_err;
94  float y_pos;
95  float y_err;
96  float z_pos;
97  float z_err;
98  float pe;
99  int plane;
100  std::string tagger;
101 } tempah;
102 
103 
104 // Function to make filling average hit easier
105 CRTavehit fillme(uint32_t i, uint16_t j, int32_t k, uint16_t l, float a,
106  float b, float c, float d, float e, float f, float g,
107  int p, std::string t);
108 
109 
110 // Function to copy average hits
112 
113 
114 // Function to make creating CRTTracks easier
115 sbn::crt::CRTTrack shcut(CRTavehit ppA,CRTavehit ppb, uint32_t time0s,uint16_t terr);
116 
117 
118 // Constructor
119 CRTTrackProducer::CRTTrackProducer(fhicl::ParameterSet const & p)
120  : EDProducer(p), trackAlg(p.get<fhicl::ParameterSet>("TrackAlg"))
121 {
122 
123  // Initialize member data here.
124  fDataLabelHits = p.get<std::string>("DataLabelHits"); // CRTHit producer module name
125  fDataLabelTZeros = p.get<std::string>("DataLabelTZeros"); // CRTTzero producer module name
126  fStoreTrack = p.get<int> ("StoreTrack"); // method 1 = all, method 2 = ave, method 3 = pure, method 4 = top plane
127  fTrackMethodType = p.get<int> ("TrackMethodType"); // Print stuff
128 
129  // Call appropriate produces<>() functions here.
130  if(fStoreTrack == 1){
131  produces< std::vector<sbn::crt::CRTTrack> >();
132  produces< art::Assns<sbn::crt::CRTTrack , sbn::crt::CRTHit> >();
133  }
134 
135 } // CRTTrackProducer()
136 
137 
138 void CRTTrackProducer::produce(art::Event & evt)
139 {
140 
141  // For validation
142  int nTrack = 0;
143  int nCompTrack = 0;
144  int nIncTrack = 0;
145 
146  // CRTTrack collection on this event
147  std::unique_ptr<std::vector<sbn::crt::CRTTrack> > CRTTrackCol(new std::vector<sbn::crt::CRTTrack>);
148  std::unique_ptr< art::Assns<sbn::crt::CRTTrack, sbn::crt::CRTHit> > Trackassn( new art::Assns<sbn::crt::CRTTrack, sbn::crt::CRTHit>);
149  art::PtrMaker<sbn::crt::CRTTrack> makeTrackPtr(evt);
150 
151  // Implementation of required member function here.
152  art::Handle< std::vector<sbn::crt::CRTHit> > rawHandle;
153  evt.getByLabel(fDataLabelHits, rawHandle); //what is the product instance name? no BernZMQ
154 
155  // Check to make sure the data we asked for is valid
156  if(!rawHandle.isValid()){
157  mf::LogWarning("CRTTrackProducer")
158  <<"No CRTHits from producer module "<<fDataLabelHits;
159  return;
160  }
161 
162  // Track method 4 = SBND method with top plane (doesn't use CRTTzero)
163  if(fTrackMethodType == 4){
164 
165  //Get the CRT hits from the event
166  std::vector<art::Ptr<sbn::crt::CRTHit> > hitlist;
167  if (evt.getByLabel(fDataLabelHits, rawHandle))
168  art::fill_ptr_vector(hitlist, rawHandle);
169 
170  std::map<art::Ptr<sbn::crt::CRTHit>, int> hitIds;
171  for(size_t i = 0; i<hitlist.size(); i++){
172  hitIds[hitlist[i]] = i;
173  }
174 
175  std::vector<std::vector<art::Ptr<sbn::crt::CRTHit>>> CRTTzeroVect = trackAlg.CreateCRTTzeros(hitlist);
176 
177  // Loop over tzeros
178  for(size_t i = 0; i<CRTTzeroVect.size(); i++){
179 
180  //loop over hits for this tzero, sort by tagger
181  std::map<std::string, std::vector<art::Ptr<sbn::crt::CRTHit>>> hits;
182  for (size_t ah = 0; ah< CRTTzeroVect[i].size(); ++ah){
183  std::string ip = CRTTzeroVect[i][ah]->tagger;
184  hits[ip].push_back(CRTTzeroVect[i][ah]);
185  } // loop over hits
186 
187  //loop over planes and calculate average hits
188  std::vector<std::pair<sbn::crt::CRTHit, std::vector<int>>> allHits;
189  for (auto &keyVal : hits){
190  std::string ip = keyVal.first;
191  std::vector<std::pair<sbn::crt::CRTHit, std::vector<int>>> ahits = trackAlg.AverageHits(hits[ip], hitIds);
192  allHits.insert(allHits.end(), ahits.begin(), ahits.end());
193  }
194 
195  //Create tracks with hits at the same tzero
196  std::vector<std::pair<sbn::crt::CRTTrack, std::vector<int>>> trackCandidates = trackAlg.CreateTracks(allHits);
197  nTrack += trackCandidates.size();
198  for(size_t j = 0; j < trackCandidates.size(); j++){
199  CRTTrackCol->emplace_back(trackCandidates[j].first);
200 
201  art::Ptr<sbn::crt::CRTTrack> trackPtr = makeTrackPtr(CRTTrackCol->size()-1);
202  for (size_t ah = 0; ah< CRTTzeroVect[i].size(); ++ah){
203  Trackassn->addSingle(trackPtr, CRTTzeroVect[i][ah]);
204  }
205  if(trackCandidates[j].first.complete) nCompTrack++;
206  else nIncTrack++;
207  }
208  }
209 
210  //Older track reconstruction methods from MicroBooNE
211  }else{
212  //Get list of tzeros
213  // std::vector<sbn::crt::CRTHit> const& CRTHitCollection(*rawHandle);
214  art::Handle< std::vector<sbn::crt::CRTTzero> > rawHandletzero;
215  evt.getByLabel(fDataLabelTZeros, rawHandletzero); //what is the product instance name? no BernZMQ
216 
217  //check to make sure the data we asked for is valid
218  if(!rawHandletzero.isValid()){
219  mf::LogWarning("CRTTrackProducer")
220  <<"No CRTTzeros from producer module "<<fDataLabelTZeros;
221  return;
222  }
223 
224  std::vector<art::Ptr<sbn::crt::CRTTzero> > tzerolist;
225  if (evt.getByLabel(fDataLabelTZeros,rawHandletzero))
226  art::fill_ptr_vector(tzerolist, rawHandletzero);
227 
228  art::FindManyP<sbn::crt::CRTHit> fmht(rawHandletzero, evt, fDataLabelTZeros);
229 
230  //loop over tzeros
231  for(size_t tzIter = 0; tzIter < tzerolist.size(); ++tzIter){
232 
233  //count planes with hits for this tzero
234  int np =0 ; //int ipflag[7] = {}; // CHANGED FROM 4 TO 7
235  int tothits =0;
236  for (int ip=0;ip<7;++ip) { // CHANGED FROM 4 TO 7
237  if (tzerolist[tzIter]->nhits[ip]>0) { np++; /*ipflag[ip]=1;*/ tothits+=tzerolist[tzIter]->nhits[ip];}
238  }
239 
240  if (np<2) continue;
241  std::vector<art::Ptr<sbn::crt::CRTHit> > hitlist=fmht.at(tzIter);
242  //for(size_t hit_i = 0; hit_i < hitlist.size(); hit
243  if (fTrackMethodType==1) {
244  double time_s_A = hitlist[0]->ts0_s;
245 
246  // find pairs of hits in different planes
247  for (size_t ah = 0; ah< hitlist.size()-1; ++ah){
248  sbn::crt::CRTHit temphit=*hitlist[ah];
249  CRTavehit Ahit = copyme(temphit);
250  int planeA = hitlist[ah]->plane;
251 
252  for (size_t bh = ah+1; bh< hitlist.size(); ++bh){
253  int planeB = hitlist[bh]->plane;
254 
255  if (planeB!=planeA && !((planeA==3&&planeB==4)||(planeA==4&&planeB==3))) { // make a track
256  temphit=*hitlist[bh];
257  CRTavehit Bhit = copyme(temphit);
258  sbn::crt::CRTTrack CRTcanTrack=shcut(Ahit,Bhit,time_s_A,0);
259  CRTTrackCol->emplace_back(CRTcanTrack);
260  }
261 
262  }
263 
264  }
265 
266  }
267 
268  else if ((fTrackMethodType==2) || (fTrackMethodType==3 && np==2 && tothits==2)) {
269 
270  //loop over hits and get average x,y,z,pe for each plane CHANGED FROM 4 TO 7
271  std::vector<float> thittime0[7];
272  std::vector<float> thittime1[7];
273  std::vector<float> tx[7];
274  std::vector<float> ty[7];
275  std::vector<float> tz[7];
276  std::vector<float> pe[7];
277 
278  double time_s_A = hitlist[0]->ts0_s;
279  // double time_s_err = hitlist[0]->ts0_s_err;
280  double time_s_err = 0.;
281  double time1_ns_A = hitlist[0]->ts1_ns;
282  double time0_ns_A = hitlist[0]->ts0_ns;
283 
284  //loop over hits for this tzero, sort by plane
285  for (size_t ah = 0; ah< hitlist.size(); ++ah){
286  int ip = hitlist[ah]->plane;
287  thittime0[ip].push_back(hitlist[ah]->ts0_ns-time0_ns_A);
288  thittime1[ip].push_back(hitlist[ah]->ts1_ns-time1_ns_A);
289  tx[ip].push_back(hitlist[ah]->x_pos);
290  ty[ip].push_back(hitlist[ah]->y_pos);
291  tz[ip].push_back(hitlist[ah]->z_pos);
292  pe[ip].push_back(hitlist[ah]->peshit);
293  } // loop over hits
294 
295  CRTavehit aveHits[7];
296  //loop over planes and calculate average hits
297  for (int ip = 0; ip < 7; ip++){
298  if (tx[ip].size()>0){
299  uint32_t at0; int32_t at1; uint16_t rt0,rt1;
300  float totpe=0.0;
301  float avet1=0.0; float rmst1 =0.0;
302  float avet0=0.0; float rmst0 =0.0;
303  float avex=0.0; float rmsx =0.0;
304  float avey=0.0; float rmsy =0.0;
305  float avez=0.0; float rmsz =0.0;
306  vmanip(thittime0[ip],&avet0,&rmst0);
307  vmanip(thittime1[ip],&avet1,&rmst1);
308  at0 = (uint32_t)(avet0+time0_ns_A); rt0 = (uint16_t)rmst0;
309  at1 = (int32_t)(avet1+time1_ns_A); rt1 = (uint16_t)rmst1;
310  vmanip(tx[ip],&avex,&rmsx);
311  vmanip(ty[ip],&avey,&rmsy);
312  vmanip(tz[ip],&avez,&rmsz);
313  totpe=std::accumulate(pe[ip].begin(), pe[ip].end(), 0.0);
314  CRTavehit aveHit = fillme(at0,rt0,at1,rt1,avex,rmsx,avey,rmsy,avez,rmsz,totpe,ip,"");
315  aveHits[ip] = aveHit;
316  }
317  else {
318  CRTavehit aveHit = fillme(0,0,0,0,-99999,-99999,-99999,-99999,-99999,-99999,-99999,ip,"");
319  aveHits[ip] = aveHit;
320  }
321  }
322 
323  // find pairs of hits in different planes
324  for (size_t ah = 0; ah< 6; ++ah){
325  CRTavehit Ahit = aveHits[ah];
326  if( Ahit.x_pos==-99999 ) continue;
327 
328  for (size_t bh = ah+1; bh< 7; ++bh){
329  if ( aveHits[bh].x_pos==-99999 ) continue;
330 
331  if (ah!=bh && !(ah==3&&bh==4)) { // make a track
332  CRTavehit Bhit = aveHits[bh];
333  sbn::crt::CRTTrack CRTcanTrack=shcut(Ahit,Bhit,time_s_A,time_s_err);
334  CRTTrackCol->emplace_back(CRTcanTrack);
335  nTrack++;
336  }
337 
338  }
339 
340  }
341 
342  }
343 
344  }// loop over tzeros
345  }
346 
347  mf::LogInfo("CRTTrackProducer")
348  <<"Number of tracks = "<<CRTTrackCol->size()<<"\n"
349  <<"Number of complete tracks = "<<CRTTrackCol->size()-nIncTrack<<"\n"
350  <<"Number of incomplete tracks = "<<nIncTrack;
351 
352  //store track collection into event
353  if(fStoreTrack == 1){
354  evt.put(std::move(CRTTrackCol));
355  evt.put(std::move(Trackassn));
356  }
357 
358 } // CRTTrackProducer::produce()
359 
360 
362 {
363 
364 } // CRTTrackProducer::beginJob()
365 
366 
368 {
369 
370 } // CRTTrackProducer::endJob()
371 
372 
373 // Function to calculate the mean and rms from a vector of values
374 void vmanip(std::vector<float> v, float* ave, float* rms)
375 {
376 
377  *ave=0.0; *rms =0.0;
378  if (v.size()>0) {
379 
380  // find the mean and *rms of all the vector elements
381  double sum = std::accumulate(v.begin(), v.end(), 0.0);
382  double mean = sum / v.size();
383  *ave=mean;
384 
385  if (v.size()>1) {
386  double sq_sum = std::inner_product(v.begin(), v.end(), v.begin(), 0.0);
387  double stdev = std::sqrt(sq_sum / v.size() - mean * mean);
388  *rms=stdev;
389  }
390 
391  }
392 
393 } // vmanip()
394 
395 
396 // Function to make creating average crt hits easier
397 CRTavehit fillme(uint32_t ts0_ns, uint16_t ts0_ns_err, int32_t ts1_ns, uint16_t ts1_ns_err,
398  float x_pos, float x_err, float y_pos, float y_err, float z_pos, float z_err,
399  float pe, int plane, std::string tagger)
400 {
401 
402  CRTavehit h;
403 
404  h.ts0_ns = ts0_ns;
405  h.ts0_ns_err = ts0_ns_err;
406  h.ts1_ns = ts1_ns;
407  h.ts1_ns_err = ts1_ns_err;
408 
409  h.x_pos = x_pos;
410  h.x_err = x_err;
411  h.y_pos = y_pos;
412  h.y_err = y_err;
413  h.z_pos = z_pos;
414  h.z_err = z_err;
415  h.pe = pe;
416  h.plane = plane;
417  h.tagger = tagger;
418 
419  return(h);
420 
421 } // fillme()
422 
423 
424 // Function to copy average CRT hits
426 {
427 
428  CRTavehit h;
429 
430  h.ts0_ns = myhit.ts0_ns;
431  h.ts0_ns_err = 0;
432  h.ts1_ns = myhit.ts1_ns;;
433  h.ts1_ns_err = 0;
434  h.x_pos = myhit.x_pos;
435  h.x_err = myhit.x_err;
436  h.y_pos = myhit.y_pos;
437  h.y_err = myhit.y_err;
438  h.z_pos = myhit.z_pos;
439  h.z_err = myhit.z_err;
440  h.pe = myhit.peshit;
441  h.plane = myhit.plane;
442  h.tagger = myhit.tagger;
443 
444  return(h);
445 
446 } // copyme()
447 
448 
449 // Function to make CRTTrack
450 sbn::crt::CRTTrack shcut(CRTavehit ppA, CRTavehit ppB, uint32_t time0s, uint16_t terr)
451 {
452 
453  sbn::crt::CRTTrack newtr;
454 
455  newtr.ts0_s = time0s;
456  newtr.ts0_s_err = terr;
457  newtr.ts0_ns_h1 = ppA.ts0_ns;
458  newtr.ts0_ns_err_h1 = ppA.ts0_ns_err;
459  newtr.ts0_ns_h2 = ppB.ts0_ns;
460  newtr.ts0_ns_err_h2 = ppB.ts0_ns_err;
461  newtr.ts0_ns = (uint32_t)(0.5*(ppA.ts0_ns+ppB.ts0_ns));
462  newtr.ts0_ns_err = (uint16_t)(0.5*sqrt(ppA.ts0_ns_err*ppA.ts0_ns_err+ppB.ts0_ns_err*ppB.ts0_ns_err));
463  newtr.ts1_ns = (int32_t)(0.5*(ppA.ts1_ns+ppB.ts1_ns));
464  newtr.ts1_ns_err = (uint16_t)(0.5*sqrt(ppA.ts0_ns_err*ppA.ts0_ns_err+ppB.ts0_ns_err*ppB.ts0_ns_err));
465  newtr.peshit = ppA.pe+ppB.pe;
466  newtr.x1_pos = ppA.x_pos;
467  newtr.x1_err = ppA.x_err;
468  newtr.y1_pos = ppA.y_pos;
469  newtr.y1_err = ppA.y_err;
470  newtr.z1_pos = ppA.z_pos;
471  newtr.z1_err = ppA.z_err;
472  newtr.x2_pos = ppB.x_pos;
473  newtr.x2_err = ppB.x_err;
474  newtr.y2_pos = ppB.y_pos;
475  newtr.y2_err = ppB.y_err;
476  newtr.z2_pos = ppB.z_pos;
477  newtr.z2_err = ppB.z_err;
478  float deltax = ppA.x_pos-ppB.x_pos;
479  float deltay = ppA.y_pos-ppB.y_pos;
480  float deltaz = ppA.z_pos-ppB.z_pos;
481  newtr.length = sqrt(deltax*deltax+deltay*deltay+deltaz*deltaz);
482  newtr.thetaxy = atan2(deltax,deltay);
483  newtr.phizy = atan2(deltaz,deltay);
484  newtr.plane1 = ppA.plane;
485  newtr.plane2 = ppB.plane;
486 
487  return(newtr);
488 
489 } // shcut()
490 
491 DEFINE_ART_MODULE(CRTTrackProducer)
492 
493 }// namespace sbnd
float z_err
position uncertainty in z-direction (cm).
Definition: CRTHit.hh:43
float x_err
position uncertainty in x-direction (cm).
Definition: CRTHit.hh:39
double ts0_ns_err_h2
T0 time error of second CRTHit.
Definition: CRTTrack.hh:51
CRTavehit copyme(sbn::crt::CRTHit myhit)
double ts1_ns_err
Error on average T1 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:29
double ts0_s
Average time (second) of the two hits making the track.
Definition: CRTTrack.hh:24
CRTTrackProducer & operator=(CRTTrackProducer const &)=delete
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
double ts0_ns_err
Error on average T0 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:27
int plane
Name of the CRT wall (in the form of numbers).
Definition: CRTHit.hh:36
struct sbnd::CRTavehit tempah
float peshit
Total photo-electron (PE) in a crt hit.
Definition: CRTHit.hh:27
float y_err
position uncertainty in y-direction (cm).
Definition: CRTHit.hh:41
void vmanip(std::vector< float > v, float *ave, float *rms)
pdgs p
Definition: selectors.fcl:22
std::vector< std::pair< sbn::crt::CRTTrack, std::vector< int > > > CreateTracks(std::vector< std::pair< sbn::crt::CRTHit, std::vector< int >>> hits)
double ts0_s_err
Average time (second) spread of the two hits making the track.
Definition: CRTTrack.hh:25
float x1_pos
X position of first CRTHit.
Definition: CRTTrack.hh:33
std::size_t size(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:561
std::vector< std::pair< sbn::crt::CRTHit, std::vector< int > > > AverageHits(std::vector< art::Ptr< sbn::crt::CRTHit >> hits, std::map< art::Ptr< sbn::crt::CRTHit >, int > hitIds)
float y1_err
Y position error of first CRTHit.
Definition: CRTTrack.hh:36
BEGIN_PROLOG g
double ts0_ns_h1
T0 time of first CRTHit.
Definition: CRTTrack.hh:48
CRTavehit fillme(uint32_t i, uint16_t j, int32_t k, uint16_t l, float a, float b, float c, float d, float e, float f, float g, int p, std::string t)
std::vector< std::vector< art::Ptr< sbn::crt::CRTHit > > > CreateCRTTzeros(std::vector< art::Ptr< sbn::crt::CRTHit >>)
process_name gaushit a
sbn::crt::CRTTrack shcut(CRTavehit ppA, CRTavehit ppb, uint32_t time0s, uint16_t terr)
while getopts h
float z_pos
position in z-direction (cm).
Definition: CRTHit.hh:42
double ts0_ns
Timestamp T0 (from White Rabbit), in UTC absolute time scale in nanoseconds from the Epoch...
Definition: CRTHit.hh:32
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
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
float length
Track length.
Definition: CRTTrack.hh:45
double ts0_ns
Average T0 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:26
float peshit
Total photoelectrons for this track (sum of PEs from the two CRTHits)
Definition: CRTTrack.hh:23
double ts0_ns_err_h1
T0 time error of first CRTHit.
Definition: CRTTrack.hh:49
float z1_pos
Z position of first CRTHit.
Definition: CRTTrack.hh:37
double ts0_ns_h2
T0 time of second CRTHit.
Definition: CRTTrack.hh:50
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
float y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
float phizy
Track angle on the Z-Y plane.
Definition: CRTTrack.hh:47
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
do i e
float x2_pos
X position of second CRTHit.
Definition: CRTTrack.hh:39
stream1 can override from command line with o or output services user sbnd
TCEvent evt
Definition: DataStructs.cxx:8
pdgs k
Definition: selectors.fcl:22
float x1_err
X position error of first CRTHit.
Definition: CRTTrack.hh:34
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
float thetaxy
Track angle on the X-Y plane.
Definition: CRTTrack.hh:46