Belle II Software development
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
31namespace Belle2 {
42
43 public:
44
47
50
51 virtual void initialize() override;
52 virtual void beginRun() override;
53 virtual void event() override;
54 virtual void endRun() override;
56 std::string m_ShaperDigitName = "SVDShaperDigits";
57 std::string m_RecoDigitName = "SVDRecoDigits";
58 std::string m_ClusterName = "SVDClusters";
59 std::string m_TrackFitResultName = "TrackFitResults";
60 std::string m_TrackName = "Tracks";
61 bool m_is2017TBanalysis = false;
62 bool m_isSimulation = false;
64 float m_debugLowTime = - 100;
67 /* user-defined parameters */
68 std::string m_rootFileName = "";
70 /* ROOT file related parameters */
71 TFile* m_rootFilePtr = nullptr;
73 private:
74
75 int m_nEvents = 0;
89
91 std::string m_svdEventInfoName;
92
93 int m_ntracks = 0;
95 static const int m_nLayers = 4;
96 static const int m_nSensors = 5;
97 static const int m_nSides = 2;
99 unsigned int sensorsOnLayer[4] = {0};
101 TList* m_histoList_track = nullptr;
102 TList* m_histoList_corr = nullptr;
103 TList* m_histoList_clTRK[m_nLayers] = {nullptr};
104 TList* m_histoList_cluster[m_nLayers] = {nullptr};
105 TList* m_histoList_shaper[m_nLayers] = {nullptr};
106 TList* m_histoList_reco[m_nLayers] = {nullptr};
108 //TRACKS
109 TH1F* m_nTracks = nullptr;
110 TH1F* m_Pvalue = nullptr;
111 TH1F* m_mom = nullptr;
112 TH1F* m_nSVDhits = nullptr;
114 //SHAPER
115 TH1F* h_nShaper[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
117 //RECO
118 TH1F* h_nReco[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
119 TH1F* h_recoCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
120 TH1F* h_recoEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
121 TH1F* h_stripNoise[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
122 TH1F* h_recoTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
124 //CLUSTERS NOT RELATED TO TRACKS
125 TH1F* h_nCl[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
126 TH1F* h_clSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
127 TH1F* h_clCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
128 TH1F* h_clEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
129 TH1F* h_clSeedMaxbin[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
133 TH2F* h_clNuVSNv[m_nLayers][m_nSensors] = {{nullptr}};
134 TH2F* h_clCoorUVSCoorV[m_nLayers][m_nSensors] = {{nullptr}};
139 TH1F* h_clSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
140 TH1F* h_clTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
145 TH2F* h_clSNVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
146 TH2F* h_clTimeVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
149 //CLUSTERS RELATED TO TRACKS
150 TH1F* h_nCltrk[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
151 TH1F* h_cltrkSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
152 TH1F* h_cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
153 TH1F* h_cltrkEnergy[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
154 TH1F* h_cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
155 TH1F* h_cltrkTime[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
156 TH1F* h_cltrkTime_TB1[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
157 TH1F* h_cltrkTime_TB2[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
158 TH1F* h_cltrkTime_TB3[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
159 TH1F* h_cltrkTime_TB4[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
161 TH2F* h_cltrkSNVSSize[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
165 //1-STRIP CLUSTERS
166 TH1F* h_1cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
167 TH1F* h_1cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
169 //2-STRIP CLUSTERS
170 TH1F* h_2cltrkCharge[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
171 TH1F* h_2cltrkSN[m_nLayers][m_nSensors][m_nSides] = {{{nullptr}}};
173 //CORRELATIONS
174 TH1F* h_cltrk_UU = nullptr;
175 TH1F* h_cltrk_VV = nullptr;
176 TH1F* h_cltrk_UV = nullptr;
178 TH2F* h_cltrkTime_L4uL5u = nullptr;
179 TH2F* h_cltrkTime_L4vL5v = nullptr;
180 TH2F* h_cltrkTime_L5uL5v = nullptr;
183 int getSensor(int layer, int sensor, bool isTB)
184 {
185 int result = 0;
186 if (isTB) {
187 if (layer == 0)
188 result = sensor - 1;
189 else if (layer == 1 || layer == 2)
190 result = sensor - 2;
191 else if (layer == 3)
192 result = sensor - 3;
193 } else result = sensor - 1;
194
195 return result;
196 }
197
199 TH1F* createHistogram1D(const char* name, const char* title,
200 Int_t nbins, Double_t min, Double_t max,
201 const char* xtitle, TList* histoList = nullptr);
203 TH2F* createHistogram2D(const char* name, const char* title,
204 Int_t nbinsX, Double_t minX, Double_t maxX, const char* titleX,
205 Int_t nbinsY, Double_t minY, Double_t maxY, const char* titleY,
206 TList* histoList = nullptr);
207
208 };
210}
211
212
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.