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 "KfTrackParam.h"
29#include "TMath.h"
30
31#include <iterator>
32#include <map>
33#include <string>
34#include <vector>
35
36namespace
37{
38 namespace ca = cbm::algo::ca;
39}
40
41
43 public:
44 CbmL1Track() = default;
45
47 void AddMCTrackIndex(int iMT) { fvMcTrackIndexes.push_back_no_warning(iMT); }
48
51
52 bool IsGhost() const { return (maxPurity < CbmL1Constants::MinPurity); }
53
55 int GetFirstHitIndex() const { return Hits.front(); }
56
58 int GetLastHitIndex() const { return Hits.back(); }
59
61 const auto& GetHitIndexes() const { return Hits; }
62
63
65 const auto& GetMCTrackIndexes() const { return fvMcTrackIndexes; }
66
68 double GetMaxPurity() const { return maxPurity; }
69
73 int GetMatchedMCTrackIndex() const { return fvMcTrackIndexes.size() ? fvMcTrackIndexes[0] : -1; }
74
76 int GetNofHits() const { return Hits.size(); }
77
79 int GetNofMCTracks() const { return fvMcTrackIndexes.size(); }
80
82 int GetNofStations() const { return nStations; }
83
84
88 void SetMaxPurity(double maxPurity_) { maxPurity = maxPurity_; }
89
91 double GetProb() const { return TMath::Prob(GetChiSq(), GetNdf()); }
92
96 std::string ToString(int verbose = 10, bool header = false) const;
97
100
101 std::vector<int> Hits;
102 int nStations{0};
103 int index{0};
104
105 double fTrackTime{0.};
106
107 std::map<int, int> hitMap; // N hits (second) from each mcTrack (first is a MC track ID) belong to current recoTrack
108 // FIXME: SZh 14.12.2022: map => unordered_map
109
110 private:
111 ca::Vector<int> fvMcTrackIndexes = {"CbmL1Track::fvMcTrackIndexes"}; // global indexes of MC tracks
112 // NOTE: mcTracks should be replaced with fvMcTrackIndexes
113
114 double maxPurity{-1.};
115};
116
117#endif
int GetNofStations() const
Gets number of stations.
Definition CbmL1Track.h:82
const auto & GetMCTrackIndexes() const
Gets a reference to MC track indexes.
Definition CbmL1Track.h:65
double GetMaxPurity() const
Gets max purity.
Definition CbmL1Track.h:68
CbmL1Track()=default
double maxPurity
Maximum persent of hits, which belong to one mcTrack.
Definition CbmL1Track.h:114
void AddMCTrackIndex(int iMT)
Adds an index of MC track index.
Definition CbmL1Track.h:47
int nStations
Number of stations with hits of this track.
Definition CbmL1Track.h:102
const auto & GetHitIndexes() const
Gets hit indexes.
Definition CbmL1Track.h:61
cbm::algo::kf::TrackParamD TLast
Track parameters in the end of the track.
Definition CbmL1Track.h:99
double fTrackTime
Time of the track [ns] ???
Definition CbmL1Track.h:105
std::vector< int > Hits
Indexes of hits of this track.
Definition CbmL1Track.h:101
void ClearMatchedMCTracks()
Clears the contents of matched MC track indexes (and pointers)
Definition CbmL1Track.h:50
void SetMaxPurity(double maxPurity_)
Definition CbmL1Track.h:88
int GetNofHits() const
Gets number of hits of the track.
Definition CbmL1Track.h:76
std::string ToString(int verbose=10, bool header=false) const
Provides a string representation of object.
bool IsGhost() const
Definition CbmL1Track.h:52
ca::Vector< int > fvMcTrackIndexes
Definition CbmL1Track.h:111
double GetProb() const
Gets probability of track fit model.
Definition CbmL1Track.h:91
std::map< int, int > hitMap
Definition CbmL1Track.h:107
int GetMatchedMCTrackIndex() const
Gets index of matched MC track.
Definition CbmL1Track.h:73
int GetFirstHitIndex() const
Gets first hit index.
Definition CbmL1Track.h:55
int GetNofMCTracks() const
Gets number of associated MC tracks.
Definition CbmL1Track.h:79
cbm::algo::kf::TrackParamD Tpv
Track parameters at primary vertex.
Definition CbmL1Track.h:98
int index
Index of this track (TODO: it seems to be not initialized)
Definition CbmL1Track.h:103
int GetLastHitIndex() const
Gets last hit index.
Definition CbmL1Track.h:58
const double MinPurity
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
TrackParam< double > TrackParamD