CMS 3D CMS Logo

ESElectronicsSim.h
Go to the documentation of this file.
1 #ifndef EcalSimAlgos_ESElectronicsSim_h
2 #define EcalSimAlgos_ESElectronicsSim_h 1
3 
9 
10 #include <vector>
11 
12 namespace CLHEP {
13  class HepRandomEngine;
14 }
15 
17 public:
18  enum { MAXADC = 4095 };
19  enum { MINADC = 0 };
20 
21  ESElectronicsSim(bool addNoise);
22  virtual ~ESElectronicsSim();
23 
24  void setGain(const int gain) { gain_ = gain; }
25  void setPedestals(const ESPedestals* peds) { peds_ = peds; }
26  void setMIPs(const ESIntercalibConstants* mips) { mips_ = mips; }
27  void setMIPToGeV(const double MIPToGeV) { MIPToGeV_ = MIPToGeV; }
28 
29  virtual void analogToDigital(CLHEP::HepRandomEngine*, const CaloSamples& cs, ESDataFrame& df) const;
30  virtual void digitalToAnalog(const ESDataFrame& df, CaloSamples& cs) const;
31 
33  void newEvent(CLHEP::HepRandomEngine*) {}
34 
35 private:
36  bool addNoise_;
37  int gain_;
40  double MIPToGeV_;
41 
42  std::vector<ESSample> encode(const CaloSamples& timeframe, CLHEP::HepRandomEngine*) const;
43  double decode(const ESSample& sample, const DetId& detId) const;
44 };
45 
46 #endif
void setGain(const int gain)
const ESIntercalibConstants * mips_
void newEvent(CLHEP::HepRandomEngine *)
anything that needs to be done once per event
unique_ptr< ClusterSequence > cs
void setMIPs(const ESIntercalibConstants *mips)
void setMIPToGeV(const double MIPToGeV)
void setPedestals(const ESPedestals *peds)
bool decode(bool &, std::string const &)
Definition: types.cc:72
Definition: DetId.h:18
def encode(args, files)
static const char gain_[]
const ESPedestals * peds_