CMS 3D CMS Logo

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 #include <unordered_set>
10 
15 
17 
19 
21 
22 namespace hgc = hgc_digi;
23 
24 template <class DFr>
26  public:
27 
28  typedef DFr DigiType;
29 
31 
39  void run(std::unique_ptr<DColl> &digiColl, hgc::HGCSimHitDataAccumulator &simData,
40  const CaloSubdetectorGeometry* theGeom, const std::unordered_set<DetId>& validIds,
41  uint32_t digitizationType,CLHEP::HepRandomEngine* engine);
42 
46  float keV2fC() const { return keV2fC_; }
48  float tdcOnset() const { return myFEelectronics_->getTDCOnset(); }
49 
53  void runSimple(std::unique_ptr<DColl> &coll, hgc::HGCSimHitDataAccumulator &simData,
54  const CaloSubdetectorGeometry* theGeom, const std::unordered_set<DetId>& validIds,
55  CLHEP::HepRandomEngine* engine);
56 
60  void updateOutput(std::unique_ptr<DColl> &coll, const DFr& rawDataFrame);
61 
65  virtual void runDigitizer(std::unique_ptr<DColl> &coll, hgc::HGCSimHitDataAccumulator &simData,
66  const CaloSubdetectorGeometry* theGeom, const std::unordered_set<DetId>& validIds,
67  uint32_t digitizerType, CLHEP::HepRandomEngine* engine)
68  {
69  throw cms::Exception("HGCDigitizerBaseException") << " Failed to find specialization of runDigitizer";
70  }
71 
75  virtual ~HGCDigitizerBase()
76  { };
77 
78 
79 
80  protected:
81 
82  //baseline configuration
84 
85  //1keV in fC
86  float keV2fC_;
87 
88  //noise level
89  std::vector<float> noise_fC_;
90 
91  //charge collection efficiency
92  std::vector<double> cce_;
93 
94  //front-end electronics model
95  std::unique_ptr<HGCFEElectronics<DFr> > myFEelectronics_;
96 
97  //bunch time
98  double bxTime_;
99 
100  //if true will put both in time and out-of-time samples in the event
102 
103 };
104 
105 #endif
std::vector< float > noise_fC_
void runSimple(std::unique_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, CLHEP::HepRandomEngine *engine)
a trivial digitization: sum energies and digitize without noise
void updateOutput(std::unique_ptr< DColl > &coll, const DFr &rawDataFrame)
prepares the output according to the number of time samples to produce
virtual ~HGCDigitizerBase()
DTOR.
edm::ParameterSet myCfg_
std::unordered_map< uint32_t, HGCCellInfo > HGCSimHitDataAccumulator
edm::SortedCollection< DFr > DColl
float tdcOnset() const
void run(std::unique_ptr< DColl > &digiColl, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizationType, CLHEP::HepRandomEngine *engine)
steer digitization mode
std::unique_ptr< HGCFEElectronics< DFr > > myFEelectronics_
HGCDigitizerBase(const edm::ParameterSet &ps)
CTOR.
float keV2fC() const
getters
std::vector< double > cce_
JetCorrectorParametersCollection coll
Definition: classes.h:10
virtual void runDigitizer(std::unique_ptr< DColl > &coll, hgc::HGCSimHitDataAccumulator &simData, const CaloSubdetectorGeometry *theGeom, const std::unordered_set< DetId > &validIds, uint32_t digitizerType, CLHEP::HepRandomEngine *engine)
to be specialized by top class
models the behavior of the front-end electronics
bool toaModeByEnergy() const