CMS 3D CMS Logo

HcalDigitizer.h
Go to the documentation of this file.
1 #ifndef HcalSimProducers_HcalDigitizer_h
2 #define HcalSimProducers_HcalDigitizer_h
3 
27 
28 #include <vector>
29 
30 class CaloHitResponse;
32 class HcalAmplifier;
33 class HPDIonFeedbackSim;
34 class HcalCoderFactory;
35 class HcalElectronicsSim;
36 class HcalTimeSlewSim;
38 class HcalShapes;
40 class HcalTopology;
41 class ZdcTopology;
42 
43 namespace CLHEP {
44  class HepRandomEngine;
45 }
46 
48 public:
50  virtual ~HcalDigitizer();
51 
53  void initializeEvent(edm::Event const &e, edm::EventSetup const &c);
54  void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
55  void accumulate(PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
56  void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
57 
64 
65 private:
66  void setup(const edm::EventSetup &es);
67  void accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const &hcalHits,
68  edm::Handle<std::vector<PCaloHit>> const &zdcHits,
69  int bunchCrossing,
70  CLHEP::HepRandomEngine *,
71  const HcalTopology *h,
72  const ZdcTopology *z);
73 
75  void fillFakeHits();
79 
81 
82  void buildHOSiPMCells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
83  void buildHFQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
84  void buildHBHEQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
85 
86  // function to evaluate aging at the digi level
87  void darkening(std::vector<PCaloHit> &hcalHits);
88 
101 
104 
112 
115 
116  std::unique_ptr<CaloHitResponse> theHBHEResponse;
117  std::unique_ptr<HcalSiPMHitResponse> theHBHESiPMResponse;
118  std::unique_ptr<CaloHitResponse> theHOResponse;
119  std::unique_ptr<HcalSiPMHitResponse> theHOSiPMResponse;
120  std::unique_ptr<CaloHitResponse> theHFResponse;
121  std::unique_ptr<CaloHitResponse> theHFQIE10Response;
122  std::unique_ptr<CaloHitResponse> theZDCResponse;
123 
124  // we need separate amplifiers (and electronicssims)
125  // because they might have separate noise generators
126  std::unique_ptr<HcalAmplifier> theHBHEAmplifier;
127  std::unique_ptr<HcalAmplifier> theHFAmplifier;
128  std::unique_ptr<HcalAmplifier> theHOAmplifier;
129  std::unique_ptr<HcalAmplifier> theZDCAmplifier;
130  std::unique_ptr<HcalAmplifier> theHFQIE10Amplifier;
131  std::unique_ptr<HcalAmplifier> theHBHEQIE11Amplifier;
132 
133  std::unique_ptr<HPDIonFeedbackSim> theIonFeedback;
134  std::unique_ptr<HcalCoderFactory> theCoderFactory;
135 
136  std::unique_ptr<HcalElectronicsSim> theHBHEElectronicsSim;
137  std::unique_ptr<HcalElectronicsSim> theHFElectronicsSim;
138  std::unique_ptr<HcalElectronicsSim> theHOElectronicsSim;
139  std::unique_ptr<HcalElectronicsSim> theZDCElectronicsSim;
140  std::unique_ptr<HcalElectronicsSim> theHFQIE10ElectronicsSim;
141  std::unique_ptr<HcalElectronicsSim> theHBHEQIE11ElectronicsSim;
142 
150 
151  std::unique_ptr<HcalTimeSlewSim> theTimeSlewSim;
152 
153  std::unique_ptr<HBHEDigitizer> theHBHEDigitizer;
154  std::unique_ptr<HODigitizer> theHODigitizer;
155  std::unique_ptr<HODigitizer> theHOSiPMDigitizer;
156  std::unique_ptr<HFDigitizer> theHFDigitizer;
157  std::unique_ptr<ZDCDigitizer> theZDCDigitizer;
158  std::unique_ptr<QIE10Digitizer> theHFQIE10Digitizer;
159  std::unique_ptr<QIE11Digitizer> theHBHEQIE11Digitizer;
160  std::unique_ptr<HcalHitRelabeller> theRelabeller;
161 
162  // need to cache some DetIds for the digitizers,
163  // if they don't come straight from the geometry
164  std::vector<DetId> hbheCells;
166  std::vector<DetId> theHOHPDDetIds;
167  std::vector<DetId> theHOSiPMDetIds;
168  std::vector<DetId> theHFQIE8DetIds, theHFQIE10DetIds;
169 
173  bool killHE_;
174  bool debugCS_;
177 
179 
181 
184 
189  std::unique_ptr<HFRecalibration> m_HFRecalibration;
190 
192 
193  std::vector<double> injectedHitsEnergy_;
194  std::vector<double> injectedHitsTime_;
195  std::vector<int> injectedHitsCells_;
196  std::vector<PCaloHit> injectedHits_;
197 };
198 
199 #endif
HFHitFilter theHFQIE10HitFilter
std::vector< DetId > theHFQIE10DetIds
std::vector< int > injectedHitsCells_
HBHEHitFilter theHBHEHitFilter
void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
CaloTDigitizer< HODigitizerTraits, CaloTDigitizerQIE8Run > HODigitizer
const HcalDDDRecConstants * theRecNumber
std::unique_ptr< CaloHitResponse > theHFResponse
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > theRecNumberToken
Definition: HcalDigitizer.h:96
std::unique_ptr< HcalTimeSlewSim > theTimeSlewSim
std::unique_ptr< HcalAmplifier > theHBHEAmplifier
virtual ~HcalDigitizer()
std::unique_ptr< HBHEDigitizer > theHBHEDigitizer
void buildHFQIECells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
HOHitFilter theHOHitFilter
std::unique_ptr< ZDCDigitizer > theZDCDigitizer
void darkening(std::vector< PCaloHit > &hcalHits)
std::unique_ptr< HcalHitRelabeller > theRelabeller
HFHitFilter theHFHitFilter
void checkGeometry(const edm::EventSetup &eventSetup)
CaloTDigitizer< HBHEDigitizerTraits, CaloTDigitizerQIE8Run > HBHEDigitizer
CaloTDigitizer< HFDigitizerTraits, CaloTDigitizerQIE8Run > HFDigitizer
void fillFakeHits()
some hits in each subdetector, just for testing purposes
std::unique_ptr< HFDigitizer > theHFDigitizer
void buildHBHEQIECells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theGeometryToken
Definition: HcalDigitizer.h:95
std::unique_ptr< HODigitizer > theHODigitizer
std::unique_ptr< HcalAmplifier > theHFAmplifier
edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > m_HBDarkeningToken
Definition: HcalDigitizer.h:92
std::unique_ptr< HcalCoderFactory > theCoderFactory
void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
std::unique_ptr< HcalElectronicsSim > theZDCElectronicsSim
std::unique_ptr< HFRecalibration > m_HFRecalibration
edm::EDGetTokenT< std::vector< PCaloHit > > zdcToken_
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
std::vector< double > injectedHitsEnergy_
void setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::unique_ptr< HcalElectronicsSim > theHFQIE10ElectronicsSim
const HBHEDarkening * m_HEDarkening
std::unique_ptr< HcalElectronicsSim > theHFElectronicsSim
edm::ESWatcher< HcalRecNumberingRecord > theRecNumberWatcher_
std::string hitsProducer_
double deliveredLumi
std::unique_ptr< HODigitizer > theHOSiPMDigitizer
Creates electronics signals from hits.
const HcalTimeSlew * hcalTimeSlew_delay_
void setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::unique_ptr< HcalAmplifier > theHBHEQIE11Amplifier
void buildHOSiPMCells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
ZDCHitFilter theZDCHitFilter
std::unique_ptr< HcalSiPMHitResponse > theHBHESiPMResponse
std::vector< double > injectedHitsTime_
HcalShapes theShapes
std::unique_ptr< CaloHitResponse > theHBHEResponse
std::vector< DetId > theHOHPDDetIds
edm::EDGetTokenT< std::vector< PCaloHit > > hcalToken_
edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > m_HEDarkeningToken
Definition: HcalDigitizer.h:93
HcalSimParameterMap theParameterMap
std::unique_ptr< HcalElectronicsSim > theHBHEElectronicsSim
const edm::ESGetToken< HcalQIETypes, HcalQIETypesRcd > qieTypesToken_
Definition: HcalDigitizer.h:97
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
Definition: HcalDigitizer.h:90
std::unique_ptr< CaloHitResponse > theHOResponse
std::unique_ptr< HPDIonFeedbackSim > theIonFeedback
std::unique_ptr< HcalAmplifier > theZDCAmplifier
edm::ESWatcher< CaloGeometryRecord > theGeometryWatcher_
Definition: HcalDigitizer.h:99
std::vector< DetId > theHFQIE8DetIds
CaloTDigitizer< HcalQIE11DigitizerTraits, CaloTDigitizerQIE1011Run > QIE11Digitizer
std::unique_ptr< QIE11Digitizer > theHBHEQIE11Digitizer
std::unique_ptr< QIE10Digitizer > theHFQIE10Digitizer
std::vector< DetId > theHOSiPMDetIds
HOHitFilter theHOSiPMHitFilter
std::unique_ptr< CaloHitResponse > theZDCResponse
const CaloGeometry * theGeometry
std::unique_ptr< HcalAmplifier > theHOAmplifier
std::unique_ptr< HcalSiPMHitResponse > theHOSiPMResponse
std::vector< DetId > hbheCells
const HBHEDarkening * m_HBDarkening
void accumulateCaloHits(edm::Handle< std::vector< PCaloHit >> const &hcalHits, edm::Handle< std::vector< PCaloHit >> const &zdcHits, int bunchCrossing, CLHEP::HepRandomEngine *, const HcalTopology *h, const ZdcTopology *z)
std::unique_ptr< HcalElectronicsSim > theHOElectronicsSim
HBHEHitFilter theHBHEQIE11HitFilter
void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< DetId > theHBHEQIE8DetIds
std::unique_ptr< CaloHitResponse > theHFQIE10Response
edm::ESGetToken< HcalMCParams, HcalMCParamsRcd > mcParamsToken_
Definition: HcalDigitizer.h:98
const edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
Definition: HcalDigitizer.h:89
std::unique_ptr< HcalAmplifier > theHFQIE10Amplifier
CaloTDigitizer< ZDCDigitizerTraits, CaloTDigitizerQIE8Run > ZDCDigitizer
std::unique_ptr< HcalElectronicsSim > theHBHEQIE11ElectronicsSim
void updateGeometry(const edm::EventSetup &eventSetup)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setup(const edm::EventSetup &es)
const edm::ESGetToken< ZdcTopology, HcalRecNumberingRecord > topoZToken_
Definition: HcalDigitizer.h:91
std::vector< DetId > theHBHEQIE11DetIds
CaloTDigitizer< HcalQIE10DigitizerTraits, CaloTDigitizerQIE1011Run > QIE10Digitizer
std::vector< PCaloHit > injectedHits_
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
void setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
HcalDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)
const edm::ESGetToken< HcalTimeSlew, HcalTimeSlewRecord > hcalTimeSlew_delay_token_
Definition: HcalDigitizer.h:94