CbmRoot
DataTreeCbmInterface.h
Go to the documentation of this file.
1 #ifndef DataTreeCbmInterface_H
2 #define DataTreeCbmInterface_H 1
3 
5 #include "CbmKFParticleFinder.h"
6 
7 #include "CbmVertex.h"
8 #include "FairTask.h"
9 #include "TLorentzVector.h"
10 #include <cstring>
11 #include <map>
12 #include <vector>
13 
14 #include "FairMCEventHeader.h"
15 #include "TCanvas.h"
16 #include "TClonesArray.h"
17 #include "TFile.h"
18 #include "TGraphErrors.h"
19 #include "TH2F.h"
20 #include "TProfile.h"
21 #include <TGeoManager.h>
22 #include <iostream>
23 
24 #include "CbmKFVertex.h"
25 #include "CbmTrackMatch.h"
26 
27 class DataTreeEvent;
28 class TClonesArray;
29 class CbmVertex;
30 class TDirectory;
31 class TH1F;
32 class TProfile;
33 class TH2F;
34 class CbmDigiManager;
35 
36 
37 class DataTreeCbmInterface : public FairTask {
38 
39 public:
42 
43  virtual InitStatus Init();
44  virtual void Exec(Option_t* opt);
45  virtual void Finish();
46 
47  void SetOutputFile(const TString filename) { fOutputFileName = filename; }
48 
49  void LoadGeo(const TString& geoFile);
50 
52  fFinderTOF = finder;
53  }
55  fFinderMC = finder;
56  }
57 
58 private:
59  void InitInput();
60  void InitOutput();
61  void InitOutputTree();
62  void InitDataTreeEvent();
63  void ClearEvent();
64  void ReadEvent();
65  void ReadPSD();
66  void ReadTracks();
67  void LinkSTS();
68  void ReadTOF();
69  void ReadMC();
70  int GetMCTrackMatch(const int idx);
71  void ReadV0(const int UseMCpid = 0);
73 
74  TString fOutputFileName {""};
75  TFile* fTreeFile {nullptr};
76  TTree* fDataTree {nullptr};
77 
78  CbmVertex* fPrimVtx {nullptr};
79  FairMCEventHeader* fHeader {nullptr};
81  TClonesArray* flistPSDhit {nullptr};
82  TClonesArray* flistMCtrack {nullptr};
83  TClonesArray* flistSTSRECOtrack {nullptr};
84  TClonesArray* flistSTStrackMATCH {nullptr};
85  TClonesArray* fGlobalTrackArray {nullptr};
86  TClonesArray* fTofHitArray {nullptr};
87  TClonesArray* fTofHitMatchArray {nullptr};
88  TClonesArray* fPsdPointArray {nullptr};
89 
90  DataTreeEvent* fDTEvent {nullptr};
91 
92  int fPsdModules {0};
93  TVector3 fPsdPosition;
94  std::map<int, TVector3> fPsdModulePositions;
95 
96 
97  std::vector<int> fMCTrackIDs;
98  std::vector<int> fTrackIDs;
99 
100  const CbmKFParticleFinder* fFinderTOF {nullptr};
101  const CbmKFParticleFinder* fFinderMC {nullptr};
102 
103  ClassDef(DataTreeCbmInterface, 1)
104 };
105 
106 #endif
DataTreeCbmInterface::InitOutput
void InitOutput()
Definition: DataTreeCbmInterface.cxx:142
DataTreeCbmInterface::LinkSTS
void LinkSTS()
Definition: DataTreeCbmInterface.cxx:504
DataTreeCbmInterface::flistPSDhit
TClonesArray * flistPSDhit
Definition: DataTreeCbmInterface.h:81
DataTreeCbmInterface::ClearEvent
void ClearEvent()
Definition: DataTreeCbmInterface.cxx:176
CbmVertex.h
CbmKFParticleFinder.h
DataTreeCbmInterface::~DataTreeCbmInterface
~DataTreeCbmInterface()
Definition: DataTreeCbmInterface.cxx:56
CbmKFParticleFinder
Definition: CbmKFParticleFinder.h:26
DataTreeCbmInterface::Exec
virtual void Exec(Option_t *opt)
Definition: DataTreeCbmInterface.cxx:159
DataTreeCbmInterface::fPrimVtx
CbmVertex * fPrimVtx
Definition: DataTreeCbmInterface.h:78
DataTreeCbmInterface::SetOutputFile
void SetOutputFile(const TString filename)
Definition: DataTreeCbmInterface.h:47
DataTreeCbmInterface::fTofHitMatchArray
TClonesArray * fTofHitMatchArray
Definition: DataTreeCbmInterface.h:87
DataTreeCbmInterface::GetMCTrackMatch
int GetMCTrackMatch(const int idx)
Definition: DataTreeCbmInterface.cxx:279
DataTreeCbmInterface::fTrackIDs
std::vector< int > fTrackIDs
Definition: DataTreeCbmInterface.h:98
DataTreeCbmInterface::fTreeFile
TFile * fTreeFile
Definition: DataTreeCbmInterface.h:75
DataTreeCbmInterface::Init
virtual InitStatus Init()
Definition: DataTreeCbmInterface.cxx:61
CbmTrackMatch.h
DataTreeCbmInterface::ReadMC
void ReadMC()
Definition: DataTreeCbmInterface.cxx:286
DataTreeCbmInterface::fFinderTOF
const CbmKFParticleFinder * fFinderTOF
Definition: DataTreeCbmInterface.h:100
DataTreeCbmInterface::Finish
virtual void Finish()
Definition: DataTreeCbmInterface.cxx:698
DataTreeCbmInterface::fOutputFileName
TString fOutputFileName
Definition: DataTreeCbmInterface.h:74
DataTreeCbmInterface::ReadTracks
void ReadTracks()
Definition: DataTreeCbmInterface.cxx:328
DataTreeCbmInterface::InitInput
void InitInput()
Definition: DataTreeCbmInterface.cxx:124
DataTreeCbmInterface::fDTEvent
DataTreeEvent * fDTEvent
Definition: DataTreeCbmInterface.h:90
DataTreeCbmInterface::ReadPsdPrimaryParticles
void ReadPsdPrimaryParticles()
Definition: DataTreeCbmInterface.cxx:248
DataTreeCbmInterface::ReadV0
void ReadV0(const int UseMCpid=0)
Definition: DataTreeCbmInterface.cxx:614
DataTreeCbmInterface::fMCTrackIDs
std::vector< int > fMCTrackIDs
Definition: DataTreeCbmInterface.h:97
DataTreeCbmInterface
Definition: DataTreeCbmInterface.h:37
DataTreeCbmInterface::flistSTSRECOtrack
TClonesArray * flistSTSRECOtrack
Definition: DataTreeCbmInterface.h:83
DataTreeCbmInterface::fPsdModulePositions
std::map< int, TVector3 > fPsdModulePositions
Definition: DataTreeCbmInterface.h:94
CbmVertex
Definition: CbmVertex.h:26
DataTreeCbmInterface::InitOutputTree
void InitOutputTree()
Definition: DataTreeCbmInterface.cxx:151
DataTreeCbmInterface::LoadGeo
void LoadGeo(const TString &geoFile)
Definition: DataTreeCbmInterface.cxx:68
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
DataTreeCbmInterface::ReadTOF
void ReadTOF()
Definition: DataTreeCbmInterface.cxx:529
CbmKFPartEfficiencies.h
DataTreeCbmInterface::SetKFParticleFinderTOF
void SetKFParticleFinderTOF(const CbmKFParticleFinder *finder)
Definition: DataTreeCbmInterface.h:51
DataTreeCbmInterface::fDigiMan
CbmDigiManager * fDigiMan
Definition: DataTreeCbmInterface.h:80
DataTreeCbmInterface::fDataTree
TTree * fDataTree
Definition: DataTreeCbmInterface.h:76
DataTreeCbmInterface::InitDataTreeEvent
void InitDataTreeEvent()
Definition: DataTreeCbmInterface.cxx:145
DataTreeCbmInterface::fHeader
FairMCEventHeader * fHeader
Definition: DataTreeCbmInterface.h:79
DataTreeCbmInterface::fPsdPointArray
TClonesArray * fPsdPointArray
Definition: DataTreeCbmInterface.h:88
DataTreeCbmInterface::fPsdPosition
TVector3 fPsdPosition
Definition: DataTreeCbmInterface.h:93
DataTreeCbmInterface::fGlobalTrackArray
TClonesArray * fGlobalTrackArray
Definition: DataTreeCbmInterface.h:85
DataTreeCbmInterface::fTofHitArray
TClonesArray * fTofHitArray
Definition: DataTreeCbmInterface.h:86
DataTreeCbmInterface::SetKFParticleFinderMC
void SetKFParticleFinderMC(const CbmKFParticleFinder *finder)
Definition: DataTreeCbmInterface.h:54
DataTreeCbmInterface::fFinderMC
const CbmKFParticleFinder * fFinderMC
Definition: DataTreeCbmInterface.h:101
DataTreeCbmInterface::ReadPSD
void ReadPSD()
Definition: DataTreeCbmInterface.cxx:213
DataTreeCbmInterface::flistSTStrackMATCH
TClonesArray * flistSTStrackMATCH
Definition: DataTreeCbmInterface.h:84
DataTreeCbmInterface::flistMCtrack
TClonesArray * flistMCtrack
Definition: DataTreeCbmInterface.h:82
DataTreeCbmInterface::fPsdModules
int fPsdModules
Definition: DataTreeCbmInterface.h:92
CbmKFVertex.h
DataTreeCbmInterface::DataTreeCbmInterface
DataTreeCbmInterface()
Definition: DataTreeCbmInterface.cxx:52
DataTreeCbmInterface::ReadEvent
void ReadEvent()
Definition: DataTreeCbmInterface.cxx:183