Belle II Software  release-08-01-10
SVDPerformanceModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 #include <framework/core/Module.h>
11 
12 #include <framework/datastore/StoreArray.h>
13 
14 #include <svd/dataobjects/SVDCluster.h>
15 #include <svd/dataobjects/SVDShaperDigit.h>
16 #include <svd/dataobjects/SVDRecoDigit.h>
17 #include <mdst/dataobjects/TrackFitResult.h>
18 #include <mdst/dataobjects/Track.h>
19 #include <tracking/dataobjects/RecoTrack.h>
20 #include <svd/calibration/SVDPulseShapeCalibrations.h>
21 #include <svd/calibration/SVDNoiseCalibrations.h>
22 #include <svd/dataobjects/SVDEventInfo.h>
23 
24 #include <string>
25 #include <TTree.h>
26 #include <TFile.h>
27 #include <TH1F.h>
28 #include <TH2F.h>
29 #include <TList.h>
30 
31 namespace Belle2 {
44  class SVDPerformanceModule : public Module {
45 
46  public:
47 
50 
52  virtual ~SVDPerformanceModule() {};
53 
54  virtual void initialize() override;
55  virtual void beginRun() override;
56  virtual void event() override;
57  virtual void endRun() override;
59  std::string m_ShaperDigitName = "SVDShaperDigits";
60  std::string m_RecoDigitName = "SVDRecoDigits";
61  std::string m_ClusterName = "SVDClusters";
62  std::string m_TrackFitResultName = "TrackFitResults";
63  std::string m_TrackName = "Tracks";
64  bool m_is2017TBanalysis = false;
65  bool m_isSimulation = false;
67  float m_debugLowTime = - 100;
70  /* user-defined parameters */
71  std::string m_rootFileName = "";
73  /* ROOT file related parameters */
74  TFile* m_rootFilePtr = nullptr;
76  private:
77 
78  int m_nEvents = 0;
92 
94  std::string m_svdEventInfoName;
95 
96  int m_ntracks = 0;
98  static const int m_nLayers = 4;
99  static const int m_nSensors = 5;
100  static const int m_nSides = 2;
102  unsigned int sensorsOnLayer[4] = {0};
104  TList* m_histoList_track = nullptr;
105  TList* m_histoList_corr = nullptr;
106  TList* m_histoList_clTRK[m_nLayers] = {nullptr};
107  TList* m_histoList_cluster[m_nLayers] = {nullptr};
108  TList* m_histoList_shaper[m_nLayers] = {nullptr};
109  TList* m_histoList_reco[m_nLayers] = {nullptr};
111  //TRACKS
112  TH1F* m_nTracks = nullptr;
113  TH1F* m_Pvalue = nullptr;
114  TH1F* m_mom = nullptr;
115  TH1F* m_nSVDhits = nullptr;
117  //SHAPER
118  TH1F* h_nShaper[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
120  //RECO
121  TH1F* h_nReco[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
122  TH1F* h_recoCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
123  TH1F* h_recoEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
124  TH1F* h_stripNoise[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
125  TH1F* h_recoTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
127  //CLUSTERS NOT RELATED TO TRACKS
128  TH1F* h_nCl[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
129  TH1F* h_clSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
130  TH1F* h_clCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
131  TH1F* h_clEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
132  TH1F* h_clSeedMaxbin[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
133  TH2F* h_clEnergyVSMaxbin[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
134  TH2F* h_clEnergyVSCoorU[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
135  TH2F* h_clEnergyVSCoorV[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
136  TH2F* h_clNuVSNv[m_nLayers][m_nSensors] = {{nullptr}};
137  TH2F* h_clCoorUVSCoorV[m_nLayers][m_nSensors] = {{nullptr}};
138  TH1F* h_clCoor1VSCoor2[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
141  TH2F* h_clEnergyUVSEnergyV[m_nLayers][m_nSensors] = {{nullptr}};
142  TH1F* h_clSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
143  TH1F* h_clTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
144  TH2F* h_clChargeVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
148  TH2F* h_clSNVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
149  TH2F* h_clTimeVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
150  TH2F* h_clTimeVSTrueTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
152  //CLUSTERS RELATED TO TRACKS
153  TH1F* h_nCltrk[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
154  TH1F* h_cltrkSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
155  TH1F* h_cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
156  TH1F* h_cltrkEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
157  TH1F* h_cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
158  TH1F* h_cltrkTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
159  TH1F* h_cltrkTime_TB1[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
160  TH1F* h_cltrkTime_TB2[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
161  TH1F* h_cltrkTime_TB3[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
162  TH1F* h_cltrkTime_TB4[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
164  TH2F* h_cltrkSNVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
165  TH2F* h_cltrkTimeVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
168  //1-STRIP CLUSTERS
169  TH1F* h_1cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
170  TH1F* h_1cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
172  //2-STRIP CLUSTERS
173  TH1F* h_2cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
174  TH1F* h_2cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
176  //CORRELATIONS
177  TH1F* h_cltrk_UU = nullptr;
178  TH1F* h_cltrk_VV = nullptr;
179  TH1F* h_cltrk_UV = nullptr;
181  TH2F* h_cltrkTime_L4uL5u = nullptr;
182  TH2F* h_cltrkTime_L4vL5v = nullptr;
183  TH2F* h_cltrkTime_L5uL5v = nullptr;
186  int getSensor(int layer, int sensor, bool isTB)
187  {
188  int result = 0;
189  if (isTB) {
190  if (layer == 0)
191  result = sensor - 1;
192  else if (layer == 1 || layer == 2)
193  result = sensor - 2;
194  else if (layer == 3)
195  result = sensor - 3;
196  } else result = sensor - 1;
197 
198  return result;
199  }
200 
202  TH1F* createHistogram1D(const char* name, const char* title,
203  Int_t nbins, Double_t min, Double_t max,
204  const char* xtitle, TList* histoList = nullptr);
206  TH2F* createHistogram2D(const char* name, const char* title,
207  Int_t nbinsX, Double_t minX, Double_t maxX, const char* titleX,
208  Int_t nbinsY, Double_t minY, Double_t maxY, const char* titleY,
209  TList* histoList = nullptr);
210 
211  };
213 }
214 
215 
Base class for Modules.
Definition: Module.h:72
This class defines the dbobject and the method to access SVD calibrations from the noise local runs.
The (TB) SVD Performance Module.
std::string m_rootFileName
root file name
TH2F * h_cltrkTimeVSTrueTime[m_nLayers][m_nSensors][m_nSides]
time VS true time
float m_debugLowTime
cluster Time below this number will produce a printout
TH1F * h_cltrk_UU
U time vs U time.
TH1F * h_recoTime[m_nLayers][m_nSensors][m_nSides]
time
TH2F * h_cltrkChargeVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
TH1F * createHistogram1D(const char *name, const char *title, Int_t nbins, Double_t min, Double_t max, const char *xtitle, TList *histoList=nullptr)
Function returning a TH1F.
TH2F * h_cltrkSNVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
TH1F * h_clTime[m_nLayers][m_nSensors][m_nSides]
time
TList * m_histoList_reco[m_nLayers]
histo list reco digits
TList * m_histoList_corr
histo list correlations
TH2F * h_clEnergyVSSize_mb6[m_nLayers][m_nSensors][m_nSides]
energy VS size, max bin == 6
TH1F * h_clCoor1VSCoor2[m_nLayers][m_nSensors][m_nSides]
coor1 VS coor2
TH2F * h_clEnergyUVSEnergyV[m_nLayers][m_nSensors]
energy VS position
TH1F * h_cltrkEnergy[m_nLayers][m_nSensors][m_nSides]
energy
TH2F * h_clNuVSNv[m_nLayers][m_nSensors]
N U culsters VS N V clusters.
std::string m_ShaperDigitName
ShaperDigits Store Array name.
virtual void initialize() override
check StoreArrays & create rootfile
TH2F * h_clEnergyVSCoorV[m_nLayers][m_nSensors][m_nSides]
energy VS position V
StoreArray< SVDCluster > m_svdClusters
SVDCluster store array.
virtual void event() override
fill histograms
TH1F * h_clCharge[m_nLayers][m_nSensors][m_nSides]
charge
StoreArray< TrackFitResult > m_tfr
TrackFitResult store array.
unsigned int sensorsOnLayer[4]
sensors on layer i
TH2F * h_clEnergyVSMaxbin[m_nLayers][m_nSensors][m_nSides]
energy VS maxbin seed
TH1F * h_nCltrk[m_nLayers][m_nSensors][m_nSides]
number per event
TH1F * h_cltrk_VV
V time vs V time.
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibration db object.
virtual void endRun() override
write histogrmas
TH1F * h_cltrkCharge[m_nLayers][m_nSensors][m_nSides]
charge
TH1F * h_recoCharge[m_nLayers][m_nSensors][m_nSides]
charge
static const int m_nLayers
max number of layers
TH2F * h_cltrkTime_L4uL5u
L4U time VS L5U time.
TH1F * h_cltrkTime_TB3[m_nLayers][m_nSensors][m_nSides]
time
TH2F * h_cltrkTimeVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
TH2F * h_clEnergyVSSize_mb12[m_nLayers][m_nSensors][m_nSides]
energy VS size, maxbin == 1,2
TH1F * h_2cltrkCharge[m_nLayers][m_nSensors][m_nSides]
charge
TH1F * h_nShaper[m_nLayers][m_nSensors][m_nSides]
number per event
static const int m_nSides
max number of sides
TH2F * h_cltrkTime_L5uL5v
L5U time VS L5V time.
TH1F * h_cltrkTime_TB4[m_nLayers][m_nSensors][m_nSides]
time
SVDPulseShapeCalibrations m_PulseShapeCal
SVDPulseShape calibration db object.
TH2F * h_clTimeVSTrueTime[m_nLayers][m_nSensors][m_nSides]
time VS true time
TH1F * h_1cltrkCharge[m_nLayers][m_nSensors][m_nSides]
charge
std::string m_TrackName
Track StoreArray name.
std::string m_RecoDigitName
SVDRecoDigits Store Array name.
TH2F * h_clEnergyVSSize_mb345[m_nLayers][m_nSensors][m_nSides]
energy VS size, maxbin == 3,4,5
virtual void beginRun() override
create histograms
TH1F * h_nCl[m_nLayers][m_nSensors][m_nSides]
number per event
TH2F * h_clEnergyVSCoorU[m_nLayers][m_nSensors][m_nSides]
energy VS position U
TH1F * h_1cltrkSN[m_nLayers][m_nSensors][m_nSides]
signal over noise
TH1F * h_clCellID1VSCellID2[m_nLayers][m_nSensors][m_nSides]
coor1 VS coor2
TH1F * h_2cltrkSN[m_nLayers][m_nSensors][m_nSides]
signal over noise
TH1F * h_cltrkTime_TB2[m_nLayers][m_nSensors][m_nSides]
time
std::string m_svdEventInfoName
Name of the SVDEventInfo object.
TList * m_histoList_track
histo list tracks
bool m_isSimulation
true if we analyze Simulated data
TH1F * h_cltrk_UV
U time vs V time.
std::string m_TrackFitResultName
TrackFitResult StoreArray name.
TList * m_histoList_clTRK[m_nLayers]
histo list clusters related to tracks
TH2F * h_clEnergy12VSdelta[m_nLayers][m_nSensors][m_nSides]
coor1 VS coor2
TH1F * m_nTracks
number of tracks
TH2F * h_clCoorUVSCoorV[m_nLayers][m_nSensors]
energy VS position
TH1F * h_clEnergy[m_nLayers][m_nSensors][m_nSides]
energy
TH1F * h_clSN[m_nLayers][m_nSensors][m_nSides]
signal over noise
static const int m_nSensors
max number of sensors
TList * m_histoList_shaper[m_nLayers]
histo list shaper digits
StoreArray< RecoTrack > m_recoTracks
RecoTracks store array.
TH2F * h_clChargeVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
std::string m_ClusterName
SVDCluster StoreArray name.
TH1F * h_cltrkSize[m_nLayers][m_nSensors][m_nSides]
size
TH1F * h_stripNoise[m_nLayers][m_nSensors][m_nSides]
strip noise
TH1F * h_clSeedMaxbin[m_nLayers][m_nSensors][m_nSides]
maxbin seed
TH1F * h_nReco[m_nLayers][m_nSensors][m_nSides]
number per event
StoreArray< SVDRecoDigit > m_svdRecos
SVDRecoDigits store array.
TH2F * createHistogram2D(const char *name, const char *title, Int_t nbinsX, Double_t minX, Double_t maxX, const char *titleX, Int_t nbinsY, Double_t minY, Double_t maxY, const char *titleY, TList *histoList=nullptr)
Function returning TH2F.
virtual ~SVDPerformanceModule()
destructor
TH2F * h_clSNVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
TH2F * h_clTimeVSSize[m_nLayers][m_nSensors][m_nSides]
charge VS size
StoreArray< Track > m_Tracks
Tracks store array.
TH1F * h_recoEnergy[m_nLayers][m_nSensors][m_nSides]
energy
StoreObjPtr< SVDEventInfo > m_storeSVDEvtInfo
Storage for SVDEventInfo object.
TFile * m_rootFilePtr
pointer at root file used for storing histograms
TH2F * h_cltrkTime_L4vL5v
L4V time VS L5V time.
int getSensor(int layer, int sensor, bool isTB)
get sensor number
bool m_is2017TBanalysis
true if we analyze 2017 TB data
TH1F * h_cltrkTime[m_nLayers][m_nSensors][m_nSides]
time
TList * m_histoList_cluster[m_nLayers]
histo list clusters
TH1F * h_clSize[m_nLayers][m_nSensors][m_nSides]
size
StoreArray< SVDShaperDigit > m_svdShapers
SVDShaperDigit store array.
TH1F * h_cltrkTime_TB1[m_nLayers][m_nSensors][m_nSides]
time
TH1F * h_cltrkSN[m_nLayers][m_nSensors][m_nSides]
signal over noise
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.