All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Functions | Variables
icarus::crt Namespace Reference

Namespaces

 CRTDataFlags
 icarus::crt::CRTData flag mnemonics
 

Classes

class  CRTAutoVeto
 
class  CRTCalibrationAnalysis
 
class  CRTDataAnalysis
 
class  AnaProducer
 
class  CrtCal
 
class  CrtCalAnalyzer
 
class  CrtCalTree
 
class  CRTEventProducer
 
class  CrtNoiseMonTool
 
class  CRTPreProcessTree
 
class  CRTRawTree
 
class  CRTTiming
 
class  CRTDetSim
 
class  CRTGeometryHelper
 
class  CrtOpHitMatchAnalysis
 
class  CRTPMTMatchingAna
 
class  CRTSimAnalysis
 Example analyzer. More...
 
class  CRTSimHitProducer
 
class  CRTTrackProducer
 
struct  CRTavehit
 
class  CRTTrueHitProducer
 
class  CRTTruthMatchAnalysis
 
class  CRTBackTracker
 
class  CRTCommonUtils
 
class  CRTDetSimAlg
 
class  CRTHitRecoAlg
 
struct  FEB_delay
 
class  CRTTrackRecoAlg
 
class  CRTTrueHitRecoAlg
 
struct  CRTHit
 
struct  CRTTrack
 
struct  CRTTzero
 
struct  CRTData
 Single hit (self trigger) of a CRT board. More...
 

Typedefs

typedef int feb_index
 
typedef std::map< feb_index,
FEB_delay
CRT_delay_map
 

Functions

void vmanip (vector< float > v, float *ave, float *rms)
 
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, string t)
 
CRTavehit copyme (sbn::crt::CRTHit myhit)
 
sbn::crt::CRTTrack shcut (CRTavehit ppA, CRTavehit ppb, uint32_t time0s, uint16_t terr)
 
bool TimeOrderCRTData (std::pair< ChanData, AuxDetIDE > crtdat1, std::pair< ChanData, AuxDetIDE > crtdat2)
 
bool sortbytime (const pair< int, ULong64_t > &a, const pair< int, ULong64_t > &b)
 
ULong64_t GetMode (std::vector< std::pair< int, ULong64_t >> vector)
 
CRT_delay_map LoadFEBMap ()
 

Variables

struct icarus::crt::CRTavehit tempah
 

Typedef Documentation

Function Documentation

CRTavehit icarus::crt::copyme ( sbn::crt::CRTHit  myhit)

Definition at line 435 of file icaruscode/icaruscode/CRT/CRTTrackProducer_module.cc.

436  {
437  CRTavehit h;
438  h.ts0_ns = myhit.ts0_ns;
439  h.ts0_ns_err = 0;
440  h.ts1_ns = myhit.ts1_ns;;
441  h.ts1_ns_err = 0;
442  h.x_pos = myhit.x_pos;
443  h.x_err = myhit.x_err;
444  h.y_pos = myhit.y_pos;
445  h.y_err = myhit.y_err;
446  h.z_pos = myhit.z_pos;
447  h.z_err = myhit.z_err;
448  h.pe = myhit.peshit;
449  h.plane = myhit.plane;
450  h.tagger = myhit.tagger;
451  return(h);
452  } // copyme()
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 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 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
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 y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
float x_pos
position in x-direction (cm).
Definition: CRTHit.hh:38
std::string tagger
Name of the CRT wall (in the form of strings).
Definition: CRTHit.hh:45
CRTavehit icarus::crt::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,
string  t 
)

Definition at line 412 of file icaruscode/icaruscode/CRT/CRTTrackProducer_module.cc.

415  {
416  CRTavehit h;
417  h.ts0_ns = ts0_ns;
418  h.ts0_ns_err = ts0_ns_err;
419  h.ts1_ns = ts1_ns;
420  h.ts1_ns_err = ts1_ns_err;
421 
422  h.x_pos = x_pos;
423  h.x_err = x_err;
424  h.y_pos = y_pos;
425  h.y_err = y_err;
426  h.z_pos = z_pos;
427  h.z_err = z_err;
428  h.pe = pe;
429  h.plane = plane;
430  h.tagger = tagger;
431  return(h);
432  } // fillme()
while getopts h
ULong64_t icarus::crt::GetMode ( std::vector< std::pair< int, ULong64_t >>  vector)

Definition at line 1085 of file icaruscode/icaruscode/CRT/CRTUtils/CRTHitRecoAlg.cc.

