Belle II Software  release-06-01-15
SVDClusterEvaluationModule.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 #ifndef SVD_CLUSTEREVALUATION_H_
10 #define SVD_CLUSTEREVALUATION_H_
11 
12 #include <framework/core/Module.h>
13 #include <vxd/geometry/GeoCache.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <svd/dataobjects/SVDCluster.h>
17 #include <svd/dataobjects/SVDHistograms.h>
18 #include <tracking/dataobjects/SVDIntercept.h>
19 #include <mdst/dataobjects/Track.h>
20 #include <framework/dataobjects/EventMetaData.h>
21 
22 
23 #include <string>
24 #include <TTree.h>
25 #include <TFile.h>
26 #include <TH1F.h>
27 #include <TH2F.h>
28 
29 namespace Belle2 {
40 
41  public:
42 
44 
45  virtual ~SVDClusterEvaluationModule();
46  virtual void initialize() override;
47  virtual void beginRun() override;
48  virtual void event() override;
49  virtual void endRun() override;
50  virtual void terminate() override;
51 
52  /* user-defined parameters */
53  std::string m_rootFileName;
54  std::string m_ClusterName;
55  std::string m_InterceptName;
56  std::string m_TrackName;
58  /* ROOT file related parameters */
59  TFile* m_rootFilePtr = nullptr;
60  TTree* m_tree = nullptr;
61  TTree* m_treeSummary = nullptr;
63  double m_UbinWidth;
64  double m_VbinWidth;
66  //branches
67  TBranch* b_experiment = nullptr;
68  TBranch* b_run = nullptr;
69  TBranch* b_ladder = nullptr;
70  TBranch* b_layer = nullptr;
71  TBranch* b_sensor = nullptr;
72  TBranch* b_interU = nullptr;
73  TBranch* b_interV = nullptr;
74  TBranch* b_interErrU = nullptr;
75  TBranch* b_interErrV = nullptr;
76  TBranch* b_interUprime = nullptr;
77  TBranch* b_interVprime = nullptr;
78  TBranch* b_interErrUprime = nullptr;
79  TBranch* b_interErrVprime = nullptr;
80  TBranch* b_residU = nullptr;
81  TBranch* b_residV = nullptr;
82  TBranch* b_clUpos = nullptr;
83  TBranch* b_clVpos = nullptr;
84  TBranch* b_clUcharge = nullptr;
85  TBranch* b_clVcharge = nullptr;
86  TBranch* b_clUsnr = nullptr;
87  TBranch* b_clVsnr = nullptr;
88  TBranch* b_clUsize = nullptr;
89  TBranch* b_clVsize = nullptr;
90  TBranch* b_clUtime = nullptr;
91  TBranch* b_clVtime = nullptr;
93  //branch variables
94  int m_experiment = -1;
95  int m_run = -1;
96  int m_ladder = -1;
97  int m_layer = -1;
98  int m_sensor = -1;
99  float m_interU = -1;
100  float m_interV = -1;
101  float m_interErrU = -1;
102  float m_interErrV = -1;
103  float m_interUprime = -1;
104  float m_interVprime = -1;
105  float m_interErrUprime = -1;
106  float m_interErrVprime = -1;
107  float m_residU = -1;
108  float m_residV = -1;
109  float m_clUpos = -1;
110  float m_clVpos = -1;
111  float m_clUcharge = -1;
112  float m_clVcharge = -1;
113  float m_clUsnr = -1;
114  float m_clVsnr = -1;
115  int m_clUsize = -1;
116  int m_clVsize = -1;
117  float m_clUtime = -1;
118  float m_clVtime = -1;
120  //branches summary variables
121  TBranch* bs_experiment = nullptr;
122  TBranch* bs_run = nullptr;
123  TBranch* bs_ladder = nullptr;
124  TBranch* bs_layer = nullptr;
125  TBranch* bs_sensor = nullptr;
126  TBranch* bs_effU = nullptr;
127  TBranch* bs_effV = nullptr;
128  TBranch* bs_effErrU = nullptr;
129  TBranch* bs_effErrV = nullptr;
130  TBranch* bs_nIntercepts = nullptr;
131  TBranch* bs_residU = nullptr;
132  TBranch* bs_residV = nullptr;
133  TBranch* bs_misU = nullptr;
134  TBranch* bs_misV = nullptr;
135  TBranch* bs_statU = nullptr;
136  TBranch* bs_statV = nullptr;
138  //branch variables
139  int ms_experiment = -1;
140  int ms_run = -1;
141  int ms_ladder = -1;
142  int ms_layer = -1;
143  int ms_sensor = -1;
144  float ms_effU = -1;
145  float ms_effV = -1;
146  float ms_effErrU = -1;
147  float ms_effErrV = -1;
148  int ms_nIntercepts = -1;
149  float ms_residU = -1;
150  float ms_residV = -1;
151  float ms_misU = -1;
152  float ms_misV = -1;
153  float ms_statU = -1;
154  float ms_statV = -1;
156  private:
157 
158  double m_cmTomicron = 10000;
159  int m_theLayer = -1;
160  double m_interSigmaMax = -1;
161  double m_uFiducial = -1;
162  double m_vFiducial = -1;
163  float m_nSigma = -1;
164  float m_halfWidth = -1;
165  int m_groupNstrips = -1;
181  float m_width_LargeS_U = 5.772;
182  float m_width_LargeS_V = 12.290;
183  float m_width_SmallS_U = 3.855;
186  float m_safety_margin = 0.2;
188  int m_nBins_LargeS_U = 100;
189  int m_nBins_LargeS_V = 100;
190  int m_nBins_SmallS_U = 100;
191  int m_nBins_SmallS_V = 100;
193  float m_abs_LargeS_U = 1;
194  float m_abs_LargeS_V = 1;
195  float m_abs_SmallS_U = 1;
196  float m_abs_SmallS_V = 1;
203  double getOneSigma(TH1F* h);
205  bool isRelatedToTrack(SVDIntercept* inter);
207  };
209 }
210 
211 #endif /* SVDClusterEvaluationModule_H_ */
212 
Base class for Modules.
Definition: Module.h:72
The SVD ClusterEvaluation Module.
TBranch * b_interErrV
intercept V position error
TTree * m_tree
pointer at tree containing the parameters
TBranch * bs_statV
intercept stat error V
int m_groupNstrips
number of strip in the group in 2D resid vs position
VXD::GeoCache & m_geoCache
the geo cache instance
float m_abs_LargeS_U
half width including safety margin, large sensor U
virtual void initialize() override
Initialize the Module.
SVDHistograms< TH1F > * m_clsResid
cluster resid plots
double getOneSigma(TH1F *h)
returns one sigma using quantiles
double m_VbinWidth
histogram v-bin width in microns
void create_SVDHistograms_interCoor()
create intercept coordinates plots
StoreArray< SVDCluster > m_svdClusters
clusters
virtual void event() override
This method is the core of the module.
bool isRelatedToTrack(SVDIntercept *inter)
is the intercept related to a track
TBranch * b_interV
intercept V position
void create_SVDHistograms_interSigma()
create intercept error plots
float m_halfWidth
window half width for efficiency computation
void create_SVDHistograms_clsResid()
create slucter resid plots
virtual void endRun() override
This method is called if the current run ends.
TBranch * b_interErrUprime
intercept U prime error
TBranch * b_interU
intercept U position
TBranch * b_interErrU
intercept U position error
virtual void terminate() override
This method is called at the end of the event processing.
float m_abs_SmallS_V
half width including safety margin, small sensor V
SVDHistograms< TH1F > * m_interSigma
intercept stat error plots
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data
float m_nSigma
number of sigmas for efficiency computation
TBranch * bs_statU
intercept stat error U
SVDHistograms< TH2F > * m_clsResid2D
2D resid plots
std::string m_TrackName
Track StoreArray name.
TBranch * b_interErrVprime
intercept V prime error
SVDHistograms< TH1F > * m_clsMinResid
cluster minimum resid plots
virtual void beginRun() override
Called when entering a new run.
double m_interSigmaMax
max of the histo of the intercept stat error
float m_interErrUprime
intercept U prime error
SVDHistograms< TH1F > * m_clsCoor
cluster coordinates plots
TTree * m_treeSummary
pointer at tree containing the summary parameters
SVDHistograms< TH2F > * m_interCoor
intercept coordinates plots
float m_interErrVprime
intercept V prime error
std::string m_ClusterName
SVDCluster StoreArray name.
int m_nBins_SmallS_U
number of bins for small sensor U
float m_interErrU
intercept U position error
float m_abs_LargeS_V
half width including safety margin, large sensor V
double m_UbinWidth
histogram u-bin width in microns
StoreArray< SVDIntercept > m_svdIntercepts
intercepts
int m_nBins_LargeS_U
number of bins for large sensor U
float m_interErrV
intercept V position error
TFile * m_rootFilePtr
pointer at root file used for storing histograms
int m_nBins_LargeS_V
number of bins for large sensor V
int m_nBins_SmallS_V
number of bins for small sensor V
float m_abs_SmallS_U
half width including safety margin, small sensor U
std::string m_InterceptName
SVDIntercept StoreArray name.
TBranch * bs_nIntercepts
number of intercepts
void create_SVDHistograms_clsCoor()
create cluster coordinates plots
SVDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an SVD ...
Definition: SVDIntercept.h:22
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:213
Abstract base class for different kinds of events.