PandaRoot
PndMCTrackInfo.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndMCTrackInfo header file -----
3 // ----- Created 16/09/19 by T.Stockmann -----
4 // -------------------------------------------------------------------------
5 
13 #ifndef PNDMCTRACKINFO_H
14 #define PNDMCTRACKINFO_H 1
15 
16 #include "FairMultiLinkedData_Interface.h"
17 #include "PndPidProbability.h"
18 
19 #include "TVector3.h"
20 #include <iostream>
21 #include <map>
22 
23 class PndMCTrackInfo : public FairMultiLinkedData_Interface {
24 
25  public:
28 
30  virtual ~PndMCTrackInfo();
31 
33  void Print(std::ostream &out = std::cout);
34 
35  friend std::ostream &operator<<(std::ostream &out, PndMCTrackInfo &track)
36  {
37  track.Print(out);
38  return out;
39  }
40 
46  std::vector<int> GetDaughters();
47  TVector3 GetDecayVertex() const { return fDecayVertex; }
48  Double_t GetDecayTime() const { return fDecayTime; }
49 
54  Int_t GetStage() const { return fStage; }
55 
60  std::vector<int> GetPIDMothers() const { return fPIDMothers; }
61 
65  std::vector<int> GetPIDDaughters() const { return fPIDDaughters; }
66 
70  int GetPID() const { return fPID; }
71 
76  Int_t GetNHits(TString branchName);
77 
78  int GetMVDPoints() const { return fMVDPoints; }
79  int GetSTTPoints() const { return fSTTPoints; }
80  int GetGEMPoints() const { return fGEMPoints; }
81  int GetFTSPoints() const { return fFTSPoints; }
82  int GetTotalPoints() const { return fTotalPoints; }
83 
87  int GetTypeCount(int type)
88  {
89  if (fTypeCount.count(type) > 0) {
90  return fTypeCount[type];
91  } else {
92  return -1;
93  }
94  };
95 
99  TVector2 GetDeltaMomentum(int type)
100  {
101  TVector2 result;
102  if (fMomentumDifference.count(type) > 0) {
103  return fMomentumDifference[type];
104  }
105  return result;
106  }
107 
113  {
114  PndPidProbability result;
115  if (fPidProb.count(type) > 0) {
116  return fPidProb[type];
117  }
118  return result;
119  }
120 
121  // Setters
122  void SetPID(int pid) { fPID = pid; }
123  void AddDaughter(FairLink doughter);
124  void AddPIDDaughter(int pid) { fPIDDaughters.push_back(pid); }
125  void SetPIDMothers(std::vector<int> pid)
126  {
127  fPIDMothers = pid;
128  fStage = fPIDMothers.size();
129  }
130  void SetDecayVertex(TVector3 vertex) { fDecayVertex = vertex; }
131  void SetDecayTime(Double_t time) { fDecayTime = time; }
132  void SetRecoMomentum(int branchType, TVector3 value) { fMomentumReco[branchType] = value; } // branchType typeID of branch containing the reconstructed track
133  void SetDeltaMomentum(int branchType, double pt, double pl) { fMomentumDifference[branchType] = TVector2(pt, pl); }; // mc momentum - reco momentum
134  void SetPidProbability(int branchType, PndPidProbability &value) { fPidProb[branchType] = value; }
135 
136  void FillPoints();
137  void FillTypeCounts();
138 
139  protected:
140  private:
141  TVector3 fDecayVertex;
142  Double_t fDecayTime;
143  int fPID;
144  std::vector<int> fPIDMothers;
145  std::vector<int> fPIDDaughters;
146  std::vector<int> fDaughters;
147  Int_t fStage;
148  Int_t fMVDPoints;
149  Int_t fSTTPoints;
150  Int_t fGEMPoints;
151  Int_t fFTSPoints;
152  Int_t fTotalPoints;
153  std::map<int, TVector3> fMomentumReco;
154  std::map<int, TVector2> fMomentumDifference; //< difference between p transversal and p longitudinal between reco track and MC track
155  std::map<int, PndPidProbability> fPidProb; //< pid probability from different algorithms
156 
157  std::map<int, int> fTypeCount;
158 
159  ClassDef(PndMCTrackInfo, 5);
160 };
161 
162 #endif
virtual ~PndMCTrackInfo()
PndPidProbability GetPidProbability(int type)
void SetDecayTime(Double_t time)
int GetTotalPoints() const
int GetPID() const
void SetDeltaMomentum(int branchType, double pt, double pl)
int GetMVDPoints() const
void SetPIDMothers(std::vector< int > pid)
friend std::ostream & operator<<(std::ostream &out, PndMCTrackInfo &track)
void SetRecoMomentum(int branchType, TVector3 value)
std::vector< int > GetPIDDaughters() const
int GetFTSPoints() const
void SetPID(int pid)
std::vector< int > GetPIDMothers() const
int GetGEMPoints() const
void FillTypeCounts()
void AddDaughter(FairLink doughter)
int GetTypeCount(int type)
void SetDecayVertex(TVector3 vertex)
void Print(std::ostream &out=std::cout)
Double_t GetDecayTime() const
void AddPIDDaughter(int pid)
TVector3 GetDecayVertex() const
Int_t GetNHits(TString branchName)
TVector2 GetDeltaMomentum(int type)
int GetSTTPoints() const
Int_t GetStage() const
std::vector< int > GetDaughters()
void SetPidProbability(int branchType, PndPidProbability &value)