CbmRoot
CbmL1ReadEvent.cxx
Go to the documentation of this file.
1 /*
2  *====================================================================
3  *
4  * CBM Level 1 Reconstruction
5  *
6  * Authors: I.Kisel, S.Gorbunov, I. Rostovtseva (2016)
7  *
8  *
9  * e-mail : ikisel@kip.uni-heidelberg.de
10  *
11  *====================================================================
12  *
13  * Read Event information to L1
14  *
15  *====================================================================
16  */
17 
18 #include "CbmKF.h"
19 #include "CbmL1.h"
20 #include "CbmMatch.h"
21 #include "CbmStsAddress.h"
22 #include "CbmStsSetup.h"
23 #include "L1Algo/L1Algo.h"
24 #include "L1AlgoInputData.h"
25 
26 #include "CbmMatch.h"
27 #include "CbmMuchGeoScheme.h"
28 #include "CbmMuchPixelHit.h"
29 #include "CbmMuchPoint.h"
30 #include "CbmTofHit.h"
31 #include "CbmTofPoint.h"
32 #include "CbmTrdHit.h"
33 #include "CbmTrdPoint.h"
34 
35 //#include "CbmMvdHitMatch.h"
36 
37 
38 #include "TDatabasePDG.h"
39 #include "TRandom.h"
40 
41 #include <iostream>
42 #include <vector>
43 
44 using std::cout;
45 using std::endl;
46 using std::find;
47 using std::vector;
48 
49 //#define MVDIDEALHITS
50 //#define STSIDEALHITS
51 
52 
53 static bool compareZ(const int& a, const int& b) {
54  // return (CbmL1::Instance()->vMCPoints[a].z < CbmL1::Instance()->vMCPoints[b].z);
55  const CbmL1* l1 = CbmL1::Instance();
56  return l1->Get_Z_vMCPoint(a) < l1->Get_Z_vMCPoint(b);
57 }
58 
59 
60 struct TmpHit { // used for sort Hits before writing in the normal arrays
61  int iStripF,
62  iStripB; // indices of real-strips, sts-strips (one got from detector. They consist from parts with differen positions, so will be divided before using)
63  int indStripF, indStripB; // indices of L1-strips, indices in TmpStrip arrays
64  int iStation;
65  int ExtIndex; // index of hit in the TClonesArray array ( negative for MVD )
66  bool isStrip;
67  double u_front, u_back; // positions of strips
68  double x, y; // position of hit
69  double dx, dy, dxy;
70  double du, dv;
71  int iMC; // index of MCPoint in the vMCPoints array
72  double time, t_er, z;
73  int Det;
74  int id;
75  int track;
76  static bool Compare(const TmpHit& a, const TmpHit& b) {
77  return (a.iStation < b.iStation)
78  || ((a.iStation == b.iStation) && (a.y < b.y));
79  }
80 };
81 
82 struct TmpStrip {
85  int iStation;
86  int iStrip;
87  bool isStrip;
88  int effIndex; // used for unefficiency
89 };
90 
92 void CbmL1::ReadEvent(L1AlgoInputData* fData_, CbmEvent* event) {
93  if (fVerbose >= 10) cout << "ReadEvent: start." << endl;
94 
95  // clear arrays for next event
96  vMCPoints.clear();
98  vMCTracks.clear();
99  vStsHits.clear();
100  vRTracks.clear();
101  vHitMCRef.clear();
102  vHitStore.clear();
103  dFEI2vMCPoints.clear();
104  dFEI2vMCTracks.clear();
105  if (fVerbose >= 10) cout << "ReadEvent: clear is done." << endl;
106 
107  vector<TmpHit> tmpHits;
108  vector<TmpStrip> tmpStrips;
109  vector<TmpStrip> tmpStripsB;
110 
111  // -- produce Sts hits from space points --
112 
113  for (int i = 0; i < NStation; i++) {
114 
115  fData_->StsHitsStartIndex[i] = static_cast<THitI>(-1);
116  fData_->StsHitsStopIndex[i] = 0;
117  }
118 
119  //Int_t nMvdPoints = 0;
120  nMvdPoints = 0;
121  // get MVD hits
122  Int_t nMvdHits = 0;
123  Int_t nMuchHits = 0;
124  Int_t nTrdHits = 0;
125  Int_t nTofHits = 0;
126  // get STS hits
127  int nStsHits = 0;
128 
129  int nStsPoints = 0;
130  int nTrdPoints = 0;
131  nMuchPoints = 0;
132  int nTofPoints = 0;
133 
134  vector<CbmLink*> ToFPointsMatch;
135 
136  if (fPerformance) {
137  Fill_vMCTracks();
138 
139  for (DFSET::iterator set_it = vFileEvent.begin();
140  set_it != vFileEvent.end();
141  ++set_it) {
142  Int_t iFile = set_it->first;
143  Int_t iEvent = set_it->second;
144 
145 
146  if (fMvdPoints && listMvdPts) {
147  Int_t nMvdPointsInEvent = fMvdPoints->Size(iFile, iEvent);
148  for (Int_t iMC = 0; iMC < nMvdPointsInEvent; iMC++) {
149  CbmL1MCPoint MC;
150 
151  MC.event = iEvent;
152 
153  if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 1)) {
154  MC.iStation = -1;
155  L1Station* sta = algo->vStations;
156  for (Int_t iSt = 0; iSt < NStsStations; iSt++)
157  MC.iStation = (MC.z > sta[iSt].z[0] - 1) ? iSt : MC.iStation;
158 
159  Double_t dtrck = dFEI(iFile, iEvent, MC.ID);
160  DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck);
161  if (trk_it == dFEI2vMCTracks.end()) continue;
162  Int_t IND_Track = trk_it->second;
163  vMCTracks[IND_Track].Points.push_back(vMCPoints.size());
164 
165  MC.ID = trk_it->second;
166 
167  // vMCTracks[MC.ID].Points.push_back(vMCPoints.size());
168 
169  vMCPoints.push_back(MC);
170  vMCPoints_in_Time_Slice.push_back(0);
171 
172  dFEI2vMCPoints.insert(DFEI2I::value_type(dFEI(iFile, iEvent, iMC),
173  vMCPoints.size() - 1));
174  nMvdPoints++;
175  }
176  }
177  }
178 
179  Int_t nMC = fStsPoints->Size(iFile, iEvent);
180 
181  for (Int_t iMC = 0; iMC < nMC; iMC++) {
182  CbmL1MCPoint MC;
183 
184  MC.event = iEvent;
185 
186  if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 0)) {
187  MC.iStation = -1;
188  L1Station* sta = algo->vStations + NMvdStations;
189  for (Int_t iSt = 0; iSt < NStsStations; iSt++)
190  MC.iStation =
191  (MC.z > sta[iSt].z[0] - 2.5) ? (NMvdStations + iSt) : MC.iStation;
192 
193  Double_t dtrck = dFEI(iFile, iEvent, MC.ID);
194  DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck);
195  if (trk_it == dFEI2vMCTracks.end()) continue;
196  Int_t IND_Track = trk_it->second;
197  vMCTracks[IND_Track].Points.push_back(vMCPoints.size());
198 
199  MC.ID = trk_it->second;
200  vMCPoints.push_back(MC);
201  vMCPoints_in_Time_Slice.push_back(0);
202 
203  dFEI2vMCPoints.insert(DFEI2I::value_type(
204  dFEI(iFile, iEvent, iMC + nMvdPoints), vMCPoints.size() - 1));
205  nStsPoints++;
206  }
207  }
208 
209  if (fMuchPoints) {
210 
211  for (Int_t iMC = 0; iMC < fMuchPoints->Size(iFile, iEvent); iMC++) {
212  CbmL1MCPoint MC;
213 
214  MC.event = iEvent;
215 
216  if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 2)) {
217  MC.iStation = -1;
218  L1Station* sta = algo->vStations + NMvdStations + NStsStations;
219  for (Int_t iSt = 0; iSt < NMuchStations; iSt++)
220  MC.iStation = (MC.z > sta[iSt].z[0] - 2.5)
221  ? (NMvdStations + NStsStations + iSt)
222  : MC.iStation;
223 
224  Double_t dtrck = dFEI(iFile, iEvent, MC.ID);
225  DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck);
226  if (trk_it == dFEI2vMCTracks.end()) continue;
227  Int_t IND_Track = trk_it->second;
228 
229  vMCTracks[IND_Track].Points.push_back(vMCPoints.size());
230 
231  MC.ID = trk_it->second;
232  vMCPoints.push_back(MC);
233  vMCPoints_in_Time_Slice.push_back(0);
234 
235  dFEI2vMCPoints.insert(DFEI2I::value_type(
236  dFEI(iFile, iEvent, iMC + nMvdPoints + nStsPoints),
237  vMCPoints.size() - 1));
238  nMuchPoints++;
239  }
240  }
241  }
242 
243 
244  if (fTrdPoints)
245  for (Int_t iMC = 0; iMC < fTrdPoints->Size(iFile, iEvent); iMC++) {
246  CbmL1MCPoint MC;
247 
248  MC.event = iEvent;
249 
250 
251  if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 3)) {
252 
253  MC.iStation = -1;
254  L1Station* sta =
255  algo->vStations + NMvdStations + NStsStations + NMuchStations;
256  for (Int_t iSt = 0; iSt < NTrdStations; iSt++)
257  MC.iStation =
258  (MC.z > sta[iSt].z[0] - 4.0)
260  : MC.iStation;
261 
262 
263  Double_t dtrck = dFEI(iFile, iEvent, MC.ID);
264  DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck);
265  if (trk_it == dFEI2vMCTracks.end()) continue;
266  Int_t IND_Track = trk_it->second;
267 
268  vMCTracks[IND_Track].Points.push_back(vMCPoints.size());
269 
270  MC.ID = trk_it->second;
271  vMCPoints.push_back(MC);
272  vMCPoints_in_Time_Slice.push_back(0);
273 
274  dFEI2vMCPoints.insert(DFEI2I::value_type(
275  dFEI(iFile, iEvent, iMC + nMvdPoints + nStsPoints + nMuchPoints),
276  vMCPoints.size() - 1));
277  nTrdPoints++;
278  }
279  }
280 
281  ToFPointsMatch.resize(0);
282 
283  if (fTofPoints) {
284  for (int j = 0; j < fTofHits->GetEntries(); j++) {
285 
286  CbmTofHit* mh = L1_DYNAMIC_CAST<CbmTofHit*>(fTofHits->At(j));
287 
288  CbmMatch* matchHitMatch =
289  L1_DYNAMIC_CAST<CbmMatch*>(fTofHitDigiMatches->At(j));
290 
291  if (matchHitMatch->GetNofLinks() > 0) {
292 
293  CbmLink* link = (CbmLink*) &matchHitMatch->GetLink(0);
295  link->GetFile(), link->GetEntry(), link->GetIndex());
296 
297  for (int iLink = 1; iLink < matchHitMatch->GetNofLinks(); iLink++) {
298 
299  CbmLink* link1 = (CbmLink*) &(matchHitMatch->GetLink(iLink));
300 
301  CbmTofPoint* pt_cur = (CbmTofPoint*) fTofPoints->Get(
302  link1->GetFile(), link1->GetEntry(), link1->GetIndex());
303 
304  TVector3 pos_cur, pos_old, pos_hit;
305 
306 
307  pt_cur->Position(pos_cur);
308  pt->Position(pos_old);
309  mh->Position(pos_hit);
310 
311  if (fabs(pos_cur.Z() - pos_hit.Z())
312  < fabs(pos_old.Z() - pos_hit.Z())) {
313  pt = pt_cur;
314  link = link1;
315  }
316  }
317 
318  ToFPointsMatch.push_back(link);
319  } // for j
320  } // if listTrdHits
321 
322 
323  for (UInt_t iMC = 0; iMC < ToFPointsMatch.size(); iMC++) {
324  CbmL1MCPoint MC;
325 
326  MC.event = iEvent;
327 
328  int eventNr = ToFPointsMatch[iMC]->GetEntry();
329 
330  if (eventNr != iEvent) continue;
331 
332  if (!ReadMCPoint(&MC,
333  ToFPointsMatch[iMC]->GetIndex(),
334  ToFPointsMatch[iMC]->GetFile(),
335  ToFPointsMatch[iMC]->GetEntry(),
336  4)) {
337 
338  MC.iStation =
340 
341  Double_t dtrck = dFEI(iFile, eventNr, MC.ID);
342  DFEI2I::iterator trk_it = dFEI2vMCTracks.find(dtrck);
343  if (trk_it == dFEI2vMCTracks.end()) continue;
344 
345  Int_t IND_Track = trk_it->second;
346 
347  vMCTracks[IND_Track].Points.push_back(vMCPoints.size());
348 
349  MC.ID = trk_it->second;
350 
351  vMCPoints.push_back(MC);
352  vMCPoints_in_Time_Slice.push_back(0);
353 
354  dFEI2vMCPoints.insert(DFEI2I::value_type(
355  dFEI(iFile,
356  eventNr,
357  ToFPointsMatch[iMC]->GetIndex() + nMvdPoints + nStsPoints
358  + nMuchPoints + nTrdPoints),
359  vMCPoints.size() - 1));
360  nTofPoints++;
361  }
362  }
363  }
364 
365  } //time_slice
366 
367  for (unsigned int iTr = 0; iTr < vMCTracks.size(); iTr++) {
368 
369  sort(
370  vMCTracks[iTr].Points.begin(), vMCTracks[iTr].Points.end(), compareZ);
371 
372  if (vMCTracks[iTr].mother_ID >= 0) {
373  Double_t dtrck = dFEI(vMCTracks[iTr].iFile,
374  vMCTracks[iTr].iEvent,
375  vMCTracks[iTr].mother_ID);
376  DFEI2I::iterator map_it = dFEI2vMCTracks.find(dtrck);
377  if (map_it == dFEI2vMCTracks.end())
378  vMCTracks[iTr].mother_ID = -2;
379  else
380  vMCTracks[iTr].mother_ID = map_it->second;
381  }
382  } //iTr
383  if (fVerbose >= 10) cout << "Points in vMCTracks are sorted." << endl;
384 
385  } //fPerformance
386 
387 
388  // get MVD hits
389 
390  if (listMvdHits) {
391 
392  // if(listMvdPts)
393  // {
394  // isUsedMvdPoint.resize(nMC);
395  // for(int iMc=0; iMc<nMC; iMc++) isUsedMvdPoint[iMc]=0;
396  // }
397 
398  for (int j = 0; j < listMvdHits->GetEntries(); j++) {
399  TmpHit th;
400  {
401  CbmMvdHit* mh = L1_DYNAMIC_CAST<CbmMvdHit*>(listMvdHits->At(j));
402  th.ExtIndex = -(1 + j);
403  th.iStation = mh->GetStationNr();
404  // th.iSector = 0;
405  th.isStrip = 0;
406  th.iStripF = j;
407  th.iStripB = -1;
408  if (th.iStripF < 0) continue;
409  if (th.iStripF >= 0 && th.iStripB >= 0) th.isStrip = 1;
410  if (th.iStripB < 0) th.iStripB = th.iStripF;
411 
412  TVector3 pos, err;
413  mh->Position(pos);
414  mh->PositionError(err);
415 
416  th.dx = mh->GetDx();
417  th.dy = mh->GetDy();
418 
419  th.du = mh->GetDx();
420  th.dv = mh->GetDy();
421  th.dxy = mh->GetDxy();
422 
423  th.x = pos.X();
424  th.y = pos.Y();
425 
426  L1Station& st = algo->vStations[th.iStation];
427  th.u_front =
428  th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
429  th.u_back =
430  th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
431  }
432  th.Det = 0;
433  th.iMC = -1;
434  int iMC = -1;
435  // int iMCTr = -1;
436  // if( listMvdHitMatches ){
437  // CbmMvdHitMatch *match = (CbmMvdHitMatch*) listMvdHitMatches->At(j);
438  // if( match){
439  // iMC = match->GetPointId();
440  // iMCTr = match->GetTrackId();
441  // }
442  // }
443  if (fPerformance) {
444  if (listMvdHitMatches) {
445  CbmMatch* mvdHitMatch =
446  L1_DYNAMIC_CAST<CbmMatch*>(listMvdHitMatches->At(j));
447 
448 
449  if (mvdHitMatch->GetNofLinks() > 0)
450  if (mvdHitMatch->GetLink(0).GetIndex() < nMvdPoints) {
451  iMC = mvdHitMatch->GetLink(0).GetIndex();
452  th.iMC = iMC;
453  // th.track = iMC;
454  }
455  }
456  // if( listMvdPts && iMC>=0 ){ // TODO1: don't need this with FairLinks
457  // CbmL1MCPoint MC;
458  // if( ! ReadMCPoint( &MC, iMC, 1 ) ){
459  // MC.iStation = th.iStation;
460  // // isUsedMvdPoint[iMC] = 1;
461  //
462  // // MC.ID = iMCTr; // because atch->GetPointId() == 0 !!! and ReadMCPoint don't work
463  // // MC.z = th.iStation; // for sort in right order
464  //
465  // vMCPoints.push_back( MC );
466  // nMvdPoints++;
467  // vMCPoints_in_Time_Slice.push_back(0);
468  // th.iMC = vMCPoints.size()-1;
469  // }
470  // Int_t iFile =-1;
471  // Int_t iEvent=-1;
472  //
473  //
474  // if ( !fTimesliceMode )
475  // {
476  // iFile = vFileEvent.begin()->first;
477  // iEvent = vFileEvent.begin()->second;
478  // }
479  //
480  // Double_t dtrck =dFEI(iFile, iEvent, iMC);
481  // DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
482  // if (trk_it==dFEI2vMCPoints.end()) continue;
483  // iMC = trk_it->second;
484  //
485  // } // if listStsPts
486  }
487  //if( h.MC_Point >=0 ) // DEBUG !!!!
488  {
489  tmpHits.push_back(th);
490  nMvdHits++;
491  }
492  } // for j
493  } // if listMvdHits
494  if (fVerbose >= 10) cout << "ReadEvent: mvd hits are gotten." << endl;
495 
496 
497  if (listStsHits) {
498  Int_t nEnt = 0;
499  if (fTimesliceMode)
500  nEnt = listStsHits->GetEntries();
501  else
502  nEnt = (event ? event->GetNofData(ECbmDataType::kStsHit)
503  : listStsHits->GetEntries());
504 
505  for (Int_t j = 0; j < nEnt; j++) {
506  Int_t hitIndex = 0;
507  if (fTimesliceMode)
508  hitIndex = j;
509  else
510  hitIndex = (event ? event->GetIndex(ECbmDataType::kStsHit, j) : j);
511 
512  CbmStsHit* sh = L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(hitIndex));
513 
514  TmpHit th;
515  {
516  CbmStsHit* mh = L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(hitIndex));
517  th.ExtIndex = hitIndex;
518  th.Det = 1;
521  mh->GetAddress()); //mh->GetStationNr() - 1;
522  th.isStrip = 0;
523  th.iStripF = 0; //mh->GetFrontDigiId();
524  th.iStripB = 0; //mh->GetBackDigiId();
525 
526  //Get time
527  th.time = mh->GetTime();
528  th.t_er = mh->GetTimeError();
529 
530 
531  th.iStripF += nMvdHits;
532  th.iStripB += nMvdHits;
533 
534  TVector3 pos, err;
535  mh->Position(pos);
536  mh->PositionError(err);
537 
538  th.x = pos.X();
539  th.y = pos.Y();
540 
541  th.dx = mh->GetDx();
542  th.dy = mh->GetDy();
543  th.dxy = mh->GetDxy();
544 
545  th.du = mh->GetDu();
546  th.dv = mh->GetDv();
547 
548  L1Station& st = algo->vStations[th.iStation];
549  th.u_front =
550  th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
551  th.u_back =
552  th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
553  }
554  th.iMC = -1;
555 
556  Int_t iMC = -1;
557 
558  if (fPerformance) {
559  if (listStsClusterMatch) {
560  const CbmMatch* frontClusterMatch = static_cast<const CbmMatch*>(
562  const CbmMatch* backClusterMatch = static_cast<const CbmMatch*>(
564  CbmMatch stsHitMatch;
565 
566  for (Int_t iFrontLink = 0;
567  iFrontLink < frontClusterMatch->GetNofLinks();
568  iFrontLink++) {
569  const CbmLink& frontLink = frontClusterMatch->GetLink(iFrontLink);
570 
571  for (Int_t iBackLink = 0;
572  iBackLink < backClusterMatch->GetNofLinks();
573  iBackLink++) {
574  const CbmLink& backLink = backClusterMatch->GetLink(iBackLink);
575  if (frontLink == backLink) {
576  stsHitMatch.AddLink(frontLink);
577  stsHitMatch.AddLink(backLink);
578  }
579  }
580  }
581 
582  if (stsHitMatch.GetNofLinks() > 0) {
583  Float_t bestWeight = 0.f;
584  for (Int_t iLink = 0; iLink < stsHitMatch.GetNofLinks(); iLink++) {
585  if (stsHitMatch.GetLink(iLink).GetWeight() > bestWeight) {
586  bestWeight = stsHitMatch.GetLink(iLink).GetWeight();
587  Int_t iFile = stsHitMatch.GetLink(iLink).GetFile();
588  Int_t iEvent = stsHitMatch.GetLink(iLink).GetEntry();
589  // if(!fTimesliceMode) //TODO Fix the event number in links
590  // iEvent+=1;
591  Int_t iIndex =
592  stsHitMatch.GetLink(iLink).GetIndex() + nMvdPoints;
593  Double_t dtrck = dFEI(iFile, iEvent, iIndex);
594  DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
595  if (trk_it == dFEI2vMCPoints.end()) continue;
596  iMC = trk_it->second;
597  }
598  }
599  }
600  } else
601  iMC = sh->GetRefId(); // TODO1: don't need this with FairLinks
602  } //fPerformance
603 
604  if (iMC > -1) {
605  th.iMC = iMC;
606  // th.track = iMC;
607  }
608 
609  tmpHits.push_back(th);
610  nStsHits++;
611 
612  } // for j
613  } // if listStsHits
614 
615  if (fMuchPixelHits) {
616 
617  Int_t nEnt = fMuchPixelHits->GetEntries();
618 
619 
620  for (int j = 0; j < nEnt; j++) {
621  TmpHit th;
622  {
623 
624  CbmMuchPixelHit* mh =
625  static_cast<CbmMuchPixelHit*>(fMuchPixelHits->At(j));
626 
627  th.ExtIndex = j;
628  th.Det = 2;
629 
630 
631  Int_t stationNumber =
633  Int_t layerNumber = CbmMuchGeoScheme::GetLayerIndex(mh->GetAddress());
634 
635  int DetId = stationNumber * 3 + layerNumber;
636 
637 
638  th.iStation = DetId + NMvdStations + NStsStations;
639  //Get time
640  th.time = mh->GetTime() - 17;
641  th.t_er = mh->GetTimeError();
642 
643 
644  // th.iSector = 0;
645  th.isStrip = 0;
646  th.iStripF = j;
647  th.iStripB = -1;
648  if (th.iStripF < 0) continue;
649  if (th.iStripF >= 0 && th.iStripB >= 0) th.isStrip = 1;
650  if (th.iStripB < 0) th.iStripB = th.iStripF;
651 
652  th.iStripF += nMvdHits + nStsHits;
653  th.iStripB += nMvdHits + nStsHits;
654 
655  th.x = mh->GetX();
656  th.y = mh->GetY();
657  th.z = mh->GetZ();
658 
659  th.dx = mh->GetDx();
660  th.dy = mh->GetDy();
661  th.dxy = 0;
662 
663  th.du = mh->GetDx();
664  th.dv = mh->GetDy();
665 
666 
667  L1Station& st = algo->vStations[th.iStation];
668  th.u_front =
669  th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
670  th.u_back =
671  th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
672  }
673  th.iMC = -1;
674  int iMC = -1;
675 
676 
677  if (fPerformance) {
678  if (listMuchHitMatches) {
679  CbmMatch* matchHitMatch =
680  L1_DYNAMIC_CAST<CbmMatch*>(listMuchHitMatches->At(j));
681 
682 
683  for (Int_t iLink = 0; iLink < matchHitMatch->GetNofLinks(); iLink++) {
684  if (matchHitMatch->GetLink(iLink).GetIndex() < nMuchPoints) {
685  iMC = matchHitMatch->GetLink(iLink).GetIndex();
686  Int_t iIndex = iMC + nMvdPoints + nStsPoints;
687 
688  Int_t iFile = matchHitMatch->GetLink(0).GetFile();
689  Int_t iEvent = matchHitMatch->GetLink(0).GetEntry();
690 
691  Double_t dtrck = dFEI(iFile, iEvent, iIndex);
692  DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
693  if (trk_it == dFEI2vMCPoints.end()) continue;
694  th.iMC = trk_it->second;
695  // th.track = vMCPoints[th.iMC].ID;
696  // th.qp = vMCPoints[iMC].p;
697  // if(matchHitMatch -> GetNofLinks() == 0) continue;
698  // Float_t bestWeight = 0.f;
699  // Float_t totalWeight = 0.f;
700  // int iMCPoint = -1;
701  // CbmLink link;
702 
703  // CbmMuchPoint* pt = (CbmMuchPoint*) fMuchPoints->Get(
704  // matchHitMatch->GetLink(0).GetFile(),
705  // matchHitMatch->GetLink(0).GetEntry(),
706  // matchHitMatch->GetLink(0).GetIndex());
707  // double mom = sqrt(pt->GetPxOut()*pt->GetPxOut()+pt->GetPyOut()*pt->GetPyOut()+pt->GetPzOut()*pt->GetPzOut());
708  // th.p = mom;
709  // th.q = pt->GetTrackID();//(L1_DYNAMIC_CAST<CbmMCTrack*>(fMCTracks->Get(link.GetFile(),link.GetEntry(), pt->GetTrackID()) ))->GetCharge();
710 
711  // th.x = pt->GetX( th.z ) + gRandom->Gaus(0,th.dx);
712  //
713  // th.y = pt->GetY(th.z) + gRandom->Gaus(0,th.dy);
714  // th.time = pt->GetTime(); //+ gRandom->Gaus(0,th.t_er);
715 
716  // L1Station& st = algo->vStations[th.iStation];
717  // th.u_front =
718  // th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
719  // th.u_back =
720  // th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
721  }
722  }
723  }
724  }
725 
726  tmpHits.push_back(th);
727  nMuchHits++;
728 
729  } // for j
730  } // if listMvdHits
731 
732  if (listTrdHits) {
733 
734  for (int j = 0; j < listTrdHits->GetEntries(); j++) {
735  TmpHit th;
736 
737  CbmTrdHit* mh = L1_DYNAMIC_CAST<CbmTrdHit*>(listTrdHits->At(j));
738  th.ExtIndex = j;
739  th.Det = 3;
740  /* num variable not used
741  int num =mh->GetPlaneId();
742 
743  if ((mh->GetPlaneId())==0) num = 0;
744  if ((mh->GetPlaneId())==1) num = 1;
745  if ((mh->GetPlaneId())==2) num = 2;
746  if ((mh->GetPlaneId())==3) num = 3;
747  if ((mh->GetPlaneId())==4) num = 4;
748 // if (num == 1) continue;
749 // if (num == 3) continue;
750  */
751 
752  // for (int k=0; k <TrdHitsOnStation[num+1].size(); k++ ){
753 
754  th.iStation =
756 
757 
758  th.time = mh->GetTime();
759  th.t_er = mh->GetTimeError();
760 
761  // th.iSector = 0;
762  th.isStrip = 0;
763  th.iStripF = j;
764  th.iStripB = -1; //TrdHitsOnStationIndex[num+1][k];
765 
766  th.iStripF += nMvdHits + nStsHits + nMuchHits;
767  th.iStripB += nMvdHits + nStsHits + nMuchHits;
768 
769  TVector3 pos, err;
770  mh->Position(pos);
771  mh->PositionError(err);
772 
773  th.x = pos.X();
774  th.y = pos.Y();
775 
776 
777  th.dx = fabs(mh->GetDx());
778  th.dy = fabs(mh->GetDy());
779  th.dxy = 0;
780 
781  th.du = fabs(mh->GetDx());
782  th.dv = fabs(mh->GetDy());
783 
784  // CbmTrdHit mh1 = TrdHitsOnStation[num+1][k];
785  //
786  // TVector3 pos1, err1;
787  // mh1.Position(pos1);
788  // mh1.PositionError(err1);
789  //
790  // if (th.dx>th.dy){
791  //
792  // th.x = pos1.X();
793  //
794  //
795  // th.dx = mh1.GetDx();
796  //
797  //
798  // th.du = mh1.GetDx();
799  //
800  // }
801  //
802  // if (th.dy>th.dx){
803  //
804  // th.y = pos1.Y();
805  //
806  // th.dy = mh1.GetDy();
807  //
808  // th.dv = mh1.GetDy();
809  // }
810 
811  L1Station& st = algo->vStations[th.iStation];
812  th.u_front =
813  th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
814  th.u_back = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
815 
816  th.iMC = -1;
817  int iMC = -1;
818 
819  if (fPerformance) {
820 
821  if (fTrdHitMatches) {
822 
823  CbmMatch* trdHitMatch =
824  L1_DYNAMIC_CAST<CbmMatch*>(fTrdHitMatches->At(j));
825 
826  // CbmMatch *trdHitMatch1 = L1_DYNAMIC_CAST<CbmMatch*>( fTrdHitMatches->At(TrdHitsOnStationIndex[num+1][k]) );
827 
828 
829  if (trdHitMatch->GetNofLinks() > 0)
830  if (trdHitMatch->GetLink(0).GetIndex() < nTrdPoints) {
831  iMC = trdHitMatch->GetLink(0).GetIndex();
832  th.iMC = iMC + nMvdPoints + nStsPoints + nMuchPoints;
833  // th.track = vMCPoints[th.iMC].ID;
834 
835  // CbmTrdPoint* pt = (CbmTrdPoint*) fTrdPoints->Get(
836  // trdHitMatch->GetLink(0).GetFile(),
837  // trdHitMatch->GetLink(0).GetEntry(),
838  // trdHitMatch->GetLink(0).GetIndex());
839 
840  // float min = 0.1;
841 
842 
843  // if( trdHitMatch1->GetNofLinks() > 0 )
844  // if( trdHitMatch1->GetLink(0).GetIndex() < nTrdPoints )
845  // {
846  //
847  // CbmTrdPoint* pt1 = (CbmTrdPoint*) fTrdPoints->Get(trdHitMatch1->GetLink(0).GetFile(),trdHitMatch1->GetLink(0).GetEntry(),trdHitMatch1->GetLink(0).GetIndex());
848  //
849  // if (mh->GetDx()>mh->GetDy()){
850  //
851  // th.dx = mh1.GetDx();
852  // th.du = mh1.GetDx();
853  // th.x = pt1->GetXOut()+ gRandom->Gaus(0,th.dx);
854  // }
855  //
856  // if (mh->GetDy()>mh->GetDx()){
857  //
858  // th.dy = mh1.GetDy();
859  // th.dv = mh1.GetDy();
860  // th.y = pt1->GetYOut()+ gRandom->Gaus(0,th.dy);
861  // }
862  //
863  //
864  // L1Station& st = algo->vStations[th.iStation];
865  // th.u_front =
866  // th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
867  // th.u_back =
868  // th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
869  //
870  }
871  }
872  }
873  tmpHits.push_back(th);
874  nTrdHits++;
875 
876  //}
877  } // for j
878  } // if listTrdHits
879 
880  if (fTofHits) {
881 
882  for (int j = 0; j < fTofHits->GetEntries(); j++) {
883  TmpHit th;
884 
885  CbmTofHit* mh = L1_DYNAMIC_CAST<CbmTofHit*>(fTofHits->At(j));
886  th.ExtIndex = j;
887  th.Det = 4;
890 
891  th.time = mh->GetTime();
892 
893  th.t_er = mh->GetTimeError();
894 
895  th.dx = mh->GetDx();
896  th.dy = mh->GetDy();
897  th.dxy = 0;
898 
899  th.du = mh->GetDx();
900  th.dv = mh->GetDy();
901 
902  // th.iSector = 0;
903  th.isStrip = 0;
904  th.iStripF = j;
905  th.iStripB = -1;
906  if (th.iStripF < 0) continue;
907  if (th.iStripF >= 0 && th.iStripB >= 0) th.isStrip = 1;
908  if (th.iStripB < 0) th.iStripB = th.iStripF;
909 
910  th.iStripF += nMvdHits + nStsHits + nMuchHits + nTrdHits;
911  th.iStripB += nMvdHits + nStsHits + nMuchHits + nTrdHits;
912 
913  TVector3 pos, err;
914  mh->Position(pos);
915  mh->PositionError(err);
916 
917  th.x = pos.X();
918  th.y = pos.Y();
919 
920  L1Station& st = algo->vStations[th.iStation];
921  th.u_front =
922  th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
923  th.u_back = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
924 
925 
926  th.iMC = -1;
927  // int iMC = -1;
928 
929 
930  if (fPerformance) {
931 
932  // if (ToFPointsMatch[j]!=0)
933 
934  // th.iMC = j+nMvdPoints+nStsPoints+nTrdPoints+nMuchPoints;
935 
936  Int_t iFile = ToFPointsMatch[j]->GetFile();
937  Int_t iEvent = ToFPointsMatch[j]->GetEntry();
938 
939  Int_t iIndex = ToFPointsMatch[j]->GetIndex() + nMvdPoints + nStsPoints
940  + nMuchPoints + nTrdPoints;
941 
942  Double_t dtrck = dFEI(iFile, iEvent, iIndex);
943  DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
944  if (trk_it == dFEI2vMCPoints.end()) continue;
945  th.iMC = trk_it->second;
946  // th.track = vMCPoints[th.iMC].ID;
947  // th.qp = vMCPoints[th.iMC].p;
948 
949  // CbmTofPoint* pt = (CbmTofPoint*) fTofPoints->Get(ToFPointsMatch[j]->GetFile(),ToFPointsMatch[j]->GetEntry(),ToFPointsMatch[j]->GetIndex());
950 
951 
952  // th.x = pt->GetX() + gRandom->Gaus(0,th.dx);
953  //
954  // th.y = pt->GetY()+ gRandom->Gaus(0,th.dy);
955  // th.time = pt->GetTime()+ gRandom->Gaus(0,th.t_er);
956  //
957  // L1Station &st = algo->vStations[th.iStation];
958  // th.u_front = th.x*st.frontInfo.cos_phi[0] + th.y*st.frontInfo.sin_phi[0];
959  // th.u_back = th.x* st.backInfo.cos_phi[0] + th.y*st.backInfo.sin_phi[0];
960  }
961 
962 
963  tmpHits.push_back(th);
964  nTofHits++;
965 
966  } // for j
967  } // if listTrdHits
968 
969  if (fVerbose >= 10) cout << "ReadEvent: sts hits are gotten." << endl;
970 
971  // sort hits
972  int nHits = nMvdHits + nStsHits + nMuchHits + nTrdHits + nTofHits;
973 
974  sort(tmpHits.begin(), tmpHits.end(), TmpHit::Compare);
975 
976  // -- create strips --
977  int NStrips = 0, NStripsB = 0;
978  for (int ih = 0; ih < nHits; ih++) {
979  TmpHit& th = tmpHits[ih];
980 
981  // try to find the respective front and back strip from the already created
982  th.indStripF = -1;
983  th.indStripB = -1;
984  for (int is = 0; is < NStrips; is++) {
985  TmpStrip& s = tmpStrips[is];
986  if (s.iStation != th.iStation) continue;
987  if (s.iStrip != th.iStripF) continue;
988  if (fabs(s.time - th.time) > 30) continue;
989  if (fabs(s.u - th.u_front) > 1.e-4) continue;
990  th.indStripF = is;
991  }
992  for (int is = 0; is < NStripsB; is++) {
993  TmpStrip& s = tmpStripsB[is];
994  if (s.iStation != th.iStation) continue;
995  if (s.iStrip != th.iStripB) continue;
996  if (fabs(s.time - th.time) > 30) continue;
997  if (fabs(s.u - th.u_back) > 1.e-4) continue;
998  th.indStripB = is;
999  }
1000  // create new strips
1001  if (th.indStripF < 0) {
1002  TmpStrip tmp;
1003  tmp.iStation = th.iStation;
1004  tmp.iStrip = th.iStripF;
1005  tmp.u = th.u_front;
1006  tmp.time = th.time;
1007  tmp.isStrip = th.isStrip;
1008  tmpStrips.push_back(tmp);
1009  th.indStripF = NStrips++;
1010  }
1011  if (th.indStripB < 0) {
1012  TmpStrip tmp1;
1013  tmp1.iStation = th.iStation;
1014  tmp1.iStrip = th.iStripB;
1015  tmp1.isStrip = th.isStrip;
1016  tmp1.u = th.u_back;
1017  tmp1.time = th.time;
1018  tmpStripsB.push_back(tmp1);
1019  th.indStripB = NStripsB++;
1020  }
1021  } // ih
1022 
1023  // take into account unefficiency and save strips in L1Algo
1024  Int_t NEffStrips = 0, NEffStripsB = 0;
1025  for (int i = 0; i < NStrips; i++) {
1026  TmpStrip& ts = tmpStrips[i];
1027  // if( ts.effIndex == -1 ){
1028  ts.effIndex = NEffStrips++;
1029  char flag = ts.iStation * 4;
1030 
1031  fData_->vStsStrips.push_back(ts.u);
1032  fData_->vSFlag.push_back(flag);
1033  }
1034  for (int i = 0; i < NStripsB; i++) {
1035  TmpStrip& ts = tmpStripsB[i];
1036  // if( ts.effIndex == -1 ){
1037  ts.effIndex = NEffStripsB++;
1038  char flag = ts.iStation * 4;
1039 
1040  fData_->vStsStripsB.push_back(ts.u);
1041  fData_->vSFlagB.push_back(flag);
1042  }
1043 
1044 
1045  if (fVerbose >= 10) cout << "ReadEvent: strips are read." << endl;
1046 
1047  // -- save hits --
1048  int nEffHits = 0;
1049  vector<float>
1050  vStsZPos_temp; // temp array for unsorted z positions of detectors segments
1051  for (int i = 0; i < nHits; i++) {
1052  TmpHit& th = tmpHits[i];
1053 
1054  CbmL1HitStore s;
1055  s.Det = th.Det;
1056  s.ExtIndex = th.ExtIndex;
1057  s.iStation = th.iStation;
1058  s.x = th.x;
1059  s.y = th.y;
1060  s.dx = th.dx;
1061  s.dy = th.dy;
1062  s.dxy = th.dxy;
1063  s.time = th.time;
1064 
1065  if (th.indStripF < 0 || th.indStripF >= NStrips) continue;
1066  if (th.indStripB < 0 || th.indStripB >= NStripsB) continue;
1067 
1068  TmpStrip& tsF = tmpStrips[th.indStripF];
1069  TmpStrip& tsB = tmpStripsB[th.indStripB];
1070 
1071  L1StsHit h;
1072  h.f = tsF.effIndex;
1073  h.b = tsB.effIndex;
1074 
1075  h.t_reco = th.time;
1076  h.t_er = th.t_er;
1077  // h.track = th.track;
1078  // h.dx = th.dx;
1079  // h.dy = th.dy;
1080  h.du = th.du;
1081  h.dv = th.dv;
1082  // h.dxy = th.dxy;
1083  // h.p = th.p;
1084  // h.q = th.q;
1085  // h.ista = th.iStation;
1086 
1087  // find and save z positions
1088  float z_tmp = -111.;
1089  int ist = th.iStation;
1090  if (ist < NMvdStations) {
1091 #ifdef MVDIDEALHITS
1092  CbmMvdPoint* point =
1093  L1_DYNAMIC_CAST<CbmMvdPoint*>(listMvdPts->At(-s.ExtIndex - 1));
1094  z_tmp = 0.5 * (point->GetZOut() + point->GetZ());
1095 #else
1096  CbmMvdHit* mh_m =
1097  L1_DYNAMIC_CAST<CbmMvdHit*>(listMvdHits->At(-s.ExtIndex - 1));
1098  z_tmp = mh_m->GetZ();
1099 #endif
1100  }
1101 
1102  if ((ist >= NMvdStations) && (ist < (NStsStations + NMvdStations))) {
1103 #ifdef STSIDEALHITS
1104  CbmStsPoint* point =
1105  L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex));
1106  z_tmp = 0.5 * (point->GetZOut() + point->GetZIn());
1107 #else
1108  CbmStsHit* mh_m =
1109  L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(s.ExtIndex));
1110  z_tmp = mh_m->GetZ();
1111 #endif
1112  }
1113 
1114  if ((ist >= NStsStations + NMvdStations)
1115  && (ist < (NStsStations + NMvdStations + NMuchStations))) {
1116  //#ifdef STSIDEALHITS
1117  // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex));
1118  // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() );
1119  //#else
1120  CbmMuchPixelHit* mh =
1121  static_cast<CbmMuchPixelHit*>(fMuchPixelHits->At(s.ExtIndex));
1122  z_tmp = mh->GetZ();
1123  //#endif
1124  }
1125 
1126  if ((ist >= NStsStations + NMvdStations + NMuchStations)
1127  && (ist
1129  //#ifdef STSIDEALHITS
1130  // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex));
1131  // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() );
1132  //#else
1133  CbmTrdHit* mh = static_cast<CbmTrdHit*>(listTrdHits->At(s.ExtIndex));
1134  z_tmp = mh->GetZ();
1135  //#endif
1136  }
1137 
1139  + NTOFStation)
1140  && (ist
1142  //#ifdef STSIDEALHITS
1143  // CbmStsPoint* point = L1_DYNAMIC_CAST<CbmStsPoint*>(listStsPts->At(s.ExtIndex));
1144  // z_tmp = 0.5 * ( point->GetZOut() + point->GetZIn() );
1145  //#else
1146  CbmTofHit* mh = static_cast<CbmTofHit*>(fTofHits->At(s.ExtIndex));
1147  z_tmp = mh->GetZ();
1148  //#endif
1149  }
1150 
1151  unsigned int k;
1152  for (k = 0; k < vStsZPos_temp.size(); k++) {
1153  if (vStsZPos_temp[k] == z_tmp) {
1154  h.iz = k;
1155  break;
1156  }
1157  }
1158  if (k == vStsZPos_temp.size()) {
1159  h.iz = vStsZPos_temp.size();
1160  vStsZPos_temp.push_back(z_tmp);
1161  }
1162 
1163  // save hit
1164  vStsHits.push_back(
1165  CbmL1StsHit(fData->vStsHits.size(), th.ExtIndex, th.Det));
1166 
1167  vStsHits[vStsHits.size() - 1].x = th.x;
1168  vStsHits[vStsHits.size() - 1].y = th.y;
1169  vStsHits[vStsHits.size() - 1].t = th.time;
1170 
1171 
1172  fData_->vStsHits.push_back(h);
1173 
1174  int sta = th.iStation;
1175 
1176  if (fData_->StsHitsStartIndex[sta] == static_cast<THitI>(-1))
1177  fData_->StsHitsStartIndex[sta] = nEffHits;
1178  nEffHits++;
1179 
1180  fData_->StsHitsStopIndex[sta] = nEffHits;
1181 
1182  vHitStore.push_back(s);
1183  vHitMCRef.push_back(th.iMC);
1184  }
1185 
1186 
1187  for (int i = 0; i < NStation; i++) {
1188 
1189  if (fData_->StsHitsStartIndex[i] == static_cast<THitI>(-1))
1190  fData_->StsHitsStartIndex[i] = fData_->StsHitsStopIndex[i];
1191  }
1192 
1193  if (fVerbose >= 10) cout << "ReadEvent: mvd and sts are saved." << endl;
1194 
1195 
1196  // sort z-pos
1197  if (vStsZPos_temp.size() != 0) {
1198  vector<float> vStsZPos_temp2;
1199  vStsZPos_temp2.clear();
1200  vStsZPos_temp2.push_back(vStsZPos_temp[0]);
1201  vector<int> newToOldIndex;
1202  newToOldIndex.clear();
1203  newToOldIndex.push_back(0);
1204 
1205  for (unsigned int k = 1; k < vStsZPos_temp.size(); k++) {
1206  vector<float>::iterator itpos = vStsZPos_temp2.begin() + 1;
1207  vector<int>::iterator iti = newToOldIndex.begin() + 1;
1208  for (; itpos < vStsZPos_temp2.end(); itpos++, iti++) {
1209  if (vStsZPos_temp[k] < *itpos) {
1210  vStsZPos_temp2.insert(itpos, vStsZPos_temp[k]);
1211  newToOldIndex.insert(iti, k);
1212  break;
1213  }
1214  }
1215  if (itpos == vStsZPos_temp2.end()) {
1216  vStsZPos_temp2.push_back(vStsZPos_temp[k]);
1217  newToOldIndex.push_back(k);
1218  }
1219  } // k
1220 
1221 
1222  if (fVerbose >= 10) cout << "ReadEvent: z-pos are sorted." << endl;
1223 
1224  for (unsigned int k = 0; k < vStsZPos_temp2.size(); k++)
1225  fData_->vStsZPos.push_back(vStsZPos_temp2[k]);
1226 
1227  int size_nto_tmp = newToOldIndex.size();
1228  vector<int> oldToNewIndex;
1229  oldToNewIndex.clear();
1230  oldToNewIndex.resize(size_nto_tmp);
1231  for (int k = 0; k < size_nto_tmp; k++)
1232  oldToNewIndex[newToOldIndex[k]] = k;
1233 
1234  int size_hs_tmp = vHitStore.size();
1235  for (int k = 0; k < size_hs_tmp; k++)
1236  fData_->vStsHits[k].iz = oldToNewIndex[fData_->vStsHits[k].iz];
1237  }
1238 
1239  if (fVerbose >= 10) cout << "ReadEvent: z-pos are saved." << endl;
1240 
1241  algo->SetData(fData_->GetStsHits(),
1242  fData_->GetStsStrips(),
1243  fData_->GetStsStripsB(),
1244  fData_->GetStsZPos(),
1245  fData_->GetSFlag(),
1246  fData_->GetSFlagB(),
1247  fData_->GetStsHitsStartIndex(),
1248  fData_->GetStsHitsStopIndex());
1249 
1250  if (fPerformance) {
1251 
1252  if (fVerbose >= 10) cout << "HitMatch is done." << endl;
1253  if (fVerbose >= 10) cout << "MCPoints and MCTracks are saved." << endl;
1254  }
1255 
1256  if (fVerbose >= 10) cout << "ReadEvent is done." << endl;
1257 
1258 
1259 } // void CbmL1::ReadEvent()
1260 
1261 
1263  PrimVtx.MC_ID = 999;
1264  {
1265  CbmL1Vtx Vtxcurr;
1266  int nvtracks = 0, nvtrackscurr = 0;
1267 
1268  vMCTracks.clear();
1269 
1270  for (DFSET::iterator set_it = vFileEvent.begin();
1271  set_it != vFileEvent.end();
1272  ++set_it) {
1273  Int_t iFile = set_it->first;
1274  Int_t iEvent = set_it->second;
1275 
1276 
1277  Int_t nMCTrack = fMCTracks->Size(iFile, iEvent);
1278 
1279 
1280  for (Int_t iMCTrack = 0; iMCTrack < nMCTrack; iMCTrack++) {
1281  CbmMCTrack* MCTrack =
1282  L1_DYNAMIC_CAST<CbmMCTrack*>(fMCTracks->Get(iFile, iEvent, iMCTrack));
1283  if (!MCTrack) continue;
1284 
1285  int mother_ID = MCTrack->GetMotherId();
1286 
1287 
1288  if (mother_ID < 0 && mother_ID != -2) mother_ID = -iEvent - 1;
1289  TVector3 vr;
1290  TLorentzVector vp;
1291  MCTrack->GetStartVertex(vr);
1292  MCTrack->Get4Momentum(vp);
1293 
1294  Int_t pdg = MCTrack->GetPdgCode();
1295  Double_t q = 1, mass = 0.;
1296  if (pdg < 9999999
1297  && ((TParticlePDG*) TDatabasePDG::Instance()->GetParticle(pdg))) {
1298  q = TDatabasePDG::Instance()->GetParticle(pdg)->Charge() / 3.0;
1299  mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
1300  } else
1301  q = 0;
1302  Int_t IND_Track = vMCTracks.size(); //or iMCTrack?
1303  CbmL1MCTrack T(mass, q, vr, vp, IND_Track, mother_ID, pdg);
1304  // CbmL1MCTrack T(mass, q, vr, vp, iMCTrack, mother_ID, pdg);
1305  T.time = MCTrack->GetStartT();
1306  T.iFile = iFile;
1307  T.iEvent = iEvent;
1308 
1309  vMCTracks.push_back(T);
1310  // Double_t dtrck =dFEI(iFile,iEvent,iMCTrack);
1311  dFEI2vMCTracks.insert(DFEI2I::value_type(dFEI(iFile, iEvent, iMCTrack),
1312  vMCTracks.size() - 1));
1313 
1314  if (T.mother_ID < 0) { // vertex track
1315  if (PrimVtx.MC_ID == 999
1316  || fabs(T.z - Vtxcurr.MC_z) > 1.e-7) { // new vertex
1317  if (nvtrackscurr > nvtracks) {
1318  PrimVtx = Vtxcurr;
1319  nvtracks = nvtrackscurr;
1320  }
1321  Vtxcurr.MC_x = T.x;
1322  Vtxcurr.MC_y = T.y;
1323  Vtxcurr.MC_z = T.z;
1324  Vtxcurr.MC_ID = T.mother_ID;
1325  nvtrackscurr = 1;
1326  } else
1327  nvtrackscurr++;
1328  }
1329  } //iTracks
1330  } //Links
1331  if (nvtrackscurr > nvtracks) PrimVtx = Vtxcurr;
1332  } //PrimVtx
1333 
1334  if (fVerbose && PrimVtx.MC_ID == 999) cout << "No primary vertex !!!" << endl;
1335 } //Fill_vMCTracks
1336 
1338  int iPoint,
1339  int file,
1340  int event,
1341  int MVD) {
1342  TVector3 xyzI, PI, xyzO, PO;
1343  Int_t mcID = -1;
1344  Double_t time = 0.f;
1345  if (MVD == 1) {
1346  CbmMvdPoint* pt = L1_DYNAMIC_CAST<CbmMvdPoint*>(
1347  fMvdPoints->Get(file, event, iPoint)); // file, event, object
1348  //CbmMvdPoint *pt = L1_DYNAMIC_CAST<CbmMvdPoint*> (Point);
1349 
1350  if (!pt) return 1;
1351  pt->Position(xyzI);
1352  pt->Momentum(PI);
1353  pt->PositionOut(xyzO);
1354  pt->MomentumOut(PO);
1355  mcID = pt->GetTrackID();
1356  time = pt->GetTime();
1357  }
1358  if (MVD == 0) {
1359  CbmStsPoint* pt = L1_DYNAMIC_CAST<CbmStsPoint*>(
1360  fStsPoints->Get(file, event, iPoint)); // file, event, object
1361  if (!pt) return 1;
1362  // if ( fTimesliceMode )
1363  // {
1364  // Double_t StartTime = fTimeSlice->GetStartTime();
1365  // Double_t EndTime = fTimeSlice->GetEndTime();
1366  // Double_t Time_MC_point = pt->GetTime() + fEventList->GetEventTime(event, file);
1367  // if (Time_MC_point < StartTime )
1368  // return 1;
1369  //
1370  // if (Time_MC_point > EndTime )
1371  // return 1;
1372  // } //if ( fTimesliceMode )
1373 
1374  pt->Position(xyzI);
1375  pt->Momentum(PI);
1376  pt->PositionOut(xyzO);
1377  pt->MomentumOut(PO);
1378  mcID = pt->GetTrackID();
1379  time = pt->GetTime();
1380  }
1381 
1382 
1383  if (MVD == 2) {
1384  CbmMuchPoint* pt = L1_DYNAMIC_CAST<CbmMuchPoint*>(
1385  fMuchPoints->Get(file, event, iPoint)); // file, event, object
1386  if (!pt) return 1;
1387  if (fTimesliceMode) {
1388  Double_t StartTime = fTimeSlice->GetStartTime();
1389  Double_t EndTime = fTimeSlice->GetEndTime();
1390  Double_t Time_MC_point =
1391  pt->GetTime() + fEventList->GetEventTime(event, file);
1392  if (Time_MC_point < StartTime) return 1;
1393 
1394  if (Time_MC_point > EndTime) return 1;
1395  } //if ( fTimesliceMode )
1396 
1397  pt->Position(xyzI);
1398  pt->Momentum(PI);
1399  pt->PositionOut(xyzO);
1400  pt->Momentum(PO);
1401  mcID = pt->GetTrackID();
1402  time = pt->GetTime();
1403  }
1404 
1405 
1406  if (MVD == 3) {
1407  CbmTrdPoint* pt = L1_DYNAMIC_CAST<CbmTrdPoint*>(
1408  fTrdPoints->Get(file, event, iPoint)); // file, event, object
1409 
1410  if (!pt) return 1;
1411  if (fTimesliceMode) {
1412  //Double_t StartTime = fTimeSlice->GetStartTime(); // not used
1413  //Double_t EndTime = fTimeSlice->GetEndTime(); // not used
1414  //Double_t Time_MC_point = pt->GetTime() + fEventList->GetEventTime(event, file); // not used
1415  // if (Time_MC_point < StartTime )
1416  // return 1;
1417  //
1418  // if (Time_MC_point > EndTime )
1419  // return 1;
1420  } //if ( fTimesliceMode )
1421 
1422  pt->Position(xyzI);
1423  pt->Momentum(PI);
1424  pt->PositionOut(xyzO);
1425  pt->MomentumOut(PO);
1426  mcID = pt->GetTrackID();
1427 
1428  time = pt->GetTime();
1429  }
1430 
1431  if (MVD == 4) {
1432  CbmTofPoint* pt = L1_DYNAMIC_CAST<CbmTofPoint*>(
1433  fTofPoints->Get(file, event, iPoint)); // file, event, object
1434  if (!pt) return 1;
1435  if (fTimesliceMode) {
1436  Double_t StartTime = fTimeSlice->GetStartTime();
1437  Double_t EndTime = fTimeSlice->GetEndTime();
1438  Double_t Time_MC_point =
1439  pt->GetTime() + fEventList->GetEventTime(event, file);
1440  if (Time_MC_point < StartTime) return 1;
1441 
1442  if (Time_MC_point > EndTime) return 1;
1443  } //if ( fTimesliceMode )
1444 
1445  pt->Position(xyzI);
1446  pt->Momentum(PI);
1447  pt->Position(xyzO);
1448  pt->Momentum(PO);
1449  mcID = pt->GetTrackID();
1450  time = pt->GetTime();
1451  }
1452 
1453  TVector3 xyz = .5 * (xyzI + xyzO);
1454  TVector3 P = .5 * (PI + PO);
1455  MC->x = xyz.X();
1456  MC->y = xyz.Y();
1457  MC->z = xyz.Z();
1458  MC->px = P.X();
1459  MC->py = P.Y();
1460  MC->pz = P.Z();
1461  MC->xIn = xyzI.X();
1462  MC->yIn = xyzI.Y();
1463  MC->zIn = xyzI.Z();
1464  MC->pxIn = PI.X();
1465  MC->pyIn = PI.Y();
1466  MC->pzIn = PI.Z();
1467  MC->xOut = xyzO.X();
1468  MC->yOut = xyzO.Y();
1469  MC->zOut = xyzO.Z();
1470  MC->pxOut = PO.X();
1471  MC->pyOut = PO.Y();
1472  MC->pzOut = PO.Z();
1473  MC->p = sqrt(fabs(MC->px * MC->px + MC->py * MC->py + MC->pz * MC->pz));
1474  MC->ID = mcID;
1475  MC->pointId = iPoint;
1476  MC->file = file;
1477  MC->event = event;
1478 
1479  MC->time = time;
1480 
1481  if (MC->ID < 0) return 1;
1482  CbmMCTrack* MCTrack =
1483  L1_DYNAMIC_CAST<CbmMCTrack*>(fMCTracks->Get(file, event, MC->ID));
1484  if (!MCTrack) return 1;
1485  MC->pdg = MCTrack->GetPdgCode();
1486  MC->mother_ID = MCTrack->GetMotherId();
1487 
1488  TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(MC->pdg);
1489  if (particlePDG) {
1490  MC->q = particlePDG->Charge() / 3.0;
1491  MC->mass = particlePDG->Mass();
1492  }
1493 
1494  return 0;
1495 }
1496 
1497 bool CbmL1::ReadMCPoint(CbmL1MCPoint* /*MC*/, int /*iPoint*/, int /*MVD*/) {
1498  return 0;
1499 }
1500 
1505  const int NHits = vStsHits.size();
1506  for (int iH = 0; iH < NHits; iH++) {
1507  CbmL1StsHit& hit = vStsHits[iH];
1508 
1509  if (hit.Det == 1) {
1510  CbmStsHit* sh =
1511  L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(vStsHits[iH].extIndex));
1512 
1513  int iP = -1;
1514 
1515  vector<int> iEvent1;
1516 
1517 
1518  if (listStsClusterMatch) {
1519 
1520  const CbmMatch* frontClusterMatch = static_cast<const CbmMatch*>(
1522  const CbmMatch* backClusterMatch = static_cast<const CbmMatch*>(
1524  CbmMatch stsHitMatch;
1525 
1526  Float_t Sum_of_front = 0;
1527  Float_t Sum_of_back = 0;
1528 
1529 
1530  for (Int_t iFrontLink = 0;
1531  iFrontLink < frontClusterMatch->GetNofLinks();
1532  iFrontLink++) {
1533  const CbmLink& frontLink = frontClusterMatch->GetLink(iFrontLink);
1534  Sum_of_front = Sum_of_front + frontLink.GetWeight();
1535  }
1536 
1537  for (Int_t iBackLink = 0; iBackLink < backClusterMatch->GetNofLinks();
1538  iBackLink++) {
1539  const CbmLink& backLink = backClusterMatch->GetLink(iBackLink);
1540  Sum_of_back = Sum_of_back + backLink.GetWeight();
1541  }
1542 
1543  for (Int_t iFrontLink = 0;
1544  iFrontLink < frontClusterMatch->GetNofLinks();
1545  iFrontLink++) {
1546  const CbmLink& frontLink = frontClusterMatch->GetLink(iFrontLink);
1547 
1548  // Float_t Fraction_front = frontLink.GetWeight()/Sum_of_front;
1549 
1550  for (Int_t iBackLink = 0; iBackLink < backClusterMatch->GetNofLinks();
1551  iBackLink++) {
1552  const CbmLink& backLink = backClusterMatch->GetLink(iBackLink);
1553 
1554  // Float_t Fraction_back = backLink.GetWeight()/Sum_of_back;
1555 
1556  if (frontLink == backLink) {
1557  stsHitMatch.AddLink(frontLink);
1558  stsHitMatch.AddLink(backLink);
1559  }
1560  }
1561  }
1562 
1563  Float_t bestWeight = 0.f;
1564  Float_t totalWeight = 0.f;
1565  for (Int_t iLink = 0; iLink < stsHitMatch.GetNofLinks(); iLink++) {
1566  Int_t iFile = stsHitMatch.GetLink(iLink).GetFile();
1567  Int_t iEvent = stsHitMatch.GetLink(iLink).GetEntry();
1568  Int_t iIndex = stsHitMatch.GetLink(iLink).GetIndex();
1569 
1570  iEvent1.push_back(iEvent);
1571 
1572 
1573  if (!fTimesliceMode) {
1574  iFile = vFileEvent.begin()->first;
1575  iEvent = vFileEvent.begin()->second;
1576  }
1577  int nMvdPoints_ = 0;
1578 
1579  if (!fTimesliceMode)
1580  if (listMvdPts) nMvdPoints_ = listMvdPts->GetEntriesFast();
1581 
1582  Double_t dtrck = dFEI(iFile, iEvent, iIndex + nMvdPoints_);
1583  DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
1584 
1585  if (trk_it == dFEI2vMCPoints.end()) continue;
1586 
1587  totalWeight += stsHitMatch.GetLink(iLink).GetWeight();
1588  if (stsHitMatch.GetLink(iLink).GetWeight() > bestWeight) {
1589  bestWeight = stsHitMatch.GetLink(iLink).GetWeight();
1590  iP = trk_it->second;
1591  }
1592  }
1593  } //mach cluster
1594 
1595 
1596  if (iP >= 0) {
1597 
1598  for (unsigned int i = 0; i < iEvent1.size(); i++) {
1599  hit.event = iEvent1[i];
1600  }
1601 
1602  hit.event = vMCPoints[iP].event;
1603  hit.mcPointIds.push_back(iP);
1604  vMCPoints[iP].hitIds.push_back(iH);
1605  } else {
1606  hit.event = -1;
1607  int idPoint = vHitMCRef[iH];
1608  if (idPoint >= 0) {
1609  hit.mcPointIds.push_back(idPoint);
1610  vMCPoints[idPoint].hitIds.push_back(iH);
1611  }
1612  } // if no clusters
1613  }
1614 
1615 
1616  if (hit.Det == 0) { // if no use Links or this is mvd hit
1617 
1618  int iP = vHitMCRef[iH];
1619  if (iP >= 0) {
1620  hit.mcPointIds.push_back(iP);
1621  vMCPoints[iP].hitIds.push_back(iH);
1622  }
1623  }
1624 
1625  if (hit.Det == 2) { // if no use Links or this is mvd hit
1626 
1627  int iP = vHitMCRef[iH];
1628 
1629  if (iP >= 0) {
1630  hit.mcPointIds.push_back(iP);
1631  vMCPoints[iP].hitIds.push_back(iH);
1632  }
1633  }
1634 
1635  if (hit.Det == 3) { // if no use Links or this is mvd hit
1636 
1637 
1638  int iP = vHitMCRef[iH];
1639  if (iP >= 0) {
1640  hit.mcPointIds.push_back(iP);
1641  vMCPoints[iP].hitIds.push_back(iH);
1642  }
1643  }
1644 
1645  if (hit.Det == 4) { // if no use Links or this is mvd hit
1646 
1647 
1648  int iP = vHitMCRef[iH];
1649 
1650  if (iP >= 0) {
1651  hit.mcPointIds.push_back(iP);
1652  vMCPoints[iP].hitIds.push_back(iH);
1653  }
1654  }
1655 
1656 
1657  } // for hits
1658 }
CbmL1::fTofHits
TClonesArray * fTofHits
Definition: CbmL1.h:314
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmL1MCPoint::q
double q
Definition: CbmL1MCPoint.h:59
CbmL1::listTrdHits
TClonesArray * listTrdHits
Definition: CbmL1.h:308
CbmL1MCPoint::mass
double mass
Definition: CbmL1MCPoint.h:59
TmpHit::t_er
double t_er
Definition: CbmL1ReadEvent.cxx:72
fscal
float fscal
Definition: L1/vectors/P4_F32vec4.h:250
CbmMatch
Definition: CbmMatch.h:22
CbmL1Vtx::MC_ID
int MC_ID
Definition: CbmL1Vtx.h:44
h
Generates beam ions for transport simulation.
Definition: CbmBeamGenerator.h:17
TmpStrip::effIndex
int effIndex
Definition: CbmL1ReadEvent.cxx:88
ECbmDataType::kStsHit
@ kStsHit
TmpHit
Definition: CbmL1ReadEvent.cxx:60
CbmMuchPoint
Definition: CbmMuchPoint.h:21
L1Algo.h
CbmPixelHit::GetDxy
Double_t GetDxy() const
Definition: CbmPixelHit.h:87
CbmPixelHit::Position
void Position(TVector3 &pos) const
Copies hit position to pos.
Definition: CbmPixelHit.cxx:64
compareZ
static bool compareZ(const int &a, const int &b)
Definition: CbmL1ReadEvent.cxx:53
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmMatch::GetLink
const CbmLink & GetLink(Int_t i) const
Definition: CbmMatch.h:35
CbmL1::fEventList
CbmMCEventList * fEventList
Definition: CbmL1.h:263
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmKF.h
CbmL1HitStore::dxy
double dxy
Definition: CbmL1.h:98
CbmL1MCPoint::x
double x
Definition: CbmL1MCPoint.h:56
CbmL1::vStsHits
vector< CbmL1StsHit > vStsHits
Used data = Repacked input data.
Definition: CbmL1.h:335
CbmL1::algo
L1Algo * algo
Definition: CbmL1.h:119
TmpHit::indStripF
int indStripF
Definition: CbmL1ReadEvent.cxx:63
L1AlgoInputData::GetStsHitsStopIndex
const THitI * GetStsHitsStopIndex() const
Definition: L1AlgoInputData.h:55
CbmL1MCPoint
Definition: CbmL1MCPoint.h:23
CbmL1MCPoint::time
double time
Definition: CbmL1MCPoint.h:59
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmL1HitStore::iStation
int iStation
Definition: CbmL1.h:97
CbmStsSetup.h
L1Station
Definition: L1Station.h:9
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
TmpHit::iStation
int iStation
Definition: CbmL1ReadEvent.cxx:64
CbmPixelHit::GetDx
Double_t GetDx() const
Definition: CbmPixelHit.h:85
CbmMCDataArray::Size
Int_t Size(Int_t fileNumber, Int_t eventNumber)
Definition: CbmMCDataArray.cxx:133
L1AlgoInputData
Definition: L1AlgoInputData.h:15
CbmL1::fTrdPoints
CbmMCDataArray * fTrdPoints
Definition: CbmL1.h:307
TmpHit::dxy
double dxy
Definition: CbmL1ReadEvent.cxx:69
CbmL1::NMuchStations
int NMuchStations
Definition: CbmL1.h:244
CbmL1Vtx::MC_z
double MC_z
Definition: CbmL1Vtx.h:43
CbmTrdPoint::PositionOut
void PositionOut(TVector3 &pos) const
Definition: CbmTrdPoint.h:78
CbmL1::dFEI
Double_t dFEI(int file, int event, int idx)
Definition: CbmL1.h:346
TmpStrip::isStrip
bool isStrip
Definition: CbmL1ReadEvent.cxx:87
CbmL1MCPoint::y
double y
Definition: CbmL1MCPoint.h:56
CbmL1::fData
L1AlgoInputData * fData
Definition: CbmL1.h:350
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmL1HitStore::x
double x
Definition: CbmL1.h:98
CbmTrdHit
data class for a reconstructed Energy-4D measurement in the TRD
Definition: CbmTrdHit.h:35
L1AlgoInputData::GetStsHits
const vector< L1StsHit > & GetStsHits() const
Definition: L1AlgoInputData.h:48
CbmL1::fTimeSlice
CbmTimeSlice * fTimeSlice
Input data.
Definition: CbmL1.h:262
CbmMvdHit::GetStationNr
virtual Int_t GetStationNr() const
Definition: CbmMvdHit.h:61
CbmL1::listMvdHits
TClonesArray * listMvdHits
Definition: CbmL1.h:288
TmpStrip
Definition: CbmL1ReadEvent.cxx:82
CbmL1MCPoint::event
int event
Definition: CbmL1MCPoint.h:64
CbmStsSetup::Instance
static CbmStsSetup * Instance()
Definition: CbmStsSetup.cxx:293
nTofHits
Int_t nTofHits
Definition: CbmHadronAnalysis.cxx:63
CbmL1MCPoint::pointId
int pointId
Definition: CbmL1MCPoint.h:62
CbmL1MCTrack::y
double y
Definition: CbmL1MCTrack.h:31
L1AlgoInputData::GetStsStrips
const vector< L1Strip > & GetStsStrips() const
Definition: L1AlgoInputData.h:49
CbmL1MCTrack::x
double x
Definition: CbmL1MCTrack.h:31
L1Station::backInfo
L1UMeasurementInfo backInfo
Definition: L1Station.h:31
CbmL1::listMvdHitMatches
TClonesArray * listMvdHitMatches
Definition: CbmL1.h:290
CbmStsPoint::GetZOut
Double_t GetZOut() const
Definition: CbmStsPoint.h:86
CbmL1HitStore
Definition: CbmL1.h:94
CbmStsHit::GetFrontClusterId
Int_t GetFrontClusterId() const
Definition: CbmStsHit.h:93
CbmL1.h
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
L1StsHit
Definition: L1StsHit.h:12
CbmTimeSlice::GetStartTime
Double_t GetStartTime() const
Definition: CbmTimeSlice.h:108
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmL1::listStsPts
TClonesArray * listStsPts
Definition: CbmL1.h:272
CbmMatch.h
L1UMeasurementInfo::sin_phi
fvec sin_phi
Definition: L1UMeasurementInfo.h:12
TmpHit::Compare
static bool Compare(const TmpHit &a, const TmpHit &b)
Definition: CbmL1ReadEvent.cxx:76
TmpHit::ExtIndex
int ExtIndex
Definition: CbmL1ReadEvent.cxx:65
TmpHit::id
int id
Definition: CbmL1ReadEvent.cxx:74
CbmPixelHit::GetDy
Double_t GetDy() const
Definition: CbmPixelHit.h:86
CbmL1::dFEI2vMCTracks
DFEI2I dFEI2vMCTracks
Definition: CbmL1.h:345
TmpHit::y
double y
Definition: CbmL1ReadEvent.cxx:68
L1AlgoInputData::vStsHits
vector< L1StsHit > vStsHits
Definition: L1AlgoInputData.h:104
CbmHit::GetTimeError
Double_t GetTimeError() const
Definition: CbmHit.h:76
CbmL1::fMvdPoints
CbmMCDataArray * fMvdPoints
Definition: CbmL1.h:268
CbmL1::fTofHitDigiMatches
TClonesArray * fTofHitDigiMatches
Definition: CbmL1.h:313
CbmL1::NMvdStations
int NMvdStations
Definition: CbmL1.h:244
CbmL1::Get_Z_vMCPoint
double Get_Z_vMCPoint(int a) const
Definition: CbmL1.h:194
CbmL1::listMvdPts
TClonesArray * listMvdPts
Definition: CbmL1.h:287
CbmMvdHit
Definition: CbmMvdHit.h:29
CbmTrdPoint::MomentumOut
void MomentumOut(TVector3 &mom) const
Definition: CbmTrdPoint.h:79
TmpHit::iMC
int iMC
Definition: CbmL1ReadEvent.cxx:71
CbmL1MCPoint::file
int file
Definition: CbmL1MCPoint.h:63
TmpHit::x
double x
Definition: CbmL1ReadEvent.cxx:68
TmpHit::u_back
double u_back
Definition: CbmL1ReadEvent.cxx:67
CbmL1StsHit::Det
int Det
Definition: CbmL1StsHit.h:34
CbmL1MCPoint::pz
double pz
Definition: CbmL1MCPoint.h:56
CbmL1::NTrdStations
int NTrdStations
Definition: CbmL1.h:244
CbmTimeSlice::GetEndTime
Double_t GetEndTime() const
Definition: CbmTimeSlice.cxx:94
CbmL1::NStsStations
int NStsStations
Definition: CbmL1.h:244
THitI
unsigned int THitI
Definition: L1StsHit.h:8
CbmStsHit
data class for a reconstructed 3-d hit in the STS
Definition: CbmStsHit.h:31
L1AlgoInputData::vSFlag
L1Vector< unsigned char > vSFlag
Definition: L1AlgoInputData.h:111
CbmStsPoint::PositionOut
void PositionOut(TVector3 &pos)
Definition: CbmStsPoint.h:96
TmpHit::du
double du
Definition: CbmL1ReadEvent.cxx:70
PI
#define PI
Definition: HagedornSpectrum.h:5
CbmMuchGeoScheme::GetLayerIndex
static Int_t GetLayerIndex(Int_t address)
Definition: CbmMuchGeoScheme.h:71
CbmL1HitStore::Det
int Det
Definition: CbmL1.h:99
CbmMuchGeoScheme::GetStationIndex
static Int_t GetStationIndex(Int_t address)
Definition: CbmMuchGeoScheme.h:68
CbmMvdPoint
Definition: CbmMvdPoint.h:28
L1Station::z
fvec z
Definition: L1Station.h:28
TmpHit::indStripB
int indStripB
Definition: CbmL1ReadEvent.cxx:63
CbmMuchPoint.h
CbmL1::Instance
static CbmL1 * Instance()
Definition: CbmL1.h:129
CbmL1::fMuchPoints
CbmMCDataArray * fMuchPoints
Definition: CbmL1.h:294
CbmL1::dFEI2vMCPoints
DFEI2I dFEI2vMCPoints
Definition: CbmL1.h:344
CbmL1::Fill_vMCTracks
void Fill_vMCTracks()
Definition: CbmL1ReadEvent.cxx:1262
CbmL1HitStore::dx
double dx
Definition: CbmL1.h:98
CbmL1MCPoint::yIn
double yIn
Definition: CbmL1MCPoint.h:57
TmpHit::u_front
double u_front
Definition: CbmL1ReadEvent.cxx:67
CbmL1::fTimesliceMode
int fTimesliceMode
Definition: CbmL1.h:365
CbmL1HitStore::time
double time
Definition: CbmL1.h:98
CbmStsHit::GetDu
Double_t GetDu() const
Error of coordinate across front-side strips @value Coordinate error [cm].
Definition: CbmStsHit.h:78
CbmStsSetup::GetStationNumber
Int_t GetStationNumber(Int_t address)
Definition: CbmStsSetup.cxx:187
CbmL1MCTrack::mother_ID
int mother_ID
Definition: CbmL1MCTrack.h:32
CbmMCDataArray::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataArray.h:47
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmL1MCTrack::z
double z
Definition: CbmL1MCTrack.h:31
CbmMvdPoint::PositionOut
void PositionOut(TVector3 &pos)
Definition: CbmMvdPoint.h:83
CbmL1Vtx::MC_x
double MC_x
Definition: CbmL1Vtx.h:43
TmpHit::dv
double dv
Definition: CbmL1ReadEvent.cxx:70
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmMCEventList::GetEventTime
Double_t GetEventTime(UInt_t event, UInt_t file)
Event start time.
Definition: CbmMCEventList.cxx:86
CbmMatch::AddLink
void AddLink(const CbmLink &newLink)
Definition: CbmMatch.cxx:42
CbmL1::PrimVtx
CbmL1Vtx PrimVtx
Definition: CbmL1.h:258
CbmL1MCPoint::iStation
int iStation
Definition: CbmL1MCPoint.h:61
TmpStrip::iStrip
int iStrip
Definition: CbmL1ReadEvent.cxx:86
CbmL1MCPoint::xOut
double xOut
Definition: CbmL1MCPoint.h:58
CbmStsPoint::MomentumOut
void MomentumOut(TVector3 &mom)
Definition: CbmStsPoint.h:97
L1AlgoInputData::StsHitsStopIndex
THitI StsHitsStopIndex[MaxNStations+1]
Definition: L1AlgoInputData.h:114
CbmL1MCPoint::p
double p
Definition: CbmL1MCPoint.h:59
CbmL1::ReadEvent
void ReadEvent(L1AlgoInputData *, CbmEvent *event=NULL)
Read information about hits, mcPoints and mcTracks into L1 classes.
Definition: CbmL1ReadEvent.cxx:92
CbmL1::ReadMCPoint
bool ReadMCPoint(CbmL1MCPoint *MC, int iPoint, int MVD)
Definition: CbmL1ReadEvent.cxx:1497
CbmL1MCTrack::iEvent
int iEvent
Definition: CbmL1MCTrack.h:32
CbmL1StsHit::event
int event
Definition: CbmL1StsHit.h:39
CbmMuchPoint::PositionOut
void PositionOut(TVector3 &pos) const
Definition: CbmMuchPoint.h:80
CbmL1MCPoint::pyIn
double pyIn
Definition: CbmL1MCPoint.h:57
CbmL1::nMvdPoints
int nMvdPoints
Definition: CbmL1.h:198
CbmTrdHit.h
Class for hits in TRD detector.
CbmStsHit::GetDv
Double_t GetDv() const
Error of coordinate across front-side strips @value Coordinate error [cm].
Definition: CbmStsHit.h:87
L1AlgoInputData::StsHitsStartIndex
THitI StsHitsStartIndex[MaxNStations+1]
Definition: L1AlgoInputData.h:113
CbmL1::fStsPoints
CbmMCDataArray * fStsPoints
Definition: CbmL1.h:266
TmpHit::isStrip
bool isStrip
Definition: CbmL1ReadEvent.cxx:66
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
TmpStrip::time
fscal time
Definition: CbmL1ReadEvent.cxx:84
CbmMvdPoint::GetZOut
Double_t GetZOut() const
Definition: CbmMvdPoint.h:72
CbmL1MCPoint::zIn
double zIn
Definition: CbmL1MCPoint.h:57
L1AlgoInputData::vStsZPos
vector< fscal > vStsZPos
Definition: L1AlgoInputData.h:108
CbmTrdPoint
Definition: CbmTrdPoint.h:23
TmpHit::iStripB
int iStripB
Definition: CbmL1ReadEvent.cxx:62
CbmL1::NStation
int NStation
Definition: CbmL1.h:244
CbmL1HitStore::ExtIndex
int ExtIndex
Definition: CbmL1.h:96
CbmL1MCTrack::iFile
int iFile
Definition: CbmL1MCTrack.h:32
CbmL1MCPoint::pxOut
double pxOut
Definition: CbmL1MCPoint.h:58
CbmL1MCPoint::z
double z
Definition: CbmL1MCPoint.h:56
nStsHits
Int_t nStsHits
Definition: CbmHadronAnalysis.cxx:65
TmpStrip::iStation
int iStation
Definition: CbmL1ReadEvent.cxx:85
L1AlgoInputData::GetSFlag
const L1Vector< unsigned char > & GetSFlag() const
Definition: L1AlgoInputData.h:52
CbmL1MCPoint::ID
int ID
Definition: CbmL1MCPoint.h:60
CbmL1::NTOFStation
int NTOFStation
Definition: CbmL1.h:245
TmpHit::time
double time
Definition: CbmL1ReadEvent.cxx:72
CbmStsHit::GetBackClusterId
Int_t GetBackClusterId() const
Definition: CbmStsHit.h:69
CbmL1StsHit
Definition: CbmL1StsHit.h:8
L1AlgoInputData.h
CbmL1MCPoint::mother_ID
int mother_ID
Definition: CbmL1MCPoint.h:60
CbmL1::nMuchPoints
int nMuchPoints
Definition: CbmL1.h:293
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmL1MCTrack::time
double time
Definition: CbmL1MCTrack.h:31
CbmL1::vRTracks
vector< CbmL1Track > vRTracks
Definition: CbmL1.h:125
CbmL1MCPoint::pyOut
double pyOut
Definition: CbmL1MCPoint.h:58
nTofPoints
Int_t nTofPoints
Definition: CbmHadronAnalysis.cxx:63
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
CbmStsPoint::GetZIn
Double_t GetZIn() const
Definition: CbmStsPoint.h:83
CbmTofPoint.h
L1AlgoInputData::GetStsStripsB
const vector< L1Strip > & GetStsStripsB() const
Definition: L1AlgoInputData.h:50
CbmL1HitStore::y
double y
Definition: CbmL1.h:98
CbmL1HitStore::dy
double dy
Definition: CbmL1.h:98
CbmMuchPixelHit.h
Class for pixel hits in MUCH detector.
TmpHit::dx
double dx
Definition: CbmL1ReadEvent.cxx:69
CbmTrdPoint.h
CbmL1StsHit::mcPointIds
vector< int > mcPointIds
Definition: CbmL1StsHit.h:35
CbmL1::vMCPoints_in_Time_Slice
vector< int > vMCPoints_in_Time_Slice
Definition: CbmL1.h:199
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmMvdPoint::MomentumOut
void MomentumOut(TVector3 &mom)
Definition: CbmMvdPoint.h:84
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
TmpHit::track
int track
Definition: CbmL1ReadEvent.cxx:75
CbmStsAddress.h
CbmL1::vHitMCRef
vector< int > vHitMCRef
Definition: CbmL1.h:339
L1AlgoInputData::GetStsZPos
const vector< fscal > & GetStsZPos() const
Definition: L1AlgoInputData.h:51
CbmTofPoint
Geometric intersection of a MC track with a TOFb detector.
Definition: CbmTofPoint.h:40
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmL1MCPoint::pzOut
double pzOut
Definition: CbmL1MCPoint.h:58
CbmL1::fMuchPixelHits
TClonesArray * fMuchPixelHits
Definition: CbmL1.h:299
CbmL1MCPoint::px
double px
Definition: CbmL1MCPoint.h:56
CbmL1MCPoint::pdg
int pdg
Definition: CbmL1MCPoint.h:60
CbmMCTrack::Get4Momentum
void Get4Momentum(TLorentzVector &momentum) const
Definition: CbmMCTrack.h:177
TmpStrip::u
fscal u
Definition: CbmL1ReadEvent.cxx:83
CbmMuchPixelHit
Definition: CbmMuchPixelHit.h:17
CbmL1MCPoint::yOut
double yOut
Definition: CbmL1MCPoint.h:58
CbmL1MCTrack
Definition: CbmL1MCTrack.h:29
L1AlgoInputData::vSFlagB
L1Vector< unsigned char > vSFlagB
Definition: L1AlgoInputData.h:112
CbmL1::vMCPoints
vector< CbmL1MCPoint > vMCPoints
Definition: CbmL1.h:197
CbmMuchGeoScheme.h
CbmL1Vtx::MC_y
double MC_y
Definition: CbmL1Vtx.h:43
L1UMeasurementInfo::cos_phi
fvec cos_phi
Definition: L1UMeasurementInfo.h:12
CbmL1MCPoint::pxIn
double pxIn
Definition: CbmL1MCPoint.h:57
TmpHit::dy
double dy
Definition: CbmL1ReadEvent.cxx:69
CbmL1::fTrdHitMatches
TClonesArray * fTrdHitMatches
Definition: CbmL1.h:309
L1AlgoInputData::GetStsHitsStartIndex
const THitI * GetStsHitsStartIndex() const
Definition: L1AlgoInputData.h:54
CbmL1::vFileEvent
DFSET vFileEvent
Definition: CbmL1.h:127
CbmL1
Definition: CbmL1.h:113
CbmL1::HitMatch
void HitMatch()
Input Performance.
Definition: CbmL1ReadEvent.cxx:1504
CbmL1::listStsClusterMatch
TClonesArray * listStsClusterMatch
Definition: CbmL1.h:278
CbmL1MCPoint::xIn
double xIn
Definition: CbmL1MCPoint.h:57
L1AlgoInputData::vStsStrips
vector< L1Strip > vStsStrips
Definition: L1AlgoInputData.h:106
TmpHit::iStripF
int iStripF
Definition: CbmL1ReadEvent.cxx:61
CbmL1Vtx
Definition: CbmL1Vtx.h:22
CbmL1MCPoint::py
double py
Definition: CbmL1MCPoint.h:56
CbmL1::vHitStore
vector< CbmL1HitStore > vHitStore
Definition: CbmL1.h:180
CbmL1::vMCTracks
vector< CbmL1MCTrack > vMCTracks
Definition: CbmL1.h:337
CbmL1::listStsHits
TClonesArray * listStsHits
Definition: CbmL1.h:276
CbmPixelHit::PositionError
void PositionError(TVector3 &dpos) const
Copies hit position error to pos.
Definition: CbmPixelHit.cxx:68
CbmL1::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmL1.h:267
CbmL1::fPerformance
Int_t fPerformance
Definition: CbmL1.h:247
CbmL1MCPoint::zOut
double zOut
Definition: CbmL1MCPoint.h:58
L1AlgoInputData::GetSFlagB
const L1Vector< unsigned char > & GetSFlagB() const
Definition: L1AlgoInputData.h:53
L1Algo::SetData
void SetData(const vector< L1StsHit > &StsHits_, const vector< L1Strip > &StsStrips_, const vector< L1Strip > &StsStripsB_, const vector< fscal > &StsZPos_, const vector< unsigned char > &SFlag_, const vector< unsigned char > &SFlagB_, const THitI *StsHitsStartIndex_, const THitI *StsHitsStopIndex_)
Definition: L1Algo.cxx:179
CbmL1::fTofPoints
CbmMCDataArray * fTofPoints
Definition: CbmL1.h:312
TmpHit::z
double z
Definition: CbmL1ReadEvent.cxx:72
L1Station::frontInfo
L1UMeasurementInfo frontInfo
Definition: L1Station.h:31
TmpHit::Det
int Det
Definition: CbmL1ReadEvent.cxx:73
CbmL1MCPoint::pzIn
double pzIn
Definition: CbmL1MCPoint.h:57
L1AlgoInputData::vStsStripsB
vector< L1Strip > vStsStripsB
Definition: L1AlgoInputData.h:107
CbmMCTrack::GetStartT
Double_t GetStartT() const
Definition: CbmMCTrack.h:78
CbmTofHit::GetPlaneId
Int_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition: core/data/tof/CbmTofHit.h:88
CbmL1::listMuchHitMatches
TClonesArray * listMuchHitMatches
Definition: CbmL1.h:295
CbmTrdHit::GetPlaneId
Int_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition: CbmTrdHit.h:73