CMS 3D CMS Logo

HcalDigitizer.h
Go to the documentation of this file.
1 #ifndef HcalSimProducers_HcalDigitizer_h
2 #define HcalSimProducers_HcalDigitizer_h
3 
23 
24 #include <vector>
25 
26 class CaloHitResponse;
28 class HcalAmplifier;
29 class HPDIonFeedbackSim;
30 class HcalCoderFactory;
31 class HcalElectronicsSim;
32 class HcalTimeSlewSim;
34 class HcalShapes;
36 class HcalTopology;
37 
38 namespace edm {
39  class ConsumesCollector;
40 }
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 
57  void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
58  void setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
59  void setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
60  void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
61  void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
62  void setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator);
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();
76  void checkGeometry(const edm::EventSetup &eventSetup);
81  void updateGeometry(const edm::EventSetup &eventSetup);
82 
83  void buildHOSiPMCells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
84  void buildHFQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
85  void buildHBHEQIECells(const std::vector<DetId> &allCells, const edm::EventSetup &eventSetup);
86 
87  // function to evaluate aging at the digi level
88  void darkening(std::vector<PCaloHit> &hcalHits);
89 
97 
100 
101  std::unique_ptr<CaloHitResponse> theHBHEResponse;
102  std::unique_ptr<HcalSiPMHitResponse> theHBHESiPMResponse;
103  std::unique_ptr<CaloHitResponse> theHOResponse;
104  std::unique_ptr<HcalSiPMHitResponse> theHOSiPMResponse;
105  std::unique_ptr<CaloHitResponse> theHFResponse;
106  std::unique_ptr<CaloHitResponse> theHFQIE10Response;
107  std::unique_ptr<CaloHitResponse> theZDCResponse;
108 
109  // we need separate amplifiers (and electronicssims)
110  // because they might have separate noise generators
111  std::unique_ptr<HcalAmplifier> theHBHEAmplifier;
112  std::unique_ptr<HcalAmplifier> theHFAmplifier;
113  std::unique_ptr<HcalAmplifier> theHOAmplifier;
114  std::unique_ptr<HcalAmplifier> theZDCAmplifier;
115  std::unique_ptr<HcalAmplifier> theHFQIE10Amplifier;
116  std::unique_ptr<HcalAmplifier> theHBHEQIE11Amplifier;
117 
118  std::unique_ptr<HPDIonFeedbackSim> theIonFeedback;
119  std::unique_ptr<HcalCoderFactory> theCoderFactory;
120 
121  std::unique_ptr<HcalElectronicsSim> theHBHEElectronicsSim;
122  std::unique_ptr<HcalElectronicsSim> theHFElectronicsSim;
123  std::unique_ptr<HcalElectronicsSim> theHOElectronicsSim;
124  std::unique_ptr<HcalElectronicsSim> theZDCElectronicsSim;
125  std::unique_ptr<HcalElectronicsSim> theHFQIE10ElectronicsSim;
126  std::unique_ptr<HcalElectronicsSim> theHBHEQIE11ElectronicsSim;
127 
135 
136  std::unique_ptr<HcalTimeSlewSim> theTimeSlewSim;
137 
138  std::unique_ptr<HBHEDigitizer> theHBHEDigitizer;
139  std::unique_ptr<HODigitizer> theHODigitizer;
140  std::unique_ptr<HODigitizer> theHOSiPMDigitizer;
141  std::unique_ptr<HFDigitizer> theHFDigitizer;
142  std::unique_ptr<ZDCDigitizer> theZDCDigitizer;
143  std::unique_ptr<QIE10Digitizer> theHFQIE10Digitizer;
144  std::unique_ptr<QIE11Digitizer> theHBHEQIE11Digitizer;
145  std::unique_ptr<HcalHitRelabeller> theRelabeller;
146 
147  // need to cache some DetIds for the digitizers,
148  // if they don't come straight from the geometry
149  std::vector<DetId> hbheCells;
150  std::vector<DetId> theHBHEQIE8DetIds, theHBHEQIE11DetIds;
151  std::vector<DetId> theHOHPDDetIds;
152  std::vector<DetId> theHOSiPMDetIds;
153  std::vector<DetId> theHFQIE8DetIds, theHFQIE10DetIds;
154 
155  bool isZDC, isHCAL, zdcgeo, hbhegeo, hogeo, hfgeo;
158  bool killHE_;
159  bool debugCS_;
162 
164 
166 
168  bool agingFlagHB, agingFlagHE;
171  std::unique_ptr<HFRecalibration> m_HFRecalibration;
172 
174 
175  std::vector<double> injectedHitsEnergy_;
176  std::vector<double> injectedHitsTime_;
177  std::vector<int> injectedHitsCells_;
178  std::vector<PCaloHit> injectedHits_;
179 };
180 
181 #endif
HFHitFilter theHFQIE10HitFilter
std::vector< int > injectedHitsCells_
HBHEHitFilter theHBHEHitFilter
CaloTDigitizer< HODigitizerTraits, CaloTDigitizerQIE8Run > HODigitizer
Definition: HcalDigitizer.h:92
const HcalDDDRecConstants * theRecNumber
Definition: HcalDigitizer.h:80
std::unique_ptr< CaloHitResponse > theHFResponse
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::unique_ptr< HcalTimeSlewSim > theTimeSlewSim
std::unique_ptr< HcalAmplifier > theHBHEAmplifier
std::unique_ptr< HBHEDigitizer > theHBHEDigitizer
HOHitFilter theHOHitFilter
std::unique_ptr< ZDCDigitizer > theZDCDigitizer
std::unique_ptr< HcalHitRelabeller > theRelabeller
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
HFHitFilter theHFHitFilter
CaloTDigitizer< HBHEDigitizerTraits, CaloTDigitizerQIE8Run > HBHEDigitizer
Definition: HcalDigitizer.h:91
CaloTDigitizer< HFDigitizerTraits, CaloTDigitizerQIE8Run > HFDigitizer
Definition: HcalDigitizer.h:93
std::unique_ptr< HFDigitizer > theHFDigitizer
std::unique_ptr< HODigitizer > theHODigitizer
std::unique_ptr< HcalAmplifier > theHFAmplifier
std::unique_ptr< HcalCoderFactory > theCoderFactory
std::unique_ptr< HcalElectronicsSim > theZDCElectronicsSim
std::unique_ptr< HFRecalibration > m_HFRecalibration
std::vector< double > injectedHitsEnergy_
std::unique_ptr< HcalElectronicsSim > theHFQIE10ElectronicsSim
const HBHEDarkening * m_HEDarkening
std::unique_ptr< HcalElectronicsSim > theHFElectronicsSim
edm::ESWatcher< HcalRecNumberingRecord > theRecNumberWatcher_
Definition: HcalDigitizer.h:78
std::string hitsProducer_
double deliveredLumi
std::unique_ptr< HODigitizer > theHOSiPMDigitizer
Creates electronics signals from hits.
const HcalTimeSlew * hcalTimeSlew_delay_
std::unique_ptr< HcalAmplifier > theHBHEQIE11Amplifier
ZDCHitFilter theZDCHitFilter
std::unique_ptr< HcalSiPMHitResponse > theHBHESiPMResponse
std::vector< double > injectedHitsTime_
HcalShapes theShapes
Definition: HcalDigitizer.h:99
std::unique_ptr< CaloHitResponse > theHBHEResponse
std::vector< DetId > theHOHPDDetIds
HcalSimParameterMap theParameterMap
Definition: HcalDigitizer.h:98
std::unique_ptr< HcalElectronicsSim > theHBHEElectronicsSim
std::unique_ptr< CaloHitResponse > theHOResponse
std::unique_ptr< HPDIonFeedbackSim > theIonFeedback
std::unique_ptr< HcalAmplifier > theZDCAmplifier
edm::ESWatcher< CaloGeometryRecord > theGeometryWatcher_
Definition: HcalDigitizer.h:77
std::vector< DetId > theHFQIE8DetIds
CaloTDigitizer< HcalQIE11DigitizerTraits, CaloTDigitizerQIE1011Run > QIE11Digitizer
Definition: HcalDigitizer.h:96
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:79
std::unique_ptr< HcalAmplifier > theHOAmplifier
std::unique_ptr< HcalSiPMHitResponse > theHOSiPMResponse
std::vector< DetId > hbheCells
const HBHEDarkening * m_HBDarkening
HLT enums.
std::unique_ptr< HcalElectronicsSim > theHOElectronicsSim
HBHEHitFilter theHBHEQIE11HitFilter
std::vector< DetId > theHBHEQIE8DetIds
std::unique_ptr< CaloHitResponse > theHFQIE10Response
std::unique_ptr< HcalAmplifier > theHFQIE10Amplifier
CaloTDigitizer< ZDCDigitizerTraits, CaloTDigitizerQIE8Run > ZDCDigitizer
Definition: HcalDigitizer.h:94
std::unique_ptr< HcalElectronicsSim > theHBHEQIE11ElectronicsSim
bool checkGeometry(bool=true)
CaloTDigitizer< HcalQIE10DigitizerTraits, CaloTDigitizerQIE1011Run > QIE10Digitizer
Definition: HcalDigitizer.h:95
std::vector< PCaloHit > injectedHits_