CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
const EcalLiteDTUPedestalsMap * m_peds
adds noise to the given frame.
Definition: EcalCoder.h:12
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:8
virtual void analogToDigital(CLHEP::HepRandomEngine *, const EcalSamples &clf, EcalDataFrame_Ph2 &df) const
from EcalSamples to EcalDataFrame_Ph2
CorrelatedNoisifier< EcalCorrMatrix_Ph2 > Noisifier
CaloTSamples< float, ecalPh2::sampleSize > EcalSamples
double fullScaleEnergy(const DetId &did) const
limit on the energy scale due to the electronics range
void setIntercalibConstants(const EcalIntercalibConstantsMC *ical)
void encode(const EcalSamples &ecalSamples, EcalDataFrame_Ph2 &df, CLHEP::HepRandomEngine *) const
produce the pulse-shape
void findIntercalibConstant(const DetId &detId, double &icalconst) const
const Noisifier * m_ebCorrNoise[ecalPh2::NGAINS]
void findGains(const DetId &detId, float theGains[]) const
void setFullScaleEnergy(double EBscale)
void setGainRatios(float gainRatios)
const EcalIntercalibConstantsMC * m_intercals
Definition: DetId.h:17
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
virtual ~EcalLiteDTUCoder()
dtor
void findPedestal(const DetId &detId, int gainId, double &pedestal, double &width) const
const bool addNoise
void setPedestals(const EcalLiteDTUPedestalsMap *pedestals)
can be fetched every event from the EventSetup
EcalLiteDTUCoder(bool addNoise, bool PreMix1, Noisifier *ebCorrNoise0, Noisifier *ebCorrNoise1=nullptr)
ctor