CbmRoot
CbmEventBuilderQA.h
Go to the documentation of this file.
1 
6 #ifndef CbmEventBuilderQA_H
7 #define CbmEventBuilderQA_H
8 
9 #include "CbmEvent.h"
10 #include "CbmStsTrack.h"
11 #include "FairTask.h"
12 
13 #include "TString.h"
14 
15 #include <map>
16 #include <vector>
17 
18 class TClonesArray;
19 class CbmMCEventList;
20 #include "CbmMCDataArray.h"
21 
22 class TClonesArray;
23 class TFile;
24 class TDirectory;
25 class TH1F;
26 class TH2F;
27 class TObject;
28 
29 class CbmEventBuilderQA : public FairTask {
30 public:
31  // Constructors/Destructors ---------
32  CbmEventBuilderQA(const char* name = "CbmEventBuilderQA",
33  Int_t iVerbose = 0,
34  TString outFileName = "CbmEventBuilderQA.root");
38 
39  void SetStsTrackBranchName(const TString& name) {
40  fStsTrackBranchName = name;
41  }
42  void SetGlobalTrackBranchName(const TString& name) {
44  }
45  void SetTofBranchName(const TString& name) { fTofBranchName = name; }
46  void SetMCTrackBranchName(const TString& name) { fMCTracksBranchName = name; }
47  void SetTrackMatchBranchName(const TString& name) {
49  }
50  void SetMuchTrackMatchBranchName(const TString& name) {
52  }
53  void SetTrdBranchName(const TString& name) { fTrdBranchName = name; }
54  void SetRichBranchName(const TString& name) { fRichBranchName = name; }
55  void SetMuchTrackBranchName(const TString& name) {
56  fMuchTrackBranchName = name;
57  }
58 
59  virtual InitStatus Init();
60  virtual void Exec(Option_t* opt);
61  virtual void Finish();
62 
63 private:
64  std::vector<std::vector<std::vector<int>>> fPointsInTracks;
65 
66 
67  struct SortEvents {
70 
71  SortEvents() : Event(nullptr), track() {}
72  };
73 
74  static bool CompareTrackTime(const SortEvents& a, const SortEvents& b) {
75  return (a.track.GetTime() < b.track.GetTime());
76  }
77 
79  const int iMCFile,
80  const int iMCEvent,
81  const int iMCTrack); // bool CbmL1MCTrack::IsReconstructable()
82 
83  void WriteHistosCurFile(TObject* obj);
84 
85  //names of input branches
88  TString fRichBranchName;
89  TString fTrdBranchName;
90  TString fTofBranchName;
98 
99  static const int fNTimeHistos = 27;
101 
102 
103  TClonesArray* fStsDigis;
104  TClonesArray* fStsTracks;
106  TClonesArray* fStsHits;
109  TClonesArray* fEvents;
110  TClonesArray* fStsTrackMatchArray;
111  TClonesArray* fStsHitMatch;
112 
114 
115  //output file with histograms
116  TString fOutFileName;
117  TFile* fOutFile;
118  TDirectory* fHistoDir;
119 
120  //histograms
121  //STS
122  static const int NStsHisto = 3;
123  TH1F* hStsHisto
124  [8]
125  [NStsHisto]; //All tracks, electrons, muons, pion, kaon, protons, fragments, ghost
126  TH1F* hStsFitHisto[8][10];
127  //Much
128  static const int NMuchHisto = 5;
129  TH1F* hMuchHisto[3][NMuchHisto]; //Muons, Background, Ghost
130  //RICH
131  static const int NRichRingHisto2D = 3; // r, axis a, axis b
133  [10]
134  [NRichRingHisto2D]; //All tracks, electrons, muons, pions, kaons, protons, fragments, mismatch, ghost track, ghost ring
135 
137 };
138 
139 #endif
CbmEventBuilderQA::fTofBranchName
TString fTofBranchName
Definition: CbmEventBuilderQA.h:90
CbmEventBuilderQA::fStsTracks
TClonesArray * fStsTracks
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:104
CbmEventBuilderQA::NRichRingHisto2D
static const int NRichRingHisto2D
Definition: CbmEventBuilderQA.h:131
CbmEventBuilderQA::SortEvents::track
CbmStsTrack track
Definition: CbmEventBuilderQA.h:69
CbmEventBuilderQA::fTrdBranchName
TString fTrdBranchName
Definition: CbmEventBuilderQA.h:89
CbmEventBuilderQA::fGlobalTrackBranchName
TString fGlobalTrackBranchName
Definition: CbmEventBuilderQA.h:87
CbmEventBuilderQA::fTrdTrackMatchBranchName
TString fTrdTrackMatchBranchName
Definition: CbmEventBuilderQA.h:95
CbmEventBuilderQA::fEventList
CbmMCEventList * fEventList
Definition: CbmEventBuilderQA.h:113
CbmEventBuilderQA::SetTrackMatchBranchName
void SetTrackMatchBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:47
CbmEventBuilderQA::fHistoDir
TDirectory * fHistoDir
Definition: CbmEventBuilderQA.h:118
CbmEventBuilderQA::fStsDigis
TClonesArray * fStsDigis
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:103
CbmEventBuilderQA::fMCTracksBranchName
TString fMCTracksBranchName
Definition: CbmEventBuilderQA.h:92
CbmEventBuilderQA::SetMuchTrackBranchName
void SetMuchTrackBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:55
CbmEventBuilderQA::hStsFitHisto
TH1F * hStsFitHisto[8][10]
Definition: CbmEventBuilderQA.h:126
CbmEventBuilderQA::fRichRingMatchBranchName
TString fRichRingMatchBranchName
Definition: CbmEventBuilderQA.h:94
CbmMCDataArray.h
CbmEventBuilderQA::fStsPoints
CbmMCDataArray * fStsPoints
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:108
CbmEventBuilderQA::CalculateIsReconstructable
bool CalculateIsReconstructable(const int iMCFile, const int iMCEvent, const int iMCTrack)
Definition: CbmEventBuilderQA.cxx:719
CbmMCDataArray
Access to a MC data branch for time-based analysis.
Definition: CbmMCDataArray.h:35
CbmEventBuilderQA::SetGlobalTrackBranchName
void SetGlobalTrackBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:42
CbmEventBuilderQA::fMvdPoints
CbmMCDataArray * fMvdPoints
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:107
CbmEventBuilderQA::fTimeHisto
TH1F * fTimeHisto[fNTimeHistos]
Definition: CbmEventBuilderQA.h:100
CbmEventBuilderQA::fStsTrackMatchArray
TClonesArray * fStsTrackMatchArray
Definition: CbmEventBuilderQA.h:110
CbmEventBuilderQA::hMuchHisto
TH1F * hMuchHisto[3][NMuchHisto]
Definition: CbmEventBuilderQA.h:129
CbmEventBuilderQA::CbmEventBuilderQA
CbmEventBuilderQA(const char *name="CbmEventBuilderQA", Int_t iVerbose=0, TString outFileName="CbmEventBuilderQA.root")
Definition: CbmEventBuilderQA.cxx:73
CbmEventBuilderQA::fStsHits
TClonesArray * fStsHits
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:106
CbmEventBuilderQA::SetRichBranchName
void SetRichBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:54
CbmEventBuilderQA
Definition: CbmEventBuilderQA.h:29
CbmEventBuilderQA::ClassDef
ClassDef(CbmEventBuilderQA, 1)
CbmEventBuilderQA::SortEvents
Definition: CbmEventBuilderQA.h:67
CbmEvent.h
CbmStsTrack.h
Data class for STS tracks.
CbmEventBuilderQA::SetMCTrackBranchName
void SetMCTrackBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:46
CbmEventBuilderQA::fOutFileName
TString fOutFileName
Definition: CbmEventBuilderQA.h:116
CbmEventBuilderQA::fMCTracks
CbmMCDataArray * fMCTracks
Input array (class CbmStsDigi)
Definition: CbmEventBuilderQA.h:105
CbmEventBuilderQA::NStsHisto
static const int NStsHisto
Definition: CbmEventBuilderQA.h:122
CbmEventBuilderQA::NMuchHisto
static const int NMuchHisto
Definition: CbmEventBuilderQA.h:128
CbmEventBuilderQA::fTofHitMatchBranchName
TString fTofHitMatchBranchName
Definition: CbmEventBuilderQA.h:96
CbmEventBuilderQA::SetMuchTrackMatchBranchName
void SetMuchTrackMatchBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:50
CbmEventBuilderQA::SetTofBranchName
void SetTofBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:45
CbmEventBuilderQA::Finish
virtual void Finish()
Definition: CbmEventBuilderQA.cxx:809
CbmMCEventList
Container class for MC events with number, file and start time.
Definition: CbmMCEventList.h:38
CbmEventBuilderQA::~CbmEventBuilderQA
~CbmEventBuilderQA()
Definition: CbmEventBuilderQA.cxx:215
CbmEventBuilderQA::hRichRingHisto2D
TH2F * hRichRingHisto2D[10][NRichRingHisto2D]
Definition: CbmEventBuilderQA.h:134
CbmEventBuilderQA::fRichBranchName
TString fRichBranchName
Definition: CbmEventBuilderQA.h:88
CbmEventBuilderQA::fNTimeHistos
static const int fNTimeHistos
Definition: CbmEventBuilderQA.h:99
CbmEventBuilderQA::fMuchTrackBranchName
TString fMuchTrackBranchName
Definition: CbmEventBuilderQA.h:91
CbmEventBuilderQA::hStsHisto
TH1F * hStsHisto[8][NStsHisto]
Definition: CbmEventBuilderQA.h:125
CbmEventBuilderQA::Exec
virtual void Exec(Option_t *opt)
Definition: CbmEventBuilderQA.cxx:286
CbmEventBuilderQA::fStsTrackMatchBranchName
TString fStsTrackMatchBranchName
Definition: CbmEventBuilderQA.h:93
CbmEventBuilderQA::CbmEventBuilderQA
CbmEventBuilderQA(const CbmEventBuilderQA &)=delete
CbmEventBuilderQA::SortEvents::Event
CbmEvent * Event
Definition: CbmEventBuilderQA.h:68
CbmEventBuilderQA::CompareTrackTime
static bool CompareTrackTime(const SortEvents &a, const SortEvents &b)
Definition: CbmEventBuilderQA.h:74
CbmEventBuilderQA::fPointsInTracks
std::vector< std::vector< std::vector< int > > > fPointsInTracks
Definition: CbmEventBuilderQA.h:64
CbmEventBuilderQA::Init
virtual InitStatus Init()
Definition: CbmEventBuilderQA.cxx:234
CbmEventBuilderQA::SortEvents::SortEvents
SortEvents()
Definition: CbmEventBuilderQA.h:71
CbmEventBuilderQA::SetTrdBranchName
void SetTrdBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:53
CbmEventBuilderQA::WriteHistosCurFile
void WriteHistosCurFile(TObject *obj)
Definition: CbmEventBuilderQA.cxx:824
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmTrack::GetTime
Double_t GetTime() const
Definition: CbmTrack.h:64
CbmEventBuilderQA::SetStsTrackBranchName
void SetStsTrackBranchName(const TString &name)
Definition: CbmEventBuilderQA.h:39
CbmEventBuilderQA::fEvents
TClonesArray * fEvents
Output array (class CbmEvent)
Definition: CbmEventBuilderQA.h:109
CbmEventBuilderQA::operator=
const CbmEventBuilderQA & operator=(const CbmEventBuilderQA &)=delete
CbmEventBuilderQA::fMuchTrackMatchBranchName
TString fMuchTrackMatchBranchName
Definition: CbmEventBuilderQA.h:97
CbmEventBuilderQA::fOutFile
TFile * fOutFile
Definition: CbmEventBuilderQA.h:117
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmEventBuilderQA::fStsTrackBranchName
TString fStsTrackBranchName
Definition: CbmEventBuilderQA.h:86
CbmEventBuilderQA::fStsHitMatch
TClonesArray * fStsHitMatch
Definition: CbmEventBuilderQA.h:111