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