CbmRoot
Loading...
Searching...
No Matches
CbmL1Track.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Ivan Kisel, Sergey Gorbunov, Denis Bertini [committer], Igor Kulakov, Maksym Zyzak, Sergei Zharko */
4
5/*
6 *====================================================================
7 *
8 * CBM Level 1 Reconstruction
9 *
10 * Authors: I.Kisel, S.Gorbunov
11 *
12 * e-mail : ikisel@kip.uni-heidelberg.de
13 *
14 *====================================================================
15 *
16 * L1 track class
17 *
18 *====================================================================
19 */
20
21// TODO: SZh 06.06.2024: Rework this class (inherit the new CbmTrack class with additional functionality)
22
23#ifndef CbmL1Track_H
24#define CbmL1Track_H
25
26#include "CaVector.h"
27#include "CbmL1Constants.h"
28#include "CbmL1MCTrack.h"
29#include "KfTrackParam.h"
30#include "TMath.h"
31
32#include <iterator>
33#include <map>
34#include <string>
35#include <vector>
36
37namespace
38{
39 namespace ca = cbm::algo::ca;
40}
41
42
43class CbmL1MCTrack;
44
46 public:
47 CbmL1Track() = default;
48
51
54
55 bool IsGhost() const { return (maxPurity < CbmL1Constants::MinPurity); }
56
58 int GetFirstHitIndex() const { return Hits.front(); }
59
61 int GetLastHitIndex() const { return Hits.back(); }
62
64 const auto& GetHitIndexes() const { return Hits; }
65
66
68 const auto& GetMCTrackIndexes() const { return fvMcTrackIndexes; }
69
71 double GetMaxPurity() const { return maxPurity; }
72
76 int GetMatchedMCTrackIndex() const { return fvMcTrackIndexes.size() ? fvMcTrackIndexes[0] : -1; }
77
79 int GetNofHits() const { return Hits.size(); }
80
82 int GetNofMCTracks() const { return fvMcTrackIndexes.size(); }
83
85 int GetNofStations() const { return nStations; }
86
87
91 void SetMaxPurity(double maxPurity_) { maxPurity = maxPurity_; }
92
94 double GetProb() const { return TMath::Prob(GetChiSq(), GetNdf()); }
95
99 std::string ToString(int verbose = 10, bool header = false) const;
100
103
104 std::vector<int> Hits;
105 int nStations{0};
106 int index{0};
107
108 double fTrackTime{0.};
109
110 std::map<int, int> hitMap; // N hits (second) from each mcTrack (first is a MC track ID) belong to current recoTrack
111 // FIXME: SZh 14.12.2022: map => unordered_map
112
113 private:
114 ca::Vector<int> fvMcTrackIndexes = {"CbmL1Track::fvMcTrackIndexes"}; // global indexes of MC tracks
115 // NOTE: mcTracks should be replaced with fvMcTrackIndexes
116
117 double maxPurity{-1.};
118};
119
120#endif
int GetNofStations() const
Gets number of stations.
Definition CbmL1Track.h:85
const auto & GetMCTrackIndexes() const
Gets a reference to MC track indexes.
Definition CbmL1Track.h:68
double GetMaxPurity() const
Gets max purity.
Definition CbmL1Track.h:71
CbmL1Track()=default
double maxPurity
Maximum persent of hits, which belong to one mcTrack.
Definition CbmL1Track.h:117
void AddMCTrackIndex(int iMT)
Adds an index of MC track index.
Definition CbmL1Track.h:50
int nStations
Number of stations with hits of this track.
Definition CbmL1Track.h:105
const auto & GetHitIndexes() const
Gets hit indexes.
Definition CbmL1Track.h:64
cbm::algo::kf::TrackParamD TLast
Track parameters in the end of the track.
Definition CbmL1Track.h:102
double fTrackTime
Time of the track [ns] ???
Definition CbmL1Track.h:108
std::vector< int > Hits
Indexes of hits of this track.
Definition CbmL1Track.h:104
void ClearMatchedMCTracks()
Clears the contents of matched MC track indexes (and pointers)
Definition CbmL1Track.h:53
void SetMaxPurity(double maxPurity_)
Definition CbmL1Track.h:91
int GetNofHits() const
Gets number of hits of the track.
Definition CbmL1Track.h:79
std::string ToString(int verbose=10, bool header=false) const
Provides a string representation of object.
bool IsGhost() const
Definition CbmL1Track.h:55
ca::Vector< int > fvMcTrackIndexes
Definition CbmL1Track.h:114
double GetProb() const
Gets probability of track fit model.
Definition CbmL1Track.h:94
std::map< int, int > hitMap
Definition CbmL1Track.h:110
int GetMatchedMCTrackIndex() const
Gets index of matched MC track.
Definition CbmL1Track.h:76
int GetFirstHitIndex() const
Gets first hit index.
Definition CbmL1Track.h:58
int GetNofMCTracks() const
Gets number of associated MC tracks.
Definition CbmL1Track.h:82
cbm::algo::kf::TrackParamD Tpv
Track parameters at primary vertex.
Definition CbmL1Track.h:101
int index
Index of this track (TODO: it seems to be not initialized)
Definition CbmL1Track.h:106
int GetLastHitIndex() const
Gets last hit index.
Definition CbmL1Track.h:61
void push_back_no_warning(Tinput value)
Pushes back a value to the vector without testing for the memory re-alocation.
Definition CaVector.h:188
const double MinPurity
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14