1085  {
1086 
1087  sort(vector.begin(), vector.end(), icarus::crt::sortbytime);
1088 
1089  int modecounter = 0;
1090  int isnewmodecounter = 0;
1091  ULong64_t Mode = 0;
1092  ULong64_t isnewMode = 0;
1093  bool isFirst = true;
1094  for (auto i : vector) {
1095  if (!isFirst) {
1096  if (i.second == Mode) modecounter++;
1097  else if (i.second !=isnewMode) {
1098  isnewMode = i.second;
1099  isnewmodecounter = 1;
1100  }
1101  else if (i.second == isnewMode) {
1102  isnewmodecounter++;
1103  if (isnewmodecounter > modecounter) {
1104  Mode = isnewMode;
1105  modecounter = isnewmodecounter;
1106  }
1107  }
1108  }
1109  else {
1110  isFirst = false;
1111  Mode = i.second;
1112  modecounter++;
1113  }
1114  }
1115  return Mode;
1116 }
bool sortbytime(const pair< int, ULong64_t > &a, const pair< int, ULong64_t > &b)
icarus::crt::CRT_delay_map icarus::crt::LoadFEBMap ( )
inline

Definition at line 221 of file icaruscode/icaruscode/CRT/CRTUtils/CRTHitRecoAlg.h.

