16#include <framework/core/Module.h>
17#include <framework/datastore/StoreArray.h>
18#include <framework/database/DBObjPtr.h>
20#include <reconstruction/dataobjects/CDCDedxTrack.h>
21#include <reconstruction/dataobjects/DedxConstants.h>
22#include <reconstruction/dbobjects/CDCDedxScaleFactor.h>
23#include <reconstruction/dbobjects/CDCDedxMomentumCor.h>
24#include <reconstruction/dbobjects/CDCDedxWireGain.h>
25#include <reconstruction/dbobjects/CDCDedxRunGain.h>
26#include <reconstruction/dbobjects/CDCDedxInjectionTime.h>
27#include <reconstruction/dbobjects/CDCDedxCosineCor.h>
28#include <reconstruction/dbobjects/CDCDedx2DCell.h>
29#include <reconstruction/dbobjects/CDCDedx1DCell.h>
30#include <reconstruction/dbobjects/CDCDedxHadronCor.h>
31#include <reconstruction/dbobjects/CDCDedxADCNonLinearity.h>
32#include <reconstruction/dbobjects/CDCDedxCosineEdge.h>
34#include <mdst/dataobjects/EventLevelTriggerTimeInfo.h>
36#include <cdc/geometry/CDCGeometryParConstants.h>
37#include <cdc/geometry/CDCGeometryPar.h>
68 virtual void event()
override;
83 void TwoDCorrection(
int layer,
double doca,
double enta,
double& dedx)
const;
99 void StandardCorrection(
int adc,
int layer,
int wireID,
double doca,
double enta,
double length,
100 double costheta,
double ring,
double time,
double& dedx)
const;
103 double GetCorrection(
int& adc,
int layer,
int wireID,
double doca,
double enta,
double costheta,
double ring,
double time)
const;
107 double D2I(
const double cosTheta,
const double D)
const;
111 double I2D(
const double cosTheta,
const double I)
const;
148 void calculateMeans(
double* mean,
double* truncatedMean,
double* truncatedMeanErr,
const std::vector<double>& dedx)
const;
This module may be used to apply the corrections to dE/dx per the calibration constants.
bool m_twoDCell
boolean to apply 2D correction
double D2I(const double cosTheta, const double D) const
Saturation correction: convert the measured ionization (D) to actual ionization (I)
bool m_runGain
boolean to apply run gains
StoreObjPtr< EventLevelTriggerTimeInfo > m_TTDInfo
Store Object Ptr: EventLevelTriggerTimeInfo.
std::vector< double > m_hadronpars
hadron saturation parameters
bool m_cosineEdge
boolean to apply cosine edge
DBObjPtr< CDCDedxRunGain > m_DBRunGain
Run gain DB object.
bool m_useDBMomCor
boolean to apply momentum correction from DB
void TwoDCorrection(int layer, double doca, double enta, double &dedx) const
Perform a 2D correction.
DBObjPtr< CDCDedxMomentumCor > m_DBMomentumCor
Momentum correction DB object.
bool m_momCor
boolean to apply momentum correction
virtual void initialize() override
Initialize the Module.
bool m_scaleCor
boolean to apply scale factor
DBObjPtr< CDCDedxHadronCor > m_DBHadronCor
hadron saturation parameters
virtual void event() override
This method is called for each event.
double m_removeHighest
upper bound for truncated mean
DBObjPtr< CDCDedxCosineEdge > m_DBCosEdgeCor
cosine edge calibration
double I2D(const double cosTheta, const double I) const
Saturation correction: convert the actural ionization (I) to measured ionization (D)
std::array< double, 56 > m_lgainavg
average calibration factor for the layer
void OneDCorrection(int layer, double enta, double &dedx) const
Perform a wire gain correction.
DBObjPtr< CDCDedxADCNonLinearity > m_DBNonlADC
hadron saturation non linearity
DBObjPtr< CDCDedx1DCell > m_DB1DCell
1D correction DB object
virtual void terminate() override
End of the event processing.
bool m_oneDCell
boolean to apply 1D correction
void HadronCorrection(double costheta, double &dedx) const
Perform a hadron saturation correction.
void calculateMeans(double *mean, double *truncatedMean, double *truncatedMeanErr, const std::vector< double > &dedx) const
Recalculate the dE/dx mean values after corrections.
void StandardCorrection(int adc, int layer, int wireID, double doca, double enta, double length, double costheta, double ring, double time, double &dedx) const
Perform a standard set of corrections.
DBObjPtr< CDCDedx2DCell > m_DB2DCell
2D correction DB object
bool m_nonlADC
boolean to apply non linear ADC
bool m_relative
boolean to apply relative or absolute correction
virtual ~CDCDedxCorrectionModule()
Destructor.
DBObjPtr< CDCDedxCosineCor > m_DBCosineCor
Electron saturation correction DB object.
StoreArray< CDCDedxTrack > m_cdcDedxTracks
Store array: CDCDedxTrack.
bool m_timeGain
boolean to apply injection time gains
void CosineEdgeCorrection(double costh, double &dedx) const
Perform the cosine edge correction.
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wire gain DB object.
void CosineCorrection(double costheta, double &dedx) const
Perform the cosine correction.
void WireGainCorrection(int wireID, double &dedx, int layer) const
Perform a wire gain correction.
CDCDedxCorrectionModule()
Constructor.
bool m_cosineCor
boolean to apply cosine correction
void RunGainCorrection(double &dedx) const
Perform a run gain correction.
double GetCorrection(int &adc, int layer, int wireID, double doca, double enta, double costheta, double ring, double time) const
Get the standard set of corrections.
double m_removeLowest
lower bound for truncated mean
DBObjPtr< CDCDedxInjectionTime > m_DBInjectTime
time gain/reso DB object
DBObjPtr< CDCDedxScaleFactor > m_DBScaleFactor
Scale factor to make electrons ~1.
void TimeGainCorrection(double &dedx, double ring, double time) const
Perform a injection time gain correction.
bool m_wireGain
boolean to apply wire gains
Class for accessing objects in the database.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.