32#include "FairMCPoint.h"
33#include "FairRootManager.h"
34#include "TClonesArray.h"
35#include "TDatabasePDG.h"
45 : fGlobalTracks(nullptr)
47 , fMuchTracks(nullptr)
51 fName =
"Global Track Finder L1";
71 Int_t globalTrackIndexStart = globalTrackIndex;
73 Int_t stsTrackIndex =
fStsTracks->GetEntriesFast();
74 Int_t muchTrackIndex =
fMuchTracks->GetEntriesFast();
75 Int_t trdTrackIndex =
fTrdTracks->GetEntriesFast();
76 Int_t tofTrackIndex =
fTofTracks->GetEntriesFast();
78 LOG(debug) <<
"Copy L1 tracks : " << L1->
fvRecoTracks.size() <<
" tracks in L1";
99 bool hasStsHits =
false;
100 bool hasMuchHits =
false;
101 bool hasTrdHits =
false;
102 bool hasTofHits =
false;
103 for (vector<int>::iterator ih = it->Hits.begin(); ih != it->Hits.end(); ++ih) {
106 if (
h.detId <= 1 && hasStsHits ==
false) {
114 if (
h.detId == 2 && hasMuchHits ==
false) {
123 if (
h.detId == 3 && hasTrdHits ==
false) {
131 if (
h.detId == 4 && hasTofHits ==
false) {
146 return globalTrackIndex - globalTrackIndexStart;
170 for (vector<int>::iterator ih = T.Hits.begin(); ih != T.Hits.end(); ++ih) {
175 else if (
h.detId == 1) {
182 track->
SetNDF(T.GetNdf());
183 track->
SetPidHypo(T.GetQp() >= 0. ? 211 : -211);
204 for (vector<int>::iterator ih = T.Hits.begin(); ih != T.Hits.end(); ++ih) {
206 if (
h.detId != systemIdT)
continue;
210 track->
SetNDF(T.GetNdf());
226 for (vector<int>::iterator ih = T.Hits.begin(); ih != T.Hits.end(); ++ih) {
228 if (
h.detId != systemIdT)
continue;
233 track->
SetNDF(T.GetNdf());
249 for (vector<int>::iterator ih = T.Hits.begin(); ih != T.Hits.end(); ++ih) {
251 if (
h.detId != systemIdT)
continue;
255 track->
SetNDF(T.GetNdf());
269 LOG(error) <<
"-E- CbmL1GlobalTrackFinder::DoFind: "
270 <<
"Track array missing! ";
307 LOG(fatal) <<
"L1 instance doesn't exist or is not initialised";
310 auto* p = TDatabasePDG::Instance()->GetParticle(pdg);
312 LOG(fatal) <<
"Particle with pdg " << pdg <<
" doesn't exist";
TClonesArray * fTofTracks
ClassImp(CbmL1GlobalTrackFinder) CbmL1GlobalTrackFinder
Data class for a reconstructed hit in the STS.
Data class for STS tracks.
Generates beam ions for transport simulation.
Class characterising one event by a collection of links (indices) to data objects,...
void SetChiSqTime(double chi2)
void SetParamLast(const FairTrackParam *parLast)
void SetMuchTrackIndex(int32_t iMuch)
void SetPidHypo(int32_t iPid)
void SetTofTrackIndex(int32_t iTofTrack)
void SetChi2(double chi2)
void SetTrdTrackIndex(int32_t iTrd)
void SetParamFirst(const FairTrackParam *parFirst)
void SetFlag(int32_t iFlag)
void SetNdfTime(int32_t ndf)
void SetStsTrackIndex(int32_t iSts)
void CbmL1TrackToCbmTrack(CbmL1Track T, CbmTrack *track, int systemIdT)
void CbmL1TrackToCbmStsTrack(CbmL1Track T, CbmStsTrack *track)
Int_t CopyL1Tracks(CbmEvent *event=nullptr)
virtual ~CbmL1GlobalTrackFinder()
void CbmL1TrackToCbmTrdTrack(CbmL1Track T, CbmTrdTrack *track, int systemIdT)
void CbmL1TrackToCbmMuchTrack(CbmL1Track T, CbmMuchTrack *track, int systemIdT)
TClonesArray * fStsTracks
void CbmL1TrackToCbmTofTrack(CbmL1Track T, CbmTofTrack *track, int systemIdT)
TClonesArray * fTrdTracks
void SetDefaultParticlePDG(int pdg=13)
TClonesArray * fGlobalTracks
TClonesArray * fTofTracks
virtual Int_t FindTracks(CbmEvent *event)
TClonesArray * fMuchTracks
cbm::algo::kf::TrackParamD TLast
Track parameters in the end of the track.
static CbmL1 * Instance()
Pointer to CbmL1 instance.
void Reconstruct(CbmEvent *event=nullptr)
ca::Vector< CbmL1HitId > fvExternalHits
Array of hits.
ca::Framework * fpAlgo
Pointer to the L1 track finder algorithm.
ca::Vector< CbmL1Track > fvRecoTracks
Reconstructed tracks container.
void AddMvdHit(int32_t hitIndex)
void AddStsHit(int32_t hitIndex)
void SetLastHitTimeError(double error)
void SetStartTimeError(double error)
void SetLastHitTime(double time)
void AddHit(int32_t index, HitType type)
void SetFirstHitTime(double time)
void SetFirstHitTimeError(double error)
void SetPidHypo(int32_t pid)
void SetFlag(int32_t flag)
void SetParamFirst(const FairTrackParam *par)
void SetChiSq(double chiSq)
void SetStartTime(double time)
void SetParamLast(const FairTrackParam *par)
void SetDefaultParticleMass(fscal mass)
Sets a default particle mass for the track fit.
T GetNdf() const
Gets NDF of track fit model.
T GetChiSq() const
Gets Chi-square of track fit model.
cbm::algo::kf::TrackParamD ConvertTrackParam(const FairTrackParam &par)
copy fair track param to Ca track param