BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmL1StsTrackFinder.cxx
Go to the documentation of this file.
1/*
2 *====================================================================
3 *
4 * CBM Level 1 Reconstruction
5 *
6 * Authors: I.Kisel, S.Gorbunov
7 *
8 * e-mail : ikisel@kip.uni-heidelberg.de
9 *
10 *====================================================================
11 *
12 * CbmL1StsTrackFinder source file
13 *
14 *====================================================================
15 */
16#include "CbmL1StsTrackFinder.h"
17
18#include "CbmKFMath.h"
19#include "CbmMvdHit.h"
20#include "CbmStsHit.h"
21#include "CbmStsTrack.h"
22#include "FairHit.h"
23#include "FairMCPoint.h"
24#include "FairRootManager.h"
25#include "L1Algo/L1Algo.h"
26#include "TClonesArray.h"
27
28#include <iostream>
29#include <vector>
30
31using std::cout;
32using std::endl;
33using std::vector;
34
35// ----- Default constructor -------------------------------------------
37{
38 fName = "STS Track Finder L1";
39}
40// -------------------------------------------------------------------------
41
42// ----- Destructor ----------------------------------------------------
44// -------------------------------------------------------------------------
45
46// ----- Public method Init --------------------------------------------
48// -------------------------------------------------------------------------
49
50// ----- Public method DoFind ------------------------------------------
52{
53 /*
54 if ( !mHitArray || !hHitArray || !sHitArray ) {
55 cout << "-E- CbmL1StsTrackFinder::DoFind: "
56 << "Hit arrays missing! " << mHitArray << " " <<hHitArray<<" "<< sHitArray << endl;
57 return -1;
58 }
59 */
60 if (!fTracks) {
61 cout << "-E- CbmL1StsTrackFinder::DoFind: "
62 << "Track array missing! " << endl;
63 return -1;
64 }
65
66 int ntracks = fTracks->GetEntries();
67
68 CbmL1* L1 = CbmL1::Instance();
69 if (!L1)
70 return 0;
71
72 L1->Reconstruct();
73
74 for (vector<CbmL1Track>::iterator it = L1->vRTracks.begin(); it != L1->vRTracks.end(); ++it) {
75 CbmL1Track& T = *it;
76 new ((*fTracks)[ntracks]) CbmStsTrack();
78 t->SetFlag(0);
79 FairTrackParam *fpar = t->GetParamFirst(), *lpar = t->GetParamLast();
80 CbmKFMath::CopyTC2TrackParam(fpar, T.T, T.C);
81 CbmKFMath::CopyTC2TrackParam(lpar, T.TLast, T.CLast);
82 t->SetChi2(T.chi2);
83 t->SetNDF(T.NDF);
84 t->SetPidHypo(T.T[4] >= 0 ? 211 : -211);
85
86 for (vector<int>::iterator ih = it->StsHits.begin(); ih != it->StsHits.end(); ++ih) {
87 CbmL1HitStore& h = L1->vHitStore[*ih];
88 double zref = L1->algo->vStations[h.iStation].z[0];
89 if (h.ExtIndex < 0) {
90 CbmMvdHit tmp;
91 tmp.SetZ(zref);
92 t->AddMvdHit(-h.ExtIndex - 1, &tmp);
93 } else {
94 CbmStsHit tmp;
95 tmp.SetZ(zref);
96 t->AddStsHit(h.ExtIndex, &tmp);
97 }
98 }
99 }
100
101 return ntracks;
102}
103// -------------------------------------------------------------------------
#define L1_DYNAMIC_CAST
Definition CbmL1Def.h:26
int Int_t
static void CopyTC2TrackParam(FairTrackParam *par, Double_t T[], Double_t C[])
int ExtIndex
Definition CbmL1.h:42
int iStation
Definition CbmL1.h:43
CbmL1StsTrackFinder()
Default constructor.
virtual void Init()
Initialisation.
virtual ~CbmL1StsTrackFinder()
Destructor.
virtual Int_t DoFind()
Track finding algorithm.
Definition CbmL1.h:48
static CbmL1 * Instance()
reconstructed tracks
Definition CbmL1.h:59
CbmMvdHit.h.
Definition CbmMvdHit.h:26
TClonesArray * fTracks
void SetNDF(Int_t ndf)
Definition CbmStsTrack.h:87
FairTrackParam * GetParamLast()
Definition CbmStsTrack.h:70
void AddStsHit(Int_t hitIndex, FairHit *hit)
Add a StsHit to the list.
void SetChi2(Double_t chi2)
Definition CbmStsTrack.h:86
void SetFlag(Int_t flag)
Definition CbmStsTrack.h:85
void AddMvdHit(Int_t hitIndex, FairHit *mvdHit)
Associate a MvdHit to the track.
FairTrackParam * GetParamFirst()
Definition CbmStsTrack.h:69
void SetPidHypo(Int_t pid)
Modifiers.
Definition CbmStsTrack.h:82
TString fName