CMS 3D CMS Logo

EcalLiteDTUCoder.h
Go to the documentation of this file.
1 #ifndef SimCalorimetry_EcalSimAlgos_EcalLiteDTUCoder_h
2 #define SimCalorimetry_EcalSimAlgos_EcalLiteDTUCoder_h
3 
10 
11 template <typename M>
13 class EcalLiteDTUSample;
14 class EcalDataFrame_Ph2;
15 class DetId;
16 class EcalLiteDTUPed;
17 
18 #include <vector>
19 
20 namespace CLHEP {
21  class HepRandomEngine;
22 }
23 
25 public:
27 
29 
31  EcalLiteDTUCoder(bool addNoise, bool PreMix1, Noisifier* ebCorrNoise0, Noisifier* ebCorrNoise1 = nullptr);
32 
34  virtual ~EcalLiteDTUCoder();
35 
37  void setPedestals(const EcalLiteDTUPedestalsMap* pedestals);
38 
39  void setGainRatios(float gainRatios);
40 
41  void setFullScaleEnergy(double EBscale);
42 
44 
46  virtual void analogToDigital(CLHEP::HepRandomEngine*, const EcalSamples& clf, EcalDataFrame_Ph2& df) const;
47 
48 private:
50  double fullScaleEnergy(const DetId& did) const;
51 
53  void encode(const EcalSamples& ecalSamples, EcalDataFrame_Ph2& df, CLHEP::HepRandomEngine*) const;
54 
55  void findPedestal(const DetId& detId, int gainId, double& pedestal, double& width) const;
56 
57  void findGains(const DetId& detId, float theGains[]) const;
58 
59  void findIntercalibConstant(const DetId& detId, double& icalconst) const;
60 
62 
63  float m_gainRatios; // the electronics gains
64 
65  const EcalIntercalibConstantsMC* m_intercals; //record specific for simulation of gain variation in MC
66 
67  double m_maxEneEB; // max attainable energy in the ecal barrel
68 
69  bool m_addNoise; // whether add noise to the pedestals and the gains
70  bool m_PreMix1; // Follow necessary steps for PreMixing input
71 
73 };
74 
75 #endif
EcalLiteDTUCoder::setFullScaleEnergy
void setFullScaleEnergy(double EBscale)
Definition: EcalLiteDTUCoder.cc:25
EcalIntercalibConstantsMC.h
ecalLiteDTU::gainId
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
Definition: EcalLiteDTUSample.h:14
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
EcalDataFrame_Ph2
Definition: EcalDataFrame_Ph2.h:12
EcalLiteDTUCoder::findIntercalibConstant
void findIntercalibConstant(const DetId &detId, double &icalconst) const
Definition: EcalLiteDTUCoder.cc:165
EcalLiteDTUCoder::fullScaleEnergy
double fullScaleEnergy(const DetId &did) const
limit on the energy scale due to the electronics range
Definition: EcalLiteDTUCoder.cc:33
EcalLiteDTUCoder::m_intercals
const EcalIntercalibConstantsMC * m_intercals
Definition: EcalLiteDTUCoder.h:65
EcalLiteDTUCoder::~EcalLiteDTUCoder
virtual ~EcalLiteDTUCoder()
dtor
Definition: EcalLiteDTUCoder.cc:23
EcalLiteDTUCoder::m_gainRatios
float m_gainRatios
Definition: EcalLiteDTUCoder.h:63
EcalLiteDTUCoder::m_PreMix1
bool m_PreMix1
Definition: EcalLiteDTUCoder.h:70
EcalLiteDTUCoder::analogToDigital
virtual void analogToDigital(CLHEP::HepRandomEngine *, const EcalSamples &clf, EcalDataFrame_Ph2 &df) const
from EcalSamples to EcalDataFrame_Ph2
Definition: EcalLiteDTUCoder.cc:35
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalLiteDTUCoder::findGains
void findGains(const DetId &detId, float theGains[]) const
EcalLiteDTUCoder::setPedestals
void setPedestals(const EcalLiteDTUPedestalsMap *pedestals)
can be fetched every event from the EventSetup
Definition: EcalLiteDTUCoder.cc:27
EcalLiteDTUCoder::findPedestal
void findPedestal(const DetId &detId, int gainId, double &pedestal, double &width) const
Definition: EcalLiteDTUCoder.cc:151
DetId
Definition: DetId.h:17
EcalLiteDTUCoder::m_addNoise
bool m_addNoise
Definition: EcalLiteDTUCoder.h:69
EcalLiteDTUPedestals.h
EcalLiteDTUCoder
Definition: EcalLiteDTUCoder.h:24
CaloTSamples
Definition: CaloTSamples.h:14
EcalLiteDTUCoder::EcalLiteDTUCoder
EcalLiteDTUCoder(bool addNoise, bool PreMix1, Noisifier *ebCorrNoise0, Noisifier *ebCorrNoise1=nullptr)
ctor
Definition: EcalLiteDTUCoder.cc:9
CLHEP
Definition: CocoaGlobals.h:27
CaloTSamples.h
EcalLiteDTUCoder::m_maxEneEB
double m_maxEneEB
Definition: EcalLiteDTUCoder.h:67
EcalLiteDTUSample
Definition: EcalLiteDTUSample.h:25
EcalConstants.h
EcalLiteDTUCoder::m_peds
const EcalLiteDTUPedestalsMap * m_peds
Definition: EcalLiteDTUCoder.h:61
EcalCATIAGainRatios.h
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
CorrelatedNoisifier
adds noise to the given frame.
Definition: EcalCoder.h:12
EcalLiteDTUCoder::setIntercalibConstants
void setIntercalibConstants(const EcalIntercalibConstantsMC *ical)
Definition: EcalLiteDTUCoder.cc:31
EcalLiteDTUCoder::Noisifier
CorrelatedNoisifier< EcalCorrMatrix_Ph2 > Noisifier
Definition: EcalLiteDTUCoder.h:28
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
EcalLiteDTUCoder::encode
void encode(const EcalSamples &ecalSamples, EcalDataFrame_Ph2 &df, CLHEP::HepRandomEngine *) const
produce the pulse-shape
Definition: EcalLiteDTUCoder.cc:42
EcalLiteDTUCoder::EcalSamples
CaloTSamples< float, ecalPh2::sampleSize > EcalSamples
Definition: EcalLiteDTUCoder.h:26
EcalLiteDTUCoder::setGainRatios
void setGainRatios(float gainRatios)
Definition: EcalLiteDTUCoder.cc:29
EcalLiteDTUCoder::m_ebCorrNoise
const Noisifier * m_ebCorrNoise[ecalPh2::NGAINS]
Definition: EcalLiteDTUCoder.h:72
ecalPh2::NGAINS
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:8
EcalCorrelatedNoiseMatrix.h