11 #include <framework/core/Module.h>
12 #include <framework/gearbox/Const.h>
14 #include <reconstruction/dataobjects/CDCDedxTrack.h>
15 #include <reconstruction/dataobjects/CDCDedxLikelihood.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <mdst/dataobjects/MCParticle.h>
19 #include <tracking/dataobjects/RecoTrack.h>
21 #include <framework/datastore/StoreArray.h>
22 #include <framework/database/DBObjPtr.h>
24 #include <reconstruction/dbobjects/CDCDedxScaleFactor.h>
25 #include <reconstruction/dbobjects/CDCDedxWireGain.h>
26 #include <reconstruction/dbobjects/CDCDedxRunGain.h>
27 #include <reconstruction/dbobjects/CDCDedxCosineCor.h>
28 #include <reconstruction/dbobjects/CDCDedx2DCell.h>
29 #include <reconstruction/dbobjects/CDCDedx1DCell.h>
30 #include <reconstruction/dbobjects/CDCDedxADCNonLinearity.h>
31 #include <reconstruction/dbobjects/CDCDedxCosineEdge.h>
32 #include <reconstruction/dbobjects/CDCDedxMeanPars.h>
33 #include <reconstruction/dbobjects/CDCDedxSigmaPars.h>
34 #include <reconstruction/dbobjects/CDCDedxHadronCor.h>
35 #include <reconstruction/dbobjects/DedxPDFs.h>
79 virtual void event()
override;
98 double meanCurve(
double* x,
double* par,
int version)
const;
101 double getMean(
double bg)
const;
104 double sigmaCurve(
double* x,
double* par,
int version)
const;
107 double getSigma(
double dedx,
double nhit,
double sin)
const;
110 double I2D(
double cosTheta,
double I)
const;
113 double D2I(
double cosTheta,
double D)
const;
122 void calculateMeans(
double* mean,
double* truncatedMean,
double* truncatedMeanErr,
const std::vector<double>& dedx)
const;
Extract CDC dE/dx information from fitted tracks.
double I2D(double cosTheta, double I) const
hadron saturation parameterization part 1
double getSigma(double dedx, double nhit, double sin) const
calculate the predicted resolution using the parameterized resolution
double D2I(double cosTheta, double D) const
hadron saturation parameterization part 2
double getMean(double bg) const
calculate the predicted mean using the parameterized resolution
virtual ~CDCDedxPIDModule()
Destructor.
std::vector< double > m_hadronpars
hadron saturation parameters
DBObjPtr< CDCDedxRunGain > m_DBRunGain
Run gain DB object.
DBObjPtr< CDCDedxMeanPars > m_DBMeanPars
dE/dx mean parameters
virtual void initialize() override
Initialize the module.
DBObjPtr< CDCDedxHadronCor > m_DBHadronCor
hadron saturation parameters
virtual void event() override
This method is called for each event.
double m_removeHighest
Portion of highest dE/dx values that should be discarded for truncated mean.
StoreArray< CDCDedxLikelihood > m_dedxLikelihoods
Output array of CDCDedxLikelihoods.
DBObjPtr< CDCDedxCosineEdge > m_DBCosEdgeCor
non-lineary ACD correction DB object
StoreArray< MCParticle > m_mcparticles
Optional array of input MCParticles.
void saveLookupLogl(double(&logl)[Const::ChargedStable::c_SetSize], double p, double dedx)
for all particles, save log-likelihood values into 'logl'.
DBObjPtr< CDCDedxADCNonLinearity > m_DBNonlADC
non-lineary ACD correction DB object
DBObjPtr< CDCDedx1DCell > m_DB1DCell
1D correction DB object
void checkPDFs()
Check the pdfs for consistency everytime they change in the database.
virtual void terminate() override
End of the event processing.
double meanCurve(double *x, double *par, int version) const
parameterized beta-gamma curve for predicted means
std::vector< double > m_sigmapars
dE/dx resolution parameters
void calculateMeans(double *mean, double *truncatedMean, double *truncatedMeanErr, const std::vector< double > &dedx) const
Save arithmetic and truncated mean for the 'dedx' values.
DBObjPtr< CDCDedx2DCell > m_DB2DCell
2D correction DB object
double sigmaCurve(double *x, double *par, int version) const
parameterized resolution for predictions
DBObjPtr< CDCDedxCosineCor > m_DBCosineCor
Electron saturation correction DB object.
bool m_ignoreMissingParticles
Ignore particles for which no PDFs are found.
StoreArray< Track > m_tracks
Required array of input Tracks.
int m_nLayerWires[9]
number of wires per layer: needed for wire gain calibration
CDCDedxPIDModule()
Default constructor.
bool m_onlyPrimaryParticles
Only save data for primary particles (as determined by MC truth)
DBObjPtr< CDCDedxSigmaPars > m_DBSigmaPars
dE/dx resolution parameters
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wire gain DB object.
std::vector< double > m_meanpars
dE/dx mean parameters
bool m_backHalfCurlers
Whether to use the back half of curlers.
bool m_trackLevel
Whether to use track-level or hit-level MC.
StoreArray< RecoTrack > m_recoTracks
Required array of input RecoTracks.
bool m_useIndividualHits
Include PDF value for each hit in likelihood.
bool m_usePrediction
Whether to use parameterized means and resolutions or lookup tables.
double m_removeLowest
Portion of lowest dE/dx values that should be discarded for truncated mean.
StoreArray< CDCDedxTrack > m_dedxTracks
Output array of CDCDedxTracks.
bool m_enableDebugOutput
Whether to save information on tracks and associated hits and dE/dx values in DedxTrack objects.
DBObjPtr< CDCDedxScaleFactor > m_DBScaleFactor
Scale factor to make electrons ~1.
void saveChiValue(double(&chi)[Const::ChargedStable::c_SetSize], double(&predmean)[Const::ChargedStable::c_SetSize], double(&predres)[Const::ChargedStable::c_SetSize], double p, double dedx, double sin, int nhit) const
for all particles, save chi values into 'chi'.
DBObjPtr< DedxPDFs > m_DBDedxPDFs
DB object for dedx:momentum PDFs.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Class for accessing objects in the database.
Accessor to arrays stored in the data store.
Abstract base class for different kinds of events.