BmnRoot
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 "L1Algo/L1Algo.h"
19
20#include "FairHit.h"
21#include "CbmStsHit.h"
22#include "CbmMvdHit.h"
23#include "FairMCPoint.h"
24#include "FairRootManager.h"
25#include "CbmStsTrack.h"
26#include "CbmKFMath.h"
27
28#include "TClonesArray.h"
29
30#include <iostream>
31#include <vector>
32
33using std::cout;
34using std::endl;
35using std::vector;
36
37// ----- Default constructor -------------------------------------------
39 fName = "STS Track Finder L1";
40}
41// -------------------------------------------------------------------------
42
43
44
45// ----- Destructor ----------------------------------------------------
47// -------------------------------------------------------------------------
48
49
50
51// ----- Public method Init --------------------------------------------
54// -------------------------------------------------------------------------
55
56
57
58// ----- Public method DoFind ------------------------------------------
60 /*
61 if ( !mHitArray || !hHitArray || !sHitArray ) {
62 cout << "-E- CbmL1StsTrackFinder::DoFind: "
63 << "Hit arrays missing! " << mHitArray << " " <<hHitArray<<" "<< sHitArray << endl;
64 return -1;
65 }
66 */
67 if ( !fTracks ) {
68 cout << "-E- CbmL1StsTrackFinder::DoFind: "
69 << "Track array missing! " << endl;
70 return -1;
71 }
72
73 int ntracks = fTracks->GetEntries();
74
76 if( !L1 ) return 0;
77
78 L1->Reconstruct();
79
80 for (vector<CbmL1Track>::iterator it = L1->vRTracks.begin(); it != L1->vRTracks.end(); ++it)
81 {
82 CbmL1Track &T = *it;
83 new((*fTracks)[ntracks]) CbmStsTrack();
84 CbmStsTrack *t = L1_DYNAMIC_CAST<CbmStsTrack*>( fTracks->At(ntracks++) );
85 t->SetFlag(0);
86 FairTrackParam* fpar = t->GetParamFirst(), * lpar = t->GetParamLast();
87 CbmKFMath::CopyTC2TrackParam( fpar, T.T, T.C );
89 t->SetChi2(T.chi2);
90 t->SetNDF(T.NDF);
91 t->SetPidHypo( T.T[4]>=0 ?211 :-211 );
92
93 for (vector<int>::iterator ih = it->StsHits.begin(); ih != it->StsHits.end(); ++ih)
94 {
95 CbmL1HitStore &h = L1->vHitStore[*ih];
96 double zref = L1->algo->vStations[h.iStation].z[0];
97 if( h.ExtIndex<0 ){
98 CbmMvdHit tmp;
99 tmp.SetZ(zref);
100 t->AddMvdHit( -h.ExtIndex-1, &tmp );
101 }else{
102 CbmStsHit tmp;
103 tmp.SetZ(zref);
104 t->AddStsHit( h.ExtIndex , &tmp );
105 }
106 }
107 }
108
109 return ntracks;
110
111}
112// -------------------------------------------------------------------------
113
114
115
116
117
118
static void CopyTC2TrackParam(FairTrackParam *par, Double_t T[], Double_t C[])
int ExtIndex
Definition CbmL1.h:43
int iStation
Definition CbmL1.h:44
double TLast[6]
Definition CbmL1Track.h:53
double CLast[15]
Definition CbmL1Track.h:53
Definition CbmL1.h:49
static CbmL1 * Instance()
reconstructed tracks
Definition CbmL1.h:60
TClonesArray * fTracks
void SetNDF(Int_t ndf)
Definition CbmStsTrack.h:87
FairTrackParam * GetParamLast()
Definition CbmStsTrack.h:70
void AddStsHit(Int_t hitIndex, FairHit *hit)
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)
FairTrackParam * GetParamFirst()
Definition CbmStsTrack.h:69
void SetPidHypo(Int_t pid)
Definition CbmStsTrack.h:82
#define L1
double C[15]