CMS 3D CMS Logo

EcalDigiProducer.cc
Go to the documentation of this file.
14 //#include "SimCalorimetry/EcalSimAlgos/interface/ESFastTDigitizer.h"
45 
55 
56 
58  EcalDigiProducer(params, iC)
59 {
61 
65 }
66 
67 // version for Pre-Mixing, for use outside of MixingModule
70  m_APDShape ( true ) ,
71  m_EBShape ( true ) ,
72  m_EEShape ( true ) ,
73  m_ESShape ( ) ,
74  m_EBdigiCollection ( params.getParameter<std::string>("EBdigiCollection") ) ,
75  m_EEdigiCollection ( params.getParameter<std::string>("EEdigiCollection") ) ,
76  m_ESdigiCollection ( params.getParameter<std::string>("ESdigiCollection") ) ,
77  m_hitsProducerTag ( params.getParameter<std::string>("hitsProducer" ) ) ,
78  m_useLCcorrection ( params.getUntrackedParameter<bool>("UseLCcorrection") ) ,
79  m_apdSeparateDigi ( params.getParameter<bool> ("apdSeparateDigi") ) ,
80 
81  m_EBs25notCont ( params.getParameter<double> ("EBs25notContainment") ) ,
82  m_EEs25notCont ( params.getParameter<double> ("EEs25notContainment") ) ,
83 
84  m_readoutFrameSize ( params.getParameter<int> ("readoutFrameSize") ) ,
86  params.getParameter<double> ("simHitToPhotoelectronsBarrel") ,
87  params.getParameter<double> ("simHitToPhotoelectronsEndcap") ,
88  params.getParameter<double> ("photoelectronsToAnalogBarrel") ,
89  params.getParameter<double> ("photoelectronsToAnalogEndcap") ,
90  params.getParameter<double> ("samplingFactor") ,
91  params.getParameter<double> ("timePhase") ,
93  params.getParameter<int> ("binOfMaximum") ,
94  params.getParameter<bool> ("doPhotostatistics") ,
95  params.getParameter<bool> ("syncPhase") ) ) ,
96 
97  m_apdDigiTag ( params.getParameter<std::string> ("apdDigiTag" ) ) ,
99  params.getParameter<bool> ("apdAddToBarrel" ) ,
101  params.getParameter<double> ("apdSimToPELow" ) ,
102  params.getParameter<double> ("apdSimToPEHigh" ) ,
103  params.getParameter<double> ("apdTimeOffset" ) ,
104  params.getParameter<double> ("apdTimeOffWidth" ) ,
105  params.getParameter<bool> ("apdDoPEStats" ) ,
106  m_apdDigiTag ,
107  params.getParameter<std::vector<double> > ( "apdNonlParms" ) ) ) ,
108 
111  &m_EBShape ,
112  true ,
113  m_apdParameters.get() ,
114  &m_APDShape ) ) ,
115 
117  &m_EBShape ,
118  false , // barrel
119  m_apdParameters.get() ,
120  &m_APDShape ) ) ,
121 
123  &m_EEShape ) ) ,
126 
127  m_addESNoise ( params.getParameter<bool> ("doESNoise") ) ,
128  m_PreMix1 ( params.getParameter<bool> ("EcalPreMixStage1") ) ,
129  m_PreMix2 ( params.getParameter<bool> ("EcalPreMixStage2") ) ,
130 
131  m_doFastES ( params.getParameter<bool> ("doFast" ) ) ,
132 
133  m_doEB ( params.getParameter<bool> ("doEB" ) ) ,
134  m_doEE ( params.getParameter<bool> ("doEE" ) ) ,
135  m_doES ( params.getParameter<bool> ("doES" ) ) ,
136 
138  new ESElectronicsSim( m_addESNoise ) ) ,
139 
143  m_addESNoise ) ) ,
144 
147  m_PreMix1 ) ) ,
148 
150  new ESDigitizer( m_ESResponse.get() ,
152  m_addESNoise ) ) ,
153 
154  m_APDDigitizer ( nullptr ) ,
158  m_Coder ( nullptr ) ,
160  m_APDCoder ( nullptr ) ,
161  m_Geometry ( nullptr ) ,
162  m_EBCorrNoise ( { {nullptr, nullptr, nullptr} } ) ,
163  m_EECorrNoise ( { {nullptr, nullptr, nullptr} } )
164 {
165  // "produces" statements taken care of elsewhere.
166  // if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
167  // mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
168  // mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
169  // mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
170  if ( m_doEB ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
171  if ( m_doEE ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
172  if ( m_doES ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
173 
174  const std::vector<double> ebCorMatG12 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG12");
175  const std::vector<double> eeCorMatG12 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG12");
176  const std::vector<double> ebCorMatG06 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG06");
177  const std::vector<double> eeCorMatG06 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG06");
178  const std::vector<double> ebCorMatG01 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG01");
179  const std::vector<double> eeCorMatG01 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG01");
180 
181  const bool applyConstantTerm = params.getParameter<bool> ("applyConstantTerm");
182  const double rmsConstantTerm = params.getParameter<double> ("ConstantTerm");
183 
184  const bool addNoise = params.getParameter<bool> ("doENoise");
185  const bool cosmicsPhase = params.getParameter<bool> ("cosmicsPhase");
186  const double cosmicsShift = params.getParameter<double> ("cosmicsShift");
187 
188 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
189 
190  // further phase for cosmics studies
191  if( cosmicsPhase )
192  {
193  if( m_doEB ) m_EBResponse->setPhaseShift( 1. + cosmicsShift ) ;
194  if( m_doEE ) m_EEResponse->setPhaseShift( 1. + cosmicsShift ) ;
195  }
196 
197  EcalCorrMatrix ebMatrix[ 3 ] ;
198  EcalCorrMatrix eeMatrix[ 3 ] ;
199 
200  assert( ebCorMatG12.size() == m_readoutFrameSize ) ;
201  assert( eeCorMatG12.size() == m_readoutFrameSize ) ;
202  assert( ebCorMatG06.size() == m_readoutFrameSize ) ;
203  assert( eeCorMatG06.size() == m_readoutFrameSize ) ;
204  assert( ebCorMatG01.size() == m_readoutFrameSize ) ;
205  assert( eeCorMatG01.size() == m_readoutFrameSize ) ;
206 
207  assert( 1.e-7 > fabs( ebCorMatG12[0] - 1.0 ) ) ;
208  assert( 1.e-7 > fabs( ebCorMatG06[0] - 1.0 ) ) ;
209  assert( 1.e-7 > fabs( ebCorMatG01[0] - 1.0 ) ) ;
210  assert( 1.e-7 > fabs( eeCorMatG12[0] - 1.0 ) ) ;
211  assert( 1.e-7 > fabs( eeCorMatG06[0] - 1.0 ) ) ;
212  assert( 1.e-7 > fabs( eeCorMatG01[0] - 1.0 ) ) ;
213 
214  for ( unsigned int row ( 0 ) ; row != m_readoutFrameSize ; ++row )
215  {
216  assert( 0 == row || 1. >= ebCorMatG12[row] ) ;
217  assert( 0 == row || 1. >= ebCorMatG06[row] ) ;
218  assert( 0 == row || 1. >= ebCorMatG01[row] ) ;
219  assert( 0 == row || 1. >= eeCorMatG12[row] ) ;
220  assert( 0 == row || 1. >= eeCorMatG06[row] ) ;
221  assert( 0 == row || 1. >= eeCorMatG01[row] ) ;
222  for ( unsigned int column ( 0 ) ; column <= row ; ++column )
223  {
224  const unsigned int index ( row - column ) ;
225  ebMatrix[0]( row, column ) = ebCorMatG12[ index ] ;
226  eeMatrix[0]( row, column ) = eeCorMatG12[ index ] ;
227  ebMatrix[1]( row, column ) = ebCorMatG06[ index ] ;
228  eeMatrix[1]( row, column ) = eeCorMatG06[ index ] ;
229  ebMatrix[2]( row, column ) = ebCorMatG01[ index ] ;
230  eeMatrix[2]( row, column ) = eeCorMatG01[ index ] ;
231  }
232  }
233 
234  m_EBCorrNoise[0].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[0] ) );
235  m_EECorrNoise[0].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[0] ) );
236  m_EBCorrNoise[1].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[1] ) );
237  m_EECorrNoise[1].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[1] ) );
238  m_EBCorrNoise[2].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[2] ) );
239  m_EECorrNoise[2].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[2] ) );
240 
241  m_Coder.reset( new EcalCoder( addNoise ,
242  m_PreMix1 ,
243  m_EBCorrNoise[0].get() ,
244  m_EECorrNoise[0].get() ,
245  m_EBCorrNoise[1].get() ,
246  m_EECorrNoise[1].get() ,
247  m_EBCorrNoise[2].get() ,
248  m_EECorrNoise[2].get() ) );
249 
251  m_Coder.get() ,
253  rmsConstantTerm ) );
254 
255  if( m_apdSeparateDigi )
256  {
257  m_APDCoder.reset( new EcalCoder( false ,
258  m_PreMix1 ,
259  m_EBCorrNoise[0].get() ,
260  m_EECorrNoise[0].get() ,
261  m_EBCorrNoise[1].get() ,
262  m_EECorrNoise[1].get() ,
263  m_EBCorrNoise[2].get() ,
264  m_EECorrNoise[2].get() ) );
265 
267  m_APDCoder.get() ,
269  rmsConstantTerm ) );
270 
271  m_APDDigitizer.reset( new EBDigitizer( m_APDResponse.get() ,
272  m_APDElectronicsSim.get() ,
273  false ) );
274  }
275 
276  if( m_doEB ) {
277  m_BarrelDigitizer.reset( new EBDigitizer( m_EBResponse.get() ,
278  m_ElectronicsSim.get() ,
279  addNoise ) );
280  }
281 
282  if( m_doEE ) {
283  m_EndcapDigitizer.reset( new EEDigitizer( m_EEResponse.get() ,
284  m_ElectronicsSim.get() ,
285  addNoise ) );
286  }
287 }
288 
289 
291 {}
292 
293 void
296  randomEngine_ = &rng->getEngine(event.streamID());
297 
298  checkGeometry( eventSetup );
299  checkCalibrations( event, eventSetup );
300  if( m_doEB ) {
301  m_BarrelDigitizer->initializeHits();
302  if(m_apdSeparateDigi) {
303  m_APDDigitizer->initializeHits();
304  }
305  }
306  if( m_doEE ) {
307  m_EndcapDigitizer->initializeHits();
308  }
309  if( m_doES ) {
310  if(m_doFastES) {
311  m_ESDigitizer->initializeHits();
312  } else {
313  m_ESOldDigitizer->initializeHits();
314  }
315  }
316 }
317 
318 void
319 EcalDigiProducer::accumulateCaloHits(HitsHandle const& ebHandle, HitsHandle const& eeHandle, HitsHandle const& esHandle, int bunchCrossing) {
320  if(m_doEB && ebHandle.isValid()) {
321  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
322 
323  if(m_apdSeparateDigi) {
324  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
325  }
326  }
327 
328  if(m_doEE && eeHandle.isValid()) {
329  m_EndcapDigitizer->add(*eeHandle.product(), bunchCrossing, randomEngine_);
330  }
331 
332  if(m_doES && esHandle.isValid()) {
333  if(m_doFastES) {
334  m_ESDigitizer->add(*esHandle.product(), bunchCrossing, randomEngine_);
335  } else {
336  m_ESOldDigitizer->add(*esHandle.product(), bunchCrossing, randomEngine_);
337  }
338  }
339 }
340 
341 void
343  // Step A: Get Inputs
345  if(m_doEB) {
346  m_EBShape.setEventSetup(eventSetup); // need to set the eventSetup here, otherwise pre-mixing module will not wrk
347  m_APDShape.setEventSetup(eventSetup); //
348  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
349  e.getByLabel(ebTag, ebHandle);
350  }
351 
353  if(m_doEE) {
354  m_EEShape.setEventSetup(eventSetup); // need to set the eventSetup here, otherwise pre-mixing module will not work
355  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
356  e.getByLabel(eeTag, eeHandle);
357  }
358 
360  if(m_doES) {
361  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
362  e.getByLabel(esTag, esHandle);
363  }
364 
365  accumulateCaloHits(ebHandle, eeHandle, esHandle, 0);
366 }
367 
368 void
370  // Step A: Get Inputs
372  if(m_doEB) {
373  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
374  e.getByLabel(ebTag, ebHandle);
375  }
376 
378  if(m_doEE) {
379  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
380  e.getByLabel(eeTag, eeHandle);
381  }
382 
384  if(m_doES) {
385  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
386  e.getByLabel(esTag, esHandle);
387  }
388 
389  accumulateCaloHits(ebHandle, eeHandle, esHandle, e.bunchCrossing());
390 }
391 
392 void
394  // Step B: Create empty output
395  std::unique_ptr<EBDigiCollection> apdResult ( !m_apdSeparateDigi || !m_doEB ? nullptr :
396  new EBDigiCollection() ) ;
397  std::unique_ptr<EBDigiCollection> barrelResult ( new EBDigiCollection() ) ;
398  std::unique_ptr<EEDigiCollection> endcapResult ( new EEDigiCollection() ) ;
399  std::unique_ptr<ESDigiCollection> preshowerResult( new ESDigiCollection() ) ;
400 
401  // run the algorithm
402 
403  if( m_doEB ) {
404  m_BarrelDigitizer->run( *barrelResult, randomEngine_ ) ;
405  cacheEBDigis( &*barrelResult ) ;
406 
407  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size() ;
408 
409  if( m_apdSeparateDigi ) {
410  m_APDDigitizer->run( *apdResult, randomEngine_ ) ;
411  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size() ;
412  }
413  }
414 
415  if( m_doEE ) {
416  m_EndcapDigitizer->run( *endcapResult, randomEngine_ ) ;
417  edm::LogInfo("EcalDigi") << "EE Digis: " << endcapResult->size() ;
418  cacheEEDigis( &*endcapResult ) ;
419  }
420  if( m_doES ) {
421  if(m_doFastES) {
422  m_ESDigitizer->run( *preshowerResult, randomEngine_ ) ;
423  } else {
424  m_ESOldDigitizer->run( *preshowerResult, randomEngine_ ) ;
425  }
426  edm::LogInfo("EcalDigi") << "ES Digis: " << preshowerResult->size();
427  }
428 
429 
430  // Step D: Put outputs into event
431  if( m_apdSeparateDigi ) {
432  //event.put(std::move(apdResult), m_apdDigiTag ) ;
433  }
434 
435  event.put(std::move(barrelResult), m_EBdigiCollection ) ;
436  event.put(std::move(endcapResult), m_EEdigiCollection ) ;
437  event.put(std::move(preshowerResult), m_ESdigiCollection ) ;
438 
439  randomEngine_ = nullptr; // to prevent access outside event
440 }
441 
442 void
444 {
446  if ( ! rng.isAvailable() ) {
447  throw cms::Exception("Configuration") <<
448  "RandomNumberGenerator service is not available.\n"
449  "You must add the service in the configuration file\n"
450  "or remove the module that requires it.";
451  }
452  CLHEP::HepRandomEngine* engine = &rng->getEngine(lumi.index());
453 
454  if( m_doEB ) {
455  if( nullptr != m_APDResponse ) m_APDResponse->initialize(engine);
456  m_EBResponse->initialize(engine);
457  }
458 }
459 
460 void
462 {
463  // Pedestals from event setup
464 
466  eventSetup.get<EcalPedestalsRcd>().get( dbPed ) ;
467  const EcalPedestals* pedestals ( dbPed.product() ) ;
468 
469  m_Coder->setPedestals( pedestals ) ;
470  if( nullptr != m_APDCoder ) m_APDCoder->setPedestals( pedestals ) ;
471 
472  // Ecal Intercalibration Constants
474  eventSetup.get<EcalIntercalibConstantsMCRcd>().get( pIcal ) ;
475  const EcalIntercalibConstantsMC* ical ( pIcal.product() ) ;
476 
477  m_Coder->setIntercalibConstants( ical ) ;
478  if( nullptr != m_APDCoder) m_APDCoder->setIntercalibConstants( ical ) ;
479 
480  m_EBResponse->setIntercal( ical ) ;
481  if( nullptr != m_APDResponse ) m_APDResponse->setIntercal( ical ) ;
482 
483  // Ecal LaserCorrection Constants
485  eventSetup.get<EcalLaserDbRecord>().get(laser);
486  const edm::TimeValue_t eventTimeValue = event.time().value();
487 
488  m_EBResponse->setEventTime(eventTimeValue);
489  m_EBResponse->setLaserConstants(laser.product(), m_useLCcorrection);
490 
491  m_EEResponse->setEventTime(eventTimeValue);
492  m_EEResponse->setLaserConstants(laser.product(), m_useLCcorrection);
493 
494  // ADC -> GeV Scale
496  eventSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
497  const EcalADCToGeVConstant* agc = pAgc.product();
498 
499  // Gain Ratios
501  eventSetup.get<EcalGainRatiosRcd>().get(pRatio);
502  const EcalGainRatios* gr = pRatio.product();
503 
504  m_Coder->setGainRatios( gr );
505  if( nullptr != m_APDCoder) m_APDCoder->setGainRatios( gr );
506 
507  EcalMGPAGainRatio * defaultRatios = new EcalMGPAGainRatio();
508 
509  double theGains[m_Coder->NGAINS+1];
510  theGains[0] = 0.;
511  theGains[3] = 1.;
512  theGains[2] = defaultRatios->gain6Over1() ;
513  theGains[1] = theGains[2]*(defaultRatios->gain12Over6()) ;
514 
515  LogDebug("EcalDigi") << " Gains: " << "\n" << " g1 = " << theGains[1]
516  << "\n" << " g2 = " << theGains[2]
517  << "\n" << " g3 = " << theGains[3] ;
518 
519  delete defaultRatios;
520 
521  const double EBscale (
522  ( agc->getEBValue())*theGains[1]*(m_Coder->MAXADC)*m_EBs25notCont ) ;
523 
524  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEBValue()
525  << "\n" << " notCont = " << m_EBs25notCont
526  << "\n" << " saturation for EB = " << EBscale
527  << ", " << m_EBs25notCont ;
528 
529  const double EEscale (
530  (agc->getEEValue())*theGains[1]*(m_Coder->MAXADC)*m_EEs25notCont ) ;
531 
532  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEEValue()
533  << "\n" << " notCont = " << m_EEs25notCont
534  << "\n" << " saturation for EB = " << EEscale
535  << ", " << m_EEs25notCont ;
536 
537  m_Coder->setFullScaleEnergy( EBscale ,
538  EEscale ) ;
539  if( nullptr != m_APDCoder ) m_APDCoder->setFullScaleEnergy( EBscale ,
540  EEscale ) ;
541 
542  if( nullptr != m_ESOldDigitizer ||
543  nullptr != m_ESDigitizer )
544  {
545  // ES condition objects
546  edm::ESHandle<ESGain> hesgain ;
548  edm::ESHandle<ESPedestals> hesPedestals ;
550 
551  eventSetup.get<ESGainRcd>(). get( hesgain ) ;
552  eventSetup.get<ESMIPToGeVConstantRcd>(). get( hesMIPToGeV ) ;
553  eventSetup.get<ESPedestalsRcd>(). get( hesPedestals ) ;
554  eventSetup.get<ESIntercalibConstantsRcd>().get( hesMIPs ) ;
555 
556  const ESGain* esgain ( hesgain.product() ) ;
557  const ESPedestals* espeds ( hesPedestals.product() ) ;
558  const ESIntercalibConstants* esmips ( hesMIPs.product() ) ;
559  const ESMIPToGeVConstant* esMipToGeV ( hesMIPToGeV.product() ) ;
560  const int ESGain ( 1.1 > esgain->getESGain() ? 1 : 2 ) ;
561  const double ESMIPToGeV ( ( 1 == ESGain ) ?
562  esMipToGeV->getESValueLow() :
563  esMipToGeV->getESValueHigh() ) ;
564 
565  if( m_doES ) {
567  if( !m_doFastES )
568  {
569  m_ESElectronicsSim->setGain( ESGain ) ;
570  m_ESElectronicsSim->setPedestals( espeds ) ;
571  m_ESElectronicsSim->setMIPs( esmips ) ;
572  m_ESElectronicsSim->setMIPToGeV( ESMIPToGeV ) ;
573  }
574  else
575  {
576  m_ESDigitizer->setGain( ESGain ) ;
577  m_ESElectronicsSimFast->setPedestals( espeds ) ;
578  m_ESElectronicsSimFast->setMIPs( esmips ) ;
579  m_ESElectronicsSimFast->setMIPToGeV( ESMIPToGeV ) ;
580  }
581  }
582  }
583 }
584 
585 void
587 {
588  // TODO find a way to avoid doing this every event
589  edm::ESHandle<CaloGeometry> hGeometry ;
590  eventSetup.get<CaloGeometryRecord>().get( hGeometry ) ;
591 
592  const CaloGeometry* pGeometry = &*hGeometry;
593 
594  if( pGeometry != m_Geometry )
595  {
596  m_Geometry = pGeometry;
597  updateGeometry();
598  }
599 }
600 
601 void
603 {
604  if( m_doEB ) {
605  if( nullptr != m_APDResponse ) m_APDResponse->setGeometry(
607  m_EBResponse->setGeometry(
609  }
610  if( m_doEE ) {
611  m_EEResponse->setGeometry(
613  }
614  if( m_doES ) {
615  m_ESResponse->setGeometry(
617  m_ESOldResponse->setGeometry( m_Geometry ) ;
618 
619  const std::vector<DetId>* theESDets (
622 
623  if( !m_doFastES )
624  {
625  if( nullptr != m_ESOldDigitizer &&
626  nullptr != theESDets )
627  m_ESOldDigitizer->setDetIds( *theESDets ) ;
628  }
629  else
630  {
631  if( nullptr != m_ESDigitizer &&
632  nullptr != theESDets )
633  m_ESDigitizer->setDetIds( *theESDets ) ;
634  }
635  }
636 }
637 
639  //noiseGenerator->setParameterMap(theParameterMap);
640  if(nullptr != m_BarrelDigitizer) m_BarrelDigitizer->setNoiseSignalGenerator(noiseGenerator);
641 }
642 
644  //noiseGenerator->setParameterMap(theParameterMap);
645  if(nullptr != m_EndcapDigitizer) m_EndcapDigitizer->setNoiseSignalGenerator(noiseGenerator);
646 }
647 
649  //noiseGenerator->setParameterMap(theParameterMap);
650  if(nullptr != m_ESDigitizer) m_ESDigitizer->setNoiseSignalGenerator(noiseGenerator);
651 }
652 
653 
655  m_EBShape.setEventSetup(setup);
656  m_EEShape.setEventSetup(setup);
657  m_APDShape.setEventSetup(setup);
658 }
659 
#define LogDebug(id)
void beginRun(edm::Run const &run, edm::EventSetup const &setup) override
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
std::unique_ptr< EcalCoder > m_APDCoder
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
std::unique_ptr< EcalElectronicsSim > m_ElectronicsSim
adds noise to the given frame.
Definition: EcalCoder.h:11
EcalDigiProducer(const edm::ParameterSet &params, edm::ProducerBase &mixMod, edm::ConsumesCollector &iC)
EcalTDigitizer< EEDigitizerTraits > EEDigitizer
std::unique_ptr< ESDigitizer > m_ESDigitizer
LuminosityBlockIndex index() const
const std::string m_ESdigiCollection
std::unique_ptr< EEDigitizer > m_EndcapDigitizer
Definition: ESGain.h:7
void setGain(const int gain)
Definition: ESShape.h:26
std::unique_ptr< EBHitResponse > m_APDResponse
const std::string m_hitsProducerTag
std::unique_ptr< EcalCoder > m_Coder
std::array< std::unique_ptr< CorrelatedNoisifier< EcalCorrMatrix > >, 3 > m_EBCorrNoise
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
#define nullptr
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
const std::string m_EEdigiCollection
std::unique_ptr< ESHitResponse > m_ESResponse
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)
const bool m_addESNoise
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
const unsigned int m_readoutFrameSize
void setEBNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void setESNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing)
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Creates electronics signals from hits.
const double m_EBs25notCont
bool isAvailable() const
Definition: Service.h:46
std::unique_ptr< CaloHitResponse > m_ESOldResponse
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
float gain6Over1() const
math::ErrorD< CaloSamples::MAXSAMPLES >::type EcalCorrMatrix
bool isValid() const
Definition: HandleBase.h:74
unsigned long long TimeValue_t
Definition: Timestamp.h:28
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
const CaloGeometry * m_Geometry
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
void checkGeometry(const edm::EventSetup &eventSetup)
std::unique_ptr< EBDigitizer > m_BarrelDigitizer
std::unique_ptr< ESElectronicsSimFast > m_ESElectronicsSimFast
CLHEP::HepRandomEngine * randomEngine_
T const * product() const
Definition: Handle.h:81
virtual void cacheEBDigis(const EBDigiCollection *ebDigiPtr) const
std::unique_ptr< EEHitResponse > m_EEResponse
EcalTDigitizer< EBDigitizerTraits > EBDigitizer
std::array< std::unique_ptr< CorrelatedNoisifier< EcalCorrMatrix > >, 3 > m_EECorrNoise
float gain12Over6() const
const bool m_apdSeparateDigi
std::unique_ptr< ESElectronicsSim > m_ESElectronicsSim
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
T get() const
Definition: EventSetup.h:68
StreamID streamID() const
Definition: Event.h:96
const std::string m_apdDigiTag
void setEventSetup(const edm::EventSetup &evtSetup)
std::unique_ptr< EBHitResponse > m_EBResponse
std::unique_ptr< ESOldDigitizer > m_ESOldDigitizer
std::unique_ptr< EcalElectronicsSim > m_APDElectronicsSim
~EcalDigiProducer() override
virtual void cacheEEDigis(const EEDigiCollection *eeDigiPtr) const
const std::string m_EBdigiCollection
T const * product() const
Definition: ESHandle.h:84
std::unique_ptr< EBDigitizer > m_APDDigitizer
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
const double m_EEs25notCont
Definition: event.py:1
Definition: Run.h:44
std::unique_ptr< const EcalSimParameterMap > m_ParameterMap
std::unique_ptr< const APDSimParameters > m_apdParameters