CbmRoot
CbmMuchDigitizerQa.h
Go to the documentation of this file.
1 
9 #ifndef CbmMuchDigitizerQa_H
10 #define CbmMuchDigitizerQa_H
11 
12 #include "CbmDigiManager.h"
13 #include "CbmGeoMuchPar.h"
14 #include "CbmMCTrack.h"
15 #include "CbmMatch.h"
16 #include "CbmMuchAddress.h"
17 #include "CbmMuchDigi.h"
18 #include "CbmMuchGeoScheme.h"
19 #include "CbmMuchModuleGem.h"
20 #include "CbmMuchPad.h"
21 #include "CbmMuchPoint.h"
22 #include "CbmMuchPointInfo.h"
23 #include "CbmMuchRecoDefs.h"
24 #include "CbmMuchSector.h"
25 #include "CbmMuchStation.h"
26 #include "CbmQaCanvas.h"
27 #include "FairLogger.h"
28 #include "FairRootFileSink.h"
29 #include "FairRootManager.h"
30 #include "FairRun.h"
31 #include "FairRuntimeDb.h"
32 #include "FairTask.h"
33 #include "Riostream.h"
34 #include "TArrayI.h"
35 #include "TCanvas.h"
36 #include "TClonesArray.h"
37 #include "TDatabasePDG.h"
38 #include "TF1.h"
39 #include "TFile.h"
40 #include "TGraph.h"
41 #include "TH1.h"
42 #include "TH2.h"
43 #include "TObjArray.h"
44 #include "TParticlePDG.h"
45 #include "TString.h"
46 #include "TStyle.h"
47 #include <algorithm>
48 #include <cassert>
49 #include <map>
50 #include <vector>
51 
52 class CbmMuchGeoScheme;
53 
58 class CbmMuchDigitizerQa : public FairTask {
59 
60 public:
61  CbmMuchDigitizerQa(const char* name = "MuchHitFinderQa", Int_t verbose = 1);
62  virtual ~CbmMuchDigitizerQa();
63  virtual InitStatus Init();
64  virtual void Exec(Option_t* option);
65  virtual void FinishTask();
66  virtual void SetParContainers();
67  static void DivideCanvas2D(TCanvas* c, int nPads);
68 
69 protected:
70  /* DigitizerQa - analysis of digitizer performance - charge distributions
71  * for tracks. Track length distrivutions. Statistics on particle types
72  */
73  void DigitizerQa();
74 
75  /* Occupance analysis - all pads,fired pads,
76  * and fired/all distributions as functions of radius
77  */
78  void OccupancyQa();
79 
80 private:
81  Int_t GetNChannels(Int_t iStation);
82  Int_t GetNSectors(Int_t iStation);
83  TVector2 GetMinPadSize(Int_t iStation);
84  TVector2 GetMaxPadSize(Int_t iStation);
85  static Double_t LandauMPV(Double_t* x, Double_t* par);
86  static Double_t MPV_n_e(Double_t Tkin, Double_t mass);
87 
90 
91  TFolder* histFolder;
92  void InitCounters();
93  void InitCanvases();
94  void InitChargeHistos();
95  void InitLengthHistos();
96  void InitPadHistos();
97  void InitChannelPadInfo();
98  void InitFits();
99  void DeInit();
100 
101  void FillTotalPadsHistos();
102  void DrawCanvases();
103  void PrintCounters();
104  void OutputNvsS();
105 
106  void UpdateParticleCounters(Int_t stId, Int_t pdgCode, Int_t motherId);
107  void FillChargePerPoint();
109 
110  void PrintFrontLayerPoints();
111  void PrintFrontLayerDigis();
112 
113  // geometry
115  Int_t fNstations = 0;
117 
118  // containers
119  TClonesArray* fPoints = nullptr;
120  TClonesArray* fDigis = nullptr;
121  TClonesArray* fDigiMatches = nullptr;
122  TClonesArray* fMCTracks = nullptr;
123  TClonesArray* fPointInfos = nullptr;
124 
125  TFolder fOutFolder;
126  Int_t fNevents = 0;
127 
128  // internal unscaled histograms, need to be scaled at the output
129  std::vector<TH1F*> fvUsPadsFiredR; // fired pads vs R, per station
130  std::vector<TH2F*> fvUsPadsFiredXY; // fired pads vs XY, per station
131 
132  // output histograms
133  TH1F* fhMcPointCharge = nullptr;
134  TH1F* fhMcPointChargeLog = nullptr;
136  nullptr;
137 
138  TH1F* fhTrackLength = nullptr;
139  TH1F* fhTrackLengthPi = nullptr;
140  TH1F* fhTrackLengthPr = nullptr;
141  TH1F* fhTrackLengthEl = nullptr;
142 
151  TH2F* fhNpadsVsS = nullptr;
152 
153  std::vector<TH1F*> fvMcPointCharge; // MC point charge per station
154  std::vector<TH1F*> fvPadsTotalR; // number of pads vs R, per station
155  std::vector<TH1F*> fvPadsFiredR; // fired pads vs R, per station
156  std::vector<TH1F*> fvPadOccupancyR; // pad occupancy vs R, per station
157 
158  // output canvaces with histogramm collections
168 
169  TF1* fFitEl = nullptr;
170  TF1* fFitPi = nullptr;
171  TF1* fFitPr = nullptr;
172 
173  Int_t fSignalPoints = 0; // Number of signal MC points
174  Int_t fnPadSizesX = 0;
175  Int_t fnPadSizesY = 0;
176 
177  Int_t* fNall = nullptr; // number of all tracks at the first station
178  Int_t* fNpr = nullptr; // number of protons at the first station
179  Int_t* fNpi = nullptr; // number of pions at the first station
180  Int_t* fNel = nullptr; // number of electrons at the first station
181  Int_t* fNmu = nullptr; // number of muons at the first station
182  Int_t* fNka = nullptr; // number of kaons at the first station
183  Int_t* fNprimary = nullptr; // number of primary tracks at the first station
184  Int_t* fNsecondary =
185  nullptr; // number of secondary tracks at the first station
186 
187  Int_t fPointsTotal = 0;
190 
191  Double_t fPadMinLx = 0.;
192  Double_t fPadMinLy = 0.;
193  Double_t fPadMaxLx = 0.;
194  Double_t fPadMaxLy = 0.;
195 
196  ClassDef(CbmMuchDigitizerQa, 0)
197 };
198 
199 #endif
CbmMuchDigitizerQa::OccupancyQa
void OccupancyQa()
Definition: CbmMuchDigitizerQa.cxx:887
CbmMuchDigitizerQa::fCanvNpadsVsArea
CbmQaCanvas * fCanvNpadsVsArea
Definition: CbmMuchDigitizerQa.h:164
CbmMuchDigitizerQa::fvMcPointCharge
std::vector< TH1F * > fvMcPointCharge
Definition: CbmMuchDigitizerQa.h:153
CbmMuchDigitizerQa::fvPadOccupancyR
std::vector< TH1F * > fvPadOccupancyR
Definition: CbmMuchDigitizerQa.h:156
CbmMuchDigitizerQa::InitPadHistos
void InitPadHistos()
Definition: CbmMuchDigitizerQa.cxx:323
CbmMuchDigitizerQa::fCanvPadOccupancyR
CbmQaCanvas * fCanvPadOccupancyR
Definition: CbmMuchDigitizerQa.h:166
CbmMuchDigi.h
CbmMuchDigitizerQa::fDigiManager
CbmDigiManager * fDigiManager
Definition: CbmMuchDigitizerQa.h:116
CbmMuchGeoScheme
Definition: CbmMuchGeoScheme.h:43
CbmMuchDigitizerQa::fhTrackLengthEl
TH1F * fhTrackLengthEl
Definition: CbmMuchDigitizerQa.h:141
CbmMuchDigitizerQa::fNall
Int_t * fNall
Definition: CbmMuchDigitizerQa.h:177
CbmMuchDigitizerQa::fOutFolder
TFolder fOutFolder
temporary additional information
Definition: CbmMuchDigitizerQa.h:125
CbmMuchDigitizerQa
Definition: CbmMuchDigitizerQa.h:58
CbmMuchDigitizerQa::MPV_n_e
static Double_t MPV_n_e(Double_t Tkin, Double_t mass)
Definition: CbmMuchDigitizerQa.cxx:980
CbmMuchDigitizerQa::SetParContainers
virtual void SetParContainers()
Definition: CbmMuchDigitizerQa.cxx:451
CbmMuchDigitizerQa::DrawCanvases
void DrawCanvases()
Definition: CbmMuchDigitizerQa.cxx:529
CbmMuchDigitizerQa::OutputNvsS
void OutputNvsS()
Definition: CbmMuchDigitizerQa.cxx:637
CbmMuchDigitizerQa::PrintFrontLayerDigis
void PrintFrontLayerDigis()
Definition: CbmMuchDigitizerQa.cxx:509
CbmMuchDigitizerQa::FillDigitizerPerformancePlots
void FillDigitizerPerformancePlots()
Definition: CbmMuchDigitizerQa.cxx:838
CbmMuchDigitizerQa::fhTrackLengthPr
TH1F * fhTrackLengthPr
Definition: CbmMuchDigitizerQa.h:140
CbmMuchDigitizerQa::GetNSectors
Int_t GetNSectors(Int_t iStation)
Definition: CbmMuchDigitizerQa.cxx:926
CbmMuchDigitizerQa::GetMaxPadSize
TVector2 GetMaxPadSize(Int_t iStation)
Definition: CbmMuchDigitizerQa.cxx:960
CbmMuchDigitizerQa::fhMcPointChargeVsTrackLength
TH2F * fhMcPointChargeVsTrackLength
Definition: CbmMuchDigitizerQa.h:147
CbmMuchDigitizerQa::FillChargePerPoint
void FillChargePerPoint()
Definition: CbmMuchDigitizerQa.cxx:804
CbmMuchDigitizerQa::fPadMinLx
Double_t fPadMinLx
Definition: CbmMuchDigitizerQa.h:191
CbmMuchDigitizerQa::InitChannelPadInfo
void InitChannelPadInfo()
Definition: CbmMuchDigitizerQa.cxx:115
CbmMuchDigitizerQa::fPadMaxLx
Double_t fPadMaxLx
Definition: CbmMuchDigitizerQa.h:193
CbmMuchDigitizerQa::fMCTracks
TClonesArray * fMCTracks
Definition: CbmMuchDigitizerQa.h:122
CbmMuchDigitizerQa::UpdateParticleCounters
void UpdateParticleCounters(Int_t stId, Int_t pdgCode, Int_t motherId)
Definition: CbmMuchDigitizerQa.cxx:782
CbmMatch.h
CbmMuchDigitizerQa::fPointsUnderCounted
Int_t fPointsUnderCounted
Definition: CbmMuchDigitizerQa.h:188
CbmMuchDigitizerQa::fNevents
Int_t fNevents
output folder with histos and canvases
Definition: CbmMuchDigitizerQa.h:126
CbmMuchDigitizerQa::fhMcPointChargeVsTrackLengthEl
TH2F * fhMcPointChargeVsTrackLengthEl
Definition: CbmMuchDigitizerQa.h:150
CbmMuchDigitizerQa::operator=
CbmMuchDigitizerQa & operator=(const CbmMuchDigitizerQa &)
CbmQaCanvas.h
Definition of the CbmQaCanvas class.
CbmMuchDigitizerQa::fCanvChargeVsLength
CbmQaCanvas * fCanvChargeVsLength
Definition: CbmMuchDigitizerQa.h:162
CbmMuchRecoDefs.h
CbmMuchDigitizerQa::PrintFrontLayerPoints
void PrintFrontLayerPoints()
Definition: CbmMuchDigitizerQa.cxx:491
CbmMuchDigitizerQa::fCanvPadsTotalR
CbmQaCanvas * fCanvPadsTotalR
Definition: CbmMuchDigitizerQa.h:167
CbmMuchDigitizerQa::fGeoScheme
CbmMuchGeoScheme * fGeoScheme
Definition: CbmMuchDigitizerQa.h:114
CbmMuchDigitizerQa::GetMinPadSize
TVector2 GetMinPadSize(Int_t iStation)
Definition: CbmMuchDigitizerQa.cxx:940
CbmMuchDigitizerQa::FillTotalPadsHistos
void FillTotalPadsHistos()
Definition: CbmMuchDigitizerQa.cxx:398
CbmMuchDigitizerQa::fhMcPointCharge
TH1F * fhMcPointCharge
Definition: CbmMuchDigitizerQa.h:133
CbmMuchPoint.h
CbmGeoMuchPar.h
CbmMuchDigitizerQa::fNka
Int_t * fNka
Definition: CbmMuchDigitizerQa.h:182
CbmMuchDigitizerQa::InitCounters
void InitCounters()
Definition: CbmMuchDigitizerQa.cxx:89
CbmMuchDigitizerQa::fvUsPadsFiredXY
std::vector< TH2F * > fvUsPadsFiredXY
Definition: CbmMuchDigitizerQa.h:130
CbmMuchDigitizerQa::fNpr
Int_t * fNpr
Definition: CbmMuchDigitizerQa.h:178
CbmMuchDigitizerQa::fFitEl
TF1 * fFitEl
Definition: CbmMuchDigitizerQa.h:169
CbmMuchDigitizerQa::Exec
virtual void Exec(Option_t *option)
Definition: CbmMuchDigitizerQa.cxx:473
CbmMuchDigitizerQa::fhMcPointChargeVsTrackLengthPi
TH2F * fhMcPointChargeVsTrackLengthPi
Definition: CbmMuchDigitizerQa.h:148
CbmMuchDigitizerQa::fPoints
TClonesArray * fPoints
Definition: CbmMuchDigitizerQa.h:119
CbmMuchDigitizerQa::fhMcPointChargeVsTrackEnergyLog
TH2F * fhMcPointChargeVsTrackEnergyLog
Definition: CbmMuchDigitizerQa.h:143
CbmMuchDigitizerQa::InitCanvases
void InitCanvases()
Definition: CbmMuchDigitizerQa.cxx:162
CbmMuchDigitizerQa::fNpi
Int_t * fNpi
Definition: CbmMuchDigitizerQa.h:179
CbmMuchSector.h
CbmMuchDigitizerQa::fCanvUsPadsFiredXY
CbmQaCanvas * fCanvUsPadsFiredXY
Definition: CbmMuchDigitizerQa.h:165
CbmMuchDigitizerQa::fPointsTotal
Int_t fPointsTotal
Definition: CbmMuchDigitizerQa.h:187
CbmMuchDigitizerQa::DivideCanvas2D
static void DivideCanvas2D(TCanvas *c, int nPads)
Definition: CbmMuchDigitizerQa.cxx:1001
CbmMuchDigitizerQa::fhTrackLengthPi
TH1F * fhTrackLengthPi
Definition: CbmMuchDigitizerQa.h:139
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmMuchDigitizerQa::fhMcPointChargeVsTrackEnergyLogEl
TH2F * fhMcPointChargeVsTrackEnergyLogEl
Definition: CbmMuchDigitizerQa.h:146
CbmMuchDigitizerQa::fhMcPointChargeLog
TH1F * fhMcPointChargeLog
MC point charge.
Definition: CbmMuchDigitizerQa.h:134
CbmMuchDigitizerQa::histFolder
TFolder * histFolder
Definition: CbmMuchDigitizerQa.h:91
CbmMuchDigitizerQa::DeInit
void DeInit()
Definition: CbmMuchDigitizerQa.cxx:40
CbmMuchDigitizerQa::InitFits
void InitFits()
Definition: CbmMuchDigitizerQa.cxx:430
CbmMuchDigitizerQa::LandauMPV
static Double_t LandauMPV(Double_t *x, Double_t *par)
Definition: CbmMuchDigitizerQa.cxx:716
CbmMuchDigitizerQa::fFitPi
TF1 * fFitPi
Definition: CbmMuchDigitizerQa.h:170
CbmMuchDigitizerQa::fvPadsFiredR
std::vector< TH1F * > fvPadsFiredR
Definition: CbmMuchDigitizerQa.h:155
CbmMuchDigitizerQa::fvPadsTotalR
std::vector< TH1F * > fvPadsTotalR
Definition: CbmMuchDigitizerQa.h:154
CbmMuchDigitizerQa::fhMcPointChargeVsTrackEnergyLogPi
TH2F * fhMcPointChargeVsTrackEnergyLogPi
Definition: CbmMuchDigitizerQa.h:144
CbmQaCanvas
Definition: CbmQaCanvas.h:27
CbmMuchDigitizerQa::fNstations
Int_t fNstations
Definition: CbmMuchDigitizerQa.h:115
CbmMuchDigitizerQa::fNmu
Int_t * fNmu
Definition: CbmMuchDigitizerQa.h:181
CbmMuchPad.h
CbmMuchDigitizerQa::fFitPr
TF1 * fFitPr
Definition: CbmMuchDigitizerQa.h:171
CbmMuchDigitizerQa::InitChargeHistos
void InitChargeHistos()
Definition: CbmMuchDigitizerQa.cxx:214
CbmMuchDigitizerQa::Init
virtual InitStatus Init()
Definition: CbmMuchDigitizerQa.cxx:61
CbmMuchDigitizerQa::fvUsPadsFiredR
std::vector< TH1F * > fvUsPadsFiredR
number of processed events
Definition: CbmMuchDigitizerQa.h:129
CbmMuchDigitizerQa::fPointsOverCounted
Int_t fPointsOverCounted
Definition: CbmMuchDigitizerQa.h:189
CbmMuchDigitizerQa::~CbmMuchDigitizerQa
virtual ~CbmMuchDigitizerQa()
Definition: CbmMuchDigitizerQa.cxx:37
CbmMuchDigitizerQa::fPadMinLy
Double_t fPadMinLy
Definition: CbmMuchDigitizerQa.h:192
CbmMCTrack.h
CbmMuchAddress.h
CbmDigiManager.h
CbmMuchDigitizerQa::fCanvTrackLength
CbmQaCanvas * fCanvTrackLength
Definition: CbmMuchDigitizerQa.h:163
CbmMuchDigitizerQa::fnPadSizesX
Int_t fnPadSizesX
Definition: CbmMuchDigitizerQa.h:174
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmMuchDigitizerQa::PrintCounters
void PrintCounters()
Definition: CbmMuchDigitizerQa.cxx:671
CbmMuchDigitizerQa::fSignalPoints
Int_t fSignalPoints
Definition: CbmMuchDigitizerQa.h:173
CbmMuchDigitizerQa::fDigiMatches
TClonesArray * fDigiMatches
Definition: CbmMuchDigitizerQa.h:121
CbmMuchDigitizerQa::fNprimary
Int_t * fNprimary
Definition: CbmMuchDigitizerQa.h:183
CbmMuchDigitizerQa::DigitizerQa
void DigitizerQa()
Definition: CbmMuchDigitizerQa.cxx:727
CbmMuchDigitizerQa::fNel
Int_t * fNel
Definition: CbmMuchDigitizerQa.h:180
CbmMuchDigitizerQa::FinishTask
virtual void FinishTask()
Definition: CbmMuchDigitizerQa.cxx:610
CbmMuchDigitizerQa::fhNpadsVsS
TH2F * fhNpadsVsS
Definition: CbmMuchDigitizerQa.h:151
CbmMuchGeoScheme.h
CbmMuchPointInfo.h
CbmMuchDigitizerQa::fPointInfos
TClonesArray * fPointInfos
Definition: CbmMuchDigitizerQa.h:123
CbmMuchDigitizerQa::fhTrackLength
TH1F * fhTrackLength
MC point charge for selected protons.
Definition: CbmMuchDigitizerQa.h:138
CbmMuchDigitizerQa::fCanvStationCharge
CbmQaCanvas * fCanvStationCharge
Definition: CbmMuchDigitizerQa.h:160
CbmMuchDigitizerQa::fNsecondary
Int_t * fNsecondary
Definition: CbmMuchDigitizerQa.h:184
CbmMuchStation.h
CbmMuchDigitizerQa::GetNChannels
Int_t GetNChannels(Int_t iStation)
Definition: CbmMuchDigitizerQa.cxx:912
CbmMuchDigitizerQa::CbmMuchDigitizerQa
CbmMuchDigitizerQa(const char *name="MuchHitFinderQa", Int_t verbose=1)
Definition: CbmMuchDigitizerQa.cxx:22
CbmMuchDigitizerQa::InitLengthHistos
void InitLengthHistos()
Definition: CbmMuchDigitizerQa.cxx:297
CbmMuchDigitizerQa::fhMcPointChargeVsTrackEnergyLogPr
TH2F * fhMcPointChargeVsTrackEnergyLogPr
Definition: CbmMuchDigitizerQa.h:145
CbmMuchDigitizerQa::fhMcPointChargeVsTrackLengthPr
TH2F * fhMcPointChargeVsTrackLengthPr
Definition: CbmMuchDigitizerQa.h:149
CbmMuchDigitizerQa::fPadMaxLy
Double_t fPadMaxLy
Definition: CbmMuchDigitizerQa.h:194
CbmMuchDigitizerQa::fDigis
TClonesArray * fDigis
Definition: CbmMuchDigitizerQa.h:120
CbmMuchModuleGem.h
CbmMuchDigitizerQa::CbmMuchDigitizerQa
CbmMuchDigitizerQa(const CbmMuchDigitizerQa &)
CbmMuchDigitizerQa::fCanvCharge
CbmQaCanvas * fCanvCharge
Definition: CbmMuchDigitizerQa.h:159
CbmMuchDigitizerQa::fCanvChargeVsEnergy
CbmQaCanvas * fCanvChargeVsEnergy
Definition: CbmMuchDigitizerQa.h:161
CbmMuchDigitizerQa::fhMcPointChargePr_1GeV_3mm
TH1F * fhMcPointChargePr_1GeV_3mm
MC point charge log scale.
Definition: CbmMuchDigitizerQa.h:135
CbmMuchDigitizerQa::fnPadSizesY
Int_t fnPadSizesY
Definition: CbmMuchDigitizerQa.h:175