Go to the documentation of this file.
27 #include "FairMCPoint.h"
28 #include "FairRootManager.h"
30 #include "TClonesArray.h"
43 : FairTask(
"CbmL1GlobalTrackFinder"), fEventNo(0) {
44 fName =
"Global Track Finder L1";
56 FairRootManager* ioman = FairRootManager::Instance();
60 ioman->Register(
"GlobalTrack",
"Global",
fGlobalTracks,
"GlobalTrack");
63 fMuchTracks =
new TClonesArray(
"CbmMuchTrack", 100);
64 ioman->Register(
"MuchTrack",
"Much",
fMuchTracks,
"MuchTrack");
68 fTrdTracks =
new TClonesArray(
"CbmTrdTrack", 100);
69 ioman->Register(
"TrdTrack",
"Trd",
fTrdTracks,
"TrdTrack");
73 fTofTracks =
new TClonesArray(
"CbmTofTrack", 100);
74 ioman->Register(
"TofTrack",
"Tof",
fTofTracks,
"TofTrack");
77 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"Event"));
79 LOG(info) <<
fEvents <<
" fEvents ";
82 LOG(warn) << GetName() <<
": No event array! Will process entire tree.";
85 fStsHits = (TClonesArray*) ioman->GetObject(
"StsHit");
88 fMvdHits = (TClonesArray*) ioman->GetObject(
"MvdHit");
91 LOG(info) << GetName() <<
": successfully initialised.";
92 LOG(info) <<
"=====================================";
103 Int_t nEvents =
fEvents->GetEntriesFast();
104 LOG(debug) << GetName() <<
": reading time slice with " << nEvents
106 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
108 LOG(debug) <<
fEvents <<
" fEvents " << iEvent <<
" iEvent ";
117 LOG(info) <<
"CbmL1GlobalTrackFinder::Exec event: " <<
fEventNo++;
134 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Event " << setw(6) << right
135 <<
eventNumber <<
", real time " << fixed << setprecision(6)
136 <<
fTimer.RealTime() <<
" s, hits: " << nHits
137 <<
", tracks: " << nTracks << ;
151 TClonesArray* globalTracks,
152 TClonesArray* stsTracks,
153 TClonesArray* trdTracks,
154 TClonesArray* muchTracks,
155 TClonesArray* tofTracks) {
164 Int_t globalTrackNo = globalTracks->GetEntriesFast();
166 Int_t stsTrackNo = (stsTracks != NULL) ? stsTracks->GetEntriesFast() : 0;
167 Int_t trdTrackNo = (trdTracks != NULL) ? trdTracks->GetEntriesFast() : 0;
168 Int_t muchTrackNo = (muchTracks != NULL) ? muchTracks->GetEntriesFast() : 0;
169 Int_t tofTrackNo = (tofTracks != NULL) ? tofTracks->GetEntriesFast() : 0;
171 for (vector<CbmL1Track>::iterator it = L1->
vRTracks.begin();
183 event ?
event->GetIndex(
kStsTrack, globalTrackNo) : globalTrackNo;
212 for (vector<int>::iterator ih = it->StsHits.begin();
213 ih != it->StsHits.end();
232 Int_t globalTrackId = stsTrackNo - 1;
233 Int_t tofHitId =
h.ExtIndex;
245 if (event)
event->AddData(
kTofHit, tofHitId);
259 if (ndf <= 0) ndf = 1;
268 if (event)
event->AddData(
kMuchTrack, muchTrackNo);
282 if (ndf <= 0) ndf = 1;
291 if (event)
event->AddData(
kTrdTrack, trdTrackNo);
305 if (ndf <= 0) ndf = 1;
314 if (event)
event->AddData(
kStsTrack, stsTrackNo);
331 Int_t trackIndex =
fTracks->GetEntriesFast();
333 LOG(debug) <<
"Copy L1 tracks : " << L1->
vRTracks.size() <<
" tracks in L1";
334 for (vector<CbmL1Track>::iterator it = L1->
vRTracks.begin();
340 if (event)
event->AddData(
kStsTrack, trackIndex);
354 for (vector<int>::iterator ih = it->StsHits.begin();
355 ih != it->StsHits.end();
359 if (
h.ExtIndex < 0) {
380 LOG(error) <<
"-E- CbmL1GlobalTrackFinder::DoFind: "
381 <<
"Track array missing! ";
419 std::cout << std::endl;
420 LOG(info) <<
"=====================================";
421 LOG(info) << GetName() <<
": Run summary";
422 LOG(info) <<
"Events processed : " <<
fNofEvents;
426 LOG(info) <<
"Time per event : " <<
fTime / Double_t(
fNofEvents) <<
" s ";
427 LOG(info) <<
"=====================================";
Double_t fTime
Total real time used for good events.
Generates beam ions for transport simulation.
const FairTrackParam * GetParamLast() const
virtual InitStatus Init()
virtual Int_t GetNofHits() const
Int_t CopyL1Tracks(CbmEvent *event=NULL)
TClonesArray * fTrdTracks
Double_t fNofTracks
Number of tracks created.
const FairTrackParam * GetParamLast() const
void SetParamLast(const FairTrackParam *parLast)
void SetTrdTrackIndex(Int_t iTrd)
TClonesArray * fGlobalTracks
void SetTrackIndex(Int_t trackIndex)
TStopwatch fTimer
Array of CbmEvent objects.
void SetTime(Double_t time)
virtual void Exec(Option_t *opt)
void SetParamLast(const FairTrackParam *par)
virtual Int_t GetNofHits() const
Data class for STS tracks.
void SetStsTrackIndex(Int_t iSts)
static CbmL1 * Instance()
Int_t GetHitIndex(Int_t iHit) const
void SetPidHypo(Int_t pid)
virtual Int_t FindTracks(CbmEvent *event)
void SetChiSq(Double_t chiSq)
void SetTimeError(Double_t error)
const FairTrackParam * GetParamFirst() const
ClassImp(CbmL1GlobalTrackFinder) CbmL1GlobalTrackFinder
virtual ~CbmL1GlobalTrackFinder()
Int_t CreateGlobalTrackArray(CbmEvent *event, TClonesArray *globalTracks, TClonesArray *stsTracks, TClonesArray *trdTracks, TClonesArray *muchTracks, TClonesArray *tofTracks)
TClonesArray * fMuchTracks
void SetTofHitIndex(Int_t tofHitIndex)
void SetParamFirst(const FairTrackParam *parFirst)
vector< CbmL1Track > vRTracks
static void CopyTC2TrackParam(FairTrackParam *par, Double_t T[], Double_t C[])
void SetMuchTrackIndex(Int_t iMuch)
void SetParamFirst(const FairTrackParam *par)
Class characterising one event by a collection of links (indices) to data objects,...
void SetTofHitIndex(Int_t iTofHit)
const FairTrackParam * GetParamFirst() const
void ProcessEvent(CbmEvent *event)
TClonesArray * fTofTracks
vector< CbmL1HitStore > vHitStore
Double_t fNofHits
Number of hits.
void AddHit(Int_t index, HitType type)
void Reconstruct(CbmEvent *event=NULL)
Provides information on attaching a TofHit to a GlobalTrack.
Data class for a reconstructed hit in the STS.
void AddMvdHit(Int_t hitIndex)