CbmRoot
Simple/Lx.cxx
Go to the documentation of this file.
1 #include "Lx.h"
2 #include "CbmKFParticle.h"
3 #include "CbmKFTrack.h"
4 #include "CbmMCTrack.h"
5 #include "CbmMuchCluster.h"
6 #include "CbmMuchDigiMatch.h"
7 #include "CbmMuchGeoScheme.h"
8 #include "CbmMuchPoint.h"
9 #include "CbmMuchTrack.h"
10 #include "CbmStsAddress.h"
11 #include "CbmStsPoint.h"
12 #include "LxDraw.h"
13 #include "TDatabasePDG.h"
14 #include "TGeoManager.h"
15 #include <iostream>
16 #include <sys/time.h>
17 
19 
20  using namespace std;
21 
23 
24 #ifdef MAKE_HISTOS
25 TH1F* LxFinder::massHisto = 0;
26 //TH1F* LxFinder::backgroundMassHisto = 0;
30 TProfile* LxFinder::effByMomentumProfile = 0;
31 TH1F* LxFinder::muPlusDtxHisto = 0;
33 TH1F* LxFinder::signalXAtZ0 = 0;
34 TH1F* LxFinder::signalYAtZ0 = 0;
35 TH1F* LxFinder::bgrXAtZ0 = 0;
36 TH1F* LxFinder::bgrYAtZ0 = 0;
39 TH1F* LxFinder::signalTanSigns = 0;
41 TH1F* LxFinder::bgrTanSigns = 0;
42 TH1F* LxFinder::bgrCoordSigns = 0;
43 TH1F* LxFinder::numberOfTracks = 0;
51 TH1F* LxFinder::muchMomErrSig = 0;
52 TH1F* LxFinder::muchMomErrBgr = 0;
53 #endif //MAKE_HISTOS
54 
55 #ifdef MAKE_DISPERSE_2D_HISTOS
56 TProfile2D* disperseLHistos[LXSTATIONS];
57 TProfile2D* disperseRHistos[LXSTATIONS];
58 TProfile2D* disperseDHistos[LXSTATIONS];
59 #endif //MAKE_DISPERSE_2D_HISTOS
60 
61 #ifdef MAKE_TRIGGERING_HISTOS
66 #endif //MAKE_TRIGGERING_HISTOS
67 
68 #ifdef MAKE_HISTOS
69 static TH1F* stsTrackChi2 = 0;
70 static TH1F* stsTrackX = 0;
71 static TH1F* stsTrackY = 0;
72 #endif //MAKE_HISTOS
73 
75  : useForWrite(false), fd(-1), evBuf(0), bufSize(0), evPtr(0), evEnd(0) {}
76 
78 
79 bool LxHitFile::Open(TString fileName, bool forWrite) {
80  useForWrite = forWrite;
81 
82  if (forWrite)
83  fd = open(fileName.Data(),
84  O_CREAT | O_WRONLY | O_TRUNC,
85  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
86  else
87  fd = open(fileName.Data(), O_RDONLY);
88 
89  return -1 != fd;
90 }
91 
92 bool LxHitFile::StartEvent(Int_t nEnt) {
93  off_t curOff = lseek(fd, 0, SEEK_CUR);
94 
95  if (-1 == curOff) return false;
96 
97  eventOffs.push_back(curOff);
98  bufSize = (2 * sizeof(Int_t) + 6 * sizeof(Double_t)) * nEnt;
99  evBuf = new char[bufSize];
100  evPtr = evBuf;
101  evEnd = evBuf + bufSize;
102  return true;
103 }
104 
106  ssize_t res = write(fd, evBuf, bufSize);
107  delete[] evBuf;
108  evBuf = 0;
109  bufSize = 0;
110  evPtr = 0;
111  evEnd = 0;
112  return -1 != res;
113 }
114 
115 bool LxHitFile::WriteHit(Int_t stationNumber,
116  Int_t layerNumber,
117  Double_t x,
118  Double_t y,
119  Double_t z,
120  Double_t xErr,
121  Double_t yErr,
122  Double_t zErr) {
123  if (evPtr + 2 * sizeof(Int_t) + 6 * sizeof(Double_t) > evEnd) return false;
124 
125  memcpy(evPtr, &stationNumber, sizeof(stationNumber));
126  evPtr += sizeof(stationNumber);
127  memcpy(evPtr, &layerNumber, sizeof(layerNumber));
128  evPtr += sizeof(layerNumber);
129  memcpy(evPtr, &x, sizeof(x));
130  evPtr += sizeof(x);
131  memcpy(evPtr, &y, sizeof(y));
132  evPtr += sizeof(y);
133  memcpy(evPtr, &z, sizeof(z));
134  evPtr += sizeof(z);
135  memcpy(evPtr, &xErr, sizeof(xErr));
136  evPtr += sizeof(xErr);
137  memcpy(evPtr, &yErr, sizeof(yErr));
138  evPtr += sizeof(yErr);
139  memcpy(evPtr, &zErr, sizeof(zErr));
140  evPtr += sizeof(zErr);
141  return true;
142 }
143 
145  off_t footerOfFooterOff = lseek(fd, -sizeof(off_t), SEEK_END);
146 
147  if (-1 == footerOfFooterOff) return false;
148 
149  off_t footerOff;
150  ssize_t readBytes = read(fd, &footerOff, sizeof(footerOff));
151 
152  if (-1 == readBytes) return false;
153 
154  Int_t numFooterEntries = (footerOfFooterOff - footerOff) / sizeof(off_t);
155 
156  if (eventNumber >= numFooterEntries) return false;
157 
158  off_t eventOff;
159  readBytes = pread(
160  fd, &eventOff, sizeof(eventOff), footerOff + eventNumber * sizeof(off_t));
161 
162  if (-1 == readBytes) return false;
163 
164  off_t nextEvOff;
165 
166  if (eventNumber == numFooterEntries - 1)
167  nextEvOff = footerOff;
168  else {
169  readBytes = pread(fd,
170  &nextEvOff,
171  sizeof(nextEvOff),
172  footerOff + (eventNumber + 1) * sizeof(off_t));
173 
174  if (-1 == readBytes) return false;
175  }
176 
177  delete[] evBuf;
178  evBuf = 0;
179  bufSize = 0;
180 
181  bufSize = nextEvOff - eventOff;
182  evBuf = new char[bufSize];
183  readBytes = pread(fd, evBuf, bufSize, eventOff);
184 
185  if (readBytes != bufSize) {
186  delete[] evBuf;
187  evBuf = 0;
188  bufSize = 0;
189  evPtr = 0;
190  evEnd = 0;
191  return false;
192  }
193 
194  evPtr = evBuf;
195  evEnd = evBuf + bufSize;
196  return true;
197 }
198 
199 bool LxHitFile::ReadHit(Int_t& stationNumber,
200  Int_t& layerNumber,
201  Double_t& x,
202  Double_t& y,
203  Double_t& z,
204  Double_t& xErr,
205  Double_t& yErr,
206  Double_t& zErr) {
207  if (evPtr + 2 * sizeof(Int_t) + 6 * sizeof(Double_t) > evEnd) return false;
208 
209  memcpy(&stationNumber, evPtr, sizeof(stationNumber));
210  evPtr += sizeof(stationNumber);
211  memcpy(&layerNumber, evPtr, sizeof(layerNumber));
212  evPtr += sizeof(layerNumber);
213  memcpy(&x, evPtr, sizeof(x));
214  evPtr += sizeof(x);
215  memcpy(&y, evPtr, sizeof(y));
216  evPtr += sizeof(y);
217  memcpy(&z, evPtr, sizeof(z));
218  evPtr += sizeof(z);
219  memcpy(&xErr, evPtr, sizeof(xErr));
220  evPtr += sizeof(xErr);
221  memcpy(&yErr, evPtr, sizeof(yErr));
222  evPtr += sizeof(yErr);
223  memcpy(&zErr, evPtr, sizeof(zErr));
224  evPtr += sizeof(zErr);
225  return true;
226 }
227 
229  if (!useForWrite) return -1 != close(fd);
230 
231  off_t footerOff = lseek(fd, 0, SEEK_CUR);
232  ssize_t res;
233  int res2;
234 
235  for (list<off_t>::iterator i = eventOffs.begin(); i != eventOffs.end(); ++i) {
236  off_t o = *i;
237  res = write(fd, &o, sizeof(o));
238 
239  if (-1 == res) goto end;
240  }
241 
242  res = write(fd, &footerOff, sizeof(footerOff));
243 
244 end:
245  res2 = close(fd);
246  return -1 != res && -1 != res2;
247 }
248 
250 
251 LxFinder::LxFinder() : muchPixelHits(0), listMCTracks(0), listMuchPts(0), listMuchClusters(0),
252  listMuchPixelDigiMatches(0), listStsTracks(0), listStsMatches(0), listStsPts(0), listRecoTracks(0),
253  superEventData(0), extFitter(), fPrimVtx(0), positiveTracks(), negativeTracks(),
254  generateInvMass(false), generateBackground(false), generateChi2(false),
255  linkWithSts(true), useMCPInsteadOfHits(false), calcMiddlePoints(true), cutCoeff(4.0), verbosity(1),
256  parallMode(false), hitFileName(""), fileSaveSuffix(""), particleType("jpsi"), pPtCut(true),
260  , MCPointsByStations(),
261  , zCoordsByStations(),
262 #endif //MAKE_DISPERSE_2D_HISTOS
263  , caSpace()
264 #ifdef MAKE_EFF_CALC
266  , falseSignalTriggerings(0)
267  , trueSignalTriggerings(0)
268  , hasSignalInEvent(false)
269  , signalCounter(0)
270 #endif //MAKE_EFF_CALC
271  , eventNumber(0)
272 #ifdef CALC_MUCH_DETECTORS_EFF
273  , mcPointsCount(0), mcPointsTriggered(0)
274 #endif //CALC_MUCH_DETECTORS_EFF
275  , saveOnlyTriggeringTracks(true)
276 {
277  fInstance = this;
278 }
279 
281 
282 TString lxFinderParticleType = "jpsi";
283 
284 static bool
285 GetHistoRMS(const char* histoNameBase, Int_t histoNumber, scaltype& retVal) {
286  bool result = false;
287 #pragma omp critical
288  {
289  char name[256];
290  char dir_name[256];
291  sprintf(dir_name, "configuration.%s", lxFinderParticleType.Data());
292 
293  if (histoNumber < 0)
294  sprintf(name, "%s/%s.root", dir_name, histoNameBase);
295  else
296  sprintf(name, "%s/%s_%d.root", dir_name, histoNameBase, histoNumber);
297 
298  TFile* curFile = TFile::CurrentFile();
299  TFile* f = new TFile(name);
300 
301  if (!f->IsZombie()) {
302  if (histoNumber < 0)
303  sprintf(name, "%s", histoNameBase);
304  else
305  sprintf(name, "%s_%d", histoNameBase, histoNumber);
306 
307  TH1F* h = static_cast<TH1F*>(f->Get(name));
308  retVal = h->GetRMS();
309  result = true;
310  }
311 
312  delete f;
313  TFile::CurrentFile() = curFile;
314  }
315  return result;
316 }
317 
318 static bool GetHistoCOV(const char* histoNameBase,
319  Int_t histoNumber,
320  Int_t axis1,
321  Int_t axis2,
322  scaltype& retVal) {
323  bool result = false;
324 #pragma omp critical
325  {
326  char name[256];
327  char dir_name[256];
328  sprintf(dir_name, "configuration.%s", lxFinderParticleType.Data());
329  sprintf(name, "%s/%s_%d.root", dir_name, histoNameBase, histoNumber);
330  TFile* curFile = TFile::CurrentFile();
331  TFile* f = new TFile(name);
332 
333  if (!f->IsZombie()) {
334  sprintf(name, "%s_%d", histoNameBase, histoNumber);
335  TH2F* h = static_cast<TH2F*>(f->Get(name));
336  retVal = h->GetCovariance(axis1, axis2);
337  result = true;
338  }
339 
340  delete f;
341  TFile::CurrentFile() = curFile;
342  }
343  return result;
344 }
345 
346 InitStatus LxFinder::Init() {
347  static Int_t nTimes = 1;
348  cout << "LxFinder::Init() called at " << nTimes++ << " time" << endl;
349 
350  if (parallMode)
351  hitFile.Open(hitFileName, false);
352  else if (hitFileName != "")
353  hitFile.Open(hitFileName, true);
354 
356 
357  FairRootManager* fRootManager = 0;
358 
359  if (!parallMode) {
360  fRootManager = FairRootManager::Instance();
361  muchPixelHits =
362  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("MuchPixelHit"));
363  listMCTracks =
364  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("MCTrack"));
365  listMuchPts =
366  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("MuchPoint"));
368  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("MuchCluster"));
370  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("MuchDigiMatch"));
371  listStsTracks =
372  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("StsTrack"));
374  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("StsTrackMatch"));
375  listStsPts =
376  LX_DYNAMIC_CAST<TClonesArray*>(fRootManager->GetObject("StsPoint"));
377  //fPrimVtx = LX_DYNAMIC_CAST<CbmVertex*> (fManager->GetObject("PrimaryVertex"));
378  /*
379  // Get pointer to PrimaryVertex object from IOManager if it exists
380  // The old name for the object is "PrimaryVertex" the new one
381  // "PrimaryVertex." Check first for the new name
382  fPrimVtx = LX_DYNAMIC_CAST<CbmVertex*>(fManager->GetObject("PrimaryVertex."));
383  if (nullptr == fPrimVtx) {
384  fPrimVtx = LX_DYNAMIC_CAST<CbmVertex*>(fManager->GetObject("PrimaryVertex"));
385  }
386  if (nullptr == fPrimVtx) {
387  Error("CbmL1SttTrackFinder::ReInit","vertex not found!");
388  return kERROR;
389  }
390  */
391  } // if (!parallMode)
392 
393  fPrimVtx = new CbmVertex;
394  scaltype rms;
395 
396  // Read Z-positions of MUCH station layers and save them in LxLayer objects.
397 
398  for (Int_t i = 0; i < LXSTATIONS; ++i) {
399  LxStation* aStation = caSpace.stations[i];
400 
401  for (Int_t j = 0; j < LXLAYERS; ++j) {
402 #pragma omp critical
403  {
404  TString muchStLrPath =
405  Form("/cave_1/much_0/muchstation%02i_0/muchstation%02ilayer%01i_0",
406  i + 1,
407  i + 1,
408  j + 1);
409  gGeoManager->cd(muchStLrPath.Data());
410  Double_t localCoords[3] = {0., 0., 0.};
411  Double_t globalCoords[3];
412  gGeoManager->LocalToMaster(localCoords, globalCoords);
413  aStation->layers[j]->zCoord = globalCoords[2];
414 #ifdef MAKE_DISPERSE_2D_HISTOS
415  zCoordsByStations[i][j] = globalCoords[2];
416 #endif //MAKE_DISPERSE_2D_HISTOS
417  }
418  }
419 
420  aStation->zCoord = aStation->layers[LXMIDDLE]->zCoord;
421 
422  //if (0 == i)
423  //cout << "First MUCH station Z-coord = " << aStation->zCoord << endl;
424 
425  if (!GetHistoRMS("muchInStationXDispLeft", i, rms)) return kFATAL;
426 
427  x_disp_left_limits[i] = cutCoeff * rms;
429 
430  if (!GetHistoRMS("muchInStationYDispLeft", i, rms)) return kFATAL;
431 
432  y_disp_left_limits[i] = cutCoeff * rms;
434 
435  if (!GetHistoRMS("muchInStationXDispRight", i, rms)) return kFATAL;
436 
437  x_disp_right_limits[i] = cutCoeff * rms;
439 
440  if (!GetHistoRMS("muchInStationYDispRight", i, rms)) return kFATAL;
441 
442  y_disp_right_limits[i] = cutCoeff * rms;
444 
445  if (i > 0) {
446  if (!GetHistoRMS("muchLongSegmentTxHisto", i, rms)) return kFATAL;
447 
448  aStation->txLimit = cutCoeff * rms;
449  tx_limits[i] = aStation->txLimit;
450  tx_limits_sq[i] = aStation->txLimit * aStation->txLimit;
451 
452  if (!GetHistoRMS("muchLongSegmentTyHisto", i, rms)) return kFATAL;
453 
454  aStation->tyLimit = cutCoeff * rms;
455  ty_limits[i] = aStation->tyLimit;
456  ty_limits_sq[i] = aStation->tyLimit * aStation->tyLimit;
457 
458 #ifdef CLUSTER_MODE
459  if (!GetHistoRMS("muchClusterXDispHisto", i, rms)) return kFATAL;
460 
461  aStation->clusterXLimit = rms;
462  aStation->clusterXLimit2 = rms * rms;
463 
464  if (!GetHistoRMS("muchClusterYDispHisto", i, rms)) return kFATAL;
465 
466  aStation->clusterYLimit = rms;
467  aStation->clusterYLimit2 = rms * rms;
468 
469  if (!GetHistoRMS("muchClusterTxDispHisto", i, rms)) return kFATAL;
470 
471  aStation->clusterTxLimit = rms;
472  aStation->clusterTxLimit2 = rms * rms;
473 
474  if (!GetHistoRMS("muchClusterTyDispHisto", i, rms)) return kFATAL;
475 
476  aStation->clusterTyLimit = rms;
477  aStation->clusterTyLimit2 = rms * rms;
478 #endif //CLUSTER_MODE
479 
480  if (i < LXSTATIONS - 1) {
481  if (!GetHistoRMS("muchSegmentTxBreakHisto", i, rms)) return kFATAL;
482 
483  aStation->txBreakSigma = rms;
484  aStation->txBreakLimit = cutCoeff * rms;
485 
486  if (!GetHistoRMS("muchSegmentTyBreakHisto", i, rms)) return kFATAL;
487 
488  aStation->tyBreakSigma = rms;
489  aStation->tyBreakLimit = cutCoeff * rms;
490  }
491  }
492 
493 #ifdef USE_KALMAN_FIT
494  if (i < LXSTATIONS - 1) {
495  for (Int_t j = 0; j <= 1; ++j) {
496  for (Int_t k = 0; k <= 1; ++k) {
497  if (!GetHistoCOV(
498  "muchXTxCovHisto", i, j + 1, k + 1, aStation->MSNoise[0][j][k]))
499  return kFATAL;
500 
501  if (!GetHistoCOV(
502  "muchYTyCovHisto", i, j + 1, k + 1, aStation->MSNoise[1][j][k]))
503  return kFATAL;
504  }
505  }
506  }
507 #endif //USE_KALMAN_FIT
508  }
509 
510  if (!GetHistoRMS("muchStsBreakX", -1, caSpace.muchStsBreakX)) {
511  cout << "LxFinder::Init(): Failed to read RMS from muchStsBreakX" << endl;
512  return kFATAL;
513  }
514 
515  if (!GetHistoRMS("muchStsBreakY", -1, caSpace.muchStsBreakY)) {
516  cout << "LxFinder::Init(): Failed to read RMS from muchStsBreakY" << endl;
517  return kFATAL;
518  }
519 
520  if (!GetHistoRMS("muchStsBreakTx", -1, caSpace.muchStsBreakTx)) {
521  cout << "LxFinder::Init(): Failed to read RMS from muchStsBreakTx" << endl;
522  return kFATAL;
523  }
524 
525  if (!GetHistoRMS("muchStsBreakTy", -1, caSpace.muchStsBreakTy)) {
526  cout << "LxFinder::Init(): Failed to read RMS from muchStsBreakTy" << endl;
527  return kFATAL;
528  }
529 
530  // Create an output array.
531  if (!parallMode) {
532  listRecoTracks = new TClonesArray("CbmMuchTrack", 100);
533  fRootManager->Register("MuchTrack",
534  "Much",
536  IsOutputBranchPersistent("MuchTrack"));
537  }
538 
539 #ifdef MAKE_HISTOS
540  if (generateInvMass)
541  massHisto = new TH1F("jpsi_mass", "jpsi_mass", 100, 2., 4.);
542 
543  if (generateBackground) {
544  //backgroundMassHisto = new TH1F("background_mass", "background_mass", 400, 2., 4.);
546  new TTree("SuperEventTracks", "Tracks for building a super event");
547  superEventTracks->Branch("tracks", "CbmStsTrack", &superEventData);
548  }
549 
550  if (generateChi2) {
551  signalChi2Histo = new TH1F("signal_chi2", "signal_chi2", 100, 0., 20.);
553  new TH1F("background_chi2", "background_chi2", 100, 0., 20.);
554  }
555 #endif //MAKE_HISTOS
556 
557 #ifdef MAKE_HISTOS
558  // char histoName[128];
559 
560  for (int i = 0; i < 6; ++i) {
561 #ifdef MAKE_DISPERSE_2D_HISTOS
562  sprintf(histoName, "disperseL_%d", i);
563  disperseLHistos[i] =
564  new TProfile2D(histoName, histoName, 30, -3., 3., 30, -3., 3.);
565  disperseLHistos[i]->StatOverflows();
566  sprintf(histoName, "disperseR_%d", i);
567  disperseRHistos[i] =
568  new TProfile2D(histoName, histoName, 30, -3., 3., 30, -3., 3.);
569  disperseRHistos[i]->StatOverflows();
570  sprintf(histoName, "disperseD_%d", i);
571  disperseDHistos[i] =
572  new TProfile2D(histoName, histoName, 30, -3., 3., 30, -3., 3.);
573  disperseDHistos[i]->StatOverflows();
574 #endif //MAKE_DISPERSE_2D_HISTOS
575  }
576 
577 #endif //MAKE_HISTOS
578 
579 #ifdef MAKE_HISTOS
581  new TH1F("muPlusDtxHisto", "Mu+ Tx difference", 200, -0.15, 0.15);
582  muPlusDtxHisto->StatOverflows();
584  new TH1F("muMinusDtxHisto", "Mu- Tx difference", 200, -0.15, 0.15);
585  muMinusDtxHisto->StatOverflows();
586  signalXAtZ0 =
587  new TH1F("signalXAtZ0", "Signal track X at Z=0", 200, -40.0, 40.0);
588  signalXAtZ0->StatOverflows();
589  signalYAtZ0 =
590  new TH1F("signalYAtZ0", "Signal track Y at Z=0", 200, -40.0, 40.0);
591  signalYAtZ0->StatOverflows();
592  bgrXAtZ0 =
593  new TH1F("bgrXAtZ0", "Background track X at Z=0", 200, -40.0, 40.0);
594  bgrXAtZ0->StatOverflows();
595  bgrYAtZ0 =
596  new TH1F("bgrYAtZ0", "Background track Y at Z=0", 200, -40.0, 40.0);
597  bgrYAtZ0->StatOverflows();
598  signalInterTracksDistance = new TH1F("signalInterTracksDistance",
599  "Distance between signal tracks",
600  200,
601  0.0,
602  30.0);
603  signalInterTracksDistance->StatOverflows();
604  bgrInterTracksDistance = new TH1F("bgrInterTracksDistance",
605  "Distance between background tracks",
606  200,
607  0.0,
608  30.0);
609  bgrInterTracksDistance->StatOverflows();
610  signalTanSigns = new TH1F("signalTanSigns",
611  "Signs of signal tracks tangents products",
612  20,
613  -2.0,
614  2.0);
615  signalTanSigns->StatOverflows();
616  signalCoordSigns = new TH1F("signalCoordSigns",
617  "Signs of signal tracks coordinates products",
618  20,
619  -2.0,
620  2.0);
621  signalCoordSigns->StatOverflows();
622  bgrTanSigns = new TH1F("bgrTanSigns",
623  "Signs of background tracks tangents products",
624  20,
625  -2.0,
626  2.0);
627  bgrTanSigns->StatOverflows();
628  bgrCoordSigns = new TH1F("bgrCoordSigns",
629  "Signs of background tracks coordinates products",
630  20,
631  -2.0,
632  2.0);
633  bgrCoordSigns->StatOverflows();
634  numberOfTracks = new TH1F("numberOfTracks",
635  "The number of reconstructed tracks in an event",
636  6,
637  0.0,
638  6.0);
639  numberOfTracks->StatOverflows();
641  new TH1F("signalInterTracksDistanceOn1st",
642  "Distance between signal tracks on the 1st station",
643  200,
644  0.0,
645  250.0);
646  signalInterTracksDistanceOn1st->StatOverflows();
648  new TH1F("bgrInterTracksDistanceOn1st",
649  "Distance between background tracks on the 1st station",
650  200,
651  0.0,
652  250.0);
653  bgrInterTracksDistanceOn1st->StatOverflows();
655  "bgrInterTracksDistanceOn1stSigns",
656  "Distance between background tracks on the 1st station separated by signs",
657  200,
658  0.0,
659  250.0);
660  bgrInterTracksDistanceOn1stSigns->StatOverflows();
662  new TH1F("signalInterTracksAngle",
663  "Angle between signal tracks by hits on 1st station",
664  200,
665  0.0,
666  60.0);
667  signalInterTracksAngle->StatOverflows();
669  new TH1F("bgrInterTracksAngle",
670  "Angle between background tracks by hits on 1st station",
671  200,
672  0.0,
673  60.0);
674  bgrInterTracksAngle->StatOverflows();
675  signalInterTrackCorrDA = new TH2F("signalInterTrackCorrDA",
676  "signalInterTrackCorrDA",
677  200,
678  0.0,
679  250.0,
680  200,
681  0.0,
682  60.0);
683  signalInterTrackCorrDA->StatOverflows();
684  bgrInterTrackCorrDA = new TH2F("bgrInterTrackCorrDA",
685  "bgrInterTrackCorrDA",
686  200,
687  0.0,
688  250.0,
689  200,
690  0.0,
691  60.0);
692  bgrInterTrackCorrDA->StatOverflows();
693  muchMomErrSig = new TH1F("muchMomErrSig",
694  "Momentum determination error for signal",
695  600,
696  -300.0,
697  300.0);
698  muchMomErrSig->StatOverflows();
699  muchMomErrBgr = new TH1F("muchMomErrBgr",
700  "Momentum determination error for background",
701  600,
702  -300.0,
703  300.0);
704  muchMomErrBgr->StatOverflows();
705 
706  effByMomentumProfile = new TProfile("Reconstruction efficiency by momentum",
707  "Reconstruction efficiency by momentum",
708  100,
709  0.0,
710  50.0,
711  0.0,
712  100.0);
713 #endif //MAKE_HISTOS
714 
715 #ifdef MAKE_TRIGGERING_HISTOS
716  triggeringAllTracksVertices = new TH1F("triggeringAllTracksVertices",
717  "triggeringAllTracksVertices",
718  330,
719  -10.0,
720  320.0);
721  triggeringAllTracksVertices->StatOverflows();
722  triggeringDistTracksVertices = new TH1F("triggeringDistTracksVertices",
723  "triggeringDistTracksVertices",
724  330,
725  -10.0,
726  320.0);
727  triggeringDistTracksVertices->StatOverflows();
728  triggeringSignTracksVertices = new TH1F("triggeringSignTracksVertices",
729  "triggeringSignTracksVertices",
730  330,
731  -10.0,
732  320.0);
733  triggeringSignTracksVertices->StatOverflows();
734  triggeringTrigTracksVertices = new TH1F("triggeringTrigTracksVertices",
735  "triggeringTrigTracksVertices",
736  330,
737  -10.0,
738  320.0);
739  triggeringTrigTracksVertices->StatOverflows();
740 #endif //MAKE_TRIGGERING_HISTOS
741 
742 #ifdef MAKE_HISTOS
743  stsTrackChi2 = new TH1F("stsTrackChi2", "stsTrackChi2", 200, 0., 10.);
744  stsTrackChi2->StatOverflows();
745  stsTrackX = new TH1F("stsTrackX", "stsTrackX", 200, -0.2, 0.2);
746  stsTrackX->StatOverflows();
747  stsTrackY = new TH1F("stsTrackY", "stsTrackY", 200, -0.2, 0.2);
748  stsTrackY->StatOverflows();
749 #endif //MAKE_HISTOS
750 
751 #ifdef MAKE_EFF_CALC
752  incomplete_events.open("incomplete_events.txt");
753 #endif //MAKE_EFF_CALC
754 
755  return kSUCCESS;
756 }
757 
758 static Int_t nTimes = 1;
759 static Int_t wholeDuration = 0;
760 static Int_t averageDuration = 0;
761 
762 void LxFinder::Exec(Option_t* opt) {
763  cout << "LxFinder::Exec() called at " << nTimes << " time" << endl;
764  timeval bTime, eTime;
765  int exeDuration;
766  gettimeofday(&bTime, 0);
767 
768  // Clean all previously created data.
769  MCTracks.clear();
770  MCPoints.clear();
771  MCStsPoints.clear();
772 
773  for (int i = 0; i < 8; ++i)
774  MCStsPointsByStations[i].clear();
775 
776 #ifdef MAKE_DISPERSE_2D_HISTOS
777  for (int i = 0; i < LXSTATIONS; ++i) {
778  for (int j = 0; j < LXLAYERS; ++j)
779  MCPointsByStations[i][j].clear();
780  }
781 #endif //MAKE_DISPERSE_2D_HISTOS
782 
783  caSpace.Clear();
784 
785  if (!parallMode) listRecoTracks->Clear();
786 
787  Int_t nEnt = 0;
788 
789 #ifdef MAKE_EFF_CALC
790  // Read MC tracks
791  nEnt = listMCTracks->GetEntries();
792  cout << "There are: " << nEnt << " of MC tracks" << endl;
793  LxMCTrack mcTrack;
794 
795  MCTracks.reserve(nEnt);
796  Int_t* root2lxmctrackmap = new Int_t[nEnt];
797  Int_t mapCnt = 0;
798 
799  for (int i = 0; i < nEnt; ++i) {
800  CbmMCTrack* mct = LX_DYNAMIC_CAST<CbmMCTrack*>(listMCTracks->At(i));
801  mcTrack.p = mct->GetP();
802  Int_t pdgCode = mct->GetPdgCode();
803 
804  if (abs(pdgCode) >= 10000) {
805  root2lxmctrackmap[i] = -1;
806  continue;
807  }
808 
809  root2lxmctrackmap[i] = mapCnt++;
810 
811  mcTrack.q = TDatabasePDG::Instance()->GetParticle(pdgCode)->Charge() / 3.0;
812  mcTrack.x = mct->GetStartX();
813  mcTrack.y = mct->GetStartY();
814  mcTrack.z = mct->GetStartZ();
815  mcTrack.px = mct->GetPx();
816  mcTrack.py = mct->GetPy();
817  mcTrack.pz = mct->GetPz();
818  mcTrack.mother_ID = mct->GetMotherId();
819  mcTrack.fUniqueID = mct->GetUniqueID();
820  mcTrack.pdg = pdgCode;
821  mcTrack.externalTrack = 0;
822  MCTracks.push_back(mcTrack);
823  }
824 
825  nEnt = listStsPts->GetEntries();
826  cout << "There are: " << nEnt << " of STS MC points" << endl;
827 
828  for (int i = 0; i < nEnt; ++i) {
829  TVector3 xyzI, PI, xyzO, PO;
830  CbmStsPoint* stsPt = LX_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(i));
831 
832  if (0 == stsPt) continue;
833 
834  LxStsMCPoint stsMCPoint;
835  stsPt->Position(xyzI);
836  stsPt->Momentum(PI);
837  stsPt->PositionOut(xyzO);
838  stsPt->MomentumOut(PO);
839  TVector3 xyz = .5 * (xyzI + xyzO);
840  TVector3 P = .5 * (PI + PO);
841  stsMCPoint.x = xyz.X();
842  stsMCPoint.y = xyz.Y();
843  stsMCPoint.z = xyz.Z();
844  stsMCPoint.px = P.X();
845  stsMCPoint.py = P.Y();
846  stsMCPoint.pz = P.Z();
847  stsMCPoint.p =
848  sqrt(fabs(stsMCPoint.px * stsMCPoint.px + stsMCPoint.py * stsMCPoint.py
849  + stsMCPoint.pz * stsMCPoint.pz));
850  stsMCPoint.stationNumber =
851  CbmStsAddress::GetElementId(stsPt->GetDetectorID(), kStsStation);
852  Int_t trackId = root2lxmctrackmap[stsPt->GetTrackID()];
853 
854  if (-1 != trackId) {
855  stsMCPoint.mcTrack = &MCTracks[trackId];
856  MCStsPoints.push_back(stsMCPoint);
857  MCTracks[trackId].stsPoints[stsMCPoint.stationNumber].push_back(
858  &MCStsPoints.back());
859  MCStsPointsByStations[stsMCPoint.stationNumber].push_back(
860  &MCStsPoints.back());
861  }
862  }
863 
864  nEnt = listMuchPts->GetEntries();
865  cout << "There are: " << nEnt << " of MUCH MC points" << endl;
866  LxMCPoint mcPoint;
867 
868  MCPoints.reserve(nEnt);
869  Int_t* root2lxmcpointmap = new Int_t
870  [nEnt]; // Unfortunately we have to use this map because in the loop
871  // below some iterations can not to produce a point.
872  mapCnt = 0;
873  // Int_t mcPtsCount = nEnt;
874  Int_t maxReferencedPtsIndex = 0;
875 
876  for (int i = 0; i < nEnt; ++i) {
877  TVector3 xyzI, PI, xyzO, PO;
878  CbmMuchPoint* pt = LX_DYNAMIC_CAST<CbmMuchPoint*>(listMuchPts->At(i));
879 
880  if (!pt) {
881  root2lxmcpointmap[i] = -1;
882  continue;
883  }
884 
885  Int_t trackId = root2lxmctrackmap[pt->GetTrackID()];
886 
887  if (-1 == trackId) {
888  root2lxmcpointmap[i] = -1;
889  continue;
890  }
891 
892  mcPoint.trackId = trackId;
893  mcPoint.track = &MCTracks[trackId];
894 
895  root2lxmcpointmap[i] = mapCnt++;
896 
897  pt->Position(xyzI);
898  pt->Momentum(PI);
899  pt->PositionOut(xyzO);
900  pt->MomentumOut(PO);
901  TVector3 xyz = .5 * (xyzI + xyzO);
902  TVector3 P = .5 * (PI + PO);
903  mcPoint.x = xyz.X();
904  mcPoint.y = xyz.Y();
905  mcPoint.z = xyz.Z();
906  mcPoint.px = P.X();
907  mcPoint.py = P.Y();
908  mcPoint.pz = P.Z();
909  mcPoint.p = sqrt(fabs(mcPoint.px * mcPoint.px + mcPoint.py * mcPoint.py
910  + mcPoint.pz * mcPoint.pz));
911  mcPoint.stationNumber =
914  MCPoints.push_back(mcPoint);
915  Int_t ptId = root2lxmcpointmap[i];
916 
917  /*
918 #ifdef MAKE_HISTOS
919  scaltype trackPt2 = MCTracks[trackId].px * MCTracks[trackId].px + MCTracks[trackId].py * MCTracks[trackId].py;
920 #endif//MAKE_HISTOS
921 */
922 
923  MCTracks[trackId].Points.push_back(&MCPoints[ptId]);
924 #ifdef MAKE_DISPERSE_2D_HISTOS
925  MCPointsByStations[mcPoint.stationNumber][mcPoint.layerNumber].push_back(
926  &MCPoints[ptId]);
927 #endif //MAKE_DISPERSE_2D_HISTOS
928  }
929 
930 #ifdef MAKE_HISTOS
931  // Build angle (tangent) breaks distribution <
932  for (vector<LxMCTrack>::iterator i = MCTracks.begin(); i != MCTracks.end();
933  ++i) {
934  LxMCTrack& track = *i;
935 
936  if ((13 != track.pdg && -13 == track.pdg) || track.mother_ID >= 0) continue;
937 
938  if (track.p < 3) continue;
939 
940  scaltype pt2 = track.px * track.px + track.py * track.py;
941 
942  if (pt2 < 1) continue;
943 
945  memset(points, 0, sizeof(points));
946 
947  for (vector<LxMCPoint*>::iterator j = track.Points.begin();
948  j != track.Points.end();
949  ++j) {
950  LxMCPoint* point = *j;
951  points[point->stationNumber][point->layerNumber] = point;
952  }
953 
954  for (int j = 0; j < LXSTATIONS; ++j) {
955 #ifdef MAKE_DISPERSE_2D_HISTOS
956  if (0 != points[j][1]) {
957  LxMCPoint* mPoint = points[j][1];
958  scaltype tx = mPoint->x / mPoint->z;
959  scaltype ty = mPoint->y / mPoint->z;
960  scaltype diffZ = zCoordsByStations[j][0] - mPoint->z;
961  scaltype x = mPoint->x + tx * diffZ;
962  scaltype y = mPoint->y + ty * diffZ;
963  list<LxMCPoint*>& lPoints = MCPointsByStations[j][0];
964 
965  for (list<LxMCPoint*>::iterator k = lPoints.begin(); k != lPoints.end();
966  ++k) {
967  LxMCPoint* lPoint = *k;
968 
969  if (lPoint->trackId == mPoint->trackId)
970  disperseLHistos[j]->Fill(lPoint->x - x, lPoint->y - y, 100.);
971  else
972  disperseLHistos[j]->Fill(lPoint->x - x, lPoint->y - y, 0.);
973  }
974 
975  diffZ = zCoordsByStations[j][2] - mPoint->z;
976  x = mPoint->x + tx * diffZ;
977  y = mPoint->y + ty * diffZ;
978  list<LxMCPoint*>& rPoints = MCPointsByStations[j][2];
979 
980  for (list<LxMCPoint*>::iterator k = rPoints.begin(); k != rPoints.end();
981  ++k) {
982  LxMCPoint* rPoint = *k;
983 
984  if (rPoint->trackId == mPoint->trackId)
985  disperseRHistos[j]->Fill(rPoint->x - x, rPoint->y - y, 100.);
986  else
987  disperseRHistos[j]->Fill(rPoint->x - x, rPoint->y - y, 0.);
988  }
989  }
990 
991  if (0 != points[j][2]) {
992  LxMCPoint* rPoint = points[j][2];
993  scaltype tx = rPoint->x / rPoint->z;
994  scaltype ty = rPoint->y / rPoint->z;
995  scaltype diffZ = zCoordsByStations[j][0] - rPoint->z;
996  scaltype x = rPoint->x + tx * diffZ;
997  scaltype y = rPoint->y + ty * diffZ;
998  list<LxMCPoint*>& lPoints = MCPointsByStations[j][0];
999 
1000  for (list<LxMCPoint*>::iterator k = lPoints.begin(); k != lPoints.end();
1001  ++k) {
1002  LxMCPoint* lPoint = *k;
1003 
1004  if (lPoint->trackId == rPoint->trackId)
1005  disperseDHistos[j]->Fill(lPoint->x - x, lPoint->y - y, 100.);
1006  else
1007  disperseDHistos[j]->Fill(lPoint->x - x, lPoint->y - y, 0.);
1008  }
1009  }
1010 #endif //MAKE_DISPERSE_2D_HISTOS
1011  } //for (int j = 0; j < LXSTATIONS; ++j)
1012  } //for (vector<LxMCTrack>::iterator i = MCTracks.begin(); i != MCTracks.end(); ++i)
1013  // > angle (tangent) breaks distribution
1014 #endif //MAKE_HISTOS
1015 
1016 #endif //MAKE_EFF_CALC
1017 
1018  // Read MUCH pixel hits.
1019  scaltype minXErr = 1000;
1020  scaltype minYErr = 1000;
1021 
1022  // At last start invocation of CA procedures.
1023  gettimeofday(&bTime, 0);
1025  gettimeofday(&eTime, 0);
1026  exeDuration =
1027  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1028  Int_t runTime = exeDuration;
1029  bTime.tv_sec = eTime.tv_sec;
1030  bTime.tv_usec = eTime.tv_usec;
1031 
1032  if (parallMode) {
1033  nEnt = 0;
1034 
1035  Int_t stationNumber, layerNumber, i = 0;
1036  Double_t x, y, z, errX, errY, errZ;
1037 
1038  while (
1039  hitFile.ReadHit(stationNumber, layerNumber, x, y, z, errX, errY, errZ)) {
1040  LxPoint* lxPoint = caSpace.AddPoint(
1041  stationNumber, layerNumber, i++, x, y, z, errX, errY, errZ);
1042  int point_number = caSpace.points_counts[stationNumber][layerNumber];
1043  caSpace.x_coords[stationNumber][layerNumber][point_number] = x;
1044  caSpace.x_errs[stationNumber][layerNumber][point_number] = errX;
1045  caSpace.y_coords[stationNumber][layerNumber][point_number] = y;
1046  caSpace.y_errs[stationNumber][layerNumber][point_number] = errY;
1047  caSpace.z_coords[stationNumber][layerNumber][point_number] = z;
1048  caSpace.point_refs[stationNumber][layerNumber][point_number] = lxPoint;
1049  ++caSpace.points_counts[stationNumber][layerNumber];
1050  ++nEnt;
1051  }
1052  } else // (!parallMode)
1053  {
1054  nEnt = muchPixelHits->GetEntries();
1055  cout << "There are: " << nEnt << " of MUCH pixel hits" << endl;
1056 
1057  if (hitFileName != "") hitFile.StartEvent(nEnt);
1058 
1059  for (Int_t i = 0; i < nEnt; ++i) {
1060  CbmMuchPixelHit* mh =
1061  LX_DYNAMIC_CAST<CbmMuchPixelHit*>(muchPixelHits->At(i));
1062 
1063  Int_t stationNumber = CbmMuchGeoScheme::GetStationIndex(mh->GetAddress());
1064  Int_t layerNumber = CbmMuchGeoScheme::GetLayerIndex(mh->GetAddress());
1065  TVector3 pos, err;
1066  mh->Position(pos);
1067  mh->PositionError(err);
1068  scaltype x = pos.X();
1069  scaltype y = pos.Y();
1070  scaltype z = pos.Z();
1071 
1072  //if (x != x || y != y || z != z)// Test for NaN
1073  //continue;
1074 
1075  if (minXErr > err.X()) minXErr = err.X();
1076 
1077  if (minYErr > err.Y()) minYErr = err.Y();
1078 
1079  LxPoint* lxPoint = 0;
1080 
1081  if (!useMCPInsteadOfHits) {
1082  lxPoint = caSpace.AddPoint(
1083  stationNumber, layerNumber, i, x, y, z, err.X(), err.Y(), err.Z());
1084  int point_number = caSpace.points_counts[stationNumber][layerNumber];
1085  caSpace.x_coords[stationNumber][layerNumber][point_number] = x;
1086  caSpace.x_errs[stationNumber][layerNumber][point_number] = err.X();
1087  caSpace.y_coords[stationNumber][layerNumber][point_number] = y;
1088  caSpace.y_errs[stationNumber][layerNumber][point_number] = err.Y();
1089  caSpace.z_coords[stationNumber][layerNumber][point_number] = z;
1090  caSpace.point_refs[stationNumber][layerNumber][point_number] = lxPoint;
1091  ++caSpace.points_counts[stationNumber][layerNumber];
1092 
1093  if (hitFileName != "")
1094  hitFile.WriteHit(stationNumber,
1095  layerNumber,
1096  pos.X(),
1097  pos.Y(),
1098  pos.Z(),
1099  err.X(),
1100  err.Y(),
1101  err.Z());
1102  }
1103 
1104 #ifdef MAKE_EFF_CALC
1105  Int_t clusterId = mh->GetRefId();
1106  CbmMuchCluster* cluster =
1107  LX_DYNAMIC_CAST<CbmMuchCluster*>(listMuchClusters->At(clusterId));
1108  Int_t nDigis = cluster->GetNofDigis();
1109 
1110  for (Int_t j = 0; j < nDigis; ++j) {
1111  CbmMuchDigiMatch* digiMatch = LX_DYNAMIC_CAST<CbmMuchDigiMatch*>(
1112  listMuchPixelDigiMatches->At(cluster->GetDigi(j)));
1113  Int_t nMCs = digiMatch->GetNofLinks();
1114 
1115  for (Int_t k = 0; k < nMCs; ++k) {
1116  const CbmLink& lnk = digiMatch->GetLink(k);
1117  Int_t mcIndex = lnk.GetIndex();
1118 
1119  if (-1 == mcIndex) continue;
1120 
1121  if (mcIndex > maxReferencedPtsIndex) maxReferencedPtsIndex = mcIndex;
1122 
1123  Int_t mcIndexMapped = root2lxmcpointmap[mcIndex];
1124 
1125  if (-1 == mcIndexMapped) continue;
1126 
1127  if (!useMCPInsteadOfHits) {
1128  MCPoints[mcIndexMapped].lxPoints.push_back(lxPoint);
1129 #ifdef MAKE_EFF_CALC
1130  lxPoint->mcPoints.push_back(&MCPoints[mcIndexMapped]);
1131 #endif //MAKE_EFF_CALC
1132  }
1133 #ifdef MAKE_EFF_CALC
1134  else if (MCPoints[mcIndexMapped].lxPoints.empty()) {
1135  LxMCPoint& mcp = MCPoints[mcIndexMapped];
1136  lxPoint = caSpace.AddPoint(stationNumber,
1137  layerNumber,
1138  i,
1139  mcp.x,
1140  mcp.y,
1141  mcp.z,
1142  err.X(),
1143  err.Y(),
1144  err.Z());
1145  MCPoints[mcIndexMapped].lxPoints.push_back(lxPoint);
1146  lxPoint->mcPoints.push_back(&MCPoints[mcIndexMapped]);
1147  }
1148 #endif //MAKE_EFF_CALC
1149  }
1150  }
1151 #endif //MAKE_EFF_CALC
1152  } // for (Int_t i = 0; i < nEnt; ++i)
1153 
1154  if (hitFileName != "") hitFile.EndEvent();
1155  } //else (!parallMode)
1156 
1157  cout << "minXErr = " << minXErr << " ; minYErr = " << minYErr << endl << endl;
1158 
1159  // At last start invocation of CA procedures.
1160  gettimeofday(&eTime, 0);
1161  exeDuration =
1162  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1163 
1164  if (verbosity > 0)
1165  cout << "Execution duration 1 was: " << exeDuration << endl;
1166 
1168 
1169  bTime.tv_sec = eTime.tv_sec;
1170  bTime.tv_usec = eTime.tv_usec;
1171  gettimeofday(&eTime, 0);
1172  exeDuration =
1173  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1174 
1175  if (verbosity > 0)
1176  cout << "Execution duration 2 was: " << exeDuration << endl;
1177 #ifdef CLUSTER_MODE
1178  caSpace.BuildRays2();
1179 #else //CLUSTER_MODE
1180  //caSpace.BuildRays();
1183 #endif //CLUSTER_MODE
1184  bTime.tv_sec = eTime.tv_sec;
1185  bTime.tv_usec = eTime.tv_usec;
1186  gettimeofday(&eTime, 0);
1187  exeDuration =
1188  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1189  //Int_t runTime = exeDuration;
1190  runTime += exeDuration;
1191 
1192  if (verbosity > 0)
1193  cout << "Execution duration 3 was: " << exeDuration << endl;
1194 
1195 #ifdef CLUSTER_MODE
1196  caSpace.ConnectNeighbours2();
1197 #else //CLUSTER_MODE
1199 #endif //CLUSTER_MODE
1200  bTime.tv_sec = eTime.tv_sec;
1201  bTime.tv_usec = eTime.tv_usec;
1202  gettimeofday(&eTime, 0);
1203  exeDuration =
1204  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1205  runTime += exeDuration;
1206 
1207  if (verbosity > 0)
1208  cout << "Execution duration 4 was: " << exeDuration << endl;
1209 #ifdef CLUSTER_MODE
1210  caSpace.Reconstruct2();
1211 #else //CLUSTER_MODE
1212  caSpace.Reconstruct();
1213 #endif //CLUSTER_MODE
1214  //caSpace.FitTracks();
1215  bTime.tv_sec = eTime.tv_sec;
1216  bTime.tv_usec = eTime.tv_usec;
1217  gettimeofday(&eTime, 0);
1218  exeDuration =
1219  (eTime.tv_sec - bTime.tv_sec) * 1000000 + eTime.tv_usec - bTime.tv_usec;
1220  runTime += exeDuration;
1221 
1222  wholeDuration += runTime;
1224  cout << "Average execution duration 3 + 4 + 5 was: " << averageDuration
1225  << endl;
1226 
1227  if (parallMode) {
1228  Int_t* pOutRunTime = reinterpret_cast<Int_t*>(const_cast<char*>(opt));
1229  *pOutRunTime = runTime;
1230  }
1231 
1232  if (verbosity > 0)
1233  cout << "Execution duration 5 was: " << exeDuration << endl;
1234 
1235  //caSpace.FitTracks();
1236  //cout << "maxReferencedPtsIndex=" << maxReferencedPtsIndex << " mcPtsCount=" << mcPtsCount << " GEF=" << listMuchPts->GetEntriesFast() << endl;
1237  //cout << "Hits=" << muchPixelHits->GetEntries() << " clusters=" << listMuchClusters->GetEntries() << " digi ms=" << listMuchPixelDigiMatches->GetEntries() << endl;
1238  //sleep(3);
1239 
1241  // Join MUCH-tracks with STS-tracks.
1243 
1244  if (linkWithSts) {
1245  // STS-tracks fulfilling the limitations peculiar for muons are picked up in the loop below.
1246  nEnt = listStsTracks->GetEntries();
1247 
1248  for (int i = 0; i < nEnt; ++i) {
1249  CbmStsTrack* stsTrack =
1250  LX_DYNAMIC_CAST<CbmStsTrack*>(listStsTracks->At(i));
1251 
1252  scaltype lpa[5] = {
1253  static_cast<Float_t>(stsTrack->GetParamLast()->GetX()),
1254  static_cast<Float_t>(stsTrack->GetParamLast()->GetY()),
1255  static_cast<Float_t>(stsTrack->GetParamLast()->GetTx()),
1256  static_cast<Float_t>(stsTrack->GetParamLast()->GetTy()),
1257  static_cast<Float_t>(stsTrack->GetParamLast()->GetQp())};
1258 
1259  if (lpa[0] != lpa[0] || lpa[1] != lpa[1] || lpa[2] != lpa[2]
1260  || lpa[3] != lpa[3] || lpa[4] != lpa[4])
1261  continue;
1262 
1263  CbmStsTrack aTrack = *stsTrack;
1264 
1265  Int_t pdgHypo = 13;
1266 
1267  if (stsTrack->GetParamLast()->GetTx()
1268  > stsTrack->GetParamFirst()->GetTx())
1269  pdgHypo = -13;
1270 
1271  extFitter.DoFit(&aTrack, pdgHypo);
1272  scaltype chi2Prim = extFitter.GetChiToVertex(&aTrack, fPrimVtx);
1273  FairTrackParam params;
1274  extFitter.Extrapolate(&aTrack, fPrimVtx->GetZ(), &params);
1275  scaltype p = 1 / params.GetQp();
1276  scaltype p2 = p * p;
1277 
1278  if (p2 < 3.0 * 3.0) continue;
1279 
1280  /*
1281  scaltype xDelta = 0.05;//5.0 * sqrt(params.GetCovariance(0, 0));
1282  scaltype yDelta = 0.05;//5.0 * sqrt(params.GetCovariance(1, 1));
1283 
1284  if (params.GetX() < -xDelta || params.GetX() > xDelta || params.GetY() < -yDelta || params.GetY() > yDelta)
1285  continue;
1286 */
1287 
1288  scaltype tx2 = params.GetTx() * params.GetTx();
1289  scaltype ty2 = params.GetTy() * params.GetTy();
1290  scaltype pt2 = p2 * (tx2 + ty2) / (1 + tx2 + ty2);
1291 
1292  if (pt2 < 1.0) continue;
1293 
1294  LxExtTrack extTrack;
1295  extTrack.track = stsTrack;
1296  extTrack.extId = i;
1297 
1298 #ifdef MAKE_EFF_CALC
1299  CbmTrackMatch* match =
1300  LX_DYNAMIC_CAST<CbmTrackMatch*>(listStsMatches->At(i));
1301  Int_t numberOfHits = match->GetNofTrueHits() + match->GetNofWrongHits()
1302  + match->GetNofFakeHits();
1303 
1304  if (match->GetNofTrueHits() >= 0.7 * numberOfHits) {
1305  Int_t mcTrackId = match->GetMCTrackId();
1306  Int_t mappedId = root2lxmctrackmap[mcTrackId];
1307 
1308  if (-1 != mappedId) {
1309  MCTracks[mappedId].externalTrack = stsTrack;
1310  extTrack.mcTrack = &MCTracks[mappedId];
1311 
1312  if (13 == MCTracks[mappedId].pdg || -13 == MCTracks[mappedId].pdg) {
1313 #ifdef MAKE_HISTOS
1314  stsTrackChi2->Fill(chi2Prim);
1315  stsTrackX->Fill(params.GetX());
1316  stsTrackY->Fill(params.GetY());
1317 #endif //MAKE_HISTOS
1318  }
1319  }
1320  }
1321 #endif //MAKE_EFF_CALC
1322 
1323  caSpace.extTracks.push_back(extTrack);
1324  }
1325 
1326  cout << "External tracks are read" << endl;
1327 
1328  // Join reconstructed tracks with external tracks.
1330  cout << "External tracks are connected" << endl;
1331  } // if(linkWithSts)
1332 
1333  // Measure a reconstruction efficiency.
1334 #ifdef MAKE_EFF_CALC
1335  if (!parallMode) {
1336  MatchMCToReco();
1337  MatchRecoToMC();
1338  }
1339 #endif //MAKE_EFF_CALC
1340  if (Trigger()) {
1342 
1344  }
1345 
1346  {
1347  Double_t result = 100 * trueSignalTriggerings;
1348  result /= signalCounter;
1349  cout << "Signal true hypotheses: " << result << "% ( "
1350  << trueSignalTriggerings << " / " << signalCounter << " )" << endl;
1351  cout << "Signal all hypotheses: " << falseSignalTriggerings << endl;
1352  }
1353 
1354  // Draw some result.
1355  //static LxDraw drawer;
1356 
1357  //drawer.ClearView();
1358  //drawer.DrawMuch();
1359  //drawer.SaveCanvas("Geometry_");
1360 
1361  //drawer.ClearView();
1362  //drawer.DrawInputHits();
1363  //drawer.SaveCanvas("Hits_");
1364  //drawer.Ask();
1365 
1366  //drawer.ClearView();
1367  //drawer.DrawInputHits();
1368  //drawer.DrawMCTracks();
1369  //gPad->WaitPrimitive();
1370  //drawer.ClearView();
1371  //drawer.DrawInputHits();
1372  //drawer.DrawRecoTracks();
1373  //drawer.DrawExtTracks();
1374  //drawer.SaveCanvas("MC_");
1375  //gPad->WaitPrimitive();
1376 
1377  /*drawer.ClearView();
1378  drawer.DrawInputHits();
1379  drawer.DrawMCTracks();
1380  drawer.DrawRays();
1381  gPad->WaitPrimitive();*/
1382 
1383  //drawer.ClearView();
1384  //drawer.DrawInputHits();
1385  //drawer.DrawRecoTracks();
1386  //drawer.SaveCanvas("Reco_");
1387  //drawer.Ask();
1388 
1389  //drawer.ClearView();
1390  //drawer.DrawInputHits();
1391  //drawer.DrawRecoTracks();
1392  //drawer.DrawExtTracks();
1393  //drawer.Ask();
1394 
1396 
1398 
1399  // Finally save reconstructed tracks.
1400  if (!parallMode) SaveRecoTracks();
1401 
1402 #ifdef MAKE_EFF_CALC
1403  // Hopefully we don't need these two maps any more.
1404  delete[] root2lxmctrackmap;
1405  delete[] root2lxmcpointmap;
1406 #endif //MAKE_EFF_CALC
1407 
1408  ++eventNumber;
1409  ++nTimes;
1410 }
1411 
1413  Int_t trackNo = listRecoTracks->GetEntriesFast();
1414 
1415  for (list<LxTrack*>::iterator i = caSpace.tracks.begin();
1416  i != caSpace.tracks.end();
1417  ++i) {
1418  LxTrack* recoTrack = *i;
1419 
1420  if (recoTrack->clone) continue;
1421 
1422  if (saveOnlyTriggeringTracks && !recoTrack->triggering) continue;
1423 
1424  LxExtTrack* stsTrack = recoTrack->externalTrack;
1425 
1426  if (0 == stsTrack) continue;
1427 
1428  CbmMuchTrack muchTrack;
1429 
1430  for (int j = 0; j < LXSTATIONS * LXLAYERS; ++j) {
1431  LxPoint* pPoint = recoTrack->points[j];
1432 
1433  if (0 != pPoint) muchTrack.AddHit(pPoint->hitId, kMUCHPIXELHIT);
1434  }
1435 
1436  muchTrack.SetChiSq(recoTrack->chi2);
1437  muchTrack.SetNDF(
1438  4 * recoTrack->length); // Probably need to calculate it more accurately.
1439  muchTrack.SetPreviousTrackId(stsTrack->extId);
1440 
1441  FairTrackParam parFirst;
1442  parFirst = *stsTrack->track->GetParamLast();
1443  muchTrack.SetFlag(0); // Good track.
1444 
1445  FairTrackParam parLast(parFirst);
1446  muchTrack.SetParamFirst(&parFirst);
1447  muchTrack.SetParamLast(&parLast);
1448 
1449  new ((*listRecoTracks)[trackNo++]) CbmMuchTrack(muchTrack);
1450  }
1451 }
1452 
1454 #ifdef MAKE_HISTOS
1455  for (list<LxTrack*>::iterator i = caSpace.tracks.begin();
1456  i != caSpace.tracks.end();
1457  ++i) {
1458  LxTrack* firstTrack = *i;
1459  LxMCTrack* mcTrack1 = firstTrack->mcTrack;
1460 
1461  if (0 == firstTrack->externalTrack) continue;
1462 
1463  LxMCTrack* mcTrack2 = firstTrack->externalTrack->mcTrack;
1464 
1465  if (mcTrack1) {
1466  // Int_t pdg1 = mcTrack1 ? mcTrack1->pdg : 10000;
1467  //map<Int_t, map<Int_t, int> >::iterator j = particleCounts.find(pdg1);
1468 
1469  //if (j == particleCounts.end())
1470  //j = particleCounts.insert(pair<Int_t, map<Int_t, int> > (pdg1, map<Int_t, int> ())).first;
1471 
1472  // Int_t pdg2 = mcTrack2 ? mcTrack2->pdg : 10000;
1473 
1474  //map<Int_t, int>::iterator k = j->second.find(pdg2);
1475 
1476  //if (k != j->second.end())
1477  //++(k->second);
1478  //else
1479  //j->second.insert(pair<Int_t, int> (pdg2, 1));
1480  }
1481 
1482  CbmStsTrack t1 = *firstTrack->externalTrack->track;
1483 
1484  // Add entry to the respective chi2 histogram if needed. This can be used for placing chi2 cuts determining J/psi.
1485  // pdg == 13 | -13 -- it is a muon.
1486  // mother_ID < 0 -- it is a primary particle. URQMD doesn't produce primary muons. So it from PLUTO <=> is J/psi.
1487 
1488  if (generateChi2) {
1489  scaltype normalizedChi2 =
1490  firstTrack->chi2 / (firstTrack->length * 4); // length * 4 == NDF.
1491 
1492  if (mcTrack2 && (mcTrack2->pdg == 13 || mcTrack2->pdg == -13)
1493  && mcTrack2->mother_ID < 0)
1494  signalChi2Histo->Fill(normalizedChi2);
1495  else
1496  backgroundChi2Histo->Fill(normalizedChi2);
1497  }
1498 
1499  if (!mcTrack2 || (mcTrack2->pdg != 13 && mcTrack2->pdg != -13)
1500  || mcTrack2->mother_ID >= 0)
1501  continue;
1502 
1503  extFitter.DoFit(&t1, 13);
1504  scaltype chi2Prim = extFitter.GetChiToVertex(&t1, fPrimVtx);
1505  FairTrackParam t1param;
1506  extFitter.Extrapolate(&t1, fPrimVtx->GetZ(), &t1param);
1507 
1508  if (t1param.GetQp() <= 0) continue;
1509 
1510  scaltype p1 = 1 / t1param.GetQp();
1511  scaltype tx12 = t1param.GetTx() * t1param.GetTx();
1512  scaltype ty12 = t1param.GetTy() * t1param.GetTy();
1513  scaltype pt12 = p1 * p1 * (tx12 + ty12) / (1 + tx12 + ty12);
1514 
1515  if (pt12 < 1) continue;
1516 
1517  CbmKFTrack muPlus(t1);
1518 
1519  for (list<LxTrack*>::iterator j = caSpace.tracks.begin();
1520  j != caSpace.tracks.end();
1521  ++j) {
1522  LxTrack* secondTrack = *j;
1523 
1524  if (0 == secondTrack->externalTrack) continue;
1525 
1526  LxMCTrack* mcSecondTrack = secondTrack->externalTrack->mcTrack;
1527 
1528  if (!mcSecondTrack
1529  || (mcSecondTrack->pdg != 13 && mcSecondTrack->pdg != -13)
1530  || mcSecondTrack->mother_ID >= 0)
1531  continue;
1532 
1533  CbmStsTrack t2 = *secondTrack->externalTrack->track;
1534  extFitter.DoFit(&t2, 13);
1535  chi2Prim = extFitter.GetChiToVertex(&t2, fPrimVtx);
1536  FairTrackParam t2param;
1537  extFitter.Extrapolate(&t2, fPrimVtx->GetZ(), &t2param);
1538 
1539  if (t2param.GetQp() >= 0) continue;
1540 
1541  scaltype p2 = 1 / t2param.GetQp();
1542  scaltype tx22 = t2param.GetTx() * t2param.GetTx();
1543  scaltype ty22 = t2param.GetTy() * t2param.GetTy();
1544  scaltype pt22 = p2 * p2 * (tx22 + ty22) / (1 + tx22 + ty22);
1545 
1546  if (pt22 < 1) continue;
1547 
1548  CbmKFTrack muMinus(t2);
1549  vector<CbmKFTrackInterface*> kfData;
1550  kfData.push_back(&muPlus);
1551  kfData.push_back(&muMinus);
1552  //CbmKFParticle DiMu;
1553  //DiMu.Construct(kfData, 0);
1554  //DiMu.TransportToDecayVertex();
1555  //scaltype m, merr;
1556  //iMu.GetMass(m, merr);
1557 
1558  //massHisto->Fill(m);
1559  }
1560  }
1561 #endif //MAKE_HISTOS
1562 }
1563 
1564 //#ifdef MAKE_HISTOS
1565 // It also deletes the histogram.
1566 static void SaveHisto(TH1* histo, const char* name) {
1567  TFile fh(name, "RECREATE");
1568  histo->Write();
1569  fh.Close();
1570  delete histo;
1571 }
1572 
1573 static void SaveHisto(TH2* histo, const char* name) {
1574  TFile fh(name, "RECREATE");
1575  histo->Write();
1576  fh.Close();
1577  delete histo;
1578 }
1579 //#endif//MAKE_HISTOS
1580 
1582  TString complexFileName;
1583 
1585 
1587 
1588  /*if (generateChi2)
1589  {
1590  SaveSignalChi2();
1591  SaveBackgroundChi2();
1592  }
1593 
1594  cout << "Statistics on particles found:" << endl;
1595 
1596  for (map<Int_t, map<Int_t, int> >::iterator i = particleCounts.begin(); i != particleCounts.end(); ++i)
1597  {
1598  string muchParticle = (10000 <= i->first || -10000 >= i->first) ? "Undefined MUCH particle" : TDatabasePDG::Instance()->GetParticle(i->first)->GetName();
1599  cout << "For MUCH particle [ " << muchParticle << " ] ( PDG = " << i->first << " ) found STS joints to:" << endl;
1600 
1601  for (map<Int_t, int>::iterator j = i->second.begin(); j != i->second.end(); ++j)
1602  {
1603  string stsParticle = (10000 <= j->first || -10000 >= j->first) ? "Undefined STS particle" : TDatabasePDG::Instance()->GetParticle(j->first)->GetName();
1604  cout << "\t" << j->second << " [ " << stsParticle << " ] ( PDG = " << j->first << " )" << endl;
1605  }
1606  }*/
1607  TFile* curFile = TFile::CurrentFile();
1608 #ifdef MAKE_HISTOS
1609 #ifdef MAKE_DISPERSE_2D_HISTOS
1610  char histoFileName[128];
1611 
1612  for (int i = 0; i < 6; ++i) {
1613  sprintf(histoFileName, "disperseL_histo_%d.root", i);
1614  SaveHisto(disperseLHistos[i], histoFileName);
1615  sprintf(histoFileName, "disperseR_histo_%d.root", i);
1616  SaveHisto(disperseRHistos[i], histoFileName);
1617  sprintf(histoFileName, "disperseD_histo_%d.root", i);
1618  SaveHisto(disperseDHistos[i], histoFileName);
1619  }
1620 #endif //MAKE_DISPERSE_2D_HISTOS
1621 #endif //MAKE_HISTOS
1622 
1623 #ifdef MAKE_HISTOS
1624  {
1625  TFile fh("effByMomentumProfile.root", "RECREATE");
1626  effByMomentumProfile->Write();
1627  fh.Close();
1628  delete effByMomentumProfile;
1629  }
1630 
1631  SaveHisto(stsTrackChi2, "stsTrackChi2.root");
1632  SaveHisto(stsTrackX, "stsTrackX.root");
1633  SaveHisto(stsTrackY, "stsTrackY.root");
1634 
1635  SaveHisto(muPlusDtxHisto, "muPlusDtxHisto.root");
1636  SaveHisto(muMinusDtxHisto, "muMinusDtxHisto.root");
1637  SaveHisto(signalXAtZ0, "signalXAtZ0.root");
1638  SaveHisto(signalYAtZ0, "signalYAtZ0.root");
1639  SaveHisto(bgrXAtZ0, "bgrXAtZ0.root");
1640  SaveHisto(bgrYAtZ0, "bgrYAtZ0.root");
1641  SaveHisto(signalInterTracksDistance, "signalInterTracksDistance.root");
1642  SaveHisto(bgrInterTracksDistance, "bgrInterTracksDistance.root");
1643  SaveHisto(signalTanSigns, "signalTanSigns.root");
1644  SaveHisto(signalCoordSigns, "signalCoordSigns.root");
1645  SaveHisto(bgrTanSigns, "bgrTanSigns.root");
1646  SaveHisto(bgrCoordSigns, "bgrCoordSigns.root");
1647  SaveHisto(numberOfTracks, "numberOfTracks.root");
1649  "signalInterTracksDistanceOn1st.root");
1650  SaveHisto(bgrInterTracksDistanceOn1st, "bgrInterTracksDistanceOn1st.root");
1652  "bgrInterTracksDistanceOn1stSigns.root");
1653  SaveHisto(signalInterTracksAngle, "signalInterTracksAngle.root");
1654  SaveHisto(bgrInterTracksAngle, "bgrInterTracksAngle.root");
1655  SaveHisto(signalInterTrackCorrDA, "signalInterTrackCorrDA.root");
1656  SaveHisto(bgrInterTrackCorrDA, "bgrInterTrackCorrDA.root");
1657  SaveHisto(muchMomErrSig, "muchMomErrSig.root");
1658  SaveHisto(muchMomErrBgr, "muchMomErrBgr.root");
1659 #ifdef MAKE_TRIGGERING_HISTOS
1660  complexFileName = "triggeringAllTracksVertices";
1661  complexFileName += fileSaveSuffix;
1662  complexFileName += ".root";
1663  SaveHisto(triggeringAllTracksVertices, complexFileName);
1664  complexFileName = "triggeringDistTracksVertices";
1665  complexFileName += fileSaveSuffix;
1666  complexFileName += ".root";
1667  SaveHisto(triggeringDistTracksVertices, complexFileName);
1668  complexFileName = "triggeringSignTracksVertices";
1669  complexFileName += fileSaveSuffix;
1670  complexFileName += ".root";
1671  SaveHisto(triggeringSignTracksVertices, complexFileName);
1672  complexFileName = "triggeringTrigTracksVertices";
1673  complexFileName += fileSaveSuffix;
1674  complexFileName += ".root";
1675  SaveHisto(triggeringTrigTracksVertices, complexFileName);
1676 #endif //MAKE_TRIGGERING_HISTOS
1677 
1678 #endif //MAKE_HISTOS
1679 
1680  TFile::CurrentFile() = curFile;
1681 
1682 #ifdef MAKE_EFF_CALC
1683  incomplete_events.close();
1684 #endif //MAKE_EFF_CALC
1685 
1686  delete superEventData;
1687 
1688 #ifdef MAKE_EFF_CALC
1689  ofstream fjtofs("../false_jpsi_triggerings.txt",
1690  ios_base::out | ios_base::app);
1691  fjtofs << falseSignalTriggerings << endl;
1692 #endif //MAKE_EFF_CALC
1693 
1694  complexFileName = "particles_count_all";
1695  complexFileName += fileSaveSuffix;
1696  complexFileName += ".txt";
1697  ofstream pcaofs(complexFileName);
1698 
1699  for (map<string, unsigned int>::iterator i = particlesCountAll.begin();
1700  i != particlesCountAll.end();
1701  ++i)
1702  pcaofs << i->first << ": " << i->second << endl;
1703 
1704  complexFileName = "particles_count_sign";
1705  complexFileName += fileSaveSuffix;
1706  complexFileName += ".txt";
1707  ofstream pcsofs(complexFileName);
1708 
1709  for (map<string, unsigned int>::iterator i = particlesCountSign.begin();
1710  i != particlesCountSign.end();
1711  ++i)
1712  pcsofs << i->first << ": " << i->second << endl;
1713 
1714  complexFileName = "particles_count_dist";
1715  complexFileName += fileSaveSuffix;
1716  complexFileName += ".txt";
1717  ofstream pcdofs(complexFileName);
1718 
1719  for (map<string, unsigned int>::iterator i = particlesCountDist.begin();
1720  i != particlesCountDist.end();
1721  ++i)
1722  pcdofs << i->first << ": " << i->second << endl;
1723 
1724  complexFileName = "particles_count_trig";
1725  complexFileName += fileSaveSuffix;
1726  complexFileName += ".txt";
1727  ofstream pctofs(complexFileName);
1728 
1729  for (map<string, unsigned int>::iterator i = particlesCountTrig.begin();
1730  i != particlesCountTrig.end();
1731  ++i)
1732  pctofs << i->first << ": " << i->second << endl;
1733 
1734  if (hitFileName != "") hitFile.Close();
1735 
1736  FairTask::FinishTask();
1737 }
1738 
1740 #ifdef MAKE_HISTOS
1741  TFile* curFile = TFile::CurrentFile();
1742 
1743  TFile fh("jpsi_inv_mass_histo.root", "RECREATE");
1744  massHisto->Write();
1745  fh.Close();
1746  delete massHisto;
1747 
1748  TFile::CurrentFile() = curFile;
1749 #endif //MAKE_HISTOS
1750 }
1751 
1753 #ifdef MAKE_HISTOS
1754  for (list<CbmStsTrack>::iterator i = positiveTracks.begin();
1755  i != positiveTracks.end();
1756  ++i) {
1757  CbmStsTrack& t1 = *i;
1758  CbmKFTrack muPlus(t1);
1759 
1760  for (list<CbmStsTrack>::iterator j = negativeTracks.begin();
1761  j != negativeTracks.end();
1762  ++j) {
1763  CbmStsTrack& t2 = *j;
1764  CbmKFTrack muMinus(t2);
1765  vector<CbmKFTrackInterface*> kfData;
1766  kfData.push_back(&muPlus);
1767  kfData.push_back(&muMinus);
1768  //CbmKFParticle DiMu;
1769  //DiMu.Construct(kfData, 0);
1770  //DiMu.TransportToDecayVertex();
1771  //scaltype m, merr;
1772  //DiMu.GetMass(m, merr);
1773 
1774  //for (int k = 0; k < 1000; ++k)
1775  //backgroundMassHisto->Fill(m);
1776  }
1777  }
1778 
1779  TFile* curFile = TFile::CurrentFile();
1780 
1781  TFile fh("tracks_tree.root", "RECREATE");
1782  superEventTracks->Write();
1783  fh.Close();
1784  delete superEventTracks;
1785 
1786  TFile::CurrentFile() = curFile;
1787 #endif //MAKE_HISTOS
1788 }
1789 
1791 #ifdef MAKE_HISTOS
1792  TFile* curFile = TFile::CurrentFile();
1793 
1794  TFile fh("signal_chi2_histo.root", "RECREATE");
1795  signalChi2Histo->Write();
1796  fh.Close();
1797  delete signalChi2Histo;
1798 
1799  TFile::CurrentFile() = curFile;
1800 #endif //MAKE_HISTOS
1801 }
1802 
1804 #ifdef MAKE_HISTOS
1805  TFile* curFile = TFile::CurrentFile();
1806 
1807  TFile fh("background_chi2_histo.root", "RECREATE");
1808  backgroundChi2Histo->Write();
1809  fh.Close();
1810  delete backgroundChi2Histo;
1811 
1812  TFile::CurrentFile() = curFile;
1813 #endif //MAKE_HISTOS
1814 }
1815 
1816 bool LxFinder::ReadEvent(Int_t evNum) { return hitFile.ReadEvent(evNum); }
LxFinder
Definition: Simple/Lx.h:73
y_disp_right_limits_sq
scaltype y_disp_right_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:32
LxTrack
Definition: LxCA.h:268
GetHistoCOV
static bool GetHistoCOV(const char *histoNameBase, Int_t histoNumber, Int_t axis1, Int_t axis2, scaltype &retVal)
Definition: Simple/Lx.cxx:318
LxMCPoint
Definition: Simple/LxMC.h:16
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
LxFinder::MCStsPointsByStations
std::list< LxStsMCPoint * > MCStsPointsByStations[8]
Definition: Simple/Lx.h:206
LxFinder::fInstance
static LxFinder * fInstance
Definition: Simple/Lx.h:135
LxFinder::calcMiddlePoints
bool calcMiddlePoints
Definition: Simple/Lx.h:193
LxStation::layers
std::vector< LxLayer * > layers
Definition: LxCA.h:190
disperseLHistos
TProfile2D * disperseLHistos[LXSTATIONS]
Definition: riplet/Lx.cxx:41
LxFinder::bgrInterTracksDistance
static TH1F * bgrInterTracksDistance
Definition: Simple/Lx.h:166
CbmMCTrack::GetStartX
Double_t GetStartX() const
Definition: CbmMCTrack.h:75
h
Generates beam ions for transport simulation.
Definition: CbmBeamGenerator.h:17
zCoordsByStations
Double_t zCoordsByStations[LXSTATIONS][LXLAYERS]
Definition: riplet/Lx.cxx:70
GetHistoRMS
static bool GetHistoRMS(const char *histoNameBase, Int_t histoNumber, scaltype &retVal)
Definition: Simple/Lx.cxx:285
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
y_disp_left_limits
scaltype y_disp_left_limits[LXSTATIONS]
Definition: LxCA.cxx:27
MCStsPointsByStations
std::list< LxStsMCPoint * > MCStsPointsByStations[8]
Definition: riplet/Lx.cxx:67
LxFinder::FinishTask
void FinishTask()
Definition: Simple/Lx.cxx:1581
LxFinder::bgrInterTracksDistanceOn1st
static TH1F * bgrInterTracksDistanceOn1st
Definition: Simple/Lx.h:175
CbmMuchPoint
Definition: CbmMuchPoint.h:21
f
float f
Definition: L1/vectors/P4_F32vec4.h:24
ty_limits
scaltype ty_limits[LXSTATIONS]
Definition: LxCA.cxx:23
LxStsMCPoint
Definition: Simple/Lx.h:67
LxFinder::muMinusDtxHisto
static TH1F * muMinusDtxHisto
Definition: Simple/Lx.h:160
CbmPixelHit::Position
void Position(TVector3 &pos) const
Copies hit position to pos.
Definition: CbmPixelHit.cxx:64
LxFinder::saveOnlyTriggeringTracks
bool saveOnlyTriggeringTracks
Definition: Simple/Lx.h:226
LxHitFile::evBuf
char * evBuf
Definition: Simple/Lx.h:59
CbmMatch::GetLink
const CbmLink & GetLink(Int_t i) const
Definition: CbmMatch.h:35
LxMCTrack::fUniqueID
UInt_t fUniqueID
Definition: Simple/LxMC.h:35
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
LxFinder::numberOfTracks
static TH1F * numberOfTracks
Definition: Simple/Lx.h:171
LxFinder::SaveBackground
void SaveBackground()
Definition: Simple/Lx.cxx:1752
CbmStsKFTrackFitter::Extrapolate
void Extrapolate(CbmStsTrack *track, Double_t z, FairTrackParam *e_track)
Definition: CbmStsKFTrackFitter.cxx:134
LxMCTrack::q
scaltype q
Definition: Simple/LxMC.h:28
LxFinder::triggeringAllTracksVertices
static TH1F * triggeringAllTracksVertices
Definition: Simple/Lx.h:228
LxFinder::Exec
void Exec(Option_t *opt)
Definition: Simple/Lx.cxx:762
LxFinder::extFitter
CbmStsKFTrackFitter extFitter
Definition: Simple/Lx.h:183
LxMCPoint::p
scaltype p
Definition: Simple/LxMC.h:17
scaltype
#define scaltype
Definition: CbmGlobalTrackingDefs.h:17
LxHitFile::~LxHitFile
~LxHitFile()
Definition: Simple/Lx.cxx:77
LxStation::txLimit
scaltype txLimit
Definition: LxCA.h:208
memset
void memset(T *dest, T i, size_t num)
Definition: L1Grid.cxx:21
SaveHisto
static void SaveHisto(TH1 *histo, const char *name)
Definition: Simple/Lx.cxx:1566
LxHitFile::useForWrite
bool useForWrite
Definition: Simple/Lx.h:56
LxFinder::massHisto
static TH1F * massHisto
Definition: Simple/Lx.h:153
LxMCTrack::pdg
Int_t pdg
Definition: Simple/LxMC.h:30
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
LxPoint::hitId
Int_t hitId
Definition: LxCA.h:61
LxStsMCPoint::stationNumber
Int_t stationNumber
Definition: Simple/Lx.h:69
LxFinder::triggeringTrigTracksVertices
static TH1F * triggeringTrigTracksVertices
Definition: Simple/Lx.h:231
LxFinder::particlesCountAll
std::map< string, unsigned int > particlesCountAll
Definition: Simple/Lx.h:233
LxTrack::length
int length
Definition: LxCA.h:280
LxMCPoint::x
scaltype x
Definition: Simple/LxMC.h:17
CbmMuchCluster
Data container for MUCH clusters.
Definition: CbmMuchCluster.h:20
LxFinder::superEventData
CbmStsTrack * superEventData
Definition: Simple/Lx.h:151
LxSpace::RestoreMiddlePoints
void RestoreMiddlePoints()
Definition: LxCA.cxx:1846
LxSpace::z_coords
scal_coords * z_coords
Definition: LxCA.h:316
CbmStsKFTrackFitter::GetChiToVertex
Double_t GetChiToVertex(CbmStsTrack *track, CbmVertex *vtx=0)
Definition: CbmStsKFTrackFitter.cxx:164
incomplete_events
std::ofstream incomplete_events
Definition: riplet/Lx.cxx:76
MCPoints
std::vector< LxMCPoint > MCPoints
Definition: riplet/Lx.cxx:63
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
LxSpace::tracks
std::list< LxTrack * > tracks
Definition: LxCA.h:326
disperseRHistos
TProfile2D * disperseRHistos[LXSTATIONS]
Definition: riplet/Lx.cxx:42
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
LxFinder::bgrInterTracksDistanceOn1stSigns
static TH1F * bgrInterTracksDistanceOn1stSigns
Definition: Simple/Lx.h:178
LxFinder::Trigger
bool Trigger()
Definition: LxTrigger.cxx:6
CbmTrackMatch::GetNofFakeHits
Int_t GetNofFakeHits() const
Definition: CbmTrackMatch.h:53
LxHitFile::eventOffs
std::list< off_t > eventOffs
Definition: Simple/Lx.h:58
LxMCTrack::p
scaltype p
Definition: Simple/LxMC.h:28
LxFinder::eventNumber
Int_t eventNumber
Definition: Simple/Lx.h:221
LxFinder::signalInterTracksDistance
static TH1F * signalInterTracksDistance
Definition: Simple/Lx.h:165
LxFinder::listStsMatches
TClonesArray * listStsMatches
Definition: Simple/Lx.h:142
LxFinder::MCTracks
std::vector< LxMCTrack > MCTracks
Definition: Simple/Lx.h:204
LxMCPoint::z
scaltype z
Definition: Simple/LxMC.h:17
CbmTrackMatch
Definition: CbmTrackMatch.h:18
CbmMuchPoint::GetDetectorId
Int_t GetDetectorId() const
Definition: CbmMuchPoint.h:69
LxFinder::MCPoints
std::vector< LxMCPoint > MCPoints
Definition: Simple/Lx.h:202
LxFinder::particlesCountDist
std::map< string, unsigned int > particlesCountDist
Definition: Simple/Lx.h:235
LxStsMCPoint::y
scaltype y
Definition: Simple/Lx.h:68
LxMCPoint::py
scaltype py
Definition: Simple/LxMC.h:17
CbmTrack::SetPreviousTrackId
void SetPreviousTrackId(Int_t previousTrackId)
Definition: CbmTrack.h:72
wholeDuration
static Int_t wholeDuration
Definition: Simple/Lx.cxx:759
LxFinder::~LxFinder
~LxFinder()
Definition: Simple/Lx.cxx:280
LxMCTrack::Points
std::vector< LxMCPoint * > Points
Definition: Simple/LxMC.h:31
LxSpace::extTracks
std::list< LxExtTrack > extTracks
Definition: LxCA.h:327
LxFinder::listMuchPts
TClonesArray * listMuchPts
Definition: Simple/Lx.h:138
LxFinder::verbosity
Int_t verbosity
Definition: Simple/Lx.h:195
LxMCPoint::layerNumber
Int_t layerNumber
Definition: Simple/LxMC.h:18
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
LXLAYERS
#define LXLAYERS
Definition: Simple/LxSettings.h:8
caSpace
LxSpace caSpace
Definition: riplet/Lx.cxx:72
LxFinder::parallMode
bool parallMode
Definition: Simple/Lx.h:196
CbmMCTrack::GetPx
Double_t GetPx() const
Definition: CbmMCTrack.h:72
LxMCPoint::px
scaltype px
Definition: Simple/LxMC.h:17
CbmTrackMatch::GetNofTrueHits
Int_t GetNofTrueHits() const
Definition: CbmTrackMatch.h:47
LxFinder::signalXAtZ0
static TH1F * signalXAtZ0
Definition: Simple/Lx.h:161
CbmMCTrack::GetPy
Double_t GetPy() const
Definition: CbmMCTrack.h:73
x_disp_left_limits
scaltype x_disp_left_limits[LXSTATIONS]
Definition: LxCA.cxx:25
LxFinder::linkWithSts
bool linkWithSts
Definition: Simple/Lx.h:191
LxFinder::falseSignalTriggerings
Int_t falseSignalTriggerings
Definition: Simple/Lx.h:216
LxHitFile::Open
bool Open(TString fileName, bool forWrite)
Definition: Simple/Lx.cxx:79
CbmTrack::SetParamLast
void SetParamLast(const FairTrackParam *par)
Definition: CbmTrack.h:76
LxFinder::hitFileName
TString hitFileName
Definition: Simple/Lx.h:197
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmTrack::SetNDF
void SetNDF(Int_t ndf)
Definition: CbmTrack.h:71
LxTrack::chi2
scaltype chi2
Definition: LxCA.h:283
LXMIDDLE
#define LXMIDDLE
Definition: Simple/LxSettings.h:10
LxFinder::generateChi2
bool generateChi2
Definition: Simple/Lx.h:190
LxFinder::bgrTanSigns
static TH1F * bgrTanSigns
Definition: Simple/Lx.h:169
LxMCTrack::y
scaltype y
Definition: Simple/LxMC.h:28
LxFinder::listMuchPixelDigiMatches
TClonesArray * listMuchPixelDigiMatches
Definition: Simple/Lx.h:140
CbmStsKFTrackFitter::DoFit
Int_t DoFit(CbmStsTrack *track, Int_t pidHypo=211)
Definition: CbmStsKFTrackFitter.cxx:79
LxFinder::generateBackground
bool generateBackground
Definition: Simple/Lx.h:189
LxStation::txBreakSigma
scaltype txBreakSigma
Definition: LxCA.h:212
LxFinder::SaveSignalChi2
void SaveSignalChi2()
Definition: Simple/Lx.cxx:1790
LxStation::tyBreakLimit
scaltype tyBreakLimit
Definition: LxCA.h:211
CbmMuchTrack
Definition: CbmMuchTrack.h:16
y_disp_right_limits
scaltype y_disp_right_limits[LXSTATIONS]
Definition: LxCA.cxx:31
LxMCPoint::trackId
Int_t trackId
Definition: Simple/LxMC.h:21
CbmMuchDigiMatch
Definition: CbmMuchDigiMatch.h:17
LxFinder::triggeringSignTracksVertices
static TH1F * triggeringSignTracksVertices
Definition: Simple/Lx.h:230
LxPoint
Definition: LxCA.h:52
CbmTrack::SetFlag
void SetFlag(Int_t flag)
Definition: CbmTrack.h:69
CbmCluster::GetNofDigis
Int_t GetNofDigis() const
Number of digis in cluster.
Definition: CbmCluster.h:69
linkWithSts
bool linkWithSts
Definition: riplet/Lx.cxx:57
LxFinder::ReadEvent
bool ReadEvent(Int_t evNum)
Definition: Simple/Lx.cxx:1816
CbmMuchCluster.h
Data container for MUCH clusters.
MAKE_EFF_CALC
#define MAKE_EFF_CALC
Definition: Simple/LxSettings.h:32
LxStsMCPoint::x
scaltype x
Definition: Simple/Lx.h:68
CbmMCTrack::GetStartZ
Double_t GetStartZ() const
Definition: CbmMCTrack.h:77
ty_limits_sq
scaltype ty_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:24
LxStation::txBreakLimit
scaltype txBreakLimit
Definition: LxCA.h:210
particleType
static TString particleType("jpsi")
LxExtTrack
Definition: LxCA.h:249
CbmStsPoint::PositionOut
void PositionOut(TVector3 &pos)
Definition: CbmStsPoint.h:96
LxMCTrack::externalTrack
CbmStsTrack * externalTrack
Definition: Simple/LxMC.h:36
PI
#define PI
Definition: HagedornSpectrum.h:5
LxFinder::hasSignalInEvent
bool hasSignalInEvent
Definition: Simple/Lx.h:218
x_disp_right_limits_sq
scaltype x_disp_right_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:30
LxSpace::InitGlobalCAArrays
void InitGlobalCAArrays()
Definition: LxCA.cxx:44
CbmMuchGeoScheme::GetLayerIndex
static Int_t GetLayerIndex(Int_t address)
Definition: CbmMuchGeoScheme.h:71
LxExtTrack::mcTrack
LxMCTrack * mcTrack
Definition: LxCA.h:252
CbmMuchGeoScheme::GetStationIndex
static Int_t GetStationIndex(Int_t address)
Definition: CbmMuchGeoScheme.h:68
LxFinder::particlesCountTrig
std::map< string, unsigned int > particlesCountTrig
Definition: Simple/Lx.h:236
LxSpace::muchStsBreakY
scaltype muchStsBreakY
Definition: LxCA.h:329
LxMCPoint::stationNumber
Int_t stationNumber
Definition: Simple/LxMC.h:18
CbmMuchPoint.h
LxFinder::muchMomErrBgr
static TH1F * muchMomErrBgr
Definition: Simple/Lx.h:180
LxStsMCPoint::py
scaltype py
Definition: Simple/Lx.h:68
CbmMuchTrack.h
LxStsMCPoint::mcTrack
LxMCTrack * mcTrack
Definition: Simple/Lx.h:70
LxFinder::particlesCountSign
std::map< string, unsigned int > particlesCountSign
Definition: Simple/Lx.h:234
positiveTracks
std::list< CbmStsTrack > positiveTracks
Definition: riplet/Lx.cxx:52
LxFinder::listStsPts
TClonesArray * listStsPts
Definition: Simple/Lx.h:144
LxSpace::y_coords
scal_coords * y_coords
Definition: LxCA.h:313
LxFinder::useMCPInsteadOfHits
bool useMCPInsteadOfHits
Definition: Simple/Lx.h:192
LxSpace::muchStsBreakTy
scaltype muchStsBreakTy
Definition: LxCA.h:331
LxFinder::signalInterTracksDistanceOn1st
static TH1F * signalInterTracksDistanceOn1st
Definition: Simple/Lx.h:172
LxFinder::SaveRecoTracks
void SaveRecoTracks()
Definition: Simple/Lx.cxx:1412
LxHitFile::evPtr
char * evPtr
Definition: Simple/Lx.h:61
LxFinder::listMCTracks
TClonesArray * listMCTracks
Definition: Simple/Lx.h:137
CbmStsAddress::GetElementId
UInt_t GetElementId(Int_t address, Int_t level)
Get the index of an element.
Definition: CbmStsAddress.cxx:180
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
LxFinder::SaveEventTracks
void SaveEventTracks()
Definition: Simple/LxUtils.cxx:6
CbmVertex
Definition: CbmVertex.h:26
LxSpace::stations
std::vector< LxStation * > stations
Definition: LxCA.h:325
LxFinder::trueSignalTriggerings
Int_t trueSignalTriggerings
Definition: Simple/Lx.h:217
CbmStsPoint::MomentumOut
void MomentumOut(TVector3 &mom)
Definition: CbmStsPoint.h:97
LxHitFile::LxHitFile
LxHitFile()
Definition: Simple/Lx.cxx:74
LxDraw.h
LxFinder::Instance
static LxFinder * Instance()
Definition: Simple/Lx.cxx:249
Lx.h
LxFinder::positiveTracks
std::list< CbmStsTrack > positiveTracks
Definition: Simple/Lx.h:186
CbmTrack::SetChiSq
void SetChiSq(Double_t chiSq)
Definition: CbmTrack.h:70
LxFinder::Init
InitStatus Init()
Definition: Simple/Lx.cxx:346
LxMCPoint::track
LxMCTrack * track
Definition: Simple/LxMC.h:22
LxSpace::AddPoint
LxPoint * AddPoint(int stationNumber, int layerNumber, int hitId, scaltype x, scaltype y, scaltype z, scaltype dx, scaltype dy, scaltype dz)
Definition: LxCA.h:339
CbmMuchPoint::PositionOut
void PositionOut(TVector3 &pos) const
Definition: CbmMuchPoint.h:80
CbmVertex::GetZ
Double_t GetZ() const
Definition: CbmVertex.h:70
LxFinder::MCStsPoints
std::list< LxStsMCPoint > MCStsPoints
Definition: Simple/Lx.h:205
LxSpace::BuildRaysGlobal
void BuildRaysGlobal()
CbmKFTrack.h
LxSpace::Reconstruct
void Reconstruct()
Definition: LxCA.cxx:2107
LxTrack::mcTrack
LxMCTrack * mcTrack
Definition: LxCA.h:276
LxStation::tyLimit
scaltype tyLimit
Definition: LxCA.h:209
LxFinder::signalInterTracksAngle
static TH1F * signalInterTracksAngle
Definition: Simple/Lx.h:173
LxMCTrack::px
scaltype px
Definition: Simple/LxMC.h:28
nTimes
static Int_t nTimes
Definition: Simple/Lx.cxx:758
LxFinder::bgrInterTracksAngle
static TH1F * bgrInterTracksAngle
Definition: Simple/Lx.h:176
LxPoint::mcPoints
std::list< LxMCPoint * > mcPoints
Definition: LxCA.h:63
CbmMuchPoint::MomentumOut
void MomentumOut(TVector3 &mom) const
Definition: CbmMuchPoint.h:81
cutCoeff
Double_t cutCoeff
Definition: riplet/Lx.cxx:60
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
LxStsMCPoint::px
scaltype px
Definition: Simple/Lx.h:68
LxMCTrack::z
scaltype z
Definition: Simple/LxMC.h:28
LxHitFile::bufSize
int bufSize
Definition: Simple/Lx.h:60
generateChi2
bool generateChi2
Definition: riplet/Lx.cxx:56
averageDuration
static Int_t averageDuration
Definition: Simple/Lx.cxx:760
CbmKFParticle.h
LxStsMCPoint::p
scaltype p
Definition: Simple/Lx.h:68
LxFinder::bgrCoordSigns
static TH1F * bgrCoordSigns
Definition: Simple/Lx.h:170
LxExtTrack::extId
Int_t extId
Definition: LxCA.h:251
LxFinder::muchMomErrSig
static TH1F * muchMomErrSig
Definition: Simple/Lx.h:179
LxTrack::triggering
bool triggering
Definition: LxCA.h:296
CbmTrackMatch::GetNofWrongHits
Int_t GetNofWrongHits() const
Definition: CbmTrackMatch.h:50
LxFinder::caSpace
LxSpace caSpace
Definition: Simple/Lx.h:211
LxExtTrack::track
CbmStsTrack * track
Definition: LxCA.h:250
LxHitFile::ReadEvent
bool ReadEvent(Int_t eventNumber)
Definition: Simple/Lx.cxx:144
LxFinder::CalcInvMass
void CalcInvMass()
Definition: Simple/Lx.cxx:1453
LxFinder::MatchRecoToMC
void MatchRecoToMC()
Definition: Simple/LxEff.cxx:135
LxFinder::signalCounter
Int_t signalCounter
Definition: Simple/Lx.h:219
LxFinder::hitFile
LxHitFile hitFile
Definition: Simple/Lx.h:237
LxFinder::SaveInvMass
void SaveInvMass()
Definition: Simple/Lx.cxx:1739
negativeTracks
std::list< CbmStsTrack > negativeTracks
Definition: riplet/Lx.cxx:53
LxMCTrack::x
scaltype x
Definition: Simple/LxMC.h:28
LxFinder::LxFinder
LxFinder()
Definition: Simple/Lx.cxx:251
LxFinder::SaveBackgroundChi2
void SaveBackgroundChi2()
Definition: Simple/Lx.cxx:1803
LxFinder::signalYAtZ0
static TH1F * signalYAtZ0
Definition: Simple/Lx.h:162
LxSpace::JoinExtTracks
void JoinExtTracks()
Definition: LxCA.cxx:2232
LxSpace::RefineMiddlePoints
void RefineMiddlePoints()
CbmMCTrack::GetStartY
Double_t GetStartY() const
Definition: CbmMCTrack.h:76
LxMCTrack::pz
scaltype pz
Definition: Simple/LxMC.h:28
stsTrackChi2
static TH1F * stsTrackChi2
Definition: Simple/Lx.cxx:69
LxFinder::listStsTracks
TClonesArray * listStsTracks
Definition: Simple/Lx.h:141
LxFinder::signalCoordSigns
static TH1F * signalCoordSigns
Definition: Simple/Lx.h:168
y_disp_left_limits_sq
scaltype y_disp_left_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:28
x_disp_left_limits_sq
scaltype x_disp_left_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:26
LxSpace::ConnectNeighbours
void ConnectNeighbours()
Definition: LxCA.cxx:2031
x_disp_right_limits
scaltype x_disp_right_limits[LXSTATIONS]
Definition: LxCA.cxx:29
CbmStsPoint.h
points
TClonesArray * points
Definition: Analyze_matching.h:18
CbmMCTrack.h
LxFinder::bgrInterTrackCorrDA
static TH2F * bgrInterTrackCorrDA
Definition: Simple/Lx.h:177
LxFinder::bgrYAtZ0
static TH1F * bgrYAtZ0
Definition: Simple/Lx.h:164
stsTrackY
static TH1F * stsTrackY
Definition: Simple/Lx.cxx:71
LxStation::zCoord
scaltype zCoord
Definition: LxCA.h:207
LxTrack::points
LxPoint * points[LXSTATIONS *LXLAYERS]
Definition: LxCA.h:282
LxStation
Definition: LxCA.h:189
LxFinder::negativeTracks
std::list< CbmStsTrack > negativeTracks
Definition: Simple/Lx.h:187
tx_limits_sq
scaltype tx_limits_sq[LXSTATIONS]
Definition: LxCA.cxx:22
LxFinder::listMuchClusters
TClonesArray * listMuchClusters
Definition: Simple/Lx.h:139
CbmMCTrack
Definition: CbmMCTrack.h:34
LxTrack::clone
bool clone
Definition: LxCA.h:292
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
LxHitFile::EndEvent
bool EndEvent()
Definition: Simple/Lx.cxx:105
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
calcMiddlePoints
bool calcMiddlePoints
Definition: riplet/Lx.cxx:59
CbmTrackMatch::GetMCTrackId
Int_t GetMCTrackId() const
Definition: CbmTrackMatch.h:44
ClassImp
ClassImp(LxFinder) using namespace std
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
LxHitFile::WriteHit
bool WriteHit(Int_t stationNumber, Int_t layerNumber, Double_t x, Double_t y, Double_t z, Double_t xErr, Double_t yErr, Double_t zErr)
Definition: Simple/Lx.cxx:115
pPtCut
bool pPtCut
Definition: riplet/Lx.cxx:61
CbmTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *par)
Definition: CbmTrack.h:75
LxHitFile::ReadHit
bool ReadHit(Int_t &stationNumber, Int_t &layerNumber, Double_t &x, Double_t &y, Double_t &z, Double_t &xErr, Double_t &yErr, Double_t &zErr)
Definition: Simple/Lx.cxx:199
LxFinder::listRecoTracks
TClonesArray * listRecoTracks
Definition: Simple/Lx.h:145
LxHitFile::fd
int fd
Definition: Simple/Lx.h:57
LxFinder::incomplete_events
std::ofstream incomplete_events
Definition: Simple/Lx.h:215
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
LxHitFile::Close
bool Close()
Definition: Simple/Lx.cxx:228
CbmStsAddress.h
tx_limits
scaltype tx_limits[LXSTATIONS]
Definition: LxCA.cxx:21
LxFinder::generateInvMass
bool generateInvMass
Definition: Simple/Lx.h:188
generateInvMass
bool generateInvMass
Definition: riplet/Lx.cxx:54
kMUCHPIXELHIT
@ kMUCHPIXELHIT
Definition: CbmHit.h:23
LxMCPoint::pz
scaltype pz
Definition: Simple/LxMC.h:17
LxFinder::fPrimVtx
CbmVertex * fPrimVtx
Definition: Simple/Lx.h:184
LxFinder::backgroundChi2Histo
static TH1F * backgroundChi2Histo
Definition: Simple/Lx.h:157
CbmMuchDigiMatch.h
LxFinder::superEventTracks
static TTree * superEventTracks
Definition: Simple/Lx.h:155
LxSpace::points_counts
int points_counts[LXSTATIONS][LXLAYERS]
Definition: LxCA.h:319
LxFinder::signalTanSigns
static TH1F * signalTanSigns
Definition: Simple/Lx.h:167
CbmMuchPixelHit
Definition: CbmMuchPixelHit.h:17
LxMCTrack
Definition: Simple/LxMC.h:27
LxStation::tyBreakSigma
scaltype tyBreakSigma
Definition: LxCA.h:213
LxFinder::cutCoeff
scaltype cutCoeff
Definition: Simple/Lx.h:194
LxSpace::muchStsBreakTx
scaltype muchStsBreakTx
Definition: LxCA.h:330
LxHitFile::StartEvent
bool StartEvent(Int_t nEnt)
Definition: Simple/Lx.cxx:92
CbmMuchGeoScheme.h
LxFinder::signalChi2Histo
static TH1F * signalChi2Histo
Definition: Simple/Lx.h:156
generateBackground
bool generateBackground
Definition: riplet/Lx.cxx:55
LxSpace::x_errs
scal_coords * x_errs
Definition: LxCA.h:312
LxHitFile::evEnd
char * evEnd
Definition: Simple/Lx.h:62
MAKE_DISPERSE_2D_HISTOS
#define MAKE_DISPERSE_2D_HISTOS
Definition: riplet/LxSettings.h:18
MCPointsByStations
std::list< LxMCPoint * > MCPointsByStations[LXSTATIONS][LXLAYERS]
Definition: riplet/Lx.cxx:69
CbmStsTrack
Definition: CbmStsTrack.h:37
LxSpace::y_errs
scal_coords * y_errs
Definition: LxCA.h:315
LxSpace::x_coords
scal_coords * x_coords
Definition: LxCA.h:310
CbmKFTrack
Definition: CbmKFTrack.h:21
LxFinder::fileSaveSuffix
TString fileSaveSuffix
Definition: Simple/Lx.h:198
LxFinder::effByMomentumProfile
static TProfile * effByMomentumProfile
Definition: Simple/Lx.h:158
LxFinder::muPlusDtxHisto
static TH1F * muPlusDtxHisto
Definition: Simple/Lx.h:159
LxSpace::point_refs
LxPoint * point_refs[LXSTATIONS][LXLAYERS][LXMAXPOINTSONSTATION]
Definition: LxCA.h:317
LxSpace::Clear
void Clear()
Definition: LxCA.cxx:1834
stsTrackX
static TH1F * stsTrackX
Definition: Simple/Lx.cxx:70
LxFinder::MatchMCToReco
void MatchMCToReco()
Definition: Simple/LxEff.cxx:8
LXSTATIONS
#define LXSTATIONS
Definition: Simple/LxSettings.h:9
CbmCluster::GetDigi
Int_t GetDigi(Int_t index) const
Get digi at position index.
Definition: CbmCluster.h:76
CbmTrack::AddHit
void AddHit(Int_t index, HitType type)
Definition: CbmTrack.cxx:75
CbmPixelHit::PositionError
void PositionError(TVector3 &dpos) const
Copies hit position error to pos.
Definition: CbmPixelHit.cxx:68
LxMCPoint::y
scaltype y
Definition: Simple/LxMC.h:17
eventNumber
Int_t eventNumber
Definition: riplet/Lx.cxx:78
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
LxFinder::bgrXAtZ0
static TH1F * bgrXAtZ0
Definition: Simple/Lx.h:163
LxFinder::muchPixelHits
TClonesArray * muchPixelHits
Definition: Simple/Lx.h:136
LxFinder::signalInterTrackCorrDA
static TH2F * signalInterTrackCorrDA
Definition: Simple/Lx.h:174
useMCPInsteadOfHits
bool useMCPInsteadOfHits
Definition: riplet/Lx.cxx:58
lxFinderParticleType
TString lxFinderParticleType
Definition: Simple/Lx.cxx:282
disperseDHistos
TProfile2D * disperseDHistos[LXSTATIONS]
Definition: riplet/Lx.cxx:43
LxStsMCPoint::z
scaltype z
Definition: Simple/Lx.h:68
CbmMCTrack::GetPz
Double_t GetPz() const
Definition: CbmMCTrack.h:74
LxMCTrack::mother_ID
Int_t mother_ID
Definition: Simple/LxMC.h:29
LxMCTrack::py
scaltype py
Definition: Simple/LxMC.h:28
LxStsMCPoint::pz
scaltype pz
Definition: Simple/Lx.h:68
LxFinder::triggeringDistTracksVertices
static TH1F * triggeringDistTracksVertices
Definition: Simple/Lx.h:229
LxSpace::muchStsBreakX
scaltype muchStsBreakX
Definition: LxCA.h:328
LxTrack::externalTrack
LxExtTrack * externalTrack
Definition: LxCA.h:269
MCTracks
std::vector< LxMCTrack > MCTracks
Definition: riplet/Lx.cxx:65
MCStsPoints
std::list< LxStsMCPoint > MCStsPoints
Definition: riplet/Lx.cxx:66