PandaRoot
PndMCTrackInfo.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndMCTrackInfo header file -----
15 // ----- Created 16/09/19 by T.Stockmann -----
16 // -------------------------------------------------------------------------
17 
25 #ifndef PNDMCTRACKINFO_H
26 #define PNDMCTRACKINFO_H 1
27 
28 #include "FairMultiLinkedData_Interface.h"
29 #include "PndPidProbability.h"
30 
31 #include "TVector3.h"
32 #include <iostream>
33 #include <map>
34 
35 class PndMCTrackInfo : public FairMultiLinkedData_Interface {
36 
37  public:
40 
42  virtual ~PndMCTrackInfo();
43 
45  void Print(std::ostream &out = std::cout);
46 
47  friend std::ostream &operator<<(std::ostream &out, PndMCTrackInfo &track)
48  {
49  track.Print(out);
50  return out;
51  }
52 
58  std::vector<int> GetDaughters();
59  TVector3 GetDecayVertex() const { return fDecayVertex; }
60  Double_t GetDecayTime() const { return fDecayTime; }
61 
66  Int_t GetStage() const { return fStage; }
67 
72  std::vector<int> GetPIDMothers() const { return fPIDMothers; }
73 
77  std::vector<int> GetPIDDaughters() const { return fPIDDaughters; }
78 
82  int GetPID() const { return fPID; }
83 
88  Int_t GetNHits(TString branchName);
89 
90  int GetMVDPoints() const { return fMVDPoints; }
91  int GetSTTPoints() const { return fSTTPoints; }
92  int GetGEMPoints() const { return fGEMPoints; }
93  int GetFTSPoints() const { return fFTSPoints; }
94  int GetTotalPoints() const { return fTotalPoints; }
95 
99  int GetTypeCount(int type)
100  {
101  if (fTypeCount.count(type) > 0) {
102  return fTypeCount[type];
103  } else {
104  return -1;
105  }
106  };
107 
111  TVector2 GetDeltaMomentum(int type)
112  {
113  TVector2 result;
114  if (fMomentumDifference.count(type) > 0) {
115  return fMomentumDifference[type];
116  }
117  return result;
118  }
119 
125  {
126  PndPidProbability result;
127  if (fPidProb.count(type) > 0) {
128  return fPidProb[type];
129  }
130  return result;
131  }
132 
133  // Setters
134  void SetPID(int pid) { fPID = pid; }
135  void AddDaughter(FairLink doughter);
136  void AddPIDDaughter(int pid) { fPIDDaughters.push_back(pid); }
137  void SetPIDMothers(std::vector<int> pid)
138  {
139  fPIDMothers = pid;
140  fStage = fPIDMothers.size();
141  }
142  void SetDecayVertex(TVector3 vertex) { fDecayVertex = vertex; }
143  void SetDecayTime(Double_t time) { fDecayTime = time; }
144  void SetRecoMomentum(int branchType, TVector3 value) { fMomentumReco[branchType] = value; } // branchType typeID of branch containing the reconstructed track
145  void SetDeltaMomentum(int branchType, double pt, double pl) { fMomentumDifference[branchType] = TVector2(pt, pl); }; // mc momentum - reco momentum
146  void SetPidProbability(int branchType, PndPidProbability &value) { fPidProb[branchType] = value; }
147 
148  void FillPoints();
149  void FillTypeCounts();
150 
151  protected:
152  private:
153  TVector3 fDecayVertex;
154  Double_t fDecayTime;
155  int fPID;
156  std::vector<int> fPIDMothers;
157  std::vector<int> fPIDDaughters;
158  std::vector<int> fDaughters;
159  Int_t fStage;
160  Int_t fMVDPoints;
161  Int_t fSTTPoints;
162  Int_t fGEMPoints;
163  Int_t fFTSPoints;
164  Int_t fTotalPoints;
165  std::map<int, TVector3> fMomentumReco;
166  std::map<int, TVector2> fMomentumDifference; //< difference between p transversal and p longitudinal between reco track and MC track
167  std::map<int, PndPidProbability> fPidProb; //< pid probability from different algorithms
168 
169  std::map<int, int> fTypeCount;
170 
171  ClassDef(PndMCTrackInfo, 5);
172 };
173 
174 #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)