59 m_APDShape ( params.getParameter<double>(
"apdShapeTstart" ) ,
60 params.getParameter<double>(
"apdShapeTau" ) ) ,
64 m_EBdigiCollection ( params.getParameter<std::
string>(
"EBdigiCollection") ) ,
65 m_EEdigiCollection ( params.getParameter<std::
string>(
"EEdigiCollection") ) ,
66 m_ESdigiCollection ( params.getParameter<std::
string>(
"ESdigiCollection") ) ,
67 m_hitsProducerTag ( params.getParameter<std::
string>(
"hitsProducer" ) ) ,
68 m_useLCcorrection ( params.getUntrackedParameter<bool>(
"UseLCcorrection") ) ,
69 m_apdSeparateDigi ( params.getParameter<bool> (
"apdSeparateDigi") ) ,
71 m_EBs25notCont ( params.getParameter<double> (
"EBs25notContainment") ) ,
72 m_EEs25notCont ( params.getParameter<double> (
"EEs25notContainment") ) ,
74 m_readoutFrameSize ( params.getParameter<int> (
"readoutFrameSize") ) ,
76 params.getParameter<double> (
"simHitToPhotoelectronsBarrel") ,
77 params.getParameter<double> (
"simHitToPhotoelectronsEndcap") ,
78 params.getParameter<double> (
"photoelectronsToAnalogBarrel") ,
79 params.getParameter<double> (
"photoelectronsToAnalogEndcap") ,
80 params.getParameter<double> (
"samplingFactor") ,
81 params.getParameter<double> (
"timePhase") ,
83 params.getParameter<int> (
"binOfMaximum") ,
84 params.getParameter<bool> (
"doPhotostatistics") ,
85 params.getParameter<bool> (
"syncPhase") ) ) ,
87 m_apdDigiTag ( params.getParameter<std::
string> (
"apdDigiTag" ) ) ,
89 params.getParameter<bool> (
"apdAddToBarrel" ) ,
91 params.getParameter<double> (
"apdSimToPELow" ) ,
92 params.getParameter<double> (
"apdSimToPEHigh" ) ,
93 params.getParameter<double> (
"apdTimeOffset" ) ,
94 params.getParameter<double> (
"apdTimeOffWidth" ) ,
95 params.getParameter<bool> (
"apdDoPEStats" ) ,
97 params.getParameter<std::vector<double> > (
"apdNonlParms" ) ) ) ,
99 m_APDResponse ( !m_apdSeparateDigi ? 0 :
114 m_ESResponse ( new
ESHitResponse( m_ParameterMap, &m_ESShape ) ) ,
115 m_ESOldResponse ( new
CaloHitResponse( m_ParameterMap, &m_ESShape ) ) ,
117 m_addESNoise ( params.getParameter<bool> (
"doESNoise") ) ,
118 m_PreMix1 ( params.getParameter<bool> (
"EcalPreMixStage1") ) ,
119 m_PreMix2 ( params.getParameter<bool> (
"EcalPreMixStage2") ) ,
121 m_doFastES ( params.getParameter<bool> (
"doFast" ) ) ,
123 m_ESElectronicsSim ( m_doFastES ? 0 :
126 m_ESOldDigitizer ( m_doFastES ? 0 :
131 m_ESElectronicsSimFast ( !m_doFastES ? 0 :
135 m_ESDigitizer ( !m_doFastES ? 0 :
137 m_ESElectronicsSimFast ,
140 m_APDDigitizer ( 0 ) ,
141 m_BarrelDigitizer ( 0 ) ,
142 m_EndcapDigitizer ( 0 ) ,
143 m_ElectronicsSim ( 0 ) ,
145 m_APDElectronicsSim ( 0 ) ,
159 const std::vector<double> ebCorMatG12 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG12");
160 const std::vector<double> eeCorMatG12 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG12");
161 const std::vector<double> ebCorMatG06 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG06");
162 const std::vector<double> eeCorMatG06 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG06");
163 const std::vector<double> ebCorMatG01 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG01");
164 const std::vector<double> eeCorMatG01 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG01");
166 const bool applyConstantTerm = params.
getParameter<
bool> (
"applyConstantTerm");
167 const double rmsConstantTerm = params.
getParameter<
double> (
"ConstantTerm");
169 const bool addNoise = params.
getParameter<
bool> (
"doENoise");
170 const bool cosmicsPhase = params.
getParameter<
bool> (
"cosmicsPhase");
171 const double cosmicsShift = params.
getParameter<
double> (
"cosmicsShift");
192 assert( 1.
e-7 > fabs( ebCorMatG12[0] - 1.0 ) ) ;
193 assert( 1.
e-7 > fabs( ebCorMatG06[0] - 1.0 ) ) ;
194 assert( 1.
e-7 > fabs( ebCorMatG01[0] - 1.0 ) ) ;
195 assert( 1.
e-7 > fabs( eeCorMatG12[0] - 1.0 ) ) ;
196 assert( 1.
e-7 > fabs( eeCorMatG06[0] - 1.0 ) ) ;
197 assert( 1.
e-7 > fabs( eeCorMatG01[0] - 1.0 ) ) ;
201 assert( 0 == row || 1. >= ebCorMatG12[row] ) ;
202 assert( 0 == row || 1. >= ebCorMatG06[row] ) ;
203 assert( 0 == row || 1. >= ebCorMatG01[row] ) ;
204 assert( 0 == row || 1. >= eeCorMatG12[row] ) ;
205 assert( 0 == row || 1. >= eeCorMatG06[row] ) ;
206 assert( 0 == row || 1. >= eeCorMatG01[row] ) ;
210 ebMatrix[0]( row,
column ) = ebCorMatG12[ index ] ;
211 eeMatrix[0]( row,
column ) = eeCorMatG12[ index ] ;
212 ebMatrix[1]( row,
column ) = ebCorMatG06[ index ] ;
213 eeMatrix[1]( row,
column ) = eeCorMatG06[ index ] ;
214 ebMatrix[2]( row,
column ) = ebCorMatG01[ index ] ;
215 eeMatrix[2]( row,
column ) = eeCorMatG01[ index ] ;
273 m_APDShape ( params.getParameter<double>(
"apdShapeTstart" ) ,
274 params.getParameter<double>(
"apdShapeTau" ) ) ,
278 m_EBdigiCollection ( params.getParameter<std::
string>(
"EBdigiCollection") ) ,
279 m_EEdigiCollection ( params.getParameter<std::
string>(
"EEdigiCollection") ) ,
280 m_ESdigiCollection ( params.getParameter<std::
string>(
"ESdigiCollection") ) ,
281 m_hitsProducerTag ( params.getParameter<std::
string>(
"hitsProducer" ) ) ,
282 m_useLCcorrection ( params.getUntrackedParameter<bool>(
"UseLCcorrection") ) ,
283 m_apdSeparateDigi ( params.getParameter<bool> (
"apdSeparateDigi") ) ,
285 m_EBs25notCont ( params.getParameter<double> (
"EBs25notContainment") ) ,
286 m_EEs25notCont ( params.getParameter<double> (
"EEs25notContainment") ) ,
288 m_readoutFrameSize ( params.getParameter<int> (
"readoutFrameSize") ) ,
290 params.getParameter<double> (
"simHitToPhotoelectronsBarrel") ,
291 params.getParameter<double> (
"simHitToPhotoelectronsEndcap") ,
292 params.getParameter<double> (
"photoelectronsToAnalogBarrel") ,
293 params.getParameter<double> (
"photoelectronsToAnalogEndcap") ,
294 params.getParameter<double> (
"samplingFactor") ,
295 params.getParameter<double> (
"timePhase") ,
297 params.getParameter<int> (
"binOfMaximum") ,
298 params.getParameter<bool> (
"doPhotostatistics") ,
299 params.getParameter<bool> (
"syncPhase") ) ) ,
301 m_apdDigiTag ( params.getParameter<std::
string> (
"apdDigiTag" ) ) ,
303 params.getParameter<bool> (
"apdAddToBarrel" ) ,
305 params.getParameter<double> (
"apdSimToPELow" ) ,
306 params.getParameter<double> (
"apdSimToPEHigh" ) ,
307 params.getParameter<double> (
"apdTimeOffset" ) ,
308 params.getParameter<double> (
"apdTimeOffWidth" ) ,
309 params.getParameter<bool> (
"apdDoPEStats" ) ,
311 params.getParameter<std::vector<double> > (
"apdNonlParms" ) ) ) ,
313 m_APDResponse ( !m_apdSeparateDigi ? 0 :
328 m_ESResponse ( new
ESHitResponse( m_ParameterMap, &m_ESShape ) ) ,
329 m_ESOldResponse ( new
CaloHitResponse( m_ParameterMap, &m_ESShape ) ) ,
331 m_addESNoise ( params.getParameter<bool> (
"doESNoise") ) ,
332 m_PreMix1 ( params.getParameter<bool> (
"EcalPreMixStage1") ) ,
333 m_PreMix2 ( params.getParameter<bool> (
"EcalPreMixStage2") ) ,
335 m_doFastES ( params.getParameter<bool> (
"doFast" ) ) ,
337 m_ESElectronicsSim ( m_doFastES ? 0 :
340 m_ESOldDigitizer ( m_doFastES ? 0 :
345 m_ESElectronicsSimFast ( !m_doFastES ? 0 :
349 m_ESDigitizer ( !m_doFastES ? 0 :
351 m_ESElectronicsSimFast ,
354 m_APDDigitizer ( 0 ) ,
355 m_BarrelDigitizer ( 0 ) ,
356 m_EndcapDigitizer ( 0 ) ,
357 m_ElectronicsSim ( 0 ) ,
359 m_APDElectronicsSim ( 0 ) ,
374 const std::vector<double> ebCorMatG12 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG12");
375 const std::vector<double> eeCorMatG12 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG12");
376 const std::vector<double> ebCorMatG06 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG06");
377 const std::vector<double> eeCorMatG06 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG06");
378 const std::vector<double> ebCorMatG01 = params.
getParameter< std::vector<double> >(
"EBCorrNoiseMatrixG01");
379 const std::vector<double> eeCorMatG01 = params.
getParameter< std::vector<double> >(
"EECorrNoiseMatrixG01");
381 const bool applyConstantTerm = params.
getParameter<
bool> (
"applyConstantTerm");
382 const double rmsConstantTerm = params.
getParameter<
double> (
"ConstantTerm");
384 const bool addNoise = params.
getParameter<
bool> (
"doENoise");
385 const bool cosmicsPhase = params.
getParameter<
bool> (
"cosmicsPhase");
386 const double cosmicsShift = params.
getParameter<
double> (
"cosmicsShift");
407 assert( 1.
e-7 > fabs( ebCorMatG12[0] - 1.0 ) ) ;
408 assert( 1.
e-7 > fabs( ebCorMatG06[0] - 1.0 ) ) ;
409 assert( 1.
e-7 > fabs( ebCorMatG01[0] - 1.0 ) ) ;
410 assert( 1.
e-7 > fabs( eeCorMatG12[0] - 1.0 ) ) ;
411 assert( 1.
e-7 > fabs( eeCorMatG06[0] - 1.0 ) ) ;
412 assert( 1.
e-7 > fabs( eeCorMatG01[0] - 1.0 ) ) ;
416 assert( 0 == row || 1. >= ebCorMatG12[row] ) ;
417 assert( 0 == row || 1. >= ebCorMatG06[row] ) ;
418 assert( 0 == row || 1. >= ebCorMatG01[row] ) ;
419 assert( 0 == row || 1. >= eeCorMatG12[row] ) ;
420 assert( 0 == row || 1. >= eeCorMatG06[row] ) ;
421 assert( 0 == row || 1. >= eeCorMatG01[row] ) ;
425 ebMatrix[0]( row,
column ) = ebCorMatG12[ index ] ;
426 eeMatrix[0]( row,
column ) = eeCorMatG12[ index ] ;
427 ebMatrix[1]( row,
column ) = ebCorMatG06[ index ] ;
428 eeMatrix[1]( row,
column ) = eeCorMatG06[ index ] ;
429 ebMatrix[2]( row,
column ) = ebCorMatG01[ index ] ;
430 eeMatrix[2]( row,
column ) = eeCorMatG01[ index ] ;
605 edm::LogInfo(
"DigiInfo") <<
"EB Digis: " << barrelResult->size() ;
609 edm::LogInfo(
"DigiInfo") <<
"APD Digis: " << apdResult->size() ;
613 edm::LogInfo(
"EcalDigi") <<
"EE Digis: " << endcapResult->size() ;
621 edm::LogInfo(
"EcalDigi") <<
"ES Digis: " << preshowerResult->size();
640 "RandomNumberGenerator service is not available.\n"
641 "You must add the service in the configuration file\n"
642 "or remove the module that requires it.";
703 theGains[1] = theGains[2]*(defaultRatios->
gain12Over6()) ;
705 LogDebug(
"EcalDigi") <<
" Gains: " <<
"\n" <<
" g1 = " << theGains[1]
706 <<
"\n" <<
" g2 = " << theGains[2]
707 <<
"\n" <<
" g3 = " << theGains[3] ;
709 delete defaultRatios;
711 const double EBscale (
716 <<
"\n" <<
" saturation for EB = " << EBscale
719 const double EEscale (
724 <<
"\n" <<
" saturation for EB = " << EEscale
750 const int ESGain ( 1.1 > esgain->getESGain() ? 1 : 2 ) ;
751 const double ESMIPToGeV ( ( 1 ==
ESGain ) ?
752 esMipToGeV->getESValueLow() :
753 esMipToGeV->getESValueHigh() ) ;
803 const std::vector<DetId>* theESDets (
EEDigitizer * m_EndcapDigitizer
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c)
int bunchCrossing() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *)
void setMIPToGeV(double MIPToGeV)
CaloHitResponse * m_ESOldResponse
void setGain(const int gain)
virtual ~EcalDigiProducer()
EcalTDigitizer< EEDigitizerTraits > EEDigitizer
CorrelatedNoisifier< EcalCorrMatrix > * m_EBCorrNoise[3]
LuminosityBlockIndex index() const
const std::string m_ESdigiCollection
const EcalSimParameterMap * m_ParameterMap
void setGain(const int gain)
void setDetIds(const std::vector< DetId > &detIds)
tell the digitizer which cells exist; cannot change during a run
void setEventTime(const edm::TimeValue_t &iTime)
const std::string m_hitsProducerTag
void setMIPs(const ESIntercalibConstants *mips)
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *engine)
void setMIPToGeV(const double MIPToGeV)
void setIntercalibConstants(const EcalIntercalibConstantsMC *ical)
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
ESOldDigitizer * m_ESOldDigitizer
void setNoiseSignalGenerator(EcalBaseSignalGenerator *noiseSignalGenerator)
EcalDigiProducer(const edm::ParameterSet ¶ms, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
const std::string m_EEdigiCollection
ESElectronicsSimFast * m_ESElectronicsSimFast
virtual void initializeHits()
ESDigitizer * m_ESDigitizer
const APDSimParameters * m_apdParameters
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
void setEENoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void setPedestals(const ESPedestals *peds)
void setPedestals(const ESPedestals *peds)
CorrelatedNoisifier< EcalCorrMatrix > * m_EECorrNoise[3]
const unsigned int m_readoutFrameSize
void setLaserConstants(const EcalLaserDbService *laser, bool &useLCcorrection)
EcalElectronicsSim * m_ElectronicsSim
void setEBNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void setESNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void setIntercal(const EcalIntercalibConstantsMC *ical)
EBHitResponse * m_APDResponse
Creates electronics signals from hits.
const double m_EBs25notCont
void setPedestals(const EcalPedestals *pedestals)
can be fetched every event from the EventSetup
EBHitResponse * m_EBResponse
void setPhaseShift(double phaseShift)
void setGain(const int gain)
ESElectronicsSim * m_ESElectronicsSim
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
EBDigitizer * m_BarrelDigitizer
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
unsigned long long TimeValue_t
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const CaloGeometry * m_Geometry
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
void checkGeometry(const edm::EventSetup &eventSetup)
ESHitResponse * m_ESResponse
void setGeometry(const CaloSubdetectorGeometry *geometry)
void setGainRatios(const EcalGainRatios *gainRatios)
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
unsigned int value() const
T const * product() const
virtual void cacheEBDigis(const EBDigiCollection *ebDigiPtr) const
void setFullScaleEnergy(double EBscale, double EEscale)
EcalTDigitizer< EBDigitizerTraits > EBDigitizer
T const * product() const
float gain12Over6() const
EBDigitizer * m_APDDigitizer
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
const bool m_apdSeparateDigi
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c)
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
virtual void run(DigiCollection &output, CLHEP::HepRandomEngine *)
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing, CLHEP::HepRandomEngine *)
void initialize(CLHEP::HepRandomEngine *)
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
const std::string m_apdDigiTag
void setDetIds(const std::vector< DetId > &detIds)
std::vector< CLHEP::HepRandomEngine * > randomEngines_
virtual void run(ESDigiCollection &output, CLHEP::HepRandomEngine *) override
turns hits into digis
volatile std::atomic< bool > shutdown_flag false
void setMIPs(const ESIntercalibConstants *mips)
virtual void cacheEEDigis(const EEDigiCollection *eeDigiPtr) const
const std::string m_EBdigiCollection
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
EcalElectronicsSim * m_APDElectronicsSim
const double m_EEs25notCont
EEHitResponse * m_EEResponse