Belle II Software release-09-00-00
SVDClusterEvaluationTrueInfoModule.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
10#ifndef SVDClusterEvaluationTrueInfo_H
11#define SVDClusterEvaluationTrueInfo_H
12
13
14#include <framework/core/Module.h>
15#include <framework/datastore/StoreObjPtr.h>
16#include <svd/dataobjects/SVDTrueHit.h>
17#include <svd/dataobjects/SVDEventInfo.h>
18#include <TList.h>
19#include <TFile.h>
20#include <TH1F.h>
21#include <TH2F.h>
22
23
24namespace Belle2 {
38
39 public:
40
43
45
47 virtual void initialize() override;
48
50 virtual void beginRun() override;
51
53 virtual void event() override;
54
56 virtual void endRun() override;
57
59 virtual void terminate() override;
60
61
62 static const int m_Nsets =
63 6;
64 static const int m_NsetsRed = 3;
66 // private:
67 TFile* m_outputFile = nullptr;
68 std::string m_outputFileName = "";
71 std::string m_svdEventInfoName;
72
75
77 TString NameOfHisto = "";
79 TString TitleOfHisto = "";
80
91 TH1F* m_histo_ClusterTimePull[m_Nsets] = {nullptr};
101 TH2F* m_histo2D_TresVsPosres[m_Nsets] = {nullptr};
109 TH1F* m_histo_THinCluster[m_Nsets] = {nullptr};
111 TH1F* m_histo_THinClusterTM[m_Nsets] = {nullptr};
116
138 float m_OrderingVec[m_Nsets] = {1., 2., 3., 4., 5., 6.};
139 float m_NullVec[m_Nsets] = {0.};
147 TList* m_histo2DList_TresVsPosres = nullptr;
151 TList* m_histoList_THinCluster = nullptr;
152 TList* m_histoList_THinClusterTM = nullptr;
155 TList* m_graphList = nullptr;
168 TH1F* m_histoControl_MCcharge = nullptr;
171 TList* m_histoList_Control = nullptr;
174 protected:
177
179 int indexFromLayerSensorSide(int LayerNumber, int SensorNumber, int UVNumber);
180
182 TString IntExtFromIndex(int idx);
183
185 TString FWFromIndex(int idx);
186
188 TString UVFromIndex(int idx);
189
191 TH1F* createHistogram1D(const char* name, const char* title,
192 Int_t nbins, Double_t min, Double_t max,
193 const char* xtitle, TList* histoList);
194
196 TH2F* createHistogram2D(const char* name, const char* title,
197 Int_t nbinsX, Double_t minX, Double_t maxX,
198 const char* titleX,
199 Int_t nbinsY, Double_t minY, Double_t maxY,
200 const char* titleY, TList* histoList);
201
203 void createEfficiencyGraph(const char* name, const char* title, int vNum[m_Nsets], int vDen[m_Nsets], TString xTitle,
204 TString yTitle, TList* list);
205
207 void createArbitraryGraphErrorChooser(const char* name, const char* title, float x[m_Nsets], float xErr[m_Nsets], float y[m_Nsets],
208 float yErr[m_Nsets], TString xTitle, TString yTitle, TList* list, int len);
209
211 void createArbitraryGraphError_Std(const char* name, const char* title, float x[m_Nsets], float xErr[m_Nsets], float y[m_Nsets],
212 float yErr[m_Nsets], TString xTitle, TString yTitle, TList* list);
213
215 void createArbitraryGraphError_Red(const char* name, const char* title, float x[m_NsetsRed], float xErr[m_NsetsRed],
216 float y[m_NsetsRed], float yErr[m_NsetsRed], TString xTitle, TString yTitle, TList* list);
217
219 bool goodTrueHit(const SVDTrueHit* thino);
220
221 };
223}
224
225
226#endif
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
Base class for Modules.
Definition: Module.h:72
Clustering Performance, using true informations.
TH1F * m_histo_StripTimeResolution[m_Nsets]
Vector of histograms depicting Strip Time Residuals.
TList * m_histoList_StripTimeResolution
Lists used to easily Draw the corresponding histos; last one is used to draw the TGraphs.
float m_RMS_GoodTHinClusterTM[m_Nsets]
good true hits in cluster truth matched rms
float m_mean_ClusterTimeResolution[m_Nsets]
average cl time resid
TString NameOfHisto
Strings to pass names of the histos in the vectors of hitos.
TString UVFromIndex(int idx)
Function returning "U" or "V" depending on the index.
int m_NumberOfClustersRelatedToTH[m_Nsets]
number of clusters related to true hits
TString TitleOfHisto
Strings to pass titles of the histos in the vectors of hitos.
TH1F * m_histoControl_MCcharge
Control Histos and List to check if the function used to define a TH as "good" is working fine.
void createArbitraryGraphErrorChooser(const char *name, const char *title, float x[m_Nsets], float xErr[m_Nsets], float y[m_Nsets], float yErr[m_Nsets], TString xTitle, TString yTitle, TList *list, int len)
Function choosing between the two following functions depending on the length of the provided arrays.
TList * m_histoList_PurityInsideTMCluster
histo list truth matched cluster purity (2D)
float m_RMS_ClusterTimeResolution[m_Nsets]
rms cluster time resid
TH1F * m_histo_ClusterUPositionPull[m_NsetsRed]
Vector of histograms depicting Cluster U Position Pull (Reduced length!)
void createArbitraryGraphError_Red(const char *name, const char *title, float x[m_NsetsRed], float xErr[m_NsetsRed], float y[m_NsetsRed], float yErr[m_NsetsRed], TString xTitle, TString yTitle, TList *list)
Function returning an arbitrarly defined TGraph with arrays length equal to m_NsetsRed.
TH1F * m_histo_ClusterUPositionResolution[m_NsetsRed]
Vector of histograms depicting Cluster U Position Residual (Reduced length!)
TList * m_histoList_ClusterTimeResolution
histo list cluster time resolution
int m_NumberOfShaperDigit[m_Nsets]
Vectors used to compute the quantities depicted in Histos and Graphs.
float m_RMS_THinClusterTM[m_Nsets]
true hits in truth matched cluster rms
float m_RMS_THinCluster[m_Nsets]
true hits in cluster rms
virtual void initialize() override
Initialize the SVDClusterEvaluationTrueInfo.
TList * m_histo2DList_TresVsPosres
histo list ime tresol VS position resol
int m_NumberOfTMRecoInNOTMCluster
number of truth matched reco digits in not truth matched clusters
int indexForHistosAndGraphs
Index used for the lists and for the vectors of histograms: it indicates the set of sensors we are lo...
TH1F * m_histo_ClusterVPositionPull[m_NsetsRed]
Vector of histograms depicting Cluster U Position Pull (Reduced length!)
virtual void event() override
This method is the core of the SVDClusterEvaluationTrueInfo.
float m_mean_GoodTHinClusterTM[m_Nsets]
good true hits in cluster truth matched average
int m_NumberOfTMClusters[m_Nsets]
number of truth matched clusters
float m_mean_ClusterVPositionResolution[m_Nsets]
average cl V position reosl
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)
Function returning TH2F.
TH1F * m_histo_ClusterTimeResolution_bin1[m_Nsets]
Vector of histograms depicting Cluster Time Residuals, divided by TriggerBin.
TH1F * m_histo_THinCluster[m_Nsets]
Vector of histograms depicting Number of TH inside a Cluster.
virtual void endRun() override
This method is called if the current run ends.
float m_mean_ClusterUPositionResolution[m_Nsets]
average cl U position resol
TH2F * m_histo2D_TresVsPosres[m_Nsets]
Vector of 2D histograms depicting Time Residuals Vs Position (U/V) Residuals for Histos.
virtual void terminate() override
This method is called at the end of the event processing.
TH1F * m_histo_GoodTHinClusterTM[m_Nsets]
Vector of histograms depicting Number of Good TH inside a TM Cluster.
TList * m_histoList_ClusterTimePull
histo list cluster time pull
TList * m_histoList_GoodTHinClusterTMGood
histo list goo true hits in cluster truth match good
float m_RMS_StripTimeResolution[m_Nsets]
rms of strip time residual
float m_mean_THinClusterTM[m_Nsets]
true hits in truth matched cluster average
float m_RMS_ClusterVPositionResolution[m_Nsets]
rms cl V position resol
float m_OrderingVec[m_Nsets]
Vectors used to Draw the TGraphs (defined in the cc) depicting the averages and the means of the hist...
TList * m_histoList_ClusterPositionPull
histo list cluster position pull
TList * m_histo2DList_PurityInsideTMCluster
histo list truth matched cluster purity (2D)
TList * m_histoList_PurityInsideNOTMCluster
histo list not truth matched cluster purity
TH1F * m_histo_PurityInsideTMCluster[m_Nsets]
Vector of histograms depicting Cluster Internal Purity (TM Recos over Reco inside a Cluster)
TString FWFromIndex(int idx)
Function returning "Forward" or "Backword" depending on the index.
virtual void beginRun() override
Called when entering a new run.
TH1F * m_histo_ClusterTimeResolution[m_Nsets]
Vector of histograms depicting Cluster Time Residuals.
TH1F * m_histo_ClusterTimePull[m_Nsets]
Vector of histograms depicting Cluster Time Pull.
int indexFromLayerSensorSide(int LayerNumber, int SensorNumber, int UVNumber)
Function returning the index used for Histos.
static const int m_NsetsRed
numbner of reduced sets
TList * m_histoList_GoodTHinClusterTM
histo list good true hits in cluster truth matched
float m_mean_PurityInsideTMCluster[m_Nsets]
cluster purity average
bool goodTrueHit(const SVDTrueHit *thino)
Function defining if a TH is good (based on charge and primaryness)
float m_RMS_ClusterUPositionResolution[m_Nsets]
rms cl U position resol
TString IntExtFromIndex(int idx)
Function returning "Internal" or "External" depending on the index.
float m_RMS_GoodTHinClusterTMGood[m_Nsets]
good true hits in cluster truth match good rms
std::string m_svdEventInfoName
Name of the SVDEventInfo object.
void createEfficiencyGraph(const char *name, const char *title, int vNum[m_Nsets], int vDen[m_Nsets], TString xTitle, TString yTitle, TList *list)
Function returning a TGraph with Y axis limited to 1 given numerator and denumerator vectors and plot...
TH1F * m_histo_GoodTHinClusterTMGood[m_Nsets]
Vector of histograms depicting Number of Good TH inside a Good TM Cluster.
TH1F * createHistogram1D(const char *name, const char *title, Int_t nbins, Double_t min, Double_t max, const char *xtitle, TList *histoList)
Function returning a TH1F.
TH1F * m_histoControl_THToMCsize
control histo: true hit to mc size
TH1F * m_histo_ClusterVPositionResolution[m_NsetsRed]
Vector of histograms depicting Cluster V Position Residual (Reduced length!)
TList * m_histoList_THinCluster
histo list true hits in cluster
TH2F * m_histo2D_PurityInsideTMCluster[m_Nsets]
Vector of 2D histograms depicting TM Reco Vs Total Reco inside a TM Cluster.
float m_mean_GoodTHinClusterTMGood[m_Nsets]
good true hits in cluster truth match good average
StoreObjPtr< SVDEventInfo > m_storeSVDEvtInfo
Storage for SVDEventInfo object.
TList * m_histoList_ClusterPositionResolution
histo list cluster position resolution
void createArbitraryGraphError_Std(const char *name, const char *title, float x[m_Nsets], float xErr[m_Nsets], float y[m_Nsets], float yErr[m_Nsets], TString xTitle, TString yTitle, TList *list)
Function returning an arbitrarly defined TGraph with arrays length equal to m_Nsets.
TH1F * m_histo_PurityInsideNOTMCluster[m_Nsets]
Vector of histograms depicting TM Cluster Internal Purity (TM Recos over Reco inside a Cluster)
static const int m_Nsets
number of sets: L3-barrel-U, L3-barrel-V, L456-barrel-U, L456-barrel-V, L456-slanted-U,...
int m_NumberOfTMRecoInTMCluster
numnber of true match reco digit in truth match cluster
float m_mean_StripTimeResolution[m_Nsets]
Vectors of floats containing the mean and the RMS from the corresponding histo.
TH1F * m_histo_THinClusterTM[m_Nsets]
Vector of histograms depicting Number of TH inside a TM Cluster.
TList * m_histoList_THinClusterTM
histo list true hits in clsuter truth match
float m_mean_THinCluster[m_Nsets]
true hits in cluster average
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: SVDTrueHit.h:33
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.