CbmRoot
Loading...
Searching...
No Matches
CbmEventBuilderQa.h
Go to the documentation of this file.
1/* Copyright (C) 2017 IKF-UFra, GSI
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Valentina Akishina , Maksym Zyzak, Valentina Akishina [committer] */
4
10#ifndef CbmEventBuilderQa_H
11#define CbmEventBuilderQa_H
12
13#include "CbmEvent.h"
14#include "CbmStsTrack.h"
15#include "FairTask.h"
16#include "TString.h"
17
18#include <map>
19#include <vector>
20
21class TClonesArray;
22class CbmMCEventList;
23#include "CbmMCDataArray.h"
24
25class TClonesArray;
26class TFile;
27class TDirectory;
28class TH1F;
29class TH2F;
30class TObject;
31
32class CbmEventBuilderQa : public FairTask {
33 public:
34 // Constructors/Destructors ---------
35 CbmEventBuilderQa(const char* name = "CbmEventBuilderQa", Int_t iVerbose = 0,
36 TString outFileName = "CbmEventBuilderQa.root");
40
41 void SetStsTrackBranchName(const TString& name) { fStsTrackBranchName = name; }
42 void SetGlobalTrackBranchName(const TString& name) { fGlobalTrackBranchName = name; }
43 void SetTofBranchName(const TString& name) { fTofBranchName = name; }
44 void SetMCTrackBranchName(const TString& name) { fMCTracksBranchName = name; }
45 void SetTrackMatchBranchName(const TString& name) { fStsTrackMatchBranchName = name; }
46 void SetMuchTrackMatchBranchName(const TString& name) { fMuchTrackMatchBranchName = name; }
47 void SetTrdBranchName(const TString& name) { fTrdBranchName = name; }
48 void SetRichBranchName(const TString& name) { fRichBranchName = name; }
49 void SetMuchTrackBranchName(const TString& name) { fMuchTrackBranchName = name; }
50
51 virtual InitStatus Init();
52 virtual void Exec(Option_t* opt);
53 virtual void Finish();
54
55 private:
56 std::vector<std::vector<std::vector<int>>> fPointsInTracks;
57
58
59 struct SortEvents {
62
63 SortEvents() : Event(nullptr), track() {}
64 };
65
66 static bool CompareTrackTime(const SortEvents& a, const SortEvents& b)
67 {
68 return (a.track.GetStartTime() < b.track.GetStartTime());
69 }
70
71 bool CalculateIsReconstructable(const int iMCFile, const int iMCEvent,
72 const int iMCTrack); // bool CbmL1MCTrack::IsReconstructable()
73
74 void WriteHistosCurFile(TObject* obj);
75
76 //names of input branches
89
90 static const int fNTimeHistos = 27;
92
93
94 TClonesArray* fStsDigis;
95 TClonesArray* fStsTracks;
97 TClonesArray* fStsHits;
100 TClonesArray* fEvents;
101 TClonesArray* fStsTrackMatchArray;
102 TClonesArray* fStsHitMatch;
103
105
106 //output file with histograms
108 TFile* fOutFile;
109 TDirectory* fHistoDir;
110
111 //histograms
112 //STS
113 static const int NStsHisto = 3;
114 TH1F* hStsHisto[8][NStsHisto]; //All tracks, electrons, muons, pion, kaon, protons, fragments, ghost
115 TH1F* hStsFitHisto[8][10];
116 //Much
117 static const int NMuchHisto = 5;
118 TH1F* hMuchHisto[3][NMuchHisto]; //Muons, Background, Ghost
119 //RICH
120 static const int NRichRingHisto2D = 3; // r, axis a, axis b
122 [10]
123 [NRichRingHisto2D]; //All tracks, electrons, muons, pions, kaons, protons, fragments, mismatch, ghost track, ghost ring
124
126};
127
128#endif
Data class for STS tracks.
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
void SetTofBranchName(const TString &name)
static const int NStsHisto
void SetRichBranchName(const TString &name)
ClassDef(CbmEventBuilderQa, 1)
const CbmEventBuilderQa & operator=(const CbmEventBuilderQa &)=delete
void SetTrdBranchName(const TString &name)
CbmMCDataArray * fMvdPoints
Input array (class CbmStsDigi)
bool CalculateIsReconstructable(const int iMCFile, const int iMCEvent, const int iMCTrack)
CbmMCDataArray * fMCTracks
Input array (class CbmStsDigi)
void SetMuchTrackBranchName(const TString &name)
static const int fNTimeHistos
void SetMCTrackBranchName(const TString &name)
void SetMuchTrackMatchBranchName(const TString &name)
static const int NRichRingHisto2D
TClonesArray * fStsTrackMatchArray
TH1F * hStsFitHisto[8][10]
TClonesArray * fStsHitMatch
TClonesArray * fStsDigis
Input array (class CbmStsDigi)
TH1F * hMuchHisto[3][NMuchHisto]
static const int NMuchHisto
void WriteHistosCurFile(TObject *obj)
CbmEventBuilderQa(const char *name="CbmEventBuilderQa", Int_t iVerbose=0, TString outFileName="CbmEventBuilderQa.root")
CbmMCEventList * fEventList
void SetGlobalTrackBranchName(const TString &name)
TH2F * hRichRingHisto2D[10][NRichRingHisto2D]
TClonesArray * fEvents
Output array (class CbmEvent)
TClonesArray * fStsTracks
Input array (class CbmStsDigi)
std::vector< std::vector< std::vector< int > > > fPointsInTracks
static bool CompareTrackTime(const SortEvents &a, const SortEvents &b)
CbmMCDataArray * fStsPoints
Input array (class CbmStsDigi)
void SetStsTrackBranchName(const TString &name)
TString fMuchTrackMatchBranchName
CbmEventBuilderQa(const CbmEventBuilderQa &)=delete
TH1F * fTimeHisto[fNTimeHistos]
TClonesArray * fStsHits
Input array (class CbmStsDigi)
TH1F * hStsHisto[8][NStsHisto]
void SetTrackMatchBranchName(const TString &name)
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
Access to a MC data branch for time-based analysis.
Container class for MC events with number, file and start time.
double GetStartTime() const
Definition CbmTrack.h:71