CbmRoot
riplet/LxEff.cxx
Go to the documentation of this file.
1 #include "LxEff.h"
2 #include "Lx.h"
3 #include <cmath>
4 #include <set>
5 
6 //#define LXDRAW
7 
8 #ifdef LXDRAW
9 #include "LxDraw.h"
10 //#define LXDRAWSAVE
11 //#define LXDRAWWAIT
12 #endif //LXDRAW
13 
14 using namespace std;
15 
16 LxEff::LxEff(LxFinderTriplet& owner) : finder(owner) {}
17 
18 #ifdef CLUSTER_MODE
19 void LxEff::AnalyzeNotMatched(ofstream& out,
20  list<LxPoint*> hits[LXSTATIONS][LXLAYERS]) {
21  out << "AnalyzeNotMatched:" << endl;
22 
23  for (Int_t stNum = LXFIRSTSTATION; stNum < LXSTATIONS - 1; ++stNum) {
24  out << "Segments #" << stNum << endl;
25  list<LxPoint*> lHits[LXLAYERS] = hits[stNum];
26  list<LxPoint*> rHits[LXLAYERS] = hits[stNum + 1];
27 
28  Double_t maxDx = 0;
29  Double_t maxDy = 0;
30  Double_t maxDtx = 0;
31  Double_t maxDty = 0;
32  Double_t minDx = 1000;
33  Double_t minDy = 1000;
34  Double_t minDtx = 1000;
35  Double_t minDty = 1000;
36 
37  for (list<LxPoint*>::iterator l0 = lHits[0].begin(); l0 != lHits[0].end();
38  ++l0) {
39  for (list<LxPoint*>::iterator l1 = lHits[1].begin(); l1 != lHits[1].end();
40  ++l1) {
41  for (list<LxPoint*>::iterator l2 = lHits[2].begin();
42  l2 != lHits[2].end();
43  ++l2) {
44  for (list<LxPoint*>::iterator r0 = rHits[0].begin();
45  r0 != rHits[0].end();
46  ++r0) {
47  for (list<LxPoint*>::iterator r1 = rHits[1].begin();
48  r1 != rHits[1].end();
49  ++r1) {
50  for (list<LxPoint*>::iterator r2 = rHits[2].begin();
51  r2 != rHits[2].end();
52  ++r2) {
53  LxPoint* lPoints[LXLAYERS] = {*l0, *l1, *l2};
54  LxPoint* rPoints[LXLAYERS] = {*r0, *r1, *r2};
55  LxRay* rays[LXLAYERS * LXLAYERS] = {};
56 
57  for (Int_t i = 0; i < LXLAYERS; ++i) {
58  for (Int_t j = 0; j < LXLAYERS; ++j)
59  rays[j * LXLAYERS + i] =
60  new LxRay(rPoints[j], lPoints[i], j * LXLAYERS + i);
61  }
62 
63  for (Int_t i = 0; i < LXLAYERS * LXLAYERS; ++i) {
64  LxRay* ray1 = rays[i];
65  Double_t tx1 = ray1->tx;
66  Double_t ty1 = ray1->ty;
67  Double_t z1 = ray1->source->z;
68  Double_t x1 = ray1->source->x;
69  Double_t y1 = ray1->source->y;
70 
71  if (minDx > ray1->source->dx) minDx = ray1->source->dx;
72 
73  if (minDy > ray1->source->dy) minDy = ray1->source->dy;
74 
75  if (minDtx > ray1->dtx) minDtx = ray1->dtx;
76 
77  if (minDty > ray1->dty) minDty = ray1->dty;
78 
79  for (Int_t j = i; j < LXLAYERS * LXLAYERS; ++j) {
80  LxRay* ray2 = rays[j];
81  Double_t tx2 = ray2->tx;
82  Double_t ty2 = ray2->ty;
83  Double_t z2 = ray2->source->z;
84  Double_t diffZ = z1 - z2;
85  Double_t x2 = ray2->source->x + tx2 * diffZ;
86  Double_t y2 = ray2->source->y + ty2 * diffZ;
87 
88  Double_t dtx = abs(tx2 - tx1);
89  Double_t dty = abs(ty2 - ty1);
90  Double_t dx = abs(x2 - x1);
91  Double_t dy = abs(y2 - y1);
92 
93  if (maxDx < dx) maxDx = dx;
94 
95  if (maxDy < dy) maxDy = dy;
96 
97  if (maxDtx < dtx) maxDtx = dtx;
98 
99  if (maxDty < dty) maxDty = dty;
100  }
101  }
102 
103  for (Int_t i = 0; i < LXLAYERS * LXLAYERS; ++i)
104  delete rays[i];
105  }
106  }
107  }
108  }
109  }
110  }
111 
112  out << 4.0
113  * sqrt(minDx * minDx
114  + finder.caSpace.stations[stNum + 1]->clusterXLimit2)
115  - maxDx
116  << " "
117  << 4.0
118  * sqrt(minDy * minDy
119  + finder.caSpace.stations[stNum + 1]->clusterYLimit2)
120  - maxDy
121  << " "
122  << 4.0
123  * sqrt(minDtx * minDtx
124  + finder.caSpace.stations[stNum + 1]->clusterTxLimit2)
125  - maxDtx
126  << " "
127  << 4.0
128  * sqrt(minDty * minDty
129  + finder.caSpace.stations[stNum + 1]->clusterTyLimit2)
130  - maxDty
131  << endl
132  << endl;
133  }
134 }
135 
136 void LxEff::AnalyzeNotMatched2(ofstream& out,
137  list<LxPoint*> hits[LXSTATIONS][LXLAYERS]) {
138  out << "AnalyzeNotMatched2:" << endl;
139 
140  for (Int_t stNum = LXFIRSTSTATION; stNum < LXSTATIONS - 1; ++stNum) {
141  out << "Segments #" << stNum << " has ";
142  list<LxPoint*> lHits[LXLAYERS] = hits[stNum];
143  list<LxPoint*> rHits[LXLAYERS] = hits[stNum + 1];
144 
145  Int_t maxOccupiedLevels = 0;
146  Int_t maxNumPointsWithRays = 0;
147 
148  for (list<LxPoint*>::iterator l0 = lHits[0].begin(); l0 != lHits[0].end();
149  ++l0) {
150  for (list<LxPoint*>::iterator l1 = lHits[1].begin(); l1 != lHits[1].end();
151  ++l1) {
152  for (list<LxPoint*>::iterator l2 = lHits[2].begin();
153  l2 != lHits[2].end();
154  ++l2) {
155  for (list<LxPoint*>::iterator r0 = rHits[0].begin();
156  r0 != rHits[0].end();
157  ++r0) {
158  for (list<LxPoint*>::iterator r1 = rHits[1].begin();
159  r1 != rHits[1].end();
160  ++r1) {
161  for (list<LxPoint*>::iterator r2 = rHits[2].begin();
162  r2 != rHits[2].end();
163  ++r2) {
164  LxPoint* lPoints[LXLAYERS] = {*l0, *l1, *l2};
165  LxPoint* rPoints[LXLAYERS] = {*r0, *r1, *r2};
166  Int_t occupiedLevels = 0;
167  Int_t numPointsWithRays = 0;
168 
169  for (Int_t i = 0; i < LXLAYERS; ++i) {
170  LxPoint* rPoint = rPoints[i];
171 
172  if (!rPoint->rays.empty()) ++numPointsWithRays;
173 
174  for (Int_t j = 0; j < LXLAYERS; ++j) {
175  LxPoint* lPoint = lPoints[j];
176 
177  for (list<LxRay*>::iterator k = rPoint->rays.begin();
178  k != rPoint->rays.end();
179  ++k) {
180  LxRay* ray = *k;
181 
182  if (ray->end == lPoint) {
183  ++occupiedLevels;
184  break;
185  }
186  }
187  }
188  }
189 
190  if (occupiedLevels > maxOccupiedLevels)
191  maxOccupiedLevels = occupiedLevels;
192 
193  if (numPointsWithRays > maxNumPointsWithRays)
194  maxNumPointsWithRays = numPointsWithRays;
195  }
196  }
197  }
198  }
199  }
200  } // for (list<LxPoint*>::iterator l0 = lHits[0].begin(); l0 != lHits[0].end(); ++l0)
201 
202  out << maxOccupiedLevels << " of occupied levels and "
203  << maxNumPointsWithRays << " points with rays" << endl
204  << endl;
205  }
206 }
207 
208 void LxEff::DumpNotMatchedMC(list<LxPoint*> hits[LXSTATIONS][LXLAYERS]) {
209  AnalyzeNotMatched(finder.incomplete_events, hits);
210  AnalyzeNotMatched2(finder.incomplete_events, hits);
211  finder.incomplete_events << "Dumping not matched MC track" << endl;
212 
213  for (Int_t i = 0; i < LXSTATIONS; ++i) {
214  finder.incomplete_events << "S" << i << " ";
215 
216  for (Int_t j = 0; j < LXLAYERS; ++j) {
217  finder.incomplete_events << "L" << j << " ";
218 
219  for (list<LxPoint*>::iterator k = hits[i][j].begin();
220  k != hits[i][j].end();
221  ++k) {
222  LxPoint* point = *k;
223  finder.incomplete_events << "[";
224 
225  if (point->track)
226  finder.incomplete_events << "t";
227  else {
228  if (point->leftClusteredRay) finder.incomplete_events << "r";
229 
230  finder.incomplete_events << "/";
231 
232  if (point->rightClusteredRay) finder.incomplete_events << "r";
233  }
234 
235  finder.incomplete_events << "] ";
236  }
237 
238  finder.incomplete_events << " ";
239  }
240 
241  finder.incomplete_events << " ";
242  }
243 
244  finder.incomplete_events << endl << endl;
245 }
246 #endif //CLUSTER_MODE
247 
248 void LxEff::AnalyzeNotMatchedMC(ofstream& out,
249  list<LxPoint*> hits[LXSTATIONS][LXLAYERS]) {
250  out << "Not matched MC track:" << endl;
251  out << "All triplets: ";
252 
253  for (Int_t i = 0; i < LXSTATIONS; ++i) {
254  Int_t tripletsCount = 0;
255 
256  for (list<LxPoint*>::iterator j = hits[i][1].begin(); j != hits[i][1].end();
257  ++j) {
258  LxPoint* point = *j;
259  tripletsCount += point->triplets.size();
260  }
261 
262  out << "[" << tripletsCount << "]";
263  }
264 
265  out << endl << "True triplets: ";
266 
267  for (Int_t i = 0; i < LXSTATIONS; ++i) {
268  Int_t trueTripletsCount = 0;
269 
270  for (list<LxPoint*>::iterator j = hits[i][1].begin(); j != hits[i][1].end();
271  ++j) {
272  LxPoint* point = *j;
273 
274  for (list<LxTriplet*>::iterator k = point->triplets.begin();
275  k != point->triplets.end();
276  ++k) {
277  LxTriplet* triplet = *k;
278  LxPoint* lPoint = triplet->left;
279  LxPoint* rPoint = triplet->right;
280  bool trueLPoint = false;
281  bool trueRPoint = false;
282 
283  for (list<LxPoint*>::iterator l = hits[i][0].begin();
284  l != hits[i][0].end();
285  ++l) {
286  if (*l == lPoint) trueLPoint = true;
287  }
288 
289  for (list<LxPoint*>::iterator l = hits[i][2].begin();
290  l != hits[i][2].end();
291  ++l) {
292  if (*l == rPoint) trueRPoint = true;
293  }
294 
295  if (trueLPoint && trueRPoint) ++trueTripletsCount;
296  }
297  }
298 
299  out << "[" << trueTripletsCount << "]";
300  }
301 
302  out << endl << "Have neighbors: ";
303 
304  for (Int_t i = 0; i < LXSTATIONS; ++i) {
305  out << "[";
306 
307  if (0 == i)
308  out << " ";
309  else {
310  set<LxTriplet*> neighbours;
311 
312  for (list<LxPoint*>::iterator j = hits[i][1].begin();
313  j != hits[i][1].end();
314  ++j) {
315  LxPoint* rPoint = *j;
316 
317  for (list<LxTriplet*>::iterator k = rPoint->triplets.begin();
318  k != rPoint->triplets.end();
319  ++k) {
320  LxTriplet* rTriplet = *k;
321 
322  for (list<LxPoint*>::iterator l = hits[i - 1][1].begin();
323  l != hits[i - 1][1].end();
324  ++l) {
325  LxPoint* lPoint = *l;
326 
327  for (list<LxTriplet*>::iterator m = lPoint->triplets.begin();
328  m != lPoint->triplets.end();
329  ++m) {
330  LxTriplet* lTriplet = *m;
331 
332  for (list<pair<LxTriplet*, Double_t>>::iterator n =
333  rTriplet->neighbours.begin();
334  n != rTriplet->neighbours.end();
335  ++n) {
336  pair<LxTriplet*, Double_t>& tc2 = *n;
337 
338  if (tc2.first == lTriplet) neighbours.insert(lTriplet);
339  }
340  }
341  }
342  }
343  }
344 
345  out << neighbours.size();
346  }
347 
348  out << "]";
349  }
350 
351  Double_t maxCrDx[LXSTATIONS] = {};
352  Double_t crDxDx2[LXSTATIONS] = {};
353  Double_t maxCrDy[LXSTATIONS] = {};
354  Double_t crDyDy2[LXSTATIONS] = {};
355  Double_t maxClDx[LXSTATIONS] = {};
356  Double_t clDxDx2[LXSTATIONS] = {};
357  Double_t maxClDy[LXSTATIONS] = {};
358  Double_t clDyDy2[LXSTATIONS] = {};
359 
360  for (Int_t i = 0; i < LXSTATIONS; ++i) {
361  for (list<LxPoint*>::iterator j = hits[i][1].begin(); j != hits[i][1].end();
362  ++j) {
363  LxPoint* cPoint = *j;
364  Double_t cTx = cPoint->x / cPoint->z;
365  Double_t cTy = cPoint->y / cPoint->z;
366 
367  for (list<LxPoint*>::iterator k = hits[i][2].begin();
368  k != hits[i][2].end();
369  ++k) {
370  LxPoint* rPoint = *k;
371  Double_t crDeltaZ = rPoint->z - cPoint->z;
372  Double_t crTx = (rPoint->x - cPoint->x) / crDeltaZ;
373  Double_t crTy = (rPoint->y - cPoint->y) / crDeltaZ;
374  Double_t crDx = abs(rPoint->x - cPoint->x - cTx * crDeltaZ);
375  Double_t crDy = abs(rPoint->y - cPoint->y - cTy * crDeltaZ);
376 
377  if (maxCrDx[i] < crDx) {
378  maxCrDx[i] = crDx;
379  crDxDx2[i] = cPoint->dx * cPoint->dx + rPoint->dx * rPoint->dx;
380  }
381 
382  if (maxCrDy[i] < crDy) {
383  maxCrDy[i] = crDy;
384  crDyDy2[i] = cPoint->dy * cPoint->dy + rPoint->dy * rPoint->dy;
385  }
386 
387  for (list<LxPoint*>::iterator l = hits[i][0].begin();
388  l != hits[i][0].end();
389  ++l) {
390  LxPoint* lPoint = *l;
391  Double_t clDeltaZ = lPoint->z - cPoint->z;
392  Double_t clDx = abs(lPoint->x - cPoint->x - crTx * clDeltaZ);
393  Double_t clDy = abs(lPoint->y - cPoint->y - crTy * clDeltaZ);
394 
395  if (maxClDx[i] < clDx) {
396  maxClDx[i] = clDx;
397  clDxDx2[i] = lPoint->dx * lPoint->dx + cPoint->dx * cPoint->dx
398  + rPoint->dx * rPoint->dx;
399  }
400 
401  if (maxClDy[i] < clDy) {
402  maxClDy[i] = clDy;
403  clDyDy2[i] = lPoint->dy * lPoint->dy + cPoint->dy * cPoint->dy
404  + rPoint->dy * rPoint->dy;
405  }
406  }
407  }
408  }
409  }
410 
411  out << endl << "Triplet C-->R X dispersions: ";
412 
413  for (Int_t i = 0; i < LXSTATIONS; ++i)
414  out << "["
415  << maxCrDx[i]
416  / sqrt(finder.caSpace.stations[i]->xDispRight2 + crDxDx2[i])
417  << "]";
418 
419  out << endl << "Triplet C-->R Y dispersions: ";
420 
421  for (Int_t i = 0; i < LXSTATIONS; ++i)
422  out << "["
423  << maxCrDy[i]
424  / sqrt(finder.caSpace.stations[i]->yDispRight2 + crDyDy2[i])
425  << "]";
426 
427  out << endl << "Triplet C-->L X dispersions: ";
428 
429  for (Int_t i = 0; i < LXSTATIONS; ++i)
430  out << "["
431  << maxClDx[i] / sqrt(finder.caSpace.stations[i]->xDispRL2 + clDxDx2[i])
432  << "]";
433 
434  out << endl << "Triplet C-->L Y dispersions: ";
435 
436  for (Int_t i = 0; i < LXSTATIONS; ++i)
437  out << "["
438  << maxClDy[i] / sqrt(finder.caSpace.stations[i]->yDispRL2 + clDyDy2[i])
439  << "]";
440 
441  Double_t maxDx[LXSTATIONS - 1] = {};
442  Double_t dxDx2[LXSTATIONS - 1] = {};
443  Double_t maxDy[LXSTATIONS - 1] = {};
444  Double_t dyDy2[LXSTATIONS - 1] = {};
445  Double_t maxDtx[LXSTATIONS - 1] = {};
446  Double_t dtxDtx2[LXSTATIONS - 1] = {};
447  Double_t maxDty[LXSTATIONS - 1] = {};
448  Double_t dtyDty2[LXSTATIONS - 1] = {};
449 
450  for (Int_t i = 1; i < LXSTATIONS; ++i) {
451  for (list<LxPoint*>::iterator j = hits[i][1].begin(); j != hits[i][1].end();
452  ++j) {
453  LxPoint* rPoint = *j;
454 
455  for (list<LxPoint*>::iterator k = hits[i - 1][1].begin();
456  k != hits[i - 1][1].end();
457  ++k) {
458  LxPoint* lPoint = *k;
459  Double_t deltaZ = lPoint->z - rPoint->z;
460 
461  for (list<LxPoint*>::iterator l = hits[i][0].begin();
462  l != hits[i][0].end();
463  ++l) {
464  LxPoint* rPoint0 = *l;
465 
466  for (list<LxPoint*>::iterator m = hits[i][2].begin();
467  m != hits[i][2].end();
468  ++m) {
469  LxPoint* rPoint2 = *m;
470  Double_t rdz = rPoint2->z - rPoint0->z;
471  Double_t rdz2 = rdz * rdz;
472  Double_t rtx = (rPoint2->x - rPoint0->x) / rdz;
473  Double_t rty = (rPoint2->y - rPoint0->y) / rdz;
474  Double_t rdtx2 = (rPoint0->dx2 + rPoint2->dx2) / rdz2;
475  Double_t rdty2 = (rPoint0->dy2 + rPoint2->dy2) / rdz2;
476 
477 #ifdef OUT_DISP_BY_TRIPLET_DIR
478  Double_t dx = abs(lPoint->x - rPoint->x - rtx * deltaZ);
479  Double_t dy = abs(lPoint->y - rPoint->y - rty * deltaZ);
480 #else //OUT_DISP_BY_TRIPLET_DIR
481  Double_t dx =
482  abs(lPoint->x - rPoint->x - deltaZ * rPoint->x / rPoint->z);
483  Double_t dy =
484  abs(lPoint->y - rPoint->y - deltaZ * rPoint->y / rPoint->z);
485 #endif //OUT_DISP_BY_TRIPLET_DIR
486 
487  if (dx > maxDx[i - 1]) {
488  maxDx[i - 1] = dx;
489  dxDx2[i - 1] = lPoint->dx2 + rPoint->dx2;
490  }
491 
492  if (dy > maxDy[i - 1]) {
493  maxDy[i - 1] = dy;
494  dyDy2[i - 1] = lPoint->dy2 + rPoint->dy2;
495  }
496 
497  for (list<LxPoint*>::iterator n = hits[i - 1][0].begin();
498  n != hits[i - 1][0].end();
499  ++n) {
500  LxPoint* lPoint0 = *n;
501 
502  for (list<LxPoint*>::iterator o = hits[i - 1][2].begin();
503  o != hits[i - 1][2].end();
504  ++o) {
505  LxPoint* lPoint2 = *o;
506  Double_t ldz = lPoint2->z - lPoint0->z;
507  Double_t ldz2 = ldz * ldz;
508  Double_t ltx = (lPoint2->x - lPoint0->x) / ldz;
509  Double_t lty = (lPoint2->y - lPoint0->y) / ldz;
510  Double_t ldtx2 = (lPoint0->dx2 + lPoint2->dx2) / ldz2;
511  Double_t ldty2 = (lPoint0->dy2 + lPoint2->dy2) / ldz2;
512 
513  Double_t dtx = abs(ltx - rtx);
514  Double_t dty = abs(lty - rty);
515 
516  if (dtx > maxDtx[i - 1]) {
517  maxDtx[i - 1] = dtx;
518  dtxDtx2[i - 1] = rdtx2 + ldtx2;
519  }
520 
521  if (dty > maxDty[i - 1]) {
522  maxDty[i - 1] = dty;
523  dtyDty2[i - 1] = rdty2 + ldty2;
524  }
525  }
526  }
527  }
528  }
529  }
530  }
531  }
532 
533  out << endl << "X dispersions: ";
534 
535  for (Int_t i = 0; i < LXSTATIONS - 1; ++i)
536 #ifdef OUT_DISP_BY_TRIPLET_DIR
537  out << "["
538  << maxDx[i]
539  / sqrt(finder.caSpace.stations[i + 1]->xOutDispTriplet2 + dxDx2[i])
540  << "]";
541 #else //OUT_DISP_BY_TRIPLET_DIR
542  out << "["
543  << maxDx[i]
544  / sqrt(finder.caSpace.stations[i + 1]->xOutDispVertex2 + dxDx2[i])
545  << "]";
546 #endif //OUT_DISP_BY_TRIPLET_DIR
547 
548  out << endl << "Y dispersions: ";
549 
550  for (Int_t i = 0; i < LXSTATIONS - 1; ++i)
551 #ifdef OUT_DISP_BY_TRIPLET_DIR
552  out << "["
553  << maxDy[i]
554  / sqrt(finder.caSpace.stations[i + 1]->yOutDispTriplet2 + dyDy2[i])
555  << "]";
556 #else //OUT_DISP_BY_TRIPLET_DIR
557  out << "["
558  << maxDy[i]
559  / sqrt(finder.caSpace.stations[i + 1]->yOutDispVertex2 + dyDy2[i])
560  << "]";
561 #endif //OUT_DISP_BY_TRIPLET_DIR
562 
563  out << endl << "Tx dispersions: ";
564 
565  for (Int_t i = 0; i < LXSTATIONS - 1; ++i)
566  out << "["
567  << maxDtx[i]
568  / sqrt(finder.caSpace.stations[i + 1]->txInterTripletBreak2
569  + dtxDtx2[i])
570  << "]";
571 
572  out << endl << "Ty dispersions: ";
573 
574  for (Int_t i = 0; i < LXSTATIONS - 1; ++i)
575  out << "["
576  << maxDty[i]
577  / sqrt(finder.caSpace.stations[i + 1]->tyInterTripletBreak2
578  + dtyDty2[i])
579  << "]";
580 
581  out << endl;
582 }
583 
584 static Double_t InterLinesDist(LxTrack* track1, LxTrack* track2) {
585  LxTriplet* triplet1 = track1->branches[0];
586  LxPoint* point1 = triplet1->center;
587  Double_t x1 = point1->x;
588  Double_t y1 = point1->y;
589  Double_t z1 = point1->z;
590 
591  //Double_t tx1 = point1->x / point1->z;
592  //Double_t delta1 = triplet1->tx - tx1;
593 
594  Double_t ax = triplet1->tx; // - 2 * delta1;
595  Double_t ay = triplet1->ty;
596  Double_t az = 1.0;
597 
598  LxTriplet* triplet2 = track2->branches[0];
599  LxPoint* point2 = triplet2->center;
600  Double_t x2 = point2->x;
601  Double_t y2 = point2->y;
602  Double_t z2 = point2->z;
603 
604  //Double_t tx2 = point2->x / point2->z;
605  //Double_t delta2 = triplet2->tx - tx2;
606 
607  Double_t bx = triplet2->tx; // - 2 * delta2;
608  Double_t by = triplet2->ty;
609  Double_t bz = 1.0;
610 
611  Double_t A = ay * bz - az * by;
612  Double_t B = az * bx - ax * bz;
613  Double_t C = ax * by - ay * bx;
614  Double_t P = A * x2 + B * y2 + C * z2;
615 
616  Double_t ABCLen = sqrt(A * A + B * B + C * C);
617 
618  Double_t cosA = A / ABCLen;
619  Double_t cosB = B / ABCLen;
620  Double_t cosC = C / ABCLen;
621  Double_t p = P / ABCLen;
622  Double_t interTrackDistance = abs(cosA * x1 + cosB * y1 + cosC * z1 - p);
623 
624  return interTrackDistance;
625 }
626 
627 static Double_t RecoTrackChi2(LxTrack* recoTrack) {
628  Double_t breakChi2 = 0;
629 
630  for (Int_t j = recoTrack->length - 1; j > 0; --j) {
631  LxTriplet* rTriplet = recoTrack->branches[j];
632  LxTriplet* lTriplet = recoTrack->branches[j - 1];
633 
634  LxStation* station = rTriplet->center->layer->station;
635  breakChi2 +=
636  (lTriplet->tx - rTriplet->tx) * (lTriplet->tx - rTriplet->tx)
637  / (station->txInterTripletBreak2 + lTriplet->dtx2 + rTriplet->dtx2)
638  + (lTriplet->ty - rTriplet->ty) * (lTriplet->ty - rTriplet->ty)
639  / (station->tyInterTripletBreak2 + lTriplet->dty2 + rTriplet->dty2);
640  }
641 
642  breakChi2 /= 2 * (recoTrack->length - 1);
643 
644  return breakChi2;
645 }
646 
647 void LxEff::CalcRecoEff(bool joinExt) {
648  Double_t result = 0;
649  static Int_t signalRecoTracks = 0;
650  static Int_t signalMCTracks = 0;
651  // static Int_t bgrRecoTracks = 0;
652  // static Int_t bgrMCTracks = 0;
653  static Int_t mc2recoZeroMatched = 0;
654  static Int_t mc2recoIncomplete = 0;
655 
656  bool hasPositiveMCTrack = false;
657  bool hasNegativeMCTrack = false;
658 
659  for (vector<LxMCTrack>::iterator i = finder.MCTracks.begin();
660  i != finder.MCTracks.end();
661  ++i) {
662  LxMCTrack& mcTrack = *i;
663  Int_t pdgCode = mcTrack.pdg;
664  map<LxTrack*, Int_t>
665  recoTracks; // Mapped value is the number of common points in MC and reconstructed tracks.
666  memset(mcTrack.hitsOnStations, 0, sizeof(mcTrack.hitsOnStations));
667  bool isSignal = true;
668  list<LxPoint*> mcTrackHits[LXSTATIONS][LXLAYERS];
669 
670  for (vector<LxMCPoint*>::iterator j = mcTrack.Points.begin();
671  j != mcTrack.Points.end();
672  ++j) {
673  LxMCPoint* pMCPoint = *j;
674 
675  for (list<LxPoint*>::iterator k = pMCPoint->lxPoints.begin();
676  k != pMCPoint->lxPoints.end();
677  ++k) {
678  LxPoint* point = *k;
679  mcTrack.hitsOnStations[point->layer->station->stationNumber]
680  [point->layer->layerNumber] = true;
681  mcTrackHits[point->layer->station->stationNumber]
682  [point->layer->layerNumber]
683  .push_back(point);
684  LxTrack* track = point->track;
685 
686  if (0 == track) continue;
687 
688  if (track->matched) continue;
689 
690  if (track->clone) continue;
691 
692  map<LxTrack*, int>::iterator l = recoTracks.find(track);
693 
694  if (l != recoTracks.end())
695  ++(l->second);
696  else
697  recoTracks[track] = 1;
698  }
699  }
700 
701  bool enoughHits = true;
702  mcTrack.stationsWithHits = 0;
703  mcTrack.layersWithHits = 0;
704 
705  for (Int_t j = 0; j < LXSTATIONS; ++j) {
706  Int_t hitsOnSt = 0;
707 
708  for (Int_t k = 0; k < LXLAYERS; ++k) {
709  if (mcTrack.hitsOnStations[j][k]) {
710  ++hitsOnSt;
711  ++mcTrack.layersWithHits;
712  }
713  }
714 
715  if (hitsOnSt < 3) {
716  if (j < finder.caSpace.stationsInAlgo) enoughHits = false;
717  } else
718  ++mcTrack.stationsWithHits;
719  }
720 
721  Double_t pt2 = mcTrack.px * mcTrack.px + mcTrack.py * mcTrack.py;
722 
723  if (!enoughHits || mcTrack.mother_ID >= 0
724  || (pdgCode != 13 && pdgCode != -13)
725  || (finder.pPtCut && (mcTrack.p < 3.0 || pt2 < 1.0)))
726  isSignal = false;
727  else
728  ++signalMCTracks;
729 
730  if (isSignal) {
731  if (-13 == pdgCode)
732  hasPositiveMCTrack = true;
733  else
734  hasNegativeMCTrack = true;
735  }
736 
737  LxTrack* matchTrack = 0;
738  Int_t matchedPoints = 0;
739 
740  for (map<LxTrack*, Int_t>::iterator j = recoTracks.begin();
741  j != recoTracks.end();
742  ++j) {
743  if (0 == matchTrack || matchedPoints < j->second) {
744  matchTrack = j->first;
745  matchedPoints = j->second;
746  }
747  }
748 
749  if (0 == matchTrack) {
750 #ifdef MAKE_EFF_CALC
751  //finder.incomplete_events << finder.eventNumber << " matched points: " << matchedPoints << " ; MC points: " << mcTrack.Points.size() << endl;
752  //finder.caSpace.CheckArray(finder.incomplete_events, mcTrack);
753 #endif //MAKE_EFF_CALC \
754  //cout << "MC track does not have common point with a reconstructed" << endl;
755  if (isSignal) {
756  ++mc2recoZeroMatched;
758  }
759 
760 #ifdef CLUSTER_MODE
761  if (isSignal) DumpNotMatchedMC(mcTrackHits);
762 #endif //CLUSTER_MODE
763 
764  continue;
765  }
766 
767  Int_t numberOfMuchMCPoints = LXLAYERS * finder.caSpace.stationsInAlgo;
768 
769  if (matchedPoints < 0.7 * numberOfMuchMCPoints) {
770 #ifdef MAKE_EFF_CALC
771  //finder.incomplete_events << finder.eventNumber << " matched points: " << matchedPoints << " ; MC points: " << mcTrack.Points.size() << endl;
772  //finder.caSpace.CheckArray(finder.incomplete_events, mcTrack);
773 #endif //MAKE_EFF_CALC \
774  //cout << "MC track have only " << matchedPoints << " common points with reconstructed" << endl;
775  if (isSignal) {
776  ++mc2recoIncomplete;
778  }
779 
780 #ifdef CLUSTER_MODE
781  if (isSignal) DumpNotMatchedMC(mcTrackHits);
782 #endif //CLUSTER_MODE
783 
784  continue;
785  }
786 
787  matchTrack->mcTrack = &mcTrack;
788  matchTrack->matched = true;
789 
790  if (!isSignal) continue;
791 
792 #ifdef CALC_LINK_WITH_STS_EFF
793  if (0 != matchTrack && matchedPoints >= 0.7 * numberOfMuchMCPoints)
794  matchTrack->mcTracks.push_back(&mcTrack);
795 #endif //CALC_LINK_WITH_STS_EFF
796 
797  if (!joinExt)
798  ++signalRecoTracks;
799  else {
800  if (0 == matchTrack->externalTrack) {
801  if (0 == mcTrack.externalTrack) ++signalRecoTracks;
802  } else if (matchTrack->externalTrack->track == mcTrack.externalTrack)
803  ++signalRecoTracks;
804  }
805  }
806 
807  result = 100 * signalRecoTracks;
808  result /= signalMCTracks;
809 
810 #ifdef MAKE_EFF_CALC
811  //if (foundNow != mcNow)
812  //finder.incomplete_events << finder.eventNumber << endl;
813 #endif //MAKE_EFF_CALC
814 
815  cout << "LxEff::CalcRecoEff signal efficiency: " << result << "( "
816  << signalRecoTracks << " / " << signalMCTracks << " )" << endl;
817  cout << "LxEff::CalcRecoEff: zero-matched: " << mc2recoZeroMatched
818  << ", incomplete: " << mc2recoIncomplete << endl;
819 
820  bool hasPositiveTrack = false;
821  bool hasNegativeTrack = false;
822 
823  for (list<LxTrack*>::iterator i = finder.caSpace.tracks.begin();
824  i != finder.caSpace.tracks.end();
825  ++i) {
826  LxTrack* recoTrack = *i;
827 
828  if (recoTrack->clone) continue;
829 
830  //if (recoTrack->length > finder.caSpace.stationsInAlgo)
831  //continue;
832 
833  LxTriplet* firstTriplet = recoTrack->branches[0];
834  LxPoint* firstPoint = firstTriplet->center;
835  Double_t particleSign = firstTriplet->tx - firstPoint->x / firstPoint->z;
836  LxTriplet* secondTriplet = recoTrack->branches[1];
837  LxPoint* secondPoint = secondTriplet->center;
838  Double_t tx =
839  (secondPoint->x - firstPoint->x) / (secondPoint->z - firstPoint->z);
840  Double_t particleSign2 = tx - firstPoint->x / firstPoint->z;
841  // Double_t yAtZ0 = firstPoint->y - firstTriplet->ty * firstPoint->z;
842  // Double_t breakChi2 = RecoTrackChi2(recoTrack);
843 
844  //if (-9 <= yAtZ0 && 9 >= yAtZ0)
845  //if (breakChi2 <= 3)
846  {
847  if (particleSign > 0 && particleSign2 > 0)
848  hasPositiveTrack = true;
849  else if (particleSign < 0 && particleSign2 < 0)
850  hasNegativeTrack = true;
851  }
852  }
853 
854  static Int_t numberOfJpsi = 0;
855 
856  if (hasPositiveTrack && hasNegativeTrack) ++numberOfJpsi;
857 
858  static Int_t numberOfMCJpsi = 0;
859  static Int_t numberOfTrueJpsi = 0;
860 
861  if (hasPositiveMCTrack && hasNegativeMCTrack) {
862  ++numberOfMCJpsi;
863 
864  if (hasPositiveTrack && hasNegativeTrack) ++numberOfTrueJpsi;
865  }
866 
867  cout << "LxEff::CalcRecoEff: number of J/Psi hypoteses " << numberOfJpsi
868  << endl;
869  result = 100 * numberOfTrueJpsi;
870  result /= numberOfMCJpsi;
871  cout << "LxEff::CalcRecoEff: J/Psi efficiency " << result << " % ( "
872  << numberOfTrueJpsi << " / " << numberOfMCJpsi << " )" << endl;
873 
874  return;
875 
876  // The code below is mostly dedicated to counting ghosts.
877  static Int_t recoTracks = 0;
878  static Int_t matchedMCTracks = 0;
879  static Int_t completeleyUnmatched = 0;
880  static Int_t notEnoughPoints = 0;
881  static Int_t notEnoughStations = 0;
882  static Int_t incompleteStations[LXSTATIONS] = {};
883  static Int_t doesntHaveStsPart = 0;
884  static Int_t doesntHaveStsPart1 = 0;
885  static Int_t doesntHaveStsPart2 = 0;
886  static Int_t unmatchedButHaveStsPart = 0;
887 
888  for (list<LxTrack*>::iterator i = finder.caSpace.tracks.begin();
889  i != finder.caSpace.tracks.end();
890  ++i) {
891  //++recoTracks;
892  LxTrack* recoTrack = *i;
893 
894  if (recoTrack->clone) continue;
895 
896  map<LxMCTrack*, Int_t>
897  mcTracks; // Mapped value is the number of common points in MC and reconstructed tracks.
898 
899 #ifdef CLUSTER_MODE
900  for (Int_t ii = 0; ii < recoTrack->length; ++ii) {
901  LxRay* ray = recoTrack->rays[ii];
902 
903  for (list<LxPoint*>::iterator j = ray->clusterPoints.begin();
904  j != ray->clusterPoints.end();
905  ++j) {
906  LxPoint* recoPoint = *j;
907 #else //CLUSTER_MODE
908  for (Int_t j = 0; j < finder.caSpace.stationsInAlgo * LXLAYERS; ++j) {
909  LxPoint* recoPoint = recoTrack->points[j];
910 #endif //CLUSTER_MODE
911 
912  if (0 == recoPoint) continue;
913 
914  for (list<LxMCPoint*>::iterator k = recoPoint->mcPoints.begin();
915  k != recoPoint->mcPoints.end();
916  ++k) {
917  LxMCPoint* mcPoint = *k;
918  LxMCTrack* mcTrack = mcPoint->track;
919 
920  if (0 == mcTrack) continue;
921 
922  map<LxMCTrack*, Int_t>::iterator mcIter = mcTracks.find(mcTrack);
923 
924  if (mcIter == mcTracks.end())
925  mcTracks[mcTrack] = 1;
926  else
927  ++(mcIter->second);
928  }
929 #ifdef CLUSTER_MODE
930  }
931 #endif //CLUSTER_MODE
932  } // for (Int_t j = 0; j < (LXSTATIONS - LXFIRSTSTATION) * LXLAYERS; ++j)
933 
934  LxMCTrack* bestMatch = 0;
935  Int_t matchedPoints = 0;
936 
937  for (map<LxMCTrack*, Int_t>::iterator j = mcTracks.begin();
938  j != mcTracks.end();
939  ++j) {
940  if (0 == bestMatch || j->second > matchedPoints) {
941  bestMatch = j->first;
942  matchedPoints = j->second;
943  }
944  }
945 
946  if (0 == bestMatch) {
947  ++completeleyUnmatched;
948  cout << "This reconstructed track is not intersected with any MC track "
949  "in any point"
950  << endl;
951 
952  if (!joinExt || 0 != recoTrack->externalTrack) ++recoTracks;
953 
954  continue;
955  }
956 
957  ++recoTracks;
958 
959  bool unmatched = false;
960 
961  if (matchedPoints < 0.7 * finder.caSpace.stationsInAlgo * LXLAYERS) {
962  ++notEnoughPoints;
963  cout << "This reconstructed track match with an MC track in only "
964  << matchedPoints << "points" << endl;
965  unmatched = true;
966  }
967 
968  if (bestMatch->stationsWithHits < finder.caSpace.stationsInAlgo) {
969  ++notEnoughStations;
970 
971 #ifdef LXDRAW
972  LxDraw drawer;
973  drawer.ClearView();
974  drawer.DrawInputHits();
975  drawer.DrawMCTracks();
976  drawer.DrawRays();
977 
978 #ifdef LXDRAWSAVE
979  char drawSaveName[64];
980  sprintf(drawSaveName, "MC_Rays_%d_", finder.eventNumber);
981  drawer.SaveCanvas(drawSaveName);
982 #endif //LXDRAWSAVE
983 
984 #ifdef LXDRAWWAIT
985  gPad->WaitPrimitive();
986 #endif //LXDRAWWAIT
987 #endif //LXDRAW
988 
989  for (Int_t j = 0; j < finder.caSpace.stationsInAlgo; ++j) {
990  Int_t hitsOnStation = 0;
991 
992  for (Int_t k = 0; k < LXLAYERS; ++k) {
993  if (bestMatch->hitsOnStations[j][k]) ++hitsOnStation;
994  }
995 
996  if (hitsOnStation < 3) ++incompleteStations[j];
997  }
998 
999  cout << "The matched MC track has hits not on all stations. Only on: "
1000  << bestMatch->stationsWithHits << endl;
1001  unmatched = true;
1002  }
1003 
1004  if (0 == bestMatch->externalTrack) {
1005  ++doesntHaveStsPart;
1006 
1007  if (unmatched)
1008  ++doesntHaveStsPart1;
1009  else
1010  ++doesntHaveStsPart2;
1011  }
1012 
1013  if (!unmatched) {
1014  if (!joinExt)
1015  ++matchedMCTracks;
1016  else {
1017  if (0 == recoTrack->externalTrack) {
1018  if (0 == bestMatch->externalTrack)
1019  ++matchedMCTracks;
1020  else
1021  cout << "LxEff::CalcRecoEff: STS track not found" << endl;
1022  } else {
1023  if (bestMatch->externalTrack == recoTrack->externalTrack->track)
1024  ++matchedMCTracks;
1025  else
1026  cout << "LxEff::CalcRecoEff: STS track determined wrongly" << endl;
1027  }
1028  }
1029  } else if (0 != bestMatch->externalTrack)
1030  ++unmatchedButHaveStsPart;
1031  } // for (list<LxTrack*>::iterator i = finder.caSpace.tracks.begin(); i != finder.caSpace.tracks.end(); ++i)
1032 
1033  result = 100 * matchedMCTracks;
1034  result /= recoTracks;
1035  cout << "LxEff::CalcRecoEff matching reconstucted efficiency: " << result
1036  << "( " << matchedMCTracks << " / " << recoTracks << " )" << endl;
1037  cout << "LxEff::CalcRecoEff 0-matched: " << completeleyUnmatched
1038  << ", not enough points: " << notEnoughPoints
1039  << ", not enough stations: " << notEnoughStations << " : ";
1040 
1041  for (Int_t i = 0; i < finder.caSpace.stationsInAlgo; ++i)
1042  cout << "[" << incompleteStations[i] << "]";
1043 
1044  cout << endl;
1045  cout << "LxEff::CalcRecoEff doesn't have an STS part: " << doesntHaveStsPart
1046  << ", unmatched: " << doesntHaveStsPart1
1047  << ", matched: " << doesntHaveStsPart2 << endl;
1048  cout << "LxEff::CalcRecoEff unmatched but have an STS part: "
1049  << unmatchedButHaveStsPart << endl;
1050 } // void LxEff::CalcRecoEff(bool joinExt)
1051 
1053  static Int_t recoTracks = 0;
1054  static Int_t matchedTracks = 0;
1055  LxTrack* positiveSignal = 0;
1056  Double_t positiveDelta = 0;
1057  Double_t negativeDelta = 0;
1058  LxTrack* negativeSignal = 0;
1059  list<LxTrack*> positiveBgrs;
1060  list<LxTrack*> negativeBgrs;
1061 
1062  for (list<LxTrack*>::iterator i = caSpace.tracks.begin();
1063  i != caSpace.tracks.end();
1064  ++i) {
1065  LxTrack* recoTrack = *i;
1066 
1067  if (recoTrack->clone) continue;
1068 
1069  ++recoTracks;
1070 
1071  map<LxMCTrack*, Int_t>
1072  mcTracks; // Mapped value is the number of common points in MC and reconstructed tracks.
1073 
1074  for (Int_t j = 0; j < caSpace.stationsInAlgo * LXLAYERS; ++j) {
1075  LxPoint* recoPoint = recoTrack->points[j];
1076 
1077  if (0 == recoPoint) continue;
1078 
1079  for (list<LxMCPoint*>::iterator k = recoPoint->mcPoints.begin();
1080  k != recoPoint->mcPoints.end();
1081  ++k) {
1082  LxMCPoint* mcPoint = *k;
1083  LxMCTrack* mcTrack = mcPoint->track;
1084 
1085  if (0 == mcTrack) continue;
1086 
1087  map<LxMCTrack*, Int_t>::iterator mcIter = mcTracks.find(mcTrack);
1088 
1089  if (mcIter == mcTracks.end())
1090  mcTracks[mcTrack] = 1;
1091  else
1092  ++(mcIter->second);
1093  } // for (list<LxMCPoint*>::iterator k = recoPoint->mcPoints.begin(); k != recoPoint->mcPoints.end(); ++k)
1094  } // for (Int_t j = 0; j < caSpace.stationsInAlgo * LXLAYERS; ++j)
1095 
1096  LxMCTrack* bestMatch = 0;
1097  Int_t matchedPoints = 0;
1098 
1099  for (map<LxMCTrack*, Int_t>::iterator j = mcTracks.begin();
1100  j != mcTracks.end();
1101  ++j) {
1102  if (0 == bestMatch || j->second > matchedPoints) {
1103  bestMatch = j->first;
1104  matchedPoints = j->second;
1105  }
1106  }
1107 
1108  LxTriplet* firstTriplet = recoTrack->branches[0];
1109  LxPoint* firstPoint = firstTriplet->center;
1110  Double_t particleSign = firstTriplet->tx - firstPoint->x / firstPoint->z;
1111  Double_t yAtZ0 = firstPoint->y - firstTriplet->ty * firstPoint->z;
1112  LxTriplet* secondTriplet = recoTrack->branches[1];
1113  LxPoint* secondPoint = secondTriplet->center;
1114  Double_t yAtZ0_2 = firstPoint->y
1115  - firstPoint->z * (secondPoint->y - firstPoint->y)
1116  / (secondPoint->z - firstPoint->z);
1117  Double_t breakChi2 = RecoTrackChi2(recoTrack);
1118 
1119  if (0 == bestMatch
1120  || matchedPoints < 0.7 * caSpace.stationsInAlgo * LXLAYERS) {
1121  if (particleSign > 0)
1122  positiveBgrs.push_back(recoTrack);
1123  else if (particleSign < 0)
1124  negativeBgrs.push_back(recoTrack);
1125 
1126  bgrYAtZ0->Fill(yAtZ0);
1127  bgrYAtZ0_2->Fill(yAtZ0_2);
1128  backgroundChi2Histo->Fill(breakChi2);
1129 
1130  continue;
1131  }
1132 
1133  ++matchedTracks;
1134 
1135  if (0 > bestMatch->mother_ID
1136  && (-13 == bestMatch->pdg || 13 == bestMatch->pdg)) {
1137  if (particleSign > 0 && -13 == bestMatch->pdg) {
1138  positiveSignal = recoTrack;
1139  positiveDelta = particleSign;
1140  } else if (particleSign < 0 && 13 == bestMatch->pdg) {
1141  negativeSignal = recoTrack;
1142  negativeDelta = particleSign;
1143  }
1144 
1145  signalYAtZ0->Fill(yAtZ0);
1146  signalYAtZ0_2->Fill(yAtZ0_2);
1147  signalChi2Histo->Fill(breakChi2);
1148  } else {
1149  if (particleSign > 0)
1150  positiveBgrs.push_back(recoTrack);
1151  else if (particleSign < 0)
1152  negativeBgrs.push_back(recoTrack);
1153 
1154  bgrYAtZ0->Fill(yAtZ0);
1155  bgrYAtZ0_2->Fill(yAtZ0_2);
1156  backgroundChi2Histo->Fill(breakChi2);
1157  }
1158  } // for (list<LxTrack*>::iterator i = caSpace.tracks.begin(); i != caSpace.tracks.end(); ++i)
1159 
1160  Double_t result = 100 * matchedTracks;
1161  result /= recoTracks;
1162  cout << "LxFinderTriplet::MatchRecoToMC(): efficiency: " << result << " % ( "
1163  << matchedTracks << " / " << recoTracks << " )" << endl;
1164 
1165  if (0 != positiveSignal && 0 != negativeSignal) {
1166  signalInterTracksDistance->Fill(
1167  InterLinesDist(positiveSignal, negativeSignal));
1168  signalSignDefect->Fill(positiveDelta + negativeDelta);
1169  }
1170 
1171  LxTrack* posBgr = 0;
1172  LxTrack* negBgr = 0;
1173  Double_t bgrDist = 10000;
1174  Double_t signDefect = 10000;
1175 
1176  for (list<LxTrack*>::iterator i = positiveBgrs.begin();
1177  i != positiveBgrs.end();
1178  ++i) {
1179  LxTrack* track1 = *i;
1180 
1181  for (list<LxTrack*>::iterator j = negativeBgrs.begin();
1182  j != negativeBgrs.end();
1183  ++j) {
1184  LxTrack* track2 = *j;
1185  Double_t dist = InterLinesDist(track1, track2);
1186 
1187  if (dist < bgrDist) {
1188  posBgr = track1;
1189  negBgr = track2;
1190  bgrDist = dist;
1191  }
1192 
1193  LxTriplet* firstTriplet1 = track1->branches[0];
1194  LxPoint* firstPoint1 = firstTriplet1->center;
1195  Double_t particleSign1 =
1196  firstTriplet1->tx - firstPoint1->x / firstPoint1->z;
1197 
1198  LxTriplet* firstTriplet2 = track2->branches[0];
1199  LxPoint* firstPoint2 = firstTriplet2->center;
1200  Double_t particleSign2 =
1201  firstTriplet2->tx - firstPoint2->x / firstPoint2->z;
1202 
1203  Double_t defect = particleSign1 + particleSign2;
1204 
1205  if (abs(defect) < abs(signDefect)) signDefect = defect;
1206  }
1207  } // for (list<LxTrack*>::iterator i = positiveBgrs.begin(); i != positiveBgrs.end(); ++i)
1208 
1209  if (0 != posBgr && 0 != negBgr) {
1210  bgrInterTracksDistance->Fill(bgrDist);
1211  bgrSignDefect->Fill(signDefect);
1212  }
1213 } // void LxFinderTriplet::MatchRecoToMC()
LxPoint::dy2
Double_t dy2
Definition: LxCATriplets.h:22
LxTrack
Definition: LxCA.h:268
LxMCPoint
Definition: Simple/LxMC.h:16
LxMCTrack::stationsWithHits
Int_t stationsWithHits
Definition: Simple/LxMC.h:37
LxSpace::stationsInAlgo
Int_t stationsInAlgo
Definition: LxCA.h:333
LxPoint::track
LxTrack * track
Definition: LxCA.h:58
LxFinderTriplet::eventNumber
Int_t eventNumber
Definition: riplet/Lx.h:130
LxFinderTriplet
Definition: riplet/Lx.h:28
LxTriplet::neighbours
std::list< std::pair< LxTriplet *, Double_t > > neighbours
Definition: LxCATriplets.h:75
LxDraw::DrawMCTracks
void DrawMCTracks()
Definition: Simple/LxDraw.cxx:78
memset
void memset(T *dest, T i, size_t num)
Definition: L1Grid.cxx:21
LxMCTrack::pdg
Int_t pdg
Definition: Simple/LxMC.h:30
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
LxTrack::branches
LxTriplet * branches[LXSTATIONS]
Definition: LxCATriplets.h:263
LxMCTrack::layersWithHits
Int_t layersWithHits
Definition: Simple/LxMC.h:38
LxTrack::length
int length
Definition: LxCA.h:280
LxFinderTriplet::pPtCut
bool pPtCut
Definition: riplet/Lx.h:113
LxEff::AnalyzeNotMatchedMC
void AnalyzeNotMatchedMC(std::ofstream &out, std::list< LxPoint * > hits[LXSTATIONS][LXLAYERS])
Definition: riplet/LxEff.cxx:248
LxSpace::tracks
std::list< LxTrack * > tracks
Definition: LxCA.h:326
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
LxDraw
Definition: Simple/LxDraw.h:9
LxMCTrack::p
scaltype p
Definition: Simple/LxMC.h:28
LxTrack::rays
LxRay * rays[LXSTATIONS - 1]
Definition: LxCA.h:281
LxMCTrack::Points
std::vector< LxMCPoint * > Points
Definition: Simple/LxMC.h:31
LxTriplet::dty2
Double_t dty2
Definition: LxCATriplets.h:68
LXLAYERS
#define LXLAYERS
Definition: Simple/LxSettings.h:8
caSpace
LxSpace caSpace
Definition: riplet/Lx.cxx:72
LxPoint::y
scaltype y
Definition: LxCA.h:53
LxFinderTriplet::MatchRecoToMC
void MatchRecoToMC()
Definition: riplet/LxEff.cxx:1052
LxStation::stationNumber
int stationNumber
Definition: LxCA.h:206
LxRay::dty
scaltype dty
Definition: LxCA.h:117
LxPoint
Definition: LxCA.h:52
LxStation::tyInterTripletBreak2
Double_t tyInterTripletBreak2
Definition: LxCATriplets.h:191
LxPoint::dx2
Double_t dx2
Definition: LxCATriplets.h:22
LxPoint::dx
scaltype dx
Definition: LxCA.h:54
LxMCPoint::lxPoints
std::list< LxPoint * > lxPoints
Definition: Simple/LxMC.h:19
LxMCTrack::externalTrack
CbmStsTrack * externalTrack
Definition: Simple/LxMC.h:36
z2
Double_t z2[nSects2]
Definition: pipe_v16a_mvdsts100.h:11
LxFinderTriplet::incomplete_events
std::ofstream incomplete_events
Definition: riplet/Lx.h:128
LxRay::ty
scaltype ty
Definition: LxCA.h:116
RecoTrackChi2
static Double_t RecoTrackChi2(LxTrack *recoTrack)
Definition: riplet/LxEff.cxx:627
LxPoint::rays
std::list< LxRay * > rays
Definition: LxCA.h:59
LxStation::txInterTripletBreak2
Double_t txInterTripletBreak2
Definition: LxCATriplets.h:190
mcTracks
static vector< vector< QAMCTrack > > mcTracks
Definition: CbmTofHitFinderTBQA.cxx:112
LxTrack::matched
bool matched
Definition: LxCA.h:275
LxRay::tx
scaltype tx
Definition: LxCA.h:116
LxPoint::z
scaltype z
Definition: LxCA.h:53
LxTriplet::tx
Double_t tx
Definition: LxCATriplets.h:65
LxSpace::stations
std::vector< LxStation * > stations
Definition: LxCA.h:325
InterLinesDist
static Double_t InterLinesDist(LxTrack *track1, LxTrack *track2)
Definition: riplet/LxEff.cxx:584
Lx.h
LxMCPoint::track
LxMCTrack * track
Definition: Simple/LxMC.h:22
LXFIRSTSTATION
#define LXFIRSTSTATION
Definition: Simple/LxSettings.h:11
LxTrack::mcTrack
LxMCTrack * mcTrack
Definition: LxCA.h:276
LxTriplet::right
LxPoint * right
Definition: LxCATriplets.h:62
LxMCTrack::px
scaltype px
Definition: Simple/LxMC.h:28
LxPoint::mcPoints
std::list< LxMCPoint * > mcPoints
Definition: LxCA.h:63
LxEff::CalcRecoEff
void CalcRecoEff(bool joinExt)
Definition: riplet/LxEff.cxx:647
LxLayer::layerNumber
int layerNumber
Definition: LxCA.h:155
LxExtTrack::track
CbmStsTrack * track
Definition: LxCA.h:250
LxRay::end
LxPoint * end
Definition: LxCA.h:119
LxMCTrack::hitsOnStations
bool hitsOnStations[LXSTATIONS][LXLAYERS]
Definition: Simple/LxMC.h:39
LxTriplet::center
LxPoint * center
Definition: LxCATriplets.h:61
LxEff::LxEff
LxEff(LxFinderTriplet &owner)
Definition: riplet/LxEff.cxx:16
LxDraw::SaveCanvas
void SaveCanvas(TString name)
Definition: Simple/LxDraw.cxx:926
LxTrack::mcTracks
std::list< LxMCTrack * > mcTracks
Definition: LxCATriplets.h:272
LxTrack::points
LxPoint * points[LXSTATIONS *LXLAYERS]
Definition: LxCA.h:282
LxStation
Definition: LxCA.h:189
LxEff.h
LxTrack::clone
bool clone
Definition: LxCA.h:292
LxRay::source
LxPoint * source
Definition: LxCA.h:118
LxTriplet
Definition: LxCATriplets.h:59
LxDraw::ClearView
void ClearView()
Definition: Simple/LxDraw.cxx:54
LxTriplet::left
LxPoint * left
Definition: LxCATriplets.h:60
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
LxTriplet::ty
Double_t ty
Definition: LxCATriplets.h:66
hits
static vector< vector< QAHit > > hits
Definition: CbmTofHitFinderTBQA.cxx:114
LxPoint::triplets
std::list< LxTriplet * > triplets
Definition: LxCATriplets.h:27
LxTriplet::dtx2
Double_t dtx2
Definition: LxCATriplets.h:67
LxFinderTriplet::MCTracks
std::vector< LxMCTrack > MCTracks
Definition: riplet/Lx.h:117
LxMCTrack
Definition: Simple/LxMC.h:27
LxDraw::DrawRays
void DrawRays()
Definition: Simple/LxDraw.cxx:628
LxFinderTriplet::caSpace
LxSpace caSpace
Definition: riplet/Lx.h:124
z1
Double_t z1[nSects1]
Definition: pipe_v16a_mvdsts100.h:6
LxPoint::layer
LxLayer * layer
Definition: LxCA.h:60
LXSTATIONS
#define LXSTATIONS
Definition: Simple/LxSettings.h:9
LxPoint::dy
scaltype dy
Definition: LxCA.h:54
LxDraw::DrawInputHits
void DrawInputHits()
Definition: Simple/LxDraw.cxx:303
LxLayer::station
LxStation * station
Definition: LxCA.h:154
LxPoint::x
scaltype x
Definition: LxCA.h:53
LxRay::dtx
scaltype dtx
Definition: LxCA.h:117
LxMCTrack::mother_ID
Int_t mother_ID
Definition: Simple/LxMC.h:29
LxMCTrack::py
scaltype py
Definition: Simple/LxMC.h:28
LxRay
Definition: LxCA.h:115
LxEff::finder
LxFinderTriplet & finder
Definition: LxEff.h:27
LxTrack::externalTrack
LxExtTrack * externalTrack
Definition: LxCA.h:269