CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalDigitizer.h
Go to the documentation of this file.
1 #ifndef HcalSimProducers_HcalDigitizer_h
2 #define HcalSimProducers_HcalDigitizer_h
3 
26 
27 #include <vector>
28 
29 class CaloHitResponse;
31 class HcalAmplifier;
32 class HPDIonFeedbackSim;
33 class HcalCoderFactory;
34 class HcalElectronicsSim;
35 class HcalTimeSlewSim;
37 class HcalShapes;
39 class HcalTopology;
40 
41 namespace CLHEP {
42  class HepRandomEngine;
43 }
44 
46 public:
48  virtual ~HcalDigitizer();
49 
51  void initializeEvent(edm::Event const &e, edm::EventSetup const &c);
52  void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
53  void accumulate(PileUpEventPrincipal const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
54  void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *);
55 
62 
63 private:
64  void setup(const edm::EventSetup &es);
65  void accumulateCaloHits(edm::Handle<std::vector<PCaloHit>> const &hcalHits,
66  edm::Handle<std::vector<PCaloHit>> const &zdcHits,
67  int bunchCrossing,
68  CLHEP::HepRandomEngine *,
69  const HcalTopology *h);
70 
72  void fillFakeHits();
75  void checkGeometry(const edm::EventSetup &eventSetup);
89  void updateGeometry(const edm::EventSetup &eventSetup);
90 
91  void buildHOSiPMCells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
92  void buildHFQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
93  void buildHBHEQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
94 
95  // function to evaluate aging at the digi level
96  void darkening(std::vector<PCaloHit> &hcalHits);
97 
105 
108 
109  std::unique_ptr<CaloHitResponse> theHBHEResponse;
110  std::unique_ptr<HcalSiPMHitResponse> theHBHESiPMResponse;
111  std::unique_ptr<CaloHitResponse> theHOResponse;
112  std::unique_ptr<HcalSiPMHitResponse> theHOSiPMResponse;
113  std::unique_ptr<CaloHitResponse> theHFResponse;
114  std::unique_ptr<CaloHitResponse> theHFQIE10Response;
115  std::unique_ptr<CaloHitResponse> theZDCResponse;
116 
117  // we need separate amplifiers (and electronicssims)
118  // because they might have separate noise generators
119  std::unique_ptr<HcalAmplifier> theHBHEAmplifier;
120  std::unique_ptr<HcalAmplifier> theHFAmplifier;
121  std::unique_ptr<HcalAmplifier> theHOAmplifier;
122  std::unique_ptr<HcalAmplifier> theZDCAmplifier;
123  std::unique_ptr<HcalAmplifier> theHFQIE10Amplifier;
124  std::unique_ptr<HcalAmplifier> theHBHEQIE11Amplifier;
125 
126  std::unique_ptr<HPDIonFeedbackSim> theIonFeedback;
127  std::unique_ptr<HcalCoderFactory> theCoderFactory;
128 
129  std::unique_ptr<HcalElectronicsSim> theHBHEElectronicsSim;
130  std::unique_ptr<HcalElectronicsSim> theHFElectronicsSim;
131  std::unique_ptr<HcalElectronicsSim> theHOElectronicsSim;
132  std::unique_ptr<HcalElectronicsSim> theZDCElectronicsSim;
133  std::unique_ptr<HcalElectronicsSim> theHFQIE10ElectronicsSim;
134  std::unique_ptr<HcalElectronicsSim> theHBHEQIE11ElectronicsSim;
135 
143 
144  std::unique_ptr<HcalTimeSlewSim> theTimeSlewSim;
145 
146  std::unique_ptr<HBHEDigitizer> theHBHEDigitizer;
147  std::unique_ptr<HODigitizer> theHODigitizer;
148  std::unique_ptr<HODigitizer> theHOSiPMDigitizer;
149  std::unique_ptr<HFDigitizer> theHFDigitizer;
150  std::unique_ptr<ZDCDigitizer> theZDCDigitizer;
151  std::unique_ptr<QIE10Digitizer> theHFQIE10Digitizer;
152  std::unique_ptr<QIE11Digitizer> theHBHEQIE11Digitizer;
153  std::unique_ptr<HcalHitRelabeller> theRelabeller;
154 
155  // need to cache some DetIds for the digitizers,
156  // if they don't come straight from the geometry
157  std::vector<DetId> hbheCells;
159  std::vector<DetId> theHOHPDDetIds;
160  std::vector<DetId> theHOSiPMDetIds;
161  std::vector<DetId> theHFQIE8DetIds, theHFQIE10DetIds;
162 
166  bool killHE_;
167  bool debugCS_;
170 
172 
174 
179  std::unique_ptr<HFRecalibration> m_HFRecalibration;
180 
182 
183  std::vector<double> injectedHitsEnergy_;
184  std::vector<double> injectedHitsTime_;
185  std::vector<int> injectedHitsCells_;
186  std::vector<PCaloHit> injectedHits_;
187 };
188 
189 #endif
HFHitFilter theHFQIE10HitFilter
std::vector< DetId > theHFQIE10DetIds
std::vector< int > injectedHitsCells_
HBHEHitFilter theHBHEHitFilter
const edm::EventSetup & c
void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
CaloTDigitizer< HODigitizerTraits, CaloTDigitizerQIE8Run > HODigitizer
const HcalDDDRecConstants * theRecNumber
Definition: HcalDigitizer.h:88
std::unique_ptr< CaloHitResponse > theHFResponse
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > theRecNumberToken
Definition: HcalDigitizer.h:82
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
Definition: HcalDigitizer.h:99
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:81
std::unique_ptr< HODigitizer > theHODigitizer
std::unique_ptr< HcalAmplifier > theHFAmplifier
edm::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > m_HBDarkeningToken
Definition: HcalDigitizer.h:78
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
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:86
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::ESGetToken< HBHEDarkening, HBHEDarkeningRecord > m_HEDarkeningToken
Definition: HcalDigitizer.h:79
HcalSimParameterMap theParameterMap
std::unique_ptr< HcalElectronicsSim > theHBHEElectronicsSim
const edm::ESGetToken< HcalQIETypes, HcalQIETypesRcd > qieTypesToken_
Definition: HcalDigitizer.h:83
const edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
Definition: HcalDigitizer.h:77
std::unique_ptr< CaloHitResponse > theHOResponse
std::unique_ptr< HPDIonFeedbackSim > theIonFeedback
std::unique_ptr< HcalAmplifier > theZDCAmplifier
edm::ESWatcher< CaloGeometryRecord > theGeometryWatcher_
Definition: HcalDigitizer.h:85
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:87
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:84
const edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
Definition: HcalDigitizer.h:76
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:80