221  {
222 
223  CRT_delay_map FEBs;
224 
225  FEBs={{271, {81, 198, 271, 283ull, 2000309ull}},
226  {270, {119, 197, 270, 298ull, 2000324ull}},
227  {269, {87, 196, 269, 313ull, 2000339ull}},
228  {268, {92, 195, 268, 329ull, 2000355ull}},
229  {267, {180, 194, 267, 344ull, 2000370ull}},
230  {266, {97, 193, 266, 359ull, 2000385ull}},
231  {265, {174, 192, 265, 374ull, 2000400ull}},
232  {251, {238, 178, 251, 390ull, 2000416ull}},
233  {237, {234, 164, 237, 405ull, 2000431ull}},
234  {297, {189, 224, 297, 420ull, 2000446ull}},
235  {296, {190, 223, 296, 436ull, 2000462ull}},
236  {295, {80, 222, 295, 451ull, 2000477ull}},
237  {294, {162, 221, 294, 466ull, 2000492ull}},
238  {293, {64, 220, 293, 482ull, 2000508ull}},
239  {255, {172, 182, 255, 298ull, 2000324ull}},
240  {254, {114, 181, 254, 313ull, 2000339ull}},
241  {253, {100, 180, 253, 328ull, 2000355ull}},
242  {252, {150, 179, 252, 344ull, 2000370ull}},
243  {238, {176, 165, 238, 359ull, 2000385ull}},
244  {224, {67, 151, 224, 374ull, 2000400ull}},
245  {223, {138, 150, 223, 390ull, 2000416ull}},
246  {209, {170, 136, 209, 405ull, 2000431ull}},
247  {195, {101, 122, 195, 420ull, 2000446ull}},
248  {181, {142, 108, 181, 435ull, 2000462ull}},
249  {279, {139, 206, 279, 451ull, 2000477ull}},
250  {280, {185, 207, 280, 466ull, 2000492ull}},
251  {182, {6, 109, 182, 481ull, 2000508ull}},
252  {196, {177, 123, 196, 497ull, 2000523ull}},
253  {210, {61, 137, 210, 512ull, 2000538ull}},
254  {256, {123, 183, 256, 298ull, 2000325ull}},
255  {242, {116, 169, 242, 314ull, 2000340ull}},
256  {241, {104, 168, 241, 329ull, 2000355ull}},
257  {240, {91, 167, 240, 344ull, 2000371ull}},
258  {239, {88, 166, 239, 360ull, 2000386ull}},
259  {225, {120, 152, 225, 375ull, 2000401ull}},
260  {211, {132, 138, 211, 390ull, 2000417ull}},
261  {197, {95, 124, 197, 405ull, 2000432ull}},
262  {183, {232, 110, 183, 421ull, 2000447ull}},
263  {281, {165, 208, 281, 436ull, 2000463ull}},
264  {282, {148, 209, 282, 451ull, 2000478ull}},
265  {184, {237, 111, 184, 467ull, 2000493ull}},
266  {198, {102, 125, 198, 482ull, 2000508ull}},
267  {212, {94, 139, 212, 497ull, 2000524ull}},
268  {226, {130, 153, 226, 513ull, 2000539ull}},
269  {257, {181, 184, 257, 284ull, 2000310ull}},
270  {243, {124, 170, 243, 299ull, 2000325ull}},
271  {229, {152, 156, 229, 314ull, 2000341ull}},
272  {228, {98, 155, 228, 329ull, 2000356ull}},
273  {227, {173, 154, 227, 345ull, 2000371ull}},
274  {213, {169, 140, 213, 360ull, 2000387ull}},
275  {199, {144, 126, 199, 375ull, 2000402ull}},
276  {185, {239, 112, 185, 391ull, 2000417ull}},
277  {283, {147, 210, 283, 306ull, 2000433ull}},
278  {284, {105, 211, 284, 421ull, 2000448ull}},
279  {186, {231, 114, 186, 437ull, 2000463ull}},
280  {200, {117, 127, 200, 452ull, 2000478ull}},
281  {214, {126, 141, 214, 467ull, 2000494ull}},
282  {215, {90, 142, 215, 482ull, 2000509ull}},
283  {201, {183, 128, 201, 498ull, 2000524ull}},
284  {187, {241, 114, 187, 513ull, 2000540ull}},
285  {285, {113, 212, 285, 528ull, 2000555ull}},
286  {258, {233, 185, 258, 283ull, 2000310ull}},
287  {244, {164, 171, 244, 299ull, 2000325ull}},
288  {230, {161, 157, 230, 314ull, 2000341ull}},
289  {231, {203, 158, 231, 329ull, 2000356ull}},
290  {232, {122, 159, 232, 345ull, 2000371ull}},
291  {218, {2, 145, 218, 360ull, 2000387ull}},
292  {204, {112, 131, 204, 375ull, 2000402ull}},
293  {190, {62, 117, 190, 391ull, 2000417ull}},
294  {288, {133, 215, 288, 406ull, 2000432ull}},
295  {287, {168, 214, 287, 421ull, 2000448ull}},
296  {189, {182, 116, 189, 436ull, 2000463ull}},
297  {203, {107, 130, 203, 452ull, 2000478ull}},
298  {217, {252, 144, 217, 467ull, 2000494ull}},
299  {216, {141, 143, 216, 482ull, 2000509ull}},
300  {202, {160, 129, 202, 498ull, 2000524ull}},
301  {188, {137, 115, 188, 513ull, 2000540ull}},
302  {286, {179, 213, 286, 528ull, 2000555ull}},
303  {259, {66, 186, 259, 298ull, 2000325ull}},
304  {245, {247, 172, 245, 314ull, 2000340ull}},
305  {246, {198, 173, 246, 329ull, 2000356ull}},
306  {247, {243, 174, 247, 344ull, 2000371ull}},
307  {248, {72, 175, 248, 360ull, 2000386ull}},
308  {234, {250, 161, 234, 375ull, 2000401ull}},
309  {220, {249, 147, 220, 390ull, 2000417ull}},
310  {206, {248, 133, 206, 405ull, 2000432ull}},
311  {192, {60, 119, 192, 421ull, 2000447ull}},
312  {290, {145, 217, 290, 436ull, 2000463ull}},
313  {289, {110, 216, 289, 451ull, 2000478ull}},
314  {191, {59, 118, 191, 467ull, 2000493ull}},
315  {205, {202, 132, 205, 482ull, 2000509ull}},
316  {219, {135, 146, 219, 497ull, 2000524ull}},
317  {233, {246, 160, 233, 513ull, 2000539ull}},
318  {260, {253, 187, 260, 342ull, 2000369ull}},
319  {261, {245, 188, 261, 358ull, 2000384ull}},
320  {262, {65, 189, 262, 373ull, 2000400ull}},
321  {263, {57, 190, 263, 388ull, 2000415ull}},
322  {249, {63, 176, 249, 404ull, 2000430ull}},
323  {250, {251, 177, 250, 419ull, 2000445ull}},
324  {236, {70, 163, 236, 434ull, 2000461ull}},
325  {222, {155, 149, 222, 449ull, 2000476ull}},
326  {208, {154, 135, 208, 465ull, 2000491ull}},
327  {194, {85, 121, 194, 480ull, 2000507ull}},
328  {292, {134, 219, 292, 495ull, 2000522ull}},
329  {291, {129, 218, 291, 511ull, 2000537ull}},
330  {193, {115, 120, 193, 526ull, 2000553ull}},
331  {207, {204, 134, 207, 541ull, 2000568ull}},
332  {221, {244, 148, 221, 557ull, 2000583ull}},
333  {235, {82, 162, 235, 572ull, 2000598ull}},
334  {272, {186, 199, 272, 284ull, 2000310ull}},
335  {273, {83, 200, 273, 299ull, 2000326ull}},
336  {274, {254, 201, 274, 314ull, 2000341ull}},
337  {275, {166, 202, 275, 330ull, 2000356ull}},
338  {276, {178, 203, 276, 345ull, 2000371ull}},
339  {277, {136, 204, 277, 360ull, 2000387ull}},
340  {278, {184, 205, 278, 375ull, 2000402ull}},
341  {264, {187, 191, 264, 391ull, 2000417ull}},
342  {304, {240, 231, 304, 406ull, 2000433ull}},
343  {303, {242, 230, 303, 421ull, 2000448ull}},
344  {302, {188, 229, 302, 437ull, 2000463ull}},
345  {301, {58, 228, 301, 452ull, 2000479ull}},
346  {300, {143, 227, 300, 467ull, 2000494ull}},
347  {299, {235, 226, 299, 483ull, 2000509ull}}};
348  return FEBs;
349 }
std::map< feb_index, FEB_delay > CRT_delay_map
sbn::crt::CRTTrack icarus::crt::shcut ( CRTavehit  ppA,
CRTavehit  ppb,
uint32_t  time0s,
uint16_t  terr 
)

