Belle II Software  release-05-02-19
ECLShowerCorrectorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * This module performs the correction for EM shower (mainly longitudinal *
6  * leakage): corr = (Reconstructed / Truth). *
7  * *
8  * Author: The Belle II Collaboration *
9  * Contributors: Torben Ferber (ferber@physics.ubc.ca) (TF) *
10  * Alon Hershenhorn (hersehn@physics.ubc.ca) *
11  * Suman Koirala (suman@ntu.edu.tw) *
12  * *
13  * This software is provided "as is" without any warranty. *
14  **************************************************************************/
15 
16 #pragma once
17 
18 // STL
19 #include <vector>
20 
21 //ROOT
22 #include <TGraph2D.h>
23 
24 // FRAMEWORK
25 #include <framework/core/Module.h>
26 #include <framework/database/DBObjPtr.h>
27 #include <framework/datastore/StoreArray.h>
28 #include <framework/datastore/StoreObjPtr.h>
29 
30 namespace Belle2 {
35  class EventLevelClusteringInfo;
36  class ECLShower;
37  class ECLShowerCorrectorLeakageCorrection;
38  class ECLShowerEnergyCorrectionTemporary;
39 
44  class ECLShowerCorrectorModule : public Module {
45 
46  public:
49 
52 
54  virtual void initialize() override;
55 
57  virtual void beginRun() override;
58 
60  virtual void event() override;
61 
63  virtual void endRun() override;
64 
66  virtual void terminate() override;
67 
70 
72  double getLeakageCorrection(const double theta, const double phi, const double energy, const double background) const;
73 
75  double getLeakageCorrectionTemporary(const double theta, const double phi, const double energy, const double background);
76 
77  private:
79  // Elisa's and Claudia's corrections
97  // TO BE UPDATED
98  const double m_fullBkgdCount = 183.0;
100  // For temporary BGx1
102  TGraph2D m_leakage_bgx1[8]; //0: theta_geo ph2, 1: theta_geo ph3, 2: phi_geo ph2, 3: phi_geo ph3, 4: theta_en ph2, 5: theta_en ph3, 6: phi_en ph2, 7 : phi_en ph3,
104  std::vector<double> m_leakage_bgx1_limits[8];
105 
106  // For BGx0 (complicated theta and phi dependency)
107  // Vectors with one entry each:
108  int m_numOfBfBins = 0;
109  int m_numOfEnergyBins = 0;
110  int m_numOfPhiBins = 0;
112  int m_numOfReg2ThetaBins = 0;
113  int m_numOfReg3ThetaBins = 0;
114  int m_phiPeriodicity = 0;
115  float m_lReg1Theta = 0;
116  float m_hReg1Theta = 0;
117  float m_lReg2Theta = 0;
118  float m_hReg2Theta = 0;
119  float m_lReg3Theta = 0;
120  float m_hReg3Theta = 0;
122  // Vector with (right now) 15 entries
123  std::vector<float> m_avgRecEn;
125  // Vectors with all corrections
126  std::vector<int> m_bgFractionBinNum;
127  std::vector<int> m_regNum;
128  std::vector<int> m_phiBinNum;
129  std::vector<int> m_thetaBinNum;
130  std::vector<int> m_energyBinNum;
131  std::vector<float> m_correctionFactor;
133  std::vector < std::vector < std::vector < std::vector < float > > > > m_reg1CorrFactorArrays;
134  std::vector < std::vector < std::vector < std::vector < float > > > > m_reg2CorrFactorArrays;
135  std::vector < std::vector < std::vector < std::vector < float > > > > m_reg3CorrFactorArrays;
139 
142 
143  public:
147  virtual const char* eclShowerArrayName() const
148  { return "ECLShowers" ; }
149 
151  virtual const char* eventLevelClusteringInfoName() const
152  { return "EventLevelClusteringInfo" ; }
153 
154  };
155 
158  public:
159 
161  virtual const char* eclShowerArrayName() const override
162  { return "ECLShowersPureCsI" ; }
163 
165  virtual const char* eventLevelClusteringInfoName() const override
166  { return "EventLevelClusteringInfoPureCsI" ; }
167 
168  };
169 
171 } // end of Belle2 namespace
Belle2::ECLShowerCorrectorModule::m_avgRecEn
std::vector< float > m_avgRecEn
averages of the energy bins
Definition: ECLShowerCorrectorModule.h:136
Belle2::ECLShowerCorrectorModule::m_eventLevelClusteringInfo
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
Store object pointer: EventLevelClusteringInfo.
Definition: ECLShowerCorrectorModule.h:154
Belle2::ECLShowerCorrectorModule::beginRun
virtual void beginRun() override
Begin run.
Definition: ECLShowerCorrectorModule.cc:79
Belle2::ECLShowerCorrectorModule::m_reg2CorrFactorArrays
std::vector< std::vector< std::vector< std::vector< float > > > > m_reg2CorrFactorArrays
region 2 corrections
Definition: ECLShowerCorrectorModule.h:147
Belle2::ECLShowerCorrectorModule::m_phiPeriodicity
int m_phiPeriodicity
repeating pattern in phi direction, for barrel it is 72
Definition: ECLShowerCorrectorModule.h:127
Belle2::ECLShowerCorrectorModule::getLeakageCorrectionTemporary
double getLeakageCorrectionTemporary(const double theta, const double phi, const double energy, const double background)
Get correction for BGx1 (temporary)
Definition: ECLShowerCorrectorModule.cc:291
Belle2::ECLShowerCorrectorModule::m_hReg3Theta
float m_hReg3Theta
upper boundary of the region 3 theta
Definition: ECLShowerCorrectorModule.h:133
Belle2::ECLShowerCorrectorModule::endRun
virtual void endRun() override
End run.
Definition: ECLShowerCorrectorModule.cc:135
Belle2::ECLShowerCorrectorModule::m_numOfBfBins
int m_numOfBfBins
number of background fraction bins; currently only two
Definition: ECLShowerCorrectorModule.h:121
Belle2::ECLShowerCorrectorModule::m_numOfReg1ThetaBins
int m_numOfReg1ThetaBins
number of region 1 theta bins
Definition: ECLShowerCorrectorModule.h:124
Belle2::ECLShowerCorrectorModule::m_reg1CorrFactorArrays
std::vector< std::vector< std::vector< std::vector< float > > > > m_reg1CorrFactorArrays
region 1 corrections
Definition: ECLShowerCorrectorModule.h:146
Belle2::ECLShowerCorrectorModule::m_lReg2Theta
float m_lReg2Theta
lower boundary of the region 2 theta
Definition: ECLShowerCorrectorModule.h:130
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_phiGeo_phase2bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_phiGeo_phase2bgx1
Leakage corrections from DB for Phase2 BG15x1.0, geometry correction as a function of phi.
Definition: ECLShowerCorrectorModule.h:98
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_bgx0
DBObjPtr< ECLShowerCorrectorLeakageCorrection > m_leakageCorrectionPtr_bgx0
Leakage corrections from DB for BGx0.
Definition: ECLShowerCorrectorModule.h:91
Belle2::ECLShowerCorrectorModule::m_leakage_bgx1
TGraph2D m_leakage_bgx1[8]
the leakage in BGx1
Definition: ECLShowerCorrectorModule.h:115
Belle2::ECLShowerCorrectorPureCsIModule::eclShowerArrayName
virtual const char * eclShowerArrayName() const override
PureCsI name ECLShowersPureCsI.
Definition: ECLShowerCorrectorModule.h:174
Belle2::ECLShowerCorrectorModule::m_regNum
std::vector< int > m_regNum
region bin
Definition: ECLShowerCorrectorModule.h:140
Belle2::ECLShowerCorrectorModule::event
virtual void event() override
Event.
Definition: ECLShowerCorrectorModule.cc:85
Belle2::ECLShowerCorrectorModule::terminate
virtual void terminate() override
Terminate.
Definition: ECLShowerCorrectorModule.cc:140
Belle2::ECLShowerCorrectorModule::m_phiBinNum
std::vector< int > m_phiBinNum
phi bin
Definition: ECLShowerCorrectorModule.h:141
Belle2::ECLShowerCorrectorModule::m_numOfReg3ThetaBins
int m_numOfReg3ThetaBins
number of region 3 theta bins
Definition: ECLShowerCorrectorModule.h:126
Belle2::ECLShowerCorrectorModule::~ECLShowerCorrectorModule
~ECLShowerCorrectorModule()
Destructor.
Definition: ECLShowerCorrectorModule.cc:65
Belle2::ECLShowerCorrectorModule::m_reg3CorrFactorArrays
std::vector< std::vector< std::vector< std::vector< float > > > > m_reg3CorrFactorArrays
region 3 corrections
Definition: ECLShowerCorrectorModule.h:148
Belle2::ECLShowerCorrectorModule::m_hReg1Theta
float m_hReg1Theta
upper boundary of the region 1 theta
Definition: ECLShowerCorrectorModule.h:129
Belle2::ECLShowerCorrectorModule::m_lReg1Theta
float m_lReg1Theta
lower boundary of the region 1 theta
Definition: ECLShowerCorrectorModule.h:128
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::ECLShowerCorrectorModule::m_bgFractionBinNum
std::vector< int > m_bgFractionBinNum
BG fraction bin.
Definition: ECLShowerCorrectorModule.h:139
Belle2::ECLShowerCorrectorModule::m_energyBinNum
std::vector< int > m_energyBinNum
energu bin
Definition: ECLShowerCorrectorModule.h:143
Belle2::ECLShowerCorrectorModule::eventLevelClusteringInfoName
virtual const char * eventLevelClusteringInfoName() const
Name to be used for default option: EventLevelClusteringInfo.
Definition: ECLShowerCorrectorModule.h:164
Belle2::ECLShowerCorrectorModule::eclShowerArrayName
virtual const char * eclShowerArrayName() const
We need names for the data objects to differentiate between PureCsI and default.
Definition: ECLShowerCorrectorModule.h:160
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_thetaGeo_phase3bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_thetaGeo_phase3bgx1
Leakage corrections from DB for Phase3 BG15x1.0, geometry correction as a function of theta.
Definition: ECLShowerCorrectorModule.h:96
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::ECLShowerCorrectorModule
Class to perform the shower correction.
Definition: ECLShowerCorrectorModule.h:57
Belle2::ECLShowerCorrectorPureCsIModule
The very same module but for PureCsI.
Definition: ECLShowerCorrectorModule.h:170
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_phiEn_phase2bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_phiEn_phase2bgx1
Leakage corrections from DB for Phase2 BG15x1.0, energy correction as a function of phi.
Definition: ECLShowerCorrectorModule.h:106
Belle2::ECLShowerCorrectorModule::initialize
virtual void initialize() override
Initialize.
Definition: ECLShowerCorrectorModule.cc:70
Belle2::ECLShowerCorrectorModule::m_eclShowers
StoreArray< ECLShower > m_eclShowers
Store array: ECLShower.
Definition: ECLShowerCorrectorModule.h:151
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_phiEn_phase3bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_phiEn_phase3bgx1
Leakage corrections from DB for Phase3 BG15x1.0, energy correction as a function of phi.
Definition: ECLShowerCorrectorModule.h:108
Belle2::ECLShowerCorrectorPureCsIModule::eventLevelClusteringInfoName
virtual const char * eventLevelClusteringInfoName() const override
Name to be used for PureCsI option: EventLevelClusteringInfoPureCsI.
Definition: ECLShowerCorrectorModule.h:178
Belle2::ECLShowerCorrectorModule::m_lReg3Theta
float m_lReg3Theta
lower boundary of the region 3 theta
Definition: ECLShowerCorrectorModule.h:132
Belle2::ECLShowerCorrectorModule::prepareLeakageCorrections
void prepareLeakageCorrections()
Prepare correction.
Definition: ECLShowerCorrectorModule.cc:145
Belle2::ECLShowerCorrectorModule::ECLShowerCorrectorModule
ECLShowerCorrectorModule()
Constructor.
Definition: ECLShowerCorrectorModule.cc:45
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_thetaEn_phase3bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_thetaEn_phase3bgx1
Leakage corrections from DB for Phase3 BG15x1.0, energy correction as a function of theta.
Definition: ECLShowerCorrectorModule.h:104
Belle2::ECLShowerCorrectorModule::m_thetaBinNum
std::vector< int > m_thetaBinNum
theta bin
Definition: ECLShowerCorrectorModule.h:142
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_thetaEn_phase2bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_thetaEn_phase2bgx1
Leakage corrections from DB for Phase2 BG15x1.0, energy correction as a function of theta.
Definition: ECLShowerCorrectorModule.h:102
Belle2::ECLShowerCorrectorModule::m_numOfEnergyBins
int m_numOfEnergyBins
number of energy bins
Definition: ECLShowerCorrectorModule.h:122
Belle2::ECLShowerCorrectorModule::getLeakageCorrection
double getLeakageCorrection(const double theta, const double phi, const double energy, const double background) const
Get correction for BGx0.
Definition: ECLShowerCorrectorModule.cc:370
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_thetaGeo_phase2bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_thetaGeo_phase2bgx1
Leakage corrections from DB for Phase2 BG15x1.0, geometry correction as a function of theta.
Definition: ECLShowerCorrectorModule.h:94
Belle2::ECLShowerCorrectorModule::m_correctionFactor
std::vector< float > m_correctionFactor
correction value
Definition: ECLShowerCorrectorModule.h:144
Belle2::ECLShowerCorrectorModule::m_hReg2Theta
float m_hReg2Theta
upper boundary of the region 2 theta
Definition: ECLShowerCorrectorModule.h:131
Belle2::ECLShowerCorrectorModule::m_leakageCorrectionPtr_phiGeo_phase3bgx1
DBObjPtr< ECLShowerEnergyCorrectionTemporary > m_leakageCorrectionPtr_phiGeo_phase3bgx1
Leakage corrections from DB for Phase3 BG15x1.0, geometry correction as a function of phi.
Definition: ECLShowerCorrectorModule.h:100
Belle2::ECLShowerCorrectorModule::m_numOfPhiBins
int m_numOfPhiBins
number of phi bins
Definition: ECLShowerCorrectorModule.h:123
Belle2::ECLShowerCorrectorModule::m_leakage_bgx1_limits
std::vector< double > m_leakage_bgx1_limits[8]
limits for the leakage in BGx1
Definition: ECLShowerCorrectorModule.h:117
Belle2::ECLShowerCorrectorModule::m_fullBkgdCount
const double m_fullBkgdCount
Nominal Background at BGx1.0 (MC12)
Definition: ECLShowerCorrectorModule.h:111
Belle2::ECLShowerCorrectorModule::m_numOfReg2ThetaBins
int m_numOfReg2ThetaBins
number of region 2 theta bins
Definition: ECLShowerCorrectorModule.h:125