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 
42 namespace CLHEP {
43  class HepRandomEngine;
44 }
45 
47 public:
49  virtual ~HcalDigitizer();
50 
52  void initializeEvent(edm::Event const &e, edm::EventSetup const &c);
53  void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
54  void accumulate(PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
55  void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
56 
63 
64 private:
65  void setup(const edm::EventSetup &es);
66  void accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const &hcalHits,
67  edm::Handle<std::vector<PCaloHit>> const &zdcHits,
68  int bunchCrossing,
69  CLHEP::HepRandomEngine *,
70  const HcalTopology *h);
71 
73  void fillFakeHits();
77 
79 
80  void buildHOSiPMCells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
81  void buildHFQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
82  void buildHBHEQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
83 
84  // function to evaluate aging at the digi level
85  void darkening(std::vector<PCaloHit> &hcalHits);
86 
98 
101 
109 
112 
113  std::unique_ptr<CaloHitResponse> theHBHEResponse;
114  std::unique_ptr<HcalSiPMHitResponse> theHBHESiPMResponse;
115  std::unique_ptr<CaloHitResponse> theHOResponse;
116  std::unique_ptr<HcalSiPMHitResponse> theHOSiPMResponse;
117  std::unique_ptr<CaloHitResponse> theHFResponse;
118  std::unique_ptr<CaloHitResponse> theHFQIE10Response;
119  std::unique_ptr<CaloHitResponse> theZDCResponse;
120 
121  // we need separate amplifiers (and electronicssims)
122  // because they might have separate noise generators
123  std::unique_ptr<HcalAmplifier> theHBHEAmplifier;
124  std::unique_ptr<HcalAmplifier> theHFAmplifier;
125  std::unique_ptr<HcalAmplifier> theHOAmplifier;
126  std::unique_ptr<HcalAmplifier> theZDCAmplifier;
127  std::unique_ptr<HcalAmplifier> theHFQIE10Amplifier;
128  std::unique_ptr<HcalAmplifier> theHBHEQIE11Amplifier;
129 
130  std::unique_ptr<HPDIonFeedbackSim> theIonFeedback;
131  std::unique_ptr<HcalCoderFactory> theCoderFactory;
132 
133  std::unique_ptr<HcalElectronicsSim> theHBHEElectronicsSim;
134  std::unique_ptr<HcalElectronicsSim> theHFElectronicsSim;
135  std::unique_ptr<HcalElectronicsSim> theHOElectronicsSim;
136  std::unique_ptr<HcalElectronicsSim> theZDCElectronicsSim;
137  std::unique_ptr<HcalElectronicsSim> theHFQIE10ElectronicsSim;
138  std::unique_ptr<HcalElectronicsSim> theHBHEQIE11ElectronicsSim;
139 
147 
148  std::unique_ptr<HcalTimeSlewSim> theTimeSlewSim;
149 
150  std::unique_ptr<HBHEDigitizer> theHBHEDigitizer;
151  std::unique_ptr<HODigitizer> theHODigitizer;
152  std::unique_ptr<HODigitizer> theHOSiPMDigitizer;
153  std::unique_ptr<HFDigitizer> theHFDigitizer;
154  std::unique_ptr<ZDCDigitizer> theZDCDigitizer;
155  std::unique_ptr<QIE10Digitizer> theHFQIE10Digitizer;
156  std::unique_ptr<QIE11Digitizer> theHBHEQIE11Digitizer;
157  std::unique_ptr<HcalHitRelabeller> theRelabeller;
158 
159  // need to cache some DetIds for the digitizers,
160  // if they don't come straight from the geometry
161  std::vector<DetId> hbheCells;
163  std::vector<DetId> theHOHPDDetIds;
164  std::vector<DetId> theHOSiPMDetIds;
165  std::vector<DetId> theHFQIE8DetIds, theHFQIE10DetIds;
166 
170  bool killHE_;
171  bool debugCS_;
174 
176 
178 
181 
186  std::unique_ptr<HFRecalibration> m_HFRecalibration;
187 
189 
190  std::vector<double> injectedHitsEnergy_;
191  std::vector<double> injectedHitsTime_;
192  std::vector<int> injectedHitsCells_;
193  std::vector<PCaloHit> injectedHits_;
194 };
195 
196 #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:93
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:92
std::unique_ptr< HODigitizer > theHODigitizer
std::unique_ptr< HcalAmplifier > theHFAmplifier
edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > m_HBDarkeningToken
Definition: HcalDigitizer.h:89
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_
Definition: HcalDigitizer.h:97
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:90
HcalSimParameterMap theParameterMap
std::unique_ptr< HcalElectronicsSim > theHBHEElectronicsSim
const edm::ESGetToken< HcalQIETypes, HcalQIETypesRcd > qieTypesToken_
Definition: HcalDigitizer.h:94
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
Definition: HcalDigitizer.h:88
std::unique_ptr< CaloHitResponse > theHOResponse
std::unique_ptr< HPDIonFeedbackSim > theIonFeedback
std::unique_ptr< HcalAmplifier > theZDCAmplifier
edm::ESWatcher< CaloGeometryRecord > theGeometryWatcher_
Definition: HcalDigitizer.h:96
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
Definition: HcalDigitizer.h:99
std::unique_ptr< HcalAmplifier > theHOAmplifier
std::unique_ptr< HcalSiPMHitResponse > theHOSiPMResponse
std::vector< DetId > hbheCells
const HBHEDarkening * m_HBDarkening
std::unique_ptr< HcalElectronicsSim > theHOElectronicsSim
HBHEHitFilter theHBHEQIE11HitFilter
void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< DetId > theHBHEQIE8DetIds
std::unique_ptr< CaloHitResponse > theHFQIE10Response
void accumulateCaloHits(edm::Handle< std::vector< PCaloHit >> const &hcalHits, edm::Handle< std::vector< PCaloHit >> const &zdcHits, int bunchCrossing, CLHEP::HepRandomEngine *, const HcalTopology *h)
edm::ESGetToken< HcalMCParams, HcalMCParamsRcd > mcParamsToken_
Definition: HcalDigitizer.h:95
const edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
Definition: HcalDigitizer.h:87
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)
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:91