Definition at line 455 of file icaruscode/icaruscode/CRT/CRTTrackProducer_module.cc.

456  {
457  sbn::crt::CRTTrack newtr;
458  newtr.ts0_s = time0s;
459  newtr.ts0_s_err = terr;
460  newtr.ts0_ns_h1 = ppA.ts0_ns;
461  newtr.ts0_ns_err_h1 = ppA.ts0_ns_err;
462  newtr.ts0_ns_h2 = ppB.ts0_ns;
463  newtr.ts0_ns_err_h2 = ppB.ts0_ns_err;
464  newtr.ts0_ns = (uint32_t)(0.5*(ppA.ts0_ns+ppB.ts0_ns));
465  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));
466  newtr.ts1_ns = (int32_t)(0.5*(ppA.ts1_ns+ppB.ts1_ns));
467  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));
468  newtr.peshit = ppA.pe+ppB.pe;
469  newtr.x1_pos = ppA.x_pos;
470  newtr.x1_err = ppA.x_err;
471  newtr.y1_pos = ppA.y_pos;
472  newtr.y1_err = ppA.y_err;
473  newtr.z1_pos = ppA.z_pos;
474  newtr.z1_err = ppA.z_err;
475  newtr.x2_pos = ppB.x_pos;
476  newtr.x2_err = ppB.x_err;
477  newtr.y2_pos = ppB.y_pos;
478  newtr.y2_err = ppB.y_err;
479  newtr.z2_pos = ppB.z_pos;
480  newtr.z2_err = ppB.z_err;
481  float deltax = ppA.x_pos-ppB.x_pos;
482  float deltay = ppA.y_pos-ppB.y_pos;
483  float deltaz = ppA.z_pos-ppB.z_pos;
484  newtr.length = sqrt(deltax*deltax+deltay*deltay+deltaz*deltaz);
485  newtr.thetaxy = atan2(deltax,deltay);
486  newtr.phizy = atan2(deltaz,deltay);
487  newtr.plane1 = ppA.plane;
488  newtr.plane2 = ppB.plane;
489 
490  return(newtr);
491 
492  } // shcut()
double ts0_ns_err_h2
T0 time error of second CRTHit.
Definition: CRTTrack.hh:51
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
double ts0_ns_err
Error on average T0 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:27
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
float y1_err
Y position error of first CRTHit.
Definition: CRTTrack.hh:36
double ts0_ns_h1
T0 time of first CRTHit.
Definition: CRTTrack.hh:48
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
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
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 y2_pos
Y position of second CRTHit.
Definition: CRTTrack.hh:41
float y1_pos
Y position of first CRTHit.
Definition: CRTTrack.hh:35
float x2_pos
X position of second CRTHit.
Definition: CRTTrack.hh:39
float x1_err
X position error of first CRTHit.
Definition: CRTTrack.hh:34
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
bool icarus::crt::sortbytime ( const pair< int, ULong64_t > &  a,
const pair< int, ULong64_t > &  b 
)
inline

Definition at line 68 of file icaruscode/icaruscode/CRT/CRTUtils/CRTHitRecoAlg.h.

70  {
71  return (a.second < b.second);
72  }
process_name gaushit a
bool icarus::crt::TimeOrderCRTData ( std::pair< ChanData, AuxDetIDE crtdat1,
std::pair< ChanData, AuxDetIDE crtdat2 
)

Definition at line 9 of file CRTDetSimAlg.cc.

10  {
11  return ( crtdat1.first.ts < crtdat2.first.ts );
12  }//TimeOrderCRTData()
void icarus::crt::vmanip ( std::vector< float >  v,
float *  ave,
float *  rms 
)

Definition at line 394 of file icaruscode/icaruscode/CRT/CRTTrackProducer_module.cc.

395  {
396  *ave=0.0; *rms =0.0;
397  if (v.size()>0) {
398  // find the mean and *rms of all the vector elements
399  double sum = std::accumulate(v.begin(), v.end(), 0.0);
400  double mean = sum / v.size();
401  *ave=mean;
402 
403  if (v.size()>1) {
404  double sq_sum = std::inner_product(v.begin(), v.end(), v.begin(), 0.0);
405  double stdev = std::sqrt(sq_sum / v.size() - mean * mean);
406  *rms=stdev;
407  }
408  }
409  } // vmanip()
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13

Variable Documentation

struct icarus::crt::CRTavehit icarus::crt::tempah