CbmRoot
LxTBBinned.h
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 
7 /*
8  * File: LxTBBinned.h
9  * Author: Timur Ablyazimov
10  *
11  * Created on 31 Mar 2016
12  */
13 
14 #ifndef LXTBBINNED_H
15 #define LXTBBINNED_H
16 
17 #include "LxTBDefinitions.h"
18 #include "LxTBMatEffs.h"
19 
20 
21 #ifdef __MACH__
22 #include <mach/mach_time.h>
23 #include <sys/time.h>
24 #ifndef CLOCK_REALTIME
25 #define CLOCK_REALTIME 0
26 #endif
27 #ifndef CLOCK_MONOTONIC
28 #define CLOCK_MONOTONIC 0
29 #endif
30 inline int clock_gettime(int /*clk_id*/, struct timespec* t) {
31  mach_timebase_info_data_t timebase;
32  mach_timebase_info(&timebase);
33  uint64_t time;
34  time = mach_absolute_time();
35  double nseconds =
36  ((double) time * (double) timebase.numer) / ((double) timebase.denom);
37  double seconds =
38  ((double) time * (double) timebase.numer) / ((double) timebase.denom * 1e9);
39  t->tv_sec = seconds;
40  t->tv_nsec = nseconds;
41  return 0;
42 }
43 #else
44 #include <time.h>
45 #endif
46 
47 #include "CbmPixelHit.h"
48 #include <list>
49 #include <memory>
50 #include <set>
51 
52 #define NOF_SIGMAS 1
53 #define NOF_SIGMAS_SQ NOF_SIGMAS* NOF_SIGMAS
54 #define TIME_ERROR 4
55 
56 extern Double_t speedOfLight;
57 
58 struct LxTbBinnedPoint;
59 
60 struct LxTbBinnedRay {
67 
68  LxTbBinnedRay(scaltype deltaZ,
69  const LxTbBinnedPoint& rP,
70  const LxTbBinnedPoint& lP,
71  scaltype Chi2); /* : lPoint(&lP), tx((lP.x - rP.x) / deltaZ),
72  dtxSq((lP.dx - rP.dx) * (lP.dx - rP.dx) / (deltaZ * deltaZ)), ty((lP.y - rP.y) / deltaZ),
73  dtySq((lP.dy - rP.dy) * (lP.dy - rP.dy) / (deltaZ * deltaZ)), chi2(Chi2)
74  {
75  }*/
76 };
77 
85  bool use;
86  std::list<LxTbBinnedRay> neighbours;
87  Int_t refId;
88 
89 #ifdef LXTB_QA
90  const CbmPixelHit* pHit;
91  bool isTrd;
93 
94  struct PointDesc {
95  Int_t eventId;
96  Int_t pointId;
97  Int_t trackId;
98  };
99 
100  std::list<PointDesc> mcRefs;
101 #endif //LXTB_QA
102 
104  scaltype Dx,
105  scaltype Y,
106  scaltype Dy,
107  timetype T,
108  timetype Dt,
109  Int_t ri,
110  bool Use)
111  : x(X)
112  , dx(Dx)
113  , y(Y)
114  , dy(Dy)
115  , t(T)
116  , dt(Dt)
117  , use(Use)
118  , neighbours()
119  , refId(ri)
120 #ifdef LXTB_QA
121  , pHit(0)
122  , isTrd(false)
123  , stationNumber(-1)
124  , mcRefs()
125 #endif //LXTB_QA
126  {
127  }
128 
129  LxTbBinnedPoint(const LxTbBinnedPoint& orig) = default;
130  LxTbBinnedPoint& operator=(const LxTbBinnedPoint& orig) = delete;
131 };
132 
134  const LxTbBinnedPoint& rP,
135  const LxTbBinnedPoint& lP,
136  scaltype Chi2)
137  : lPoint(&lP)
138  , tx((lP.x - rP.x) / deltaZ)
139  , dtxSq((lP.dx - rP.dx) * (lP.dx - rP.dx) / (deltaZ * deltaZ))
140  , ty((lP.y - rP.y) / deltaZ)
141  , dtySq((lP.dy - rP.dy) * (lP.dy - rP.dy) / (deltaZ * deltaZ))
142  , chi2(Chi2) {}
143 
144 struct LxTbXBin {
145  std::list<LxTbBinnedPoint> points;
146  bool use;
147 
148  LxTbXBin() : points(), use(false), maxDx() {}
149 
150  void Clear() {
151  points.clear();
152  use = false;
153  }
154 
155  // New feature
157 
158  void AddPoint(const LxTbBinnedPoint& point) { points.push_back(point); }
159 };
160 
161 struct LxTbYXBin {
163  int nofXBins;
164  bool use;
165 
166  LxTbYXBin(int nxbs) : xBins(new LxTbXBin[nxbs]), nofXBins(nxbs), use(false) {}
167  LxTbYXBin(const LxTbYXBin&) = delete;
168  LxTbYXBin& operator=(const LxTbYXBin&) = delete;
169 
170  ~LxTbYXBin() { delete[] xBins; }
171 
172  void Clear() {
173  for (int i = 0; i < nofXBins; ++i)
174  xBins[i].Clear();
175 
176  use = false;
177  }
178 };
179 
180 struct LxTbTYXBin {
183  bool use;
184 
185  LxTbTYXBin(int nxbs, int nybs)
186  : yxBins(
187  reinterpret_cast<LxTbYXBin*>(new unsigned char[nybs * sizeof(LxTbYXBin)]))
188  , nofYXBins(nybs)
189  , use(false) {
190  for (int i = 0; i < nybs; ++i)
191  new (&yxBins[i]) LxTbYXBin(nxbs);
192  }
193  LxTbTYXBin(const LxTbTYXBin&) = delete;
194  LxTbTYXBin& operator=(const LxTbTYXBin&) = delete;
195 
196  ~LxTbTYXBin() { delete[] reinterpret_cast<unsigned char*>(yxBins); }
197 
198  void Clear() {
199  for (int i = 0; i < nofYXBins; ++i)
200  yxBins[i].Clear();
201 
202  use = false;
203  }
204 };
205 
207  struct Q {
209  };
210 
213  int nofXBins;
214  int nofYBins;
216  int lastXBin;
217  int lastYBin;
230  Q qs[2];
231 
232  LxTbBinnedStation(int nofxb, int nofyb, int noftb)
233  : stationNumber(-1)
234  , z()
235  , nofXBins(nofxb)
236  , nofYBins(nofyb)
237  , nofTYXBins(noftb)
238  , lastXBin(nofxb - 1)
239  , lastYBin(nofyb - 1)
240  , minX()
241  , maxX()
242  , binSizeX()
243  , minY()
244  , maxY()
245  , binSizeY()
246  , absorber()
247  , deltaThetaX()
248  , deltaThetaY()
249  , dispX()
250  , dispY()
251  , tyxBins(reinterpret_cast<LxTbTYXBin*>(
252  new unsigned char[noftb * sizeof(LxTbTYXBin)]))
253  , qs() {
254  for (int i = 0; i < noftb; ++i)
256  }
259 
260  ~LxTbBinnedStation() { delete[] reinterpret_cast<unsigned char*>(tyxBins); }
261 
262  void Clear() {
263  for (int i = 0; i < nofTYXBins; ++i)
264  tyxBins[i].Clear();
265  }
266 };
267 
270  int nofXBins;
271  int nofYBins;
273  int lastXBin;
274  int lastYBin;
287 
288  LxTbBinnedTrdStation(int nofxb, int nofyb, int noftb)
289  : Zs()
290  , nofXBins(nofxb)
291  , nofYBins(nofyb)
292  , nofTYXBins(noftb)
293  , lastXBin(nofxb - 1)
294  , lastYBin(nofyb - 1)
295  , minX()
296  , maxX()
297  , binSizeX()
298  , minY()
299  , maxY()
300  , binSizeY()
301  , absorber()
302  , deltaThetaX()
303  , deltaThetaY()
304  , dispXs()
305  , dispYs()
306  , tyxBinsArr()
307 
308  {
309  for (int i = 0; i < 4; ++i) {
310  tyxBinsArr[i] = reinterpret_cast<LxTbTYXBin*>(
311  new unsigned char[noftb * sizeof(LxTbTYXBin)]);
312 
313  for (int j = 0; j < noftb; ++j) {
314  new (&tyxBinsArr[i][j]) LxTbTYXBin(nofXBins, nofYBins);
315  }
316  }
317  }
320 
322  for (int i = 0; i < 4; ++i)
323  delete[] reinterpret_cast<unsigned char*>(tyxBinsArr[i]);
324  }
325 
326  void Clear() {
327  for (int i = 0; i < 4; ++i) {
328  for (int j = 0; j < nofTYXBins; ++j)
329  tyxBinsArr[i][j].Clear();
330  }
331  }
332 };
333 
334 static long fullDuration = 0;
335 
337 
338  struct KFParamsCoord {
340  };
341 
342  struct KFParams {
346  };
347 
349  const KFParamsCoord& prevParam,
350  scaltype m,
351  scaltype V,
352  scaltype& chi2,
353  int stationNumber,
354  int coordNumber) {
355  const LxTbBinnedStation& station = stations[stationNumber];
356  const LxTbBinnedStation::Q& Q = station.qs[coordNumber];
357  scaltype deltaZ = station.z - stations[stationNumber + 1].z;
358  scaltype deltaZSq = deltaZ * deltaZ;
359 
360  // Extrapolate.
361  param.coord += prevParam.tg * deltaZ; // params[k].tg is unchanged.
362 
363  // Filter.
364  param.C11 += prevParam.C12 * deltaZ + prevParam.C21 * deltaZ
365  + prevParam.C22 * deltaZSq + Q.Q11;
366  param.C12 += prevParam.C22 * deltaZ + Q.Q12;
367  param.C21 += prevParam.C22 * deltaZ + Q.Q21;
368  param.C22 += Q.Q22;
369 
370  scaltype S = 1.0 / (V + param.C11);
371  scaltype Kcoord = param.C11 * S;
372  scaltype Ktg = param.C21 * S;
373  scaltype dzeta = m - param.coord;
374  param.coord += Kcoord * dzeta;
375  param.tg += Ktg * dzeta;
376  param.C21 -= param.C11 * Ktg;
377  param.C22 -= param.C12 * Ktg;
378  param.C11 *= 1.0 - Kcoord;
379  param.C12 *= 1.0 - Kcoord;
380  chi2 += dzeta * S * dzeta;
381  }
382 
383  void KFAddPoint(KFParams& param,
384  const KFParams& prevParam,
385  scaltype m[2],
386  scaltype V[2],
387  int stationNumber) {
388  /*LxRay* ray = rays[i];
389  LxPoint* point = ray->end;
390  LxStation* station = point->layer->station;
391  scaltype m[2] = { point->x, point->y };
392  scaltype V[2] = { point->dx * point->dx, point->dy * point->dy };
393  KFParams pPrev[2] = { params[0], params[1] };
394  scaltype deltaZ = point->z - prevPoint->z;
395  scaltype deltaZ2 = deltaZ * deltaZ;*/
396 
397  KFAddPointCoord(param.xParams,
398  prevParam.xParams,
399  m[0],
400  V[0],
401  param.chi2,
402  stationNumber,
403  0);
404  KFAddPointCoord(param.yParams,
405  prevParam.yParams,
406  m[1],
407  V[1],
408  param.chi2,
409  stationNumber,
410  1);
411  }
412 
413  struct Chain {
417  bool highMom;
418 
419  Chain(const LxTbBinnedPoint* const* pts, int nofPts, scaltype Chi2)
420  : points(new LxTbBinnedPoint*[nofPts])
421  , nofPoints(nofPts)
422  , chi2(Chi2)
423  , highMom(false) {
424  for (int i = 0; i < nofPoints; ++i)
425  points[i] = new LxTbBinnedPoint(*pts[i]);
426  }
427  Chain(const Chain&) = delete;
428  Chain& operator=(const Chain&) = delete;
429 
430  ~Chain() {
431  for (int i = 0; i < nofPoints; ++i)
432  delete points[i];
433 
434  delete[] points;
435  }
436  };
437 
438  struct ChainImpl {
439  //const LxTbBinnedPoint* points[];// Change to dynamical allocation
442 
443  ChainImpl(const LxTbBinnedPoint** pts, int nofPts, scaltype Chi2)
444  : points(new const LxTbBinnedPoint*[nofPts]), chi2(Chi2) {
445  memcpy(points, pts, nofPts * sizeof(const LxTbBinnedPoint*));
446  }
447 
448  void Destroy() { delete[] points; }
449  };
450 
452  TriggerTimeArray(int noftb, int tbl, timetype& mt)
453  : nofTimebins(noftb)
454  , tbLength(tbl)
455  , minT(mt)
456  , triggerTimeBins(new std::list<std::pair<timetype, timetype>>[noftb]) {}
459 
461 
462  void Clear() {
463  for (int i = 0; i < nofTimebins; ++i)
464  triggerTimeBins[i].clear();
465  }
466 
467  void Insert(const std::pair<timetype, timetype>& v) {
468  timetype wT = NOF_SIGMAS * sqrt(2.0) * v.second;
469  int minInd = (v.first - wT - minT) / tbLength;
470  int maxInd = (v.first + wT - minT) / tbLength;
471 
472  if (minInd < 0)
473  minInd = 0;
474  else if (minInd >= nofTimebins)
475  minInd = nofTimebins - 1;
476 
477  if (maxInd < 0)
478  maxInd = 0;
479  else if (maxInd >= nofTimebins)
480  maxInd = nofTimebins - 1;
481 
482  bool busy = false;
483 
484  for (int i = minInd; i <= maxInd; ++i) {
485  for (std::list<std::pair<timetype, timetype>>::const_iterator j =
486  triggerTimeBins[i].begin();
487  j != triggerTimeBins[i].end();
488  ++j) {
489  const std::pair<timetype, timetype>& p = *j;
490 
491  if (fabs(v.first - p.first)
492  <= NOF_SIGMAS * sqrt(v.second * v.second + p.second * p.second)) {
493  busy = true;
494  break;
495  }
496  }
497 
498  if (busy) break;
499  }
500 
501  if (!busy) {
502  int ind = (v.first - minT) / tbLength;
503 
504  if (ind < 0)
505  ind = 0;
506  else if (ind >= nofTimebins)
507  ind = nofTimebins - 1;
508 
509  triggerTimeBins[ind].push_back(v);
510  }
511  }
512 
514  int tbLength;
516  std::list<std::pair<timetype, timetype>>* triggerTimeBins;
517  };
518 
519  struct SignalParticle {
520  const char* fName;
521  int fPdgCode;
523  bool fHasTrd;
524  };
525 
528 
530  //int nofStations;
534  std::list<Chain*>* recoTracks;
536  bool fHasTrd;
538 
551 #ifdef LXTB_QA
552  std::set<Int_t> triggerEventNumber;
553 #endif //LXTB_QA
554 
561 
562  LxTbBinnedFinder(int nofTrdLayers,
563  int nofStations,
564  int nofTimeBins,
565  std::pair<int, int>* nofSpatBins,
566  int nofTrdXBins,
567  int nofTrdYBins,
568  int timeBinLength)
570  , stations(reinterpret_cast<LxTbBinnedStation*>(
571  new unsigned char[nofStations * sizeof(LxTbBinnedStation)]))
572  , trdStation(nofTrdXBins, nofTrdYBins, nofTimeBins)
573  , minT(0)
574  , maxT(0)
575  , recoTracks(new std::list<Chain*>[nofTimeBins])
576  , nofTrackBins(nofTimeBins)
577  , fHasTrd(nofTrdLayers > 0)
578  , fNofTrdLayers(nofTrdLayers)
579  , triggerTimes_trd0_sign0_dist0(nofTimeBins, timeBinLength, minT)
580  , triggerTimes_trd0_sign0_dist1(nofTimeBins, timeBinLength, minT)
581  , triggerTimes_trd0_sign1_dist0(nofTimeBins, timeBinLength, minT)
582  , triggerTimes_trd0_sign1_dist1(nofTimeBins, timeBinLength, minT)
583  , triggerTimes_trd1_sign0_dist0(nofTimeBins, timeBinLength, minT)
584  , triggerTimes_trd1_sign0_dist1(nofTimeBins, timeBinLength, minT)
585  , triggerTimes_trd1_sign1_dist0(nofTimeBins, timeBinLength, minT)
586  , triggerTimes_trd1_sign1_dist1(nofTimeBins, timeBinLength, minT)
587  , triggerTimes_trd05_sign0_dist0(nofTimeBins, timeBinLength, minT)
588  , triggerTimes_trd05_sign0_dist1(nofTimeBins, timeBinLength, minT)
589  , triggerTimes_trd05_sign1_dist0(nofTimeBins, timeBinLength, minT)
590  , triggerTimes_trd05_sign1_dist1(nofTimeBins, timeBinLength, minT)
591  ,
592 #ifdef LXTB_QA
594  ,
595 #endif //LXTB_QA
596  fNofStations(nofStations)
597  , fLastStationNumber(nofStations - 1)
598  , fNofTimeBins(nofTimeBins)
599  , fLastTimeBinNumber(nofTimeBins - 1)
600  , fTimeBinLength(timeBinLength)
601  , fTimeSliceLength(nofTimeBins * timeBinLength) {
602  for (int i = 0; i < fNofStations; ++i)
603  new (&stations[i]) LxTbBinnedStation(
604  nofSpatBins[i].first, nofSpatBins[i].second, nofTimeBins);
605  }
606 
609 
610  virtual ~LxTbBinnedFinder() {
611  for (int i = 0; i < fNofStations; ++i)
612  delete[] reinterpret_cast<unsigned char*>(&stations[i]);
613 
614  delete[] recoTracks;
615  }
616 
617  void SetSignalParticle(const char* name) {
618  for (int i = 0; true; ++i) {
619  if (0 == strlen(particleDescs[i].fName)) break;
620 
621  if (0 == strcmp(particleDescs[i].fName, name)) {
623  break;
624  }
625  }
626  }
627 
628  void Clear() {
629  for (int i = 0; i < fNofStations; ++i)
630  stations[i].Clear();
631 
632  trdStation.Clear();
633 
634  for (int i = 0; i < nofTrackBins; ++i)
635  recoTracks[i].clear();
636 
649 #ifdef LXTB_QA
650  triggerEventNumber.clear();
651 #endif //LXTB_QA
652  }
653 
654  void SetTSBegin(unsigned long long tsLowBound) { minT = tsLowBound; }
655 
656  void Init() {
658  scaltype E = fSignalParticle->fMinEnergy; // GeV
659  scaltype E0 = E;
660 
661  for (int i = 0; i < fNofStations; ++i) {
662  stations[i].binSizeX =
663  (stations[i].maxX - stations[i].minX) / stations[i].nofXBins;
664  stations[i].binSizeY =
665  (stations[i].maxY - stations[i].minY) / stations[i].nofYBins;
666  scaltype L = stations[i].absorber.width; // / cos(3.14159265 * 15 / 180);
667  E -= EnergyLoss(E, L, &stations[i].absorber);
668 
669  if (i > 0) {
670  scaltype Escat = (E0 + E) / 2;
671  scaltype deltaTheta = CalcThetaPrj(Escat, L, &stations[i].absorber);
672  stations[i].deltaThetaX = deltaTheta;
673  stations[i].deltaThetaY = deltaTheta;
676  stations[i].qs[0] = {
677  q0XSq * L * L / 3, q0XSq * L / 2, q0XSq * L / 2, q0XSq};
678  stations[i].qs[1] = {
679  q0YSq * L * L / 3, q0YSq * L / 2, q0YSq * L / 2, q0YSq};
680  }
681 
682  E0 = E;
683  }
684 
685  scaltype Ls[fNofStations + 1];
686  Ls[0] = stations[0].absorber.zCoord;
687 
688  for (int i = 1; i < fNofStations; ++i)
689  Ls[i] = stations[i].absorber.zCoord - Ls[i - 1];
690 
692 
693  scaltype Ls1[fNofStations + 1];
694  scaltype Ls2[fNofStations + 1];
695 
696  Ls1[0] = 0;
697  Ls2[0] = stations[0].absorber.zCoord;
698 
699  for (int i = 1; i < fNofStations; ++i) {
700  Ls1[i] = stations[i - 1].z - stations[i - 1].absorber.zCoord;
701  Ls2[i] = stations[i].absorber.zCoord - stations[i - 1].z;
702  }
703 
706  Ls2[fNofStations] = 0;
707 
708  for (int s = 1; s < fNofStations; ++s) {
709  LxTbBinnedStation& station = stations[s];
710  scaltype L = station.z;
711  int n = s + 1;
712  scaltype thetaXSq = 0;
713  scaltype thetaYSq = 0;
714 
715  for (int i = 1; i < n; ++i) {
716  scaltype sumLi = 0;
717 
718  for (int j = 0; j < i; ++j)
719  sumLi += Ls[j];
720 
721  thetaXSq +=
722  sumLi * sumLi * stations[i].deltaThetaX * stations[i].deltaThetaX;
723  thetaYSq +=
724  sumLi * sumLi * stations[i].deltaThetaY * stations[i].deltaThetaY;
725  }
726 
727  thetaXSq /= L * L;
728  thetaYSq /= L * L;
729 
730  thetaXSq += stations[s].deltaThetaX * stations[s].deltaThetaX * Ls2[n - 1]
731  * Ls2[n - 1]
732  / ((Ls2[n - 1] + Ls1[n]) * (Ls2[n - 1] + Ls1[n]));
733  thetaYSq += stations[s].deltaThetaY * stations[s].deltaThetaY * Ls2[n - 1]
734  * Ls2[n - 1]
735  / ((Ls2[n - 1] + Ls1[n]) * (Ls2[n - 1] + Ls1[n]));
736 
737  scaltype deltaZ = stations[s].z - stations[s - 1].z;
738  station.dispX = deltaZ * sqrt(thetaXSq);
739  station.dispY = deltaZ * sqrt(thetaYSq);
740  }
741 
742  if (fHasTrd) {
747  scaltype L = trdStation.absorber.width; // / cos(3.14159265 * 15 / 180);
748  E -= EnergyLoss(E, L, &trdStation.absorber);
749  scaltype Escat = (E0 + E) / 2;
750  scaltype deltaTheta = CalcThetaPrj(Escat, L, &trdStation.absorber);
751  trdStation.deltaThetaX = deltaTheta;
752  trdStation.deltaThetaY = deltaTheta;
753 
754  for (int i = 0; i < fNofTrdLayers; ++i) {
758  }
759 
760  E0 = E;
761  }
762  }
763 
765  scaltype wX,
766  scaltype y,
767  scaltype wY,
768  timetype t,
769  timetype wT,
770  int layerIndex,
771  std::list<LxTbBinnedPoint*>& results) {
772  if (x + wX < trdStation.minX || x - wX > trdStation.maxX
773  || y + wY < trdStation.minY || y - wY > trdStation.maxY || t + wT < minT
774  || t - wT > maxT)
775  return;
776 
777  int lTindMin = (t - wT - minT) / fTimeBinLength;
778 
779  if (lTindMin < 0)
780  lTindMin = 0;
781  else if (lTindMin > fLastTimeBinNumber)
782  lTindMin = fLastTimeBinNumber;
783 
784  int lTindMax = (t + wT - minT) / fTimeBinLength;
785 
786  if (lTindMax < 0)
787  lTindMax = 0;
788  else if (lTindMax > fLastTimeBinNumber)
789  lTindMax = fLastTimeBinNumber;
790 
791  int lYindMin = (y - wY - trdStation.minY) / trdStation.binSizeY;
792 
793  if (lYindMin < 0)
794  lYindMin = 0;
795  else if (lYindMin > trdStation.lastYBin)
796  lYindMin = trdStation.lastYBin;
797 
798  int lYindMax = (y + wY - trdStation.minY) / trdStation.binSizeY;
799 
800  if (lYindMax < 0)
801  lYindMax = 0;
802  else if (lYindMax > trdStation.lastYBin)
803  lYindMax = trdStation.lastYBin;
804 
805  int lXindMin = (x - wX - trdStation.minX) / trdStation.binSizeX;
806 
807  if (lXindMin < 0)
808  lXindMin = 0;
809  else if (lXindMin > trdStation.lastXBin)
810  lXindMin = trdStation.lastXBin;
811 
812  int lXindMax = (x + wX - trdStation.minX) / trdStation.binSizeX;
813 
814  if (lXindMax < 0)
815  lXindMax = 0;
816  else if (lXindMax > trdStation.lastXBin)
817  lXindMax = trdStation.lastXBin;
818 
819  LxTbTYXBin* tyxBins = trdStation.tyxBinsArr[layerIndex];
820 
821  for (int lTind = lTindMin; lTind <= lTindMax; ++lTind) {
822  LxTbTYXBin& lTyxBin = tyxBins[lTind];
823 
824  for (int lYind = lYindMin; lYind <= lYindMax; ++lYind) {
825  LxTbYXBin& lYxBin = lTyxBin.yxBins[lYind];
826 
827  for (int lXind = lXindMin; lXind <= lXindMax; ++lXind) {
828  LxTbXBin& lXBin = lYxBin.xBins[lXind];
829 
830  for (std::list<LxTbBinnedPoint>::iterator i = lXBin.points.begin();
831  i != lXBin.points.end();
832  ++i) {
833  LxTbBinnedPoint& point = *i;
834 
835  if (point.x > x - wX && point.x < x + wX && point.y > y - wY
836  && point.y < y + wY && point.t > t - wT && point.t < t + wT)
837  results.push_back(&point);
838  }
839  }
840  }
841  }
842  }
843 
844  void Reconstruct() {
845  //cout << "LxTbBinnedFinder::Reconstruct() started" << endl;
846  timespec ts;
847  clock_gettime(CLOCK_REALTIME, &ts);
848  long beginTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
852  int nofXBins = lastStation.nofXBins;
853  int nofYBins = lastStation.nofYBins;
854 
855  /*if (hasTrd)
856  {
857  scaltype lastZ = lastStation.z;
858  scaltype deltaZsTrd[4] = {trdStation.Zs[0] - lastZ, trdStation.Zs[2] - lastZ, trdStation.Zs[2] - lastZ, trdStation.Zs[3] - lastZ};
859 
860  for (int i = 0; i < NOF_TIMEBINS; ++i)
861  {
862 
863  LxTbTYXBin& lTyxBin = lastStation.tyxBins[i];
864 
865  for (int j = 0; j < nofYBins; ++j)
866  {
867  LxTbYXBin& lYxBin = lTyxBin.yxBins[j];
868 
869  for (int k = 0; k < nofXBins; ++k)
870  {
871  LxTbXBin& lXBin = lYxBin.xBins[k];
872 
873  for (std::list<LxTbBinnedPoint>::iterator l = lXBin.points.begin(); l != lXBin.points.end(); ++l)
874  {
875  LxTbBinnedPoint& lPoint = *l;
876  scaltype tx = lPoint.x / lastZ;
877  scaltype ty = lPoint.y / lastZ;
878  scaltype trdPx0 = lPoint.x + tx * deltaZsTrd[0];
879  scaltype trdPy0 = lPoint.y + ty * deltaZsTrd[0];
880  scaltype trajLen0 = sqrt(1 + tx * tx + ty * ty) * deltaZsTrd[0];
881  scaltype trdPt0 = lPoint.t + 1.e9 * trajLen0 / c; // 1.e9 to convert to ns.
882  scaltype wX0 = NOF_SIGMAS * trdStation.dispXs[0];
883  scaltype wY0 = NOF_SIGMAS * trdStation.dispYs[0];
884  scaltype wT0 = NOF_SIGMAS * sqrt(2.0) * lPoint.dt;
885  std::list<LxTbBinnedPoint*> results0;
886  FindNeighbours(trdPx0, wX0, trdPy0, wY0, trdPt0, wT0, 0, results0);
887 
888  scaltype trdPx1 = lPoint.x + tx * deltaZsTrd[1];
889  scaltype trdPy1 = lPoint.y + ty * deltaZsTrd[1];
890  scaltype trajLen1 = sqrt(1 + tx * tx + ty * ty) * deltaZsTrd[1];
891  scaltype trdPt1 = lPoint.t + 1.e9 * trajLen1 / c; // 1.e9 to convert to ns.
892  scaltype wX1 = NOF_SIGMAS * trdStation.dispXs[1];
893  scaltype wY1 = NOF_SIGMAS * trdStation.dispYs[1];
894  scaltype wT1 = NOF_SIGMAS * sqrt(2.0) * lPoint.dt;
895  std::list<LxTbBinnedPoint*> results1;
896  FindNeighbours(trdPx1, wX1, trdPy1, wY1, trdPt1, wT1, 1, results1);
897 
898  for (std::list<LxTbBinnedPoint*>::const_iterator m = results0.begin(); m != results0.end(); ++m)
899  {
900  LxTbBinnedPoint& trdPoint0 = *(*m);
901 
902  for (std::list<LxTbBinnedPoint*>::const_iterator n = results1.begin(); n != results1.end(); ++n)
903  {
904  LxTbBinnedPoint& trdPoint1 = *(*n);
905  scaltype trdTx = (trdPoint1.x - trdPoint0.x) / (trdStation.Zs[1] - trdStation.Zs[0]);
906  scaltype trdTy = (trdPoint1.y - trdPoint0.y) / (trdStation.Zs[1] - trdStation.Zs[0]);
907 
908  scaltype trdPx2 = trdPoint1.x + trdTx * (trdStation.Zs[2] - trdStation.Zs[1]);
909  scaltype trdPy2 = trdPoint1.y + trdTy * (trdStation.Zs[2] - trdStation.Zs[1]);
910  scaltype trajLen2 = sqrt(1 + trdTx * trdTx + trdTx * trdTx) * (trdStation.Zs[2] - trdStation.Zs[1]);
911  scaltype trdPt2 = trdPoint1.t + 1.e9 * trajLen2 / c; // 1.e9 to convert to ns.
912  scaltype wX2 = 0.35135;
913  scaltype wY2 = 0.33515;
914  scaltype wT2 = NOF_SIGMAS * sqrt(2.0) * trdPoint1.dt;
915  std::list<LxTbBinnedPoint*> results2;
916  FindNeighbours(trdPx2, wX2, trdPy2, wY2, trdPt2, wT2, 2, results2);
917 
918  if (results2.empty())
919  continue;
920 
921  scaltype trdPx3 = trdPoint1.x + trdTx * (trdStation.Zs[3] - trdStation.Zs[1]);
922  scaltype trdPy3 = trdPoint1.y + trdTy * (trdStation.Zs[3] - trdStation.Zs[1]);
923  scaltype trajLen3 = sqrt(1 + trdTx * trdTx + trdTx * trdTx) * (trdStation.Zs[3] - trdStation.Zs[1]);
924  scaltype trdPt3 = trdPoint1.t + 1.e9 * trajLen3 / c; // 1.e9 to convert to ns.
925  scaltype wX3 = 0.909;
926  scaltype wY3 = 0.8455;
927  scaltype wT3 = NOF_SIGMAS * sqrt(2.0) * trdPoint1.dt;
928  std::list<LxTbBinnedPoint*> results3;
929  FindNeighbours(trdPx3, wX3, trdPy3, wY3, trdPt3, wT3, 3, results3);
930 
931  if (results3.empty())
932  continue;
933 
934  lPoint.use = true;
935  lXBin.use = true;
936  lYxBin.use = true;
937  lTyxBin.use = true;
938  }
939  }
940  }
941  }
942  }
943  }
944  }*/
945 
946  for (int i = fLastStationNumber; i >= 1; --i) {
947  LxTbBinnedStation& rStation = stations[i];
948  LxTbBinnedStation& lStation = stations[i - 1];
949  scaltype binSizeX = lStation.binSizeX;
950  scaltype binSizeY = lStation.binSizeY;
951  scaltype rZ = rStation.z;
952  scaltype lZ = lStation.z;
953  scaltype deltaZ = lZ - rZ;
954  scaltype dispXSq = rStation.dispX * rStation.dispX;
955  scaltype dispYSq = rStation.dispY * rStation.dispY;
956  scaltype minX = lStation.minX;
957  scaltype maxX = lStation.maxX;
958  scaltype minY = lStation.minY;
959  scaltype maxY = lStation.maxY;
960  int rNofXBins = rStation.nofXBins;
961  int rNofYBins = rStation.nofYBins;
962  int lastXBin = lStation.nofXBins - 1;
963  int lastYBin = lStation.nofYBins - 1;
964 
965  for (int j = 0; j < fNofTimeBins; ++j) {
966  LxTbTYXBin& rTyxBin = rStation.tyxBins[j];
967 
968  if (!rTyxBin.use) continue;
969 
970  for (int k = 0; k < rNofYBins; ++k) {
971  LxTbYXBin& rYxBin = rTyxBin.yxBins[k];
972 
973  if (!rYxBin.use) continue;
974 
975  for (int l = 0; l < rNofXBins; ++l) {
976  LxTbXBin& rXBin = rYxBin.xBins[l];
977 
978  if (!rXBin.use) continue;
979 
980  for (std::list<LxTbBinnedPoint>::iterator m = rXBin.points.begin();
981  m != rXBin.points.end();
982  ++m) {
983  LxTbBinnedPoint& rPoint = *m;
984 
985  if (!rPoint.use) continue;
986 
987  scaltype tx = rPoint.x / rZ;
988  scaltype ty = rPoint.y / rZ;
989  scaltype pX = rPoint.x + tx * deltaZ;
990  scaltype pY = rPoint.y + ty * deltaZ;
991  scaltype trajLen = sqrt(1 + tx * tx + ty * ty) * deltaZ;
992  timetype pT =
993  rPoint.t
994  + 1.e9 * trajLen
995  / c; // 1.e9 to convert to ns and trajLen is negative.
996  scaltype rDxSq = rPoint.dx * rPoint.dx;
997  scaltype xDiv0 = dispXSq + rDxSq;
998  scaltype wX = NOF_SIGMAS * sqrt(xDiv0 + rDxSq);
999  scaltype rDySq = rPoint.dy * rPoint.dy;
1000  scaltype yDiv0 = dispYSq + rDySq;
1001  scaltype wY = NOF_SIGMAS * sqrt(yDiv0 + rDySq);
1002  timetype wT = NOF_SIGMAS * sqrt(2.0) * rPoint.dt;
1003 
1004  if (pX + wX < minX || pX - wX > maxX || pY + wY < minY
1005  || pY - wY > maxY || pT + wT < minT || pT - wT > maxT)
1006  continue;
1007 
1008  int lTindMin = (pT - wT - minT) / fTimeBinLength;
1009 
1010  if (lTindMin < 0)
1011  lTindMin = 0;
1012  else if (lTindMin > fLastTimeBinNumber)
1013  lTindMin = fLastTimeBinNumber;
1014 
1015  int lTindMax = (pT + wT - minT) / fTimeBinLength;
1016 
1017  if (lTindMax < 0)
1018  lTindMax = 0;
1019  else if (lTindMax > fLastTimeBinNumber)
1020  lTindMax = fLastTimeBinNumber;
1021 
1022  int lYindMin = (pY - wY - minY) / binSizeY;
1023 
1024  if (lYindMin < 0)
1025  lYindMin = 0;
1026  else if (lYindMin > lastYBin)
1027  lYindMin = lastYBin;
1028 
1029  int lYindMax = (pY + wY - minY) / binSizeY;
1030 
1031  if (lYindMax < 0)
1032  lYindMax = 0;
1033  else if (lYindMax > lastYBin)
1034  lYindMax = lastYBin;
1035 
1036  int lXindMin = (pX - wX - minX) / binSizeX;
1037 
1038  if (lXindMin < 0)
1039  lXindMin = 0;
1040  else if (lXindMin > lastXBin)
1041  lXindMin = lastXBin;
1042 
1043  int lXindMax = (pX + wX - minX) / binSizeX;
1044 
1045  if (lXindMax < 0)
1046  lXindMax = 0;
1047  else if (lXindMax > lastXBin)
1048  lXindMax = lastXBin;
1049 
1050  for (int lTind = lTindMin; lTind <= lTindMax; ++lTind) {
1051  LxTbTYXBin& lTyxBin = lStation.tyxBins[lTind];
1052 
1053  for (int lYind = lYindMin; lYind <= lYindMax; ++lYind) {
1054  LxTbYXBin& lYxBin = lTyxBin.yxBins[lYind];
1055 
1056  for (int lXind = lXindMin; lXind <= lXindMax; ++lXind) {
1057  LxTbXBin& lXBin = lYxBin.xBins[lXind];
1058 
1059  for (std::list<LxTbBinnedPoint>::iterator n =
1060  lXBin.points.begin();
1061  n != lXBin.points.end();
1062  ++n) {
1063  LxTbBinnedPoint& lPoint = *n;
1064  scaltype xDiv = xDiv0 + lPoint.dx * lPoint.dx;
1065  scaltype wX_prec_sq = NOF_SIGMAS_SQ * xDiv;
1066  scaltype yDiv = yDiv0 + lPoint.dy * lPoint.dy;
1067  scaltype wY_prec_sq = NOF_SIGMAS_SQ * yDiv;
1068  scaltype deltaX = lPoint.x - pX;
1069  scaltype deltaXSq = deltaX * deltaX;
1070  scaltype deltaY = lPoint.y - pY;
1071  scaltype deltaYSq = deltaY * deltaY;
1072  timetype deltaT = lPoint.t - pT;
1073  timetype deltaTSq = deltaT * deltaT;
1074 
1075  if (deltaXSq < wX_prec_sq && deltaYSq < wY_prec_sq
1076  && deltaTSq < wT * wT) {
1077  lPoint.use = true;
1078  lXBin.use = true;
1079  rPoint.neighbours.push_back(
1080  LxTbBinnedRay(deltaZ,
1081  rPoint,
1082  lPoint,
1083  deltaXSq / xDiv + deltaYSq / yDiv
1084  + deltaTSq
1085  / (rPoint.dt * rPoint.dt
1086  + lPoint.dt * lPoint.dt)));
1087  }
1088  }
1089 
1090  if (lXBin.use) lYxBin.use = true;
1091  }
1092 
1093  if (lYxBin.use) lTyxBin.use = true;
1094  }
1095  }
1096  } // for (std::list<LxTbBinnedPoint>::iterator m = rStation
1097  } // for (int l = 0; l < NOF_XBINS; ++l)
1098  } // for (int k = 0; k < NOF_YBINS; ++k)
1099  } // for (int j = 0; j < NOF_TIMEBINS; ++j)
1100  } // for (int i = fLastStationNumber; i >=1; --i)
1101 
1103 
1104  for (int i = 0; i < fNofTimeBins; ++i) {
1105  LxTbTYXBin& rTyxBin = lastStation.tyxBins[i];
1106 
1107  if (!rTyxBin.use) continue;
1108 
1109  for (int j = 0; j < nofYBins; ++j) {
1110  LxTbYXBin& rYxBin = rTyxBin.yxBins[j];
1111 
1112  if (!rYxBin.use) continue;
1113 
1114  for (int k = 0; k < nofXBins; ++k) {
1115  LxTbXBin& rXBin = rYxBin.xBins[k];
1116 
1117  if (!rXBin.use) continue;
1118 
1119  for (std::list<LxTbBinnedPoint>::iterator l = rXBin.points.begin();
1120  l != rXBin.points.end();
1121  ++l) {
1122  LxTbBinnedPoint& rPoint = *l;
1123  std::list<ChainImpl> chains;
1124 
1125  KFParams kfParams = {{rPoint.x,
1126  rPoint.x / lastStation.z,
1127  rPoint.dx * rPoint.dx,
1128  0,
1129  0,
1130  1.0},
1131  {rPoint.y,
1132  rPoint.y / lastStation.z,
1133  rPoint.dy * rPoint.dy,
1134  0,
1135  0,
1136  1.0},
1137  0};
1138 
1139  FindChains(
1140  fLastStationNumber, &rPoint, 0, points, kfParams, chains);
1141  const ChainImpl* bestChain = 0;
1142  scaltype chi2 = 0;
1143 
1144  for (std::list<ChainImpl>::const_iterator m = chains.begin();
1145  m != chains.end();
1146  ++m) {
1147  const ChainImpl& chain = *m;
1148 
1149  if (0 == bestChain || chain.chi2 < chi2) {
1150  bestChain = &chain;
1151  chi2 = chain.chi2;
1152  }
1153  }
1154 
1155  if (0 != bestChain) {
1156  int trackBinInd =
1157  (bestChain->points[fLastStationNumber]->t - minT)
1158  / fTimeBinLength;
1159 
1160  if (trackBinInd < 0)
1161  trackBinInd = 0;
1162  else if (trackBinInd > nofTrackBins)
1163  trackBinInd = nofTrackBins;
1164 
1165  recoTracks[trackBinInd].push_back(
1166  new Chain(bestChain->points, fNofStations, chi2));
1167  }
1168 
1169  for (std::list<ChainImpl>::iterator m = chains.begin();
1170  m != chains.end();
1171  ++m) {
1172  ChainImpl& chain = *m;
1173  delete[] chain.points;
1174  }
1175  }
1176  }
1177  }
1178  }
1179 
1180  if (fHasTrd) {
1181  scaltype lastZ = lastStation.z;
1182  LxTbBinnedStation& beforeLastStation = stations[fLastStationNumber - 1];
1183  scaltype beforeLastZ = beforeLastStation.z;
1184  scaltype deltaZsTrd[4] = {trdStation.Zs[0] - lastZ,
1185  trdStation.Zs[2] - lastZ,
1186  trdStation.Zs[2] - lastZ,
1187  trdStation.Zs[3] - lastZ};
1188  scaltype dispX0Sq = trdStation.dispXs[0] * trdStation.dispXs[0];
1189  scaltype dispY0Sq = trdStation.dispYs[0] * trdStation.dispYs[0];
1190  scaltype dispX1Sq = trdStation.dispXs[1] * trdStation.dispXs[1];
1191  scaltype dispY1Sq = trdStation.dispYs[1] * trdStation.dispYs[1];
1192  scaltype trdDeltaZ10 = (trdStation.Zs[1] - trdStation.Zs[0]);
1193  scaltype trdDeltaZ10Sq = trdDeltaZ10 * trdDeltaZ10;
1194  scaltype trdDeltaZ21 = (trdStation.Zs[2] - trdStation.Zs[1]);
1195  scaltype trdDeltaZ21Sq = trdDeltaZ21 * trdDeltaZ21;
1196  scaltype trdDeltaZ31 = (trdStation.Zs[3] - trdStation.Zs[1]);
1197  scaltype trdDeltaZ31Sq = trdDeltaZ31 * trdDeltaZ31;
1198 
1199  for (int i = 0; i < nofTrackBins; ++i) {
1200  std::list<Chain*>& recoTracksBin = recoTracks[i];
1201 
1202  for (std::list<Chain*>::iterator j = recoTracksBin.begin();
1203  j != recoTracksBin.end();
1204  ++j) {
1205  Chain* track = *j;
1206  LxTbBinnedPoint& lPoint = *track->points[track->nofPoints - 1];
1207  LxTbBinnedPoint& lPointL = *track->points[track->nofPoints - 2];
1208  scaltype tx = (lPoint.x - lPointL.x) / (lastZ - beforeLastZ);
1209  scaltype ty = (lPoint.y - lPointL.y) / (lastZ - beforeLastZ);
1210  scaltype trdPx0 = lPoint.x + tx * deltaZsTrd[0];
1211  scaltype trdPy0 = lPoint.y + ty * deltaZsTrd[0];
1212  scaltype trajLen0 = sqrt(1 + tx * tx + ty * ty) * deltaZsTrd[0];
1213  timetype trdPt0 =
1214  lPoint.t + 1.e9 * trajLen0 / c; // 1.e9 to convert to ns.
1215  scaltype wX0 =
1216  NOF_SIGMAS * sqrt(dispX0Sq + 2 * lPoint.dx * lPoint.dx);
1217  scaltype wY0 =
1218  NOF_SIGMAS * sqrt(dispY0Sq + 2 * lPoint.dy * lPoint.dy);
1219  timetype wT0 = NOF_SIGMAS * sqrt(2.0) * lPoint.dt;
1220  std::list<LxTbBinnedPoint*> results0;
1221  FindNeighbours(trdPx0, wX0, trdPy0, wY0, trdPt0, wT0, 0, results0);
1222 
1223  scaltype trdPx1 = lPoint.x + tx * deltaZsTrd[1];
1224  scaltype trdPy1 = lPoint.y + ty * deltaZsTrd[1];
1225  scaltype trajLen1 = sqrt(1 + tx * tx + ty * ty) * deltaZsTrd[1];
1226  timetype trdPt1 =
1227  lPoint.t + 1.e9 * trajLen1 / c; // 1.e9 to convert to ns.
1228  scaltype wX1 =
1229  NOF_SIGMAS * sqrt(dispX1Sq + 2 * lPoint.dx * lPoint.dx);
1230  scaltype wY1 =
1231  NOF_SIGMAS * sqrt(dispY1Sq + 2 * lPoint.dy * lPoint.dy);
1232  timetype wT1 = NOF_SIGMAS * sqrt(2.0) * lPoint.dt;
1233  std::list<LxTbBinnedPoint*> results1;
1234  FindNeighbours(trdPx1, wX1, trdPy1, wY1, trdPt1, wT1, 1, results1);
1235 
1236  for (std::list<LxTbBinnedPoint*>::const_iterator k = results0.begin();
1237  k != results0.end();
1238  ++k) {
1239  LxTbBinnedPoint& trdPoint0 = *(*k);
1240 
1241  for (std::list<LxTbBinnedPoint*>::const_iterator l =
1242  results1.begin();
1243  l != results1.end();
1244  ++l) {
1245  LxTbBinnedPoint& trdPoint1 = *(*l);
1246  scaltype trdTx = (trdPoint1.x - trdPoint0.x) / trdDeltaZ10;
1247  scaltype trdTy = (trdPoint1.y - trdPoint0.y) / trdDeltaZ10;
1248  scaltype trdDtxSq =
1249  (trdPoint0.dx * trdPoint0.dx + trdPoint1.dx * trdPoint1.dx)
1250  / trdDeltaZ10Sq;
1251  scaltype trdDtySq =
1252  (trdPoint0.dy * trdPoint0.dy + trdPoint1.dy * trdPoint1.dy)
1253  / trdDeltaZ10Sq;
1254 
1255  scaltype trdPx2 = trdPoint1.x + trdTx * trdDeltaZ21;
1256  scaltype trdPy2 = trdPoint1.y + trdTy * trdDeltaZ21;
1257  scaltype trajLen2 =
1258  sqrt(1 + trdTx * trdTx + trdTx * trdTx) * trdDeltaZ21;
1259  timetype trdPt2 =
1260  trdPoint1.t + 1.e9 * trajLen2 / c; // 1.e9 to convert to ns.
1261  scaltype wX2 =
1262  NOF_SIGMAS
1263  * sqrt(0.0878375 * 0.0878375 + trdDtxSq * trdDeltaZ21Sq
1264  + trdPoint1.dx * trdPoint1.dx); //0.35135;
1265  scaltype wY2 =
1266  NOF_SIGMAS
1267  * sqrt(0.0837875 * 0.0837875 + trdDtySq * trdDeltaZ21Sq
1268  + trdPoint1.dy * trdPoint1.dy); //0.33515;
1269  timetype wT2 = NOF_SIGMAS * sqrt(2.0) * trdPoint1.dt;
1270  std::list<LxTbBinnedPoint*> results2;
1272  trdPx2, wX2, trdPy2, wY2, trdPt2, wT2, 2, results2);
1273 
1274  if (results2.empty()) continue;
1275 
1276  scaltype trdPx3 = trdPoint1.x + trdTx * trdDeltaZ31;
1277  scaltype trdPy3 = trdPoint1.y + trdTy * trdDeltaZ31;
1278  scaltype trajLen3 =
1279  sqrt(1 + trdTx * trdTx + trdTx * trdTx) * trdDeltaZ31;
1280  timetype trdPt3 =
1281  trdPoint1.t + 1.e9 * trajLen3 / c; // 1.e9 to convert to ns.
1282  scaltype wX3 = NOF_SIGMAS
1283  * sqrt(0.22725 * 0.22725 + trdDtxSq * trdDeltaZ31Sq
1284  + trdPoint1.dx * trdPoint1.dx); //0.909;
1285  scaltype wY3 =
1286  NOF_SIGMAS
1287  * sqrt(0.211375 * 0.211375 + trdDtySq * trdDeltaZ31Sq
1288  + trdPoint1.dy * trdPoint1.dy); //0.8455;
1289  timetype wT3 = NOF_SIGMAS * sqrt(2.0) * trdPoint1.dt;
1290  std::list<LxTbBinnedPoint*> results3;
1292  trdPx3, wX3, trdPy3, wY3, trdPt3, wT3, 3, results3);
1293 
1294  if (!results3.empty()) {
1295  track->highMom = true;
1296  break;
1297  }
1298  }
1299 
1300  if (track->highMom) break;
1301  }
1302  }
1303  }
1304  }
1305 
1306  Trigger();
1307 
1308  clock_gettime(CLOCK_REALTIME, &ts);
1309  long endTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
1310  fullDuration += endTime - beginTime;
1311  //cout << "LxTbNaiveFinder::Reconstruct() full duration was: " << fullDuration << endl;
1312  //cout << "LxTbNaiveFinder::Reconstruct() the number of found tracks: " << recoTracks.size() << endl;
1313  }
1314 
1315  void FindChains(int stationIndex,
1316  const LxTbBinnedPoint* rPoint,
1317  const LxTbBinnedRay* /*rRay*/,
1318  const LxTbBinnedPoint** points,
1319  KFParams kfParamsPrev,
1320  std::list<ChainImpl>& chains) {
1321  points[stationIndex] = rPoint;
1322 
1323  if (0 == stationIndex) {
1324  ChainImpl chain(points, fNofStations, kfParamsPrev.chi2);
1325  chains.push_back(chain);
1326  return;
1327  }
1328 
1329  for (std::list<LxTbBinnedRay>::const_iterator i =
1330  rPoint->neighbours.begin();
1331  i != rPoint->neighbours.end();
1332  ++i) {
1333  const LxTbBinnedRay& lRay = *i;
1334  const LxTbBinnedPoint* lPoint = lRay.lPoint;
1335  /*scaltype chi2_2 = chi2 + lRay.chi2;
1336 
1337  if (0 != rRay)
1338  //chi2_2 += (lRay.tx - rRay->tx) * (lRay.tx - rRay->tx) / (rRay->dtxSq + lRay.dtxSq) +
1339  //(lRay.ty - rRay->ty) * (lRay.ty - rRay->ty) / (rRay->dtySq + lRay.dtySq);
1340  chi2_2 += (lRay.tx - rRay->tx) * (lRay.tx - rRay->tx) / (stations[stationIndex].deltaThetaX * stations[stationIndex].deltaThetaX) +
1341  (lRay.ty - rRay->ty) * (lRay.ty - rRay->ty) / (stations[stationIndex].deltaThetaY * stations[stationIndex].deltaThetaY);*/
1342  KFParams kfParams = kfParamsPrev;
1343  scaltype m[2] = {lPoint->x, lPoint->y};
1344  scaltype V[2] = {lPoint->dx * lPoint->dx, lPoint->dy * lPoint->dy};
1345  KFAddPoint(kfParams, kfParamsPrev, m, V, stationIndex - 1);
1346  FindChains(stationIndex - 1, lPoint, &lRay, points, kfParams, chains);
1347  }
1348  }
1349 
1350  void TriggerBin(std::list<Chain*>& recoTracksBin,
1351  std::list<Chain*>& borderTracks,
1352  int i,
1353  bool handleBorder) {
1354  std::list<Chain*>::const_iterator it =
1355  handleBorder ? borderTracks.begin() : recoTracksBin.begin();
1356  std::list<Chain*>::const_iterator endIt =
1357  handleBorder ? borderTracks.end() : recoTracksBin.end();
1358 
1359  for (; it != endIt; ++it) {
1360  Chain* track = *it;
1361  LxTbBinnedPoint* point = track->points[fLastStationNumber];
1362  timetype dt = point->dt;
1363  timetype dtSq = dt * dt;
1364  timetype wt = NOF_SIGMAS * sqrt(2.0) * dt;
1365 
1366  if (!handleBorder && point->t + wt > minT + (i + 1) * fTimeBinLength)
1367  borderTracks.push_back(track);
1368 
1369  scaltype trackSign = (track->points[1]->x - track->points[0]->x)
1370  / (stations[1].z - stations[0].z)
1371  - track->points[0]->x / stations[0].z;
1372  std::list<Chain*>::const_iterator it2 =
1373  handleBorder ? recoTracksBin.begin() : it;
1374  std::list<Chain*>::const_iterator endIt2 = recoTracksBin.end();
1375 
1376  if (!handleBorder) ++it2;
1377 
1378  for (; it2 != endIt2; ++it2) {
1379  Chain* track2 = *it2;
1380  LxTbBinnedPoint* point2 = track2->points[fLastStationNumber];
1381  timetype dt2 = point2->dt;
1382  timetype dt2Sq = dt2 * dt2;
1383 
1384  if (fabs(point2->t - point->t) > NOF_SIGMAS * sqrt(dtSq + dt2Sq))
1385  continue;
1386 
1387  scaltype track2Sign = (track2->points[1]->x - track2->points[0]->x)
1388  / (stations[1].z - stations[0].z)
1389  - track2->points[0]->x / stations[0].z;
1390  scaltype dist =
1391  sqrt((track2->points[0]->x - track->points[0]->x)
1392  * (track2->points[0]->x - track->points[0]->x)
1393  + (track2->points[0]->y - track->points[0]->y)
1394  * (track2->points[0]->y - track->points[0]->y));
1395  std::pair<timetype, timetype> pairTime((point->t + point2->t) / 2,
1396  sqrt(dtSq + dt2Sq) / 2);
1397 
1398  if (track->highMom && track2->highMom) {
1399  if (trackSign * track2Sign < 0) {
1400  if (dist >= 50.0) {
1402 #ifdef LXTB_QA
1403  triggerEventNumber.insert(point->mcRefs.front().eventId);
1404 #endif //LXTB_QA
1405  }
1406 
1408  }
1409 
1410  if (dist >= 50.0) triggerTimes_trd1_sign0_dist1.Insert(pairTime);
1411 
1413  }
1414 
1415  if (track->highMom || track2->highMom) {
1416  if (trackSign * track2Sign < 0) {
1417  if (dist >= 50.0) triggerTimes_trd05_sign1_dist1.Insert(pairTime);
1418 
1420  }
1421 
1422  if (dist >= 50.0) triggerTimes_trd05_sign0_dist1.Insert(pairTime);
1423 
1425  }
1426 
1427  if (trackSign * track2Sign < 0) {
1428  if (dist >= 50.0) triggerTimes_trd0_sign1_dist1.Insert(pairTime);
1429 
1431  }
1432 
1433  if (dist >= 50.0) triggerTimes_trd0_sign0_dist1.Insert(pairTime);
1434 
1436  }
1437  }
1438  }
1439 
1440  void Trigger() {
1441  std::list<Chain*> borderTracks;
1442 
1443  for (int i = 0; i < nofTrackBins; ++i) {
1444  TriggerBin(recoTracks[i], borderTracks, 0, true);
1445  borderTracks.clear();
1446  TriggerBin(recoTracks[i], borderTracks, i, false);
1447  }
1448  }
1449 };
1450 
1451 #endif /* LXTBBINNED_H */
NOF_SIGMAS_SQ
#define NOF_SIGMAS_SQ
Definition: LxTBBinned.h:53
LxTbBinnedTrdStation::binSizeX
scaltype binSizeX
Definition: LxTBBinned.h:277
LxTbTYXBin::LxTbTYXBin
LxTbTYXBin(int nxbs, int nybs)
Definition: LxTBBinned.h:185
LxTbBinnedPoint::PointDesc::pointId
Int_t pointId
Definition: LxTBBinned.h:96
LxTbBinnedFinder::TriggerTimeArray
Definition: LxTBBinned.h:451
LxTbBinnedFinder::triggerTimes_trd05_sign0_dist0
TriggerTimeArray triggerTimes_trd05_sign0_dist0
Definition: LxTBBinned.h:547
LxTbBinnedStation::lastYBin
int lastYBin
Definition: LxTBBinned.h:217
LxTbBinnedPoint::refId
Int_t refId
Definition: LxTBBinned.h:87
LxTbBinnedFinder::fSignalParticle
SignalParticle * fSignalParticle
Definition: LxTBBinned.h:527
LxTbBinnedTrdStation::LxTbBinnedTrdStation
LxTbBinnedTrdStation(const LxTbBinnedTrdStation &)=delete
LxTbBinnedPoint::operator=
LxTbBinnedPoint & operator=(const LxTbBinnedPoint &orig)=delete
LxTbBinnedPoint::use
bool use
Definition: LxTBBinned.h:85
LxTbBinnedFinder::Chain::points
LxTbBinnedPoint ** points
Definition: LxTBBinned.h:414
LxTbBinnedFinder::SignalParticle::fName
const char * fName
Definition: LxTBBinned.h:520
LxTbYXBin::~LxTbYXBin
~LxTbYXBin()
Definition: LxTBBinned.h:170
LxTbBinnedFinder::FindNeighbours
void FindNeighbours(scaltype x, scaltype wX, scaltype y, scaltype wY, timetype t, timetype wT, int layerIndex, std::list< LxTbBinnedPoint * > &results)
Definition: LxTBBinned.h:764
LxTbBinnedTrdStation::absorber
LxTbAbsorber absorber
Definition: LxTBBinned.h:281
LxTbBinnedFinder::fLastStationNumber
int fLastStationNumber
Definition: LxTBBinned.h:556
LxTbBinnedStation::lastXBin
int lastXBin
Definition: LxTBBinned.h:216
LxTbTYXBin
Definition: LxTBBinned.h:180
LxTbBinnedStation::Clear
void Clear()
Definition: LxTBBinned.h:262
LxTbBinnedStation::Q::Q22
scaltype Q22
Definition: LxTBBinned.h:208
LxTbBinnedPoint::mcRefs
std::list< PointDesc > mcRefs
Definition: LxTBBinned.h:100
LxTbBinnedRay::lPoint
const LxTbBinnedPoint * lPoint
Definition: LxTBBinned.h:61
scaltype
#define scaltype
Definition: CbmGlobalTrackingDefs.h:17
LxTbBinnedFinder::SetTSBegin
void SetTSBegin(unsigned long long tsLowBound)
Definition: LxTBBinned.h:654
LxTbBinnedFinder::maxT
timetype maxT
Definition: LxTBBinned.h:533
LxTbBinnedRay::dtxSq
scaltype dtxSq
Definition: LxTBBinned.h:63
LxTbBinnedFinder::triggerTimes_trd0_sign1_dist1
TriggerTimeArray triggerTimes_trd0_sign1_dist1
Definition: LxTBBinned.h:542
LxTbBinnedFinder::KFParamsCoord::C22
scaltype C22
Definition: LxTBBinned.h:339
LxTbBinnedStation::absorber
LxTbAbsorber absorber
Definition: LxTBBinned.h:224
LxTbBinnedFinder::minT
timetype minT
Definition: LxTBBinned.h:532
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
LxTbBinnedStation::nofTYXBins
int nofTYXBins
Definition: LxTBBinned.h:215
LxTbBinnedFinder::fTimeSliceLength
int fTimeSliceLength
Definition: LxTBBinned.h:560
LxTbTYXBin::~LxTbTYXBin
~LxTbTYXBin()
Definition: LxTBBinned.h:196
LxTbBinnedTrdStation::Zs
scaltype Zs[4]
Definition: LxTBBinned.h:269
LxTbBinnedRay::dtySq
scaltype dtySq
Definition: LxTBBinned.h:65
LxTbBinnedTrdStation::minX
scaltype minX
Definition: LxTBBinned.h:275
LxTbBinnedFinder::nofTrackBins
int nofTrackBins
Definition: LxTBBinned.h:535
LxTbAbsorber::zCoord
scaltype zCoord
Definition: LxTBMatEffs.h:23
LxTbTYXBin::yxBins
LxTbYXBin * yxBins
Definition: LxTBBinned.h:181
LxTbBinnedFinder::fNofStations
int fNofStations
Definition: LxTBBinned.h:555
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
LxTbTYXBin::Clear
void Clear()
Definition: LxTBBinned.h:198
LxTbBinnedFinder::SetSignalParticle
void SetSignalParticle(const char *name)
Definition: LxTBBinned.h:617
LxTbXBin::LxTbXBin
LxTbXBin()
Definition: LxTBBinned.h:148
LxTbYXBin::use
bool use
Definition: LxTBBinned.h:164
LxTbYXBin::Clear
void Clear()
Definition: LxTBBinned.h:172
NOF_SIGMAS
#define NOF_SIGMAS
Definition: LxTBBinned.h:52
LxTbBinnedStation::Q::Q12
scaltype Q12
Definition: LxTBBinned.h:208
LxTbBinnedFinder::Reconstruct
void Reconstruct()
Definition: LxTBBinned.h:844
LxTbBinnedFinder::ChainImpl
Definition: LxTBBinned.h:438
LxTbBinnedStation::Q
Definition: LxTBBinned.h:207
LxTbBinnedFinder::LxTbBinnedFinder
LxTbBinnedFinder(int nofTrdLayers, int nofStations, int nofTimeBins, std::pair< int, int > *nofSpatBins, int nofTrdXBins, int nofTrdYBins, int timeBinLength)
Definition: LxTBBinned.h:562
LxTbBinnedFinder::ChainImpl::chi2
scaltype chi2
Definition: LxTBBinned.h:441
LxTbBinnedFinder::Chain
Definition: LxTBBinned.h:413
LxTbBinnedStation::nofYBins
int nofYBins
Definition: LxTBBinned.h:214
LxTbBinnedFinder::ChainImpl::ChainImpl
ChainImpl(const LxTbBinnedPoint **pts, int nofPts, scaltype Chi2)
Definition: LxTBBinned.h:443
LxTbTYXBin::nofYXBins
int nofYXBins
Definition: LxTBBinned.h:182
LxTbBinnedFinder::Chain::Chain
Chain(const Chain &)=delete
LxTbBinnedFinder::TriggerBin
void TriggerBin(std::list< Chain * > &recoTracksBin, std::list< Chain * > &borderTracks, int i, bool handleBorder)
Definition: LxTBBinned.h:1350
LxTbBinnedFinder::TriggerTimeArray::Insert
void Insert(const std::pair< timetype, timetype > &v)
Definition: LxTBBinned.h:467
LxTbBinnedFinder::triggerTimes_trd0_sign0_dist1
TriggerTimeArray triggerTimes_trd0_sign0_dist1
Definition: LxTBBinned.h:540
LxTbBinnedStation::dispY
scaltype dispY
Definition: LxTBBinned.h:228
fullDuration
static long fullDuration
Definition: LxTBBinned.h:334
LxTbXBin::points
std::list< LxTbBinnedPoint > points
Definition: LxTBBinned.h:145
LxTbBinnedFinder::KFParamsCoord::C11
scaltype C11
Definition: LxTBBinned.h:339
LxTbYXBin::xBins
LxTbXBin * xBins
Definition: LxTBBinned.h:162
LxTbBinnedTrdStation::nofXBins
int nofXBins
Definition: LxTBBinned.h:270
LxTbBinnedFinder::Trigger
void Trigger()
Definition: LxTBBinned.h:1440
LxTbBinnedPoint::isTrd
bool isTrd
Definition: LxTBBinned.h:91
LxTbBinnedTrdStation::maxX
scaltype maxX
Definition: LxTBBinned.h:276
LxTbBinnedFinder::SignalParticle
Definition: LxTBBinned.h:519
LxTbBinnedFinder::TriggerTimeArray::~TriggerTimeArray
~TriggerTimeArray()
Definition: LxTBBinned.h:460
LxTbBinnedTrdStation::nofTYXBins
int nofTYXBins
Definition: LxTBBinned.h:272
LxTbBinnedPoint::dx
scaltype dx
Definition: LxTBBinned.h:80
LxTbBinnedStation::deltaThetaX
scaltype deltaThetaX
Definition: LxTBBinned.h:225
LxTbBinnedFinder::triggerEventNumber
std::set< Int_t > triggerEventNumber
Definition: LxTBBinned.h:552
LxTbYXBin::nofXBins
int nofXBins
Definition: LxTBBinned.h:163
LxTbBinnedStation::Q::Q11
scaltype Q11
Definition: LxTBBinned.h:208
LxTbXBin
Definition: LxTBBinned.h:144
LxTbBinnedTrdStation::nofYBins
int nofYBins
Definition: LxTBBinned.h:271
LxTbBinnedFinder::fHasTrd
bool fHasTrd
Definition: LxTBBinned.h:536
LxTbBinnedFinder::KFParams
Definition: LxTBBinned.h:342
LxTbBinnedFinder::triggerTimes_trd1_sign1_dist1
TriggerTimeArray triggerTimes_trd1_sign1_dist1
Definition: LxTBBinned.h:546
LxTbBinnedFinder::Chain::chi2
scaltype chi2
Definition: LxTBBinned.h:416
LxTbXBin::use
bool use
Definition: LxTBBinned.h:146
LxTbBinnedFinder::KFParams::yParams
KFParamsCoord yParams
Definition: LxTBBinned.h:344
LxTbBinnedFinder::fLastTimeBinNumber
int fLastTimeBinNumber
Definition: LxTBBinned.h:558
LxTbBinnedFinder::KFParamsCoord::tg
scaltype tg
Definition: LxTBBinned.h:339
LxTbBinnedFinder::Chain::highMom
bool highMom
Definition: LxTBBinned.h:417
LxTbBinnedFinder::KFParams::xParams
KFParamsCoord xParams
Definition: LxTBBinned.h:343
LxTbBinnedStation::operator=
LxTbBinnedStation & operator=(const LxTbBinnedStation &)=delete
LxTbBinnedStation::stationNumber
int stationNumber
Definition: LxTBBinned.h:211
LxTbBinnedFinder::TriggerTimeArray::tbLength
int tbLength
Definition: LxTBBinned.h:514
LxTbBinnedFinder::~LxTbBinnedFinder
virtual ~LxTbBinnedFinder()
Definition: LxTBBinned.h:610
LxTbBinnedFinder::TriggerTimeArray::triggerTimeBins
std::list< std::pair< timetype, timetype > > * triggerTimeBins
Definition: LxTBBinned.h:516
LxTbBinnedFinder::SignalParticle::fMinEnergy
scaltype fMinEnergy
Definition: LxTBBinned.h:522
LxTbBinnedFinder
Definition: LxTBBinned.h:336
LxTbBinnedFinder::Chain::nofPoints
int nofPoints
Definition: LxTBBinned.h:415
LxTbXBin::AddPoint
void AddPoint(const LxTbBinnedPoint &point)
Definition: LxTBBinned.h:158
LxTbBinnedStation::binSizeX
scaltype binSizeX
Definition: LxTBBinned.h:220
LxTbBinnedTrdStation::~LxTbBinnedTrdStation
~LxTbBinnedTrdStation()
Definition: LxTBBinned.h:321
LxTbBinnedFinder::triggerTimes_trd1_sign0_dist1
TriggerTimeArray triggerTimes_trd1_sign0_dist1
Definition: LxTBBinned.h:544
LxTbBinnedFinder::KFParamsCoord::C12
scaltype C12
Definition: LxTBBinned.h:339
LxTbBinnedStation::nofXBins
int nofXBins
Definition: LxTBBinned.h:213
LxTbBinnedStation::minX
scaltype minX
Definition: LxTBBinned.h:218
LxTbBinnedFinder::triggerTimes_trd0_sign1_dist0
TriggerTimeArray triggerTimes_trd0_sign1_dist0
Definition: LxTBBinned.h:541
LxTbYXBin::LxTbYXBin
LxTbYXBin(int nxbs)
Definition: LxTBBinned.h:166
LxTbBinnedRay::tx
scaltype tx
Definition: LxTBBinned.h:62
LxTbBinnedTrdStation::dispYs
scaltype dispYs[4]
Definition: LxTBBinned.h:285
LxTbBinnedFinder::triggerTimes_trd0_sign0_dist0
TriggerTimeArray triggerTimes_trd0_sign0_dist0
Definition: LxTBBinned.h:539
LxTbBinnedFinder::TriggerTimeArray::TriggerTimeArray
TriggerTimeArray(const TriggerTimeArray &)=delete
LxTbBinnedPoint::PointDesc::trackId
Int_t trackId
Definition: LxTBBinned.h:97
LxTbBinnedTrdStation
Definition: LxTBBinned.h:268
LxTbBinnedFinder::TriggerTimeArray::nofTimebins
int nofTimebins
Definition: LxTBBinned.h:513
LxTbBinnedTrdStation::operator=
LxTbBinnedTrdStation & operator=(const LxTbBinnedTrdStation &)=delete
LxTbBinnedStation::binSizeY
scaltype binSizeY
Definition: LxTBBinned.h:223
LxTbBinnedStation::deltaThetaY
scaltype deltaThetaY
Definition: LxTBBinned.h:226
LxTbBinnedFinder::particleDescs
static SignalParticle particleDescs[]
Definition: LxTBBinned.h:526
LxTbBinnedFinder::KFParamsCoord::coord
scaltype coord
Definition: LxTBBinned.h:339
LxTbBinnedPoint::y
scaltype y
Definition: LxTBBinned.h:81
CbmPixelHit.h
LxTbXBin::maxDx
scaltype maxDx
Definition: LxTBBinned.h:156
LxTbBinnedPoint::PointDesc
Definition: LxTBBinned.h:94
LxTbBinnedFinder::LxTbBinnedFinder
LxTbBinnedFinder(const LxTbBinnedFinder &)=delete
first
bool first
Definition: LKFMinuit.cxx:143
LxTbBinnedTrdStation::Clear
void Clear()
Definition: LxTBBinned.h:326
LxTbBinnedStation::z
scaltype z
Definition: LxTBBinned.h:212
LxTbBinnedFinder::Chain::Chain
Chain(const LxTbBinnedPoint *const *pts, int nofPts, scaltype Chi2)
Definition: LxTBBinned.h:419
LxTbBinnedFinder::TriggerTimeArray::TriggerTimeArray
TriggerTimeArray(int noftb, int tbl, timetype &mt)
Definition: LxTBBinned.h:452
LxTbBinnedFinder::KFParamsCoord
Definition: LxTBBinned.h:338
LxTbBinnedTrdStation::LxTbBinnedTrdStation
LxTbBinnedTrdStation(int nofxb, int nofyb, int noftb)
Definition: LxTBBinned.h:288
LxTbBinnedPoint::PointDesc::eventId
Int_t eventId
Definition: LxTBBinned.h:95
LxTbBinnedPoint::dy
scaltype dy
Definition: LxTBBinned.h:82
LxTbBinnedStation::maxY
scaltype maxY
Definition: LxTBBinned.h:222
LxTbBinnedRay::chi2
scaltype chi2
Definition: LxTBBinned.h:66
LxTbBinnedFinder::triggerTimes_trd1_sign1_dist0
TriggerTimeArray triggerTimes_trd1_sign1_dist0
Definition: LxTBBinned.h:545
LxTbBinnedFinder::trdStation
LxTbBinnedTrdStation trdStation
Definition: LxTBBinned.h:531
LxTbBinnedFinder::fNofTrdLayers
int fNofTrdLayers
Definition: LxTBBinned.h:537
LxTbBinnedFinder::triggerTimes_trd05_sign0_dist1
TriggerTimeArray triggerTimes_trd05_sign0_dist1
Definition: LxTBBinned.h:548
LxTbTYXBin::use
bool use
Definition: LxTBBinned.h:183
LxTbBinnedFinder::TriggerTimeArray::operator=
TriggerTimeArray & operator=(const TriggerTimeArray &)=delete
LxTbBinnedTrdStation::binSizeY
scaltype binSizeY
Definition: LxTBBinned.h:280
CalcThetaPrj
static scaltype CalcThetaPrj(scaltype E, scaltype x, const LxTbAbsorber *mat)
Definition: LxTBMatEffs.h:125
points
TClonesArray * points
Definition: Analyze_matching.h:18
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
LxTbBinnedTrdStation::lastXBin
int lastXBin
Definition: LxTBBinned.h:273
LxTbBinnedPoint::dt
timetype dt
Definition: LxTBBinned.h:84
LxTbBinnedPoint::LxTbBinnedPoint
LxTbBinnedPoint(const LxTbBinnedPoint &orig)=default
timetype
#define timetype
Definition: CbmGlobalTrackingDefs.h:18
LxTbBinnedStation::maxX
scaltype maxX
Definition: LxTBBinned.h:219
LxTbYXBin
Definition: LxTBBinned.h:161
LxTbTYXBin::LxTbTYXBin
LxTbTYXBin(const LxTbTYXBin &)=delete
LxTbBinnedRay
Definition: LxTBBinned.h:60
LxTbYXBin::operator=
LxTbYXBin & operator=(const LxTbYXBin &)=delete
LxTbAbsorber::width
scaltype width
Definition: LxTBMatEffs.h:24
LxTbBinnedFinder::ChainImpl::Destroy
void Destroy()
Definition: LxTBBinned.h:448
speedOfLight
Double_t speedOfLight
LxTbBinnedStation::Q::Q21
scaltype Q21
Definition: LxTBBinned.h:208
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
LxTbYXBin::LxTbYXBin
LxTbYXBin(const LxTbYXBin &)=delete
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
LxTbBinnedStation::qs
Q qs[2]
Definition: LxTBBinned.h:230
LxTbBinnedFinder::triggerTimes_trd05_sign1_dist1
TriggerTimeArray triggerTimes_trd05_sign1_dist1
Definition: LxTBBinned.h:550
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
LxTbAbsorber
Definition: LxTBMatEffs.h:22
LxTbBinnedStation::dispX
scaltype dispX
Definition: LxTBBinned.h:227
LxTbBinnedStation::minY
scaltype minY
Definition: LxTBBinned.h:221
LxTbBinnedFinder::SignalParticle::fPdgCode
int fPdgCode
Definition: LxTBBinned.h:521
LxTbBinnedFinder::triggerTimes_trd05_sign1_dist0
TriggerTimeArray triggerTimes_trd05_sign1_dist0
Definition: LxTBBinned.h:549
LxTbBinnedPoint::pHit
const CbmPixelHit * pHit
Definition: LxTBBinned.h:90
LxTbBinnedFinder::fTimeBinLength
int fTimeBinLength
Definition: LxTBBinned.h:559
CbmPixelHit
Definition: CbmPixelHit.h:21
LXTB_QA
#define LXTB_QA
Definition: LxTBDefinitions.h:18
LxTbBinnedFinder::Chain::operator=
Chain & operator=(const Chain &)=delete
LxTbBinnedStation::LxTbBinnedStation
LxTbBinnedStation(int nofxb, int nofyb, int noftb)
Definition: LxTBBinned.h:232
LxTbBinnedFinder::operator=
LxTbBinnedFinder & operator=(const LxTbBinnedFinder &)=delete
LxTbBinnedTrdStation::dispXs
scaltype dispXs[4]
Definition: LxTBBinned.h:284
LxTbBinnedFinder::KFParams::chi2
scaltype chi2
Definition: LxTBBinned.h:345
EnergyLoss
static scaltype EnergyLoss(scaltype E, scaltype L, const LxTbAbsorber *mat)
Definition: LxTBMatEffs.h:79
LxTbBinnedStation::LxTbBinnedStation
LxTbBinnedStation(const LxTbBinnedStation &)=delete
LxTbBinnedFinder::KFAddPoint
void KFAddPoint(KFParams &param, const KFParams &prevParam, scaltype m[2], scaltype V[2], int stationNumber)
Definition: LxTBBinned.h:383
LxTbBinnedFinder::recoTracks
std::list< Chain * > * recoTracks
Definition: LxTBBinned.h:534
LxTbBinnedStation
Definition: LxTBBinned.h:206
LxTBDefinitions.h
LxTbBinnedPoint::t
timetype t
Definition: LxTBBinned.h:83
LxTbBinnedPoint::neighbours
std::list< LxTbBinnedRay > neighbours
Definition: LxTBBinned.h:86
LxTbBinnedTrdStation::lastYBin
int lastYBin
Definition: LxTBBinned.h:274
LxTbBinnedFinder::Clear
void Clear()
Definition: LxTBBinned.h:628
LxTbBinnedRay::LxTbBinnedRay
LxTbBinnedRay(scaltype deltaZ, const LxTbBinnedPoint &rP, const LxTbBinnedPoint &lP, scaltype Chi2)
Definition: LxTBBinned.h:133
LxTbBinnedFinder::KFParamsCoord::C21
scaltype C21
Definition: LxTBBinned.h:339
LxTbBinnedPoint
Definition: LxTBBinned.h:78
LxTbBinnedFinder::SignalParticle::fHasTrd
bool fHasTrd
Definition: LxTBBinned.h:523
LxTBMatEffs.h
LxTbBinnedTrdStation::deltaThetaY
scaltype deltaThetaY
Definition: LxTBBinned.h:283
LxTbBinnedTrdStation::maxY
scaltype maxY
Definition: LxTBBinned.h:279
LxTbBinnedRay::ty
scaltype ty
Definition: LxTBBinned.h:64
LxTbBinnedFinder::ChainImpl::points
const LxTbBinnedPoint ** points
Definition: LxTBBinned.h:440
LxTbBinnedFinder::triggerTimes_trd1_sign0_dist0
TriggerTimeArray triggerTimes_trd1_sign0_dist0
Definition: LxTBBinned.h:543
LxTbBinnedStation::~LxTbBinnedStation
~LxTbBinnedStation()
Definition: LxTBBinned.h:260
LxTbBinnedTrdStation::minY
scaltype minY
Definition: LxTBBinned.h:278
LxTbBinnedStation::tyxBins
LxTbTYXBin * tyxBins
Definition: LxTBBinned.h:229
LxTbBinnedTrdStation::deltaThetaX
scaltype deltaThetaX
Definition: LxTBBinned.h:282
LxTbBinnedFinder::KFAddPointCoord
void KFAddPointCoord(KFParamsCoord &param, const KFParamsCoord &prevParam, scaltype m, scaltype V, scaltype &chi2, int stationNumber, int coordNumber)
Definition: LxTBBinned.h:348
LxTbBinnedTrdStation::tyxBinsArr
LxTbTYXBin * tyxBinsArr[4]
Definition: LxTBBinned.h:286
LxTbBinnedPoint::x
scaltype x
Definition: LxTBBinned.h:79
LxTbBinnedFinder::TriggerTimeArray::minT
timetype & minT
Definition: LxTBBinned.h:515
LxTbTYXBin::operator=
LxTbTYXBin & operator=(const LxTbTYXBin &)=delete
LxTbXBin::Clear
void Clear()
Definition: LxTBBinned.h:150
LxTbBinnedPoint::stationNumber
Int_t stationNumber
Definition: LxTBBinned.h:92
LxTbBinnedFinder::stations
LxTbBinnedStation * stations
Definition: LxTBBinned.h:529
LxTbBinnedPoint::LxTbBinnedPoint
LxTbBinnedPoint(scaltype X, scaltype Dx, scaltype Y, scaltype Dy, timetype T, timetype Dt, Int_t ri, bool Use)
Definition: LxTBBinned.h:103
LxTbBinnedFinder::Init
void Init()
Definition: LxTBBinned.h:656
LxTbBinnedFinder::FindChains
void FindChains(int stationIndex, const LxTbBinnedPoint *rPoint, const LxTbBinnedRay *, const LxTbBinnedPoint **points, KFParams kfParamsPrev, std::list< ChainImpl > &chains)
Definition: LxTBBinned.h:1315
LxTbBinnedFinder::TriggerTimeArray::Clear
void Clear()
Definition: LxTBBinned.h:462
LxTbBinnedFinder::Chain::~Chain
~Chain()
Definition: LxTBBinned.h:430
LxTbBinnedFinder::fNofTimeBins
int fNofTimeBins
Definition: LxTBBinned.h:557