Belle II Software  release-05-02-19
CDCDedxCorrectionModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jake Bennett
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CDCDEDXCORRECTIONMODULE_H
12 #define CDCDEDXCORRECTIONMODULE_H
13 
14 #include <framework/core/Module.h>
15 
16 #include <framework/datastore/StoreArray.h>
17 #include <framework/database/DBObjPtr.h>
18 
19 #include <reconstruction/dbobjects/CDCDedxScaleFactor.h>
20 #include <reconstruction/dbobjects/CDCDedxMomentumCor.h>
21 #include <reconstruction/dbobjects/CDCDedxWireGain.h>
22 #include <reconstruction/dbobjects/CDCDedxRunGain.h>
23 #include <reconstruction/dbobjects/CDCDedxCosineCor.h>
24 #include <reconstruction/dbobjects/CDCDedx2DCell.h>
25 #include <reconstruction/dbobjects/CDCDedx1DCell.h>
26 #include <reconstruction/dbobjects/CDCDedxHadronCor.h>
27 #include <reconstruction/dbobjects/CDCDedxADCNonLinearity.h> //new in rel5
28 #include <reconstruction/dbobjects/CDCDedxCosineEdge.h> //new in rel5
29 
30 #include <vector>
31 
32 namespace Belle2 {
37  class CDCDedxTrack;
38 
45  class CDCDedxCorrectionModule : public Module {
46 
47  public:
48 
52  virtual ~CDCDedxCorrectionModule();
53 
57  virtual void initialize() override;
58 
61  virtual void event() override;
62 
64  virtual void terminate() override;
65 
67  void RunGainCorrection(double& dedx) const;
68 
70  void WireGainCorrection(int wireID, double& dedx) const;
71 
73  void TwoDCorrection(int layer, double doca, double enta, double& dedx) const;
74 
76  void OneDCorrection(int layer, double enta, double& dedx) const;
77 
79  void CosineCorrection(double costheta, double& dedx) const;
80 
82  void CosineEdgeCorrection(double costh, double& dedx) const;
83 
86  void HadronCorrection(double costheta, double& dedx) const;
87 
89  void StandardCorrection(int adc, int layer, int wireID, double doca, double enta, double length, double costheta,
90  double& dedx) const;
91 
93  double GetCorrection(int& adc, int layer, int wireID, double doca, double enta, double costheta) const;
94 
97  double D2I(const double cosTheta, const double D) const;
98 
101  double I2D(const double cosTheta, const double I) const;
102 
103  private:
104 
105  bool m_relative;
107  bool m_momCor;
108  bool m_useDBMomCor;
109  bool m_scaleCor;
110  bool m_cosineCor;
111  bool m_wireGain;
112  bool m_runGain;
113  bool m_twoDCell;
114  bool m_oneDCell;
116  bool m_nonlADC;
120  //parameters: calibration constants
132  std::vector<double> m_hadronpars;
135  void calculateMeans(double* mean, double* truncatedMean, double* truncatedMeanErr, const std::vector<double>& dedx) const;
136 
141 
143  double m_alpha{ -1.};
145  double m_gamma{ -1.};
147  double m_delta{ -1.};
149  double m_power{ -1.};
151  double m_ratio{ -1.};
152 
153  };
155 } // Belle2 namespace
156 #endif
Belle2::CDCDedxCorrectionModule::calculateMeans
void calculateMeans(double *mean, double *truncatedMean, double *truncatedMeanErr, const std::vector< double > &dedx) const
Recalculate the dE/dx mean values after corrections.
Definition: CDCDedxCorrectionModule.cc:342
Belle2::CDCDedxCorrectionModule::CosineEdgeCorrection
void CosineEdgeCorrection(double costh, double &dedx) const
Perform the cosine edge correction.
Definition: CDCDedxCorrectionModule.cc:215
Belle2::CDCDedxCorrectionModule::HadronCorrection
void HadronCorrection(double costheta, double &dedx) const
Perform a hadron saturation correction.
Definition: CDCDedxCorrectionModule.cc:224
Belle2::CDCDedxCorrectionModule::CDCDedxCorrectionModule
CDCDedxCorrectionModule()
Constructor.
Definition: CDCDedxCorrectionModule.cc:24
Belle2::CDCDedxCorrectionModule::m_removeLowest
double m_removeLowest
lower bound for truncated mean
Definition: CDCDedxCorrectionModule.h:146
Belle2::CDCDedxCorrectionModule::m_cosineCor
bool m_cosineCor
boolean to apply cosine correction
Definition: CDCDedxCorrectionModule.h:118
Belle2::CDCDedxCorrectionModule::TwoDCorrection
void TwoDCorrection(int layer, double doca, double enta, double &dedx) const
Perform a 2D correction.
Definition: CDCDedxCorrectionModule.cc:192
Belle2::CDCDedxCorrectionModule::m_wireGain
bool m_wireGain
boolean to apply wire gains
Definition: CDCDedxCorrectionModule.h:119
Belle2::CDCDedxCorrectionModule::StandardCorrection
void StandardCorrection(int adc, int layer, int wireID, double doca, double enta, double length, double costheta, double &dedx) const
Perform a standard set of corrections.
Definition: CDCDedxCorrectionModule.cc:229
Belle2::CDCDedxCorrectionModule::~CDCDedxCorrectionModule
virtual ~CDCDedxCorrectionModule()
Destructor.
Definition: CDCDedxCorrectionModule.cc:43
Belle2::CDCDedxCorrectionModule::WireGainCorrection
void WireGainCorrection(int wireID, double &dedx) const
Perform a wire gain correction.
Definition: CDCDedxCorrectionModule.cc:181
Belle2::CDCDedxCorrectionModule::m_momCor
bool m_momCor
boolean to apply momentum correction
Definition: CDCDedxCorrectionModule.h:115
Belle2::CDCDedxCorrectionModule::m_removeHighest
double m_removeHighest
upper bound for truncated mean
Definition: CDCDedxCorrectionModule.h:148
Belle2::CDCDedxCorrectionModule::m_scaleCor
bool m_scaleCor
boolean to apply scale factor
Definition: CDCDedxCorrectionModule.h:117
Belle2::CDCDedxCorrectionModule::m_cosineEdge
bool m_cosineEdge
boolean to apply cosine edge
Definition: CDCDedxCorrectionModule.h:123
Belle2::CDCDedxCorrectionModule::terminate
virtual void terminate() override
End of the event processing.
Definition: CDCDedxCorrectionModule.cc:166
Belle2::CDCDedxCorrectionModule::OneDCorrection
void OneDCorrection(int layer, double enta, double &dedx) const
Perform a wire gain correction.
Definition: CDCDedxCorrectionModule.cc:201
Belle2::CDCDedxCorrectionModule::m_DBNonlADC
DBObjPtr< CDCDedxADCNonLinearity > m_DBNonlADC
hadron saturation non linearity
Definition: CDCDedxCorrectionModule.h:137
Belle2::CDCDedxCorrectionModule::m_DBCosineCor
DBObjPtr< CDCDedxCosineCor > m_DBCosineCor
Electron saturation correction DB object.
Definition: CDCDedxCorrectionModule.h:133
Belle2::CDCDedxCorrectionModule::event
virtual void event() override
This method is called for each event.
Definition: CDCDedxCorrectionModule.cc:79
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::CDCDedxCorrectionModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: CDCDedxCorrectionModule.cc:45
Belle2::CDCDedxCorrectionModule::m_oneDCell
bool m_oneDCell
boolean to apply 1D correction
Definition: CDCDedxCorrectionModule.h:122
Belle2::CDCDedxCorrectionModule::CosineCorrection
void CosineCorrection(double costheta, double &dedx) const
Perform the cosine correction.
Definition: CDCDedxCorrectionModule.cc:208
Belle2::CDCDedxCorrectionModule::GetCorrection
double GetCorrection(int &adc, int layer, int wireID, double doca, double enta, double costheta) const
Get the standard set of corrections.
Definition: CDCDedxCorrectionModule.cc:266
Belle2::CDCDedxCorrectionModule::m_DBWireGains
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wire gain DB object.
Definition: CDCDedxCorrectionModule.h:131
Belle2::CDCDedxCorrectionModule::m_DB2DCell
DBObjPtr< CDCDedx2DCell > m_DB2DCell
2D correction DB object
Definition: CDCDedxCorrectionModule.h:134
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CDCDedxCorrectionModule::RunGainCorrection
void RunGainCorrection(double &dedx) const
Perform a run gain correction.
Definition: CDCDedxCorrectionModule.cc:172
Belle2::CDCDedxCorrectionModule::m_delta
double m_delta
saturation correction parameter: delta
Definition: CDCDedxCorrectionModule.h:155
Belle2::CDCDedxCorrectionModule::m_twoDCell
bool m_twoDCell
boolean to apply 2D correction
Definition: CDCDedxCorrectionModule.h:121
Belle2::CDCDedxCorrectionModule::I2D
double I2D(const double cosTheta, const double I) const
Saturation correction: convert the actural ionization (I) to measured ionization (D)
Definition: CDCDedxCorrectionModule.cc:309
Belle2::CDCDedxCorrectionModule::m_nonlADC
bool m_nonlADC
boolean to apply non linear ADC
Definition: CDCDedxCorrectionModule.h:124
Belle2::CDCDedxCorrectionModule::m_power
double m_power
saturation correction parameter: power on cos(theta)
Definition: CDCDedxCorrectionModule.h:157
Belle2::CDCDedxCorrectionModule::m_DBHadronCor
DBObjPtr< CDCDedxHadronCor > m_DBHadronCor
hadron saturation parameters
Definition: CDCDedxCorrectionModule.h:136
Belle2::CDCDedxCorrectionModule::m_DBCosEdgeCor
DBObjPtr< CDCDedxCosineEdge > m_DBCosEdgeCor
cosine edge calibration
Definition: CDCDedxCorrectionModule.h:138
Belle2::CDCDedxCorrectionModule::m_DB1DCell
DBObjPtr< CDCDedx1DCell > m_DB1DCell
1D correction DB object
Definition: CDCDedxCorrectionModule.h:135
Belle2::CDCDedxCorrectionModule::m_runGain
bool m_runGain
boolean to apply run gains
Definition: CDCDedxCorrectionModule.h:120
Belle2::CDCDedxCorrectionModule::m_gamma
double m_gamma
saturation correction parameter: gamma
Definition: CDCDedxCorrectionModule.h:153
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::CDCDedxCorrectionModule::m_cdcDedxTracks
StoreArray< CDCDedxTrack > m_cdcDedxTracks
Store array: CDCDedxTrack.
Definition: CDCDedxCorrectionModule.h:126
Belle2::CDCDedxCorrectionModule::m_DBMomentumCor
DBObjPtr< CDCDedxMomentumCor > m_DBMomentumCor
Momentum correction DB object.
Definition: CDCDedxCorrectionModule.h:130
Belle2::CDCDedxCorrectionModule::m_useDBMomCor
bool m_useDBMomCor
boolean to apply momentum correction from DB
Definition: CDCDedxCorrectionModule.h:116
Belle2::CDCDedxCorrectionModule::m_hadronpars
std::vector< double > m_hadronpars
hadron saturation parameters
Definition: CDCDedxCorrectionModule.h:140
Belle2::CDCDedxCorrectionModule::m_DBRunGain
DBObjPtr< CDCDedxRunGain > m_DBRunGain
Run gain DB object.
Definition: CDCDedxCorrectionModule.h:132
Belle2::CDCDedxCorrectionModule::m_alpha
double m_alpha
saturation correction parameter: alpha
Definition: CDCDedxCorrectionModule.h:151
Belle2::CDCDedxCorrectionModule::D2I
double D2I(const double cosTheta, const double D) const
Saturation correction: convert the measured ionization (D) to actual ionization (I)
Definition: CDCDedxCorrectionModule.cc:287
Belle2::CDCDedxCorrectionModule::m_relative
bool m_relative
boolean to apply relative or absolute correction
Definition: CDCDedxCorrectionModule.h:113
Belle2::CDCDedxCorrectionModule::m_ratio
double m_ratio
saturation correction parameter: ratio
Definition: CDCDedxCorrectionModule.h:159
Belle2::CDCDedxCorrectionModule::m_DBScaleFactor
DBObjPtr< CDCDedxScaleFactor > m_DBScaleFactor
Scale factor to make electrons ~1.
Definition: CDCDedxCorrectionModule.h:129