CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCDigitizerBase.h
Go to the documentation of this file.
1 #ifndef SimCalorimetry_HGCSimProducers_hgcdigitizerbase
2 #define SimCalorimetry_HGCSimProducers_hgcdigitizerbase
3 
4 #include <array>
5 #include <iostream>
6 #include <vector>
7 #include <memory>
8 #include <unordered_map>
9 
14 
16 
18 
19 namespace hgc = hgc_digi;
20 
21 template <class DFr>
23  public:
24 
26 
31  bxTime_ = ps.getParameter<double>("bxTime");
32  myCfg_ = ps.getParameter<edm::ParameterSet>("digiCfg");
33  doTimeSamples_ = myCfg_.getParameter< bool >("doTimeSamples");
34  if(myCfg_.exists("keV2fC")) keV2fC_ = myCfg_.getParameter<double>("keV2fC");
35  else keV2fC_ = 1.0;
36  if(myCfg_.exists("noise_fC")) noise_fC_ = myCfg_.getParameter<double>("noise_fC");
37  else noise_fC_ = 1.0;
38  edm::ParameterSet feCfg = myCfg_.getParameter<edm::ParameterSet>("feCfg");
39  myFEelectronics_ = std::unique_ptr<HGCFEElectronics<DFr> >( new HGCFEElectronics<DFr>(feCfg) );
40  }
41 
45  void run(std::auto_ptr<DColl> &digiColl, hgc::HGCSimHitDataAccumulator &simData, uint32_t digitizationType,CLHEP::HepRandomEngine* engine);
46 
50  float keV2fC() const { return keV2fC_; }
52  float tdcOnset() const { return myFEelectronics_->getTDCOnset(); }
53 
57  void runSimple(std::auto_ptr<DColl> &coll, hgc::HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine* engine);
58 
62  void updateOutput(std::auto_ptr<DColl> &coll, const DFr& rawDataFrame);
63 
67  virtual void runDigitizer(std::auto_ptr<DColl> &coll, hgc::HGCSimHitDataAccumulator &simData,uint32_t digitizerType, CLHEP::HepRandomEngine* engine)
68  {
69  throw cms::Exception("HGCDigitizerBaseException") << " Failed to find specialization of runDigitizer";
70  }
71 
76  { };
77 
78 
79 
80  protected:
81 
82  //baseline configuration
84 
85  //1keV in fC
86  float keV2fC_;
87 
88  //noise level
89  float noise_fC_;
90 
91  //front-end electronics model
92  std::unique_ptr<HGCFEElectronics<DFr> > myFEelectronics_;
93 
94  //bunch time
95  double bxTime_;
96 
97  //if true will put both in time and out-of-time samples in the event
99 
100 };
101 
102 #endif
T getParameter(std::string const &) const
virtual void runDigitizer(std::auto_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, uint32_t digitizerType, CLHEP::HepRandomEngine *engine)
to be specialized by top class
void runSimple(std::auto_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, CLHEP::HepRandomEngine *engine)
a trivial digitization: sum energies and digitize without noise
edm::ParameterSet myCfg_
edm::SortedCollection< DFr > DColl
float tdcOnset() const
std::unique_ptr< HGCFEElectronics< DFr > > myFEelectronics_
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
float keV2fC() const
getters
void updateOutput(std::auto_ptr< DColl > &coll, const DFr &rawDataFrame)
prepares the output according to the number of time samples to produce
JetCorrectorParametersCollection coll
Definition: classes.h:10
void run(std::auto_ptr< DColl > &digiColl, hgc::HGCSimHitDataAccumulator &simData, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
steer digitization mode
models the behavior of the front-end electronics
bool toaModeByEnergy() const
std::unordered_map< uint32_t, std::array< HGCSimHitData, 2 > > HGCSimHitDataAccumulator