CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
EcalDigiProducer Class Reference

#include <EcalDigiProducer.h>

Inheritance diagram for EcalDigiProducer:
DigiAccumulatorMixMod EcalTBDigiProducer

Public Member Functions

virtual void accumulate (edm::Event const &e, edm::EventSetup const &c)
 
virtual void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
 EcalDigiProducer (const edm::ParameterSet &params, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
 EcalDigiProducer (const edm::ParameterSet &params, edm::ConsumesCollector &iC)
 
virtual void finalizeEvent (edm::Event &e, edm::EventSetup const &c)
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c)
 
void setEBNoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
void setEENoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
void setESNoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
virtual ~EcalDigiProducer ()
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Protected Attributes

EBHitResponsem_EBResponse
 
EEHitResponsem_EEResponse
 
const EcalSimParameterMapm_ParameterMap
 

Private Types

typedef edm::Handle
< std::vector< PCaloHit > > 
HitsHandle
 

Private Member Functions

void accumulateCaloHits (HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing, CLHEP::HepRandomEngine *)
 
virtual void cacheEBDigis (const EBDigiCollection *ebDigiPtr) const
 
virtual void cacheEEDigis (const EEDigiCollection *eeDigiPtr) const
 
void checkCalibrations (const edm::Event &event, const edm::EventSetup &eventSetup)
 
void checkGeometry (const edm::EventSetup &eventSetup)
 
CLHEP::HepRandomEngine * randomEngine (edm::StreamID const &streamID)
 
void updateGeometry ()
 

Private Attributes

const bool m_addESNoise
 
EcalCoderm_APDCoder
 
const std::string m_apdDigiTag
 
EBDigitizerm_APDDigitizer
 
EcalElectronicsSimm_APDElectronicsSim
 
const APDSimParametersm_apdParameters
 
EBHitResponsem_APDResponse
 
const bool m_apdSeparateDigi
 
const APDShape m_APDShape
 
EBDigitizerm_BarrelDigitizer
 
EcalCoderm_Coder
 
const bool m_doFastES
 
CorrelatedNoisifier
< EcalCorrMatrix > * 
m_EBCorrNoise [3]
 
const std::string m_EBdigiCollection
 
const double m_EBs25notCont
 
const EBShape m_EBShape
 
CorrelatedNoisifier
< EcalCorrMatrix > * 
m_EECorrNoise [3]
 
const std::string m_EEdigiCollection
 
const double m_EEs25notCont
 
const EEShape m_EEShape
 
EcalElectronicsSimm_ElectronicsSim
 
EEDigitizerm_EndcapDigitizer
 
const std::string m_ESdigiCollection
 
ESDigitizerm_ESDigitizer
 
ESElectronicsSimm_ESElectronicsSim
 
ESElectronicsSimFastm_ESElectronicsSimFast
 
ESOldDigitizerm_ESOldDigitizer
 
CaloHitResponsem_ESOldResponse
 
ESHitResponsem_ESResponse
 
ESShape m_ESShape
 
const CaloGeometrym_Geometry
 
const std::string m_hitsProducerTag
 
const bool m_PreMix1
 
const bool m_PreMix2
 
const unsigned int m_readoutFrameSize
 
bool m_useLCcorrection
 
std::vector
< CLHEP::HepRandomEngine * > 
randomEngines_
 

Detailed Description

Definition at line 60 of file EcalDigiProducer.h.

Member Typedef Documentation

typedef edm::Handle<std::vector<PCaloHit> > EcalDigiProducer::HitsHandle
private

Definition at line 82 of file EcalDigiProducer.h.

Constructor & Destructor Documentation

EcalDigiProducer::EcalDigiProducer ( const edm::ParameterSet params,
edm::one::EDProducerBase mixMod,
edm::ConsumesCollector iC 
)

Definition at line 57 of file EcalDigiProducer.cc.

References assert(), column, edm::ConsumesCollector::consumes(), alignCSCRings::e, edm::ParameterSet::getParameter(), cmsHarvester::index, HLT_25ns14e33_v1_cff::InputTag, m_APDCoder, m_apdDigiTag, m_APDDigitizer, m_APDElectronicsSim, m_APDResponse, m_apdSeparateDigi, m_BarrelDigitizer, m_Coder, m_EBCorrNoise, m_EBdigiCollection, m_EBResponse, m_EECorrNoise, m_EEdigiCollection, m_EEResponse, m_ElectronicsSim, m_EndcapDigitizer, m_ESdigiCollection, m_hitsProducerTag, m_ParameterMap, m_PreMix1, m_readoutFrameSize, and EcalHitResponse::setPhaseShift().

57  :
59  m_APDShape ( params.getParameter<double>( "apdShapeTstart" ) ,
60  params.getParameter<double>( "apdShapeTau" ) ) ,
61  m_EBShape ( ) ,
62  m_EEShape ( ) ,
63  m_ESShape ( ) ,
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") ) ,
70 
71  m_EBs25notCont ( params.getParameter<double> ("EBs25notContainment") ) ,
72  m_EEs25notCont ( params.getParameter<double> ("EEs25notContainment") ) ,
73 
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") ) ) ,
86 
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" ) ,
96  m_apdDigiTag ,
97  params.getParameter<std::vector<double> > ( "apdNonlParms" ) ) ) ,
98 
101  &m_EBShape ,
102  true ,
104  &m_APDShape ) ) ,
105 
107  &m_EBShape ,
108  false , // barrel
110  &m_APDShape ) ) ,
111 
113  &m_EEShape ) ) ,
116 
117  m_addESNoise ( params.getParameter<bool> ("doESNoise") ) ,
118  m_PreMix1 ( params.getParameter<bool> ("EcalPreMixStage1") ) ,
119  m_PreMix2 ( params.getParameter<bool> ("EcalPreMixStage2") ) ,
120 
121  m_doFastES ( params.getParameter<bool> ("doFast" ) ) ,
122 
124  new ESElectronicsSim( m_addESNoise ) ) ,
125 
129  m_addESNoise ) ) ,
130 
133  m_PreMix1) ) ,
134 
135  m_ESDigitizer ( !m_doFastES ? 0 :
138  m_addESNoise ) ) ,
139 
140  m_APDDigitizer ( 0 ) ,
141  m_BarrelDigitizer ( 0 ) ,
142  m_EndcapDigitizer ( 0 ) ,
143  m_ElectronicsSim ( 0 ) ,
144  m_Coder ( 0 ) ,
145  m_APDElectronicsSim ( 0 ) ,
146  m_APDCoder ( 0 ) ,
147  m_Geometry ( 0 ) ,
148  m_EBCorrNoise ( ) ,
149  m_EECorrNoise ( )
150 {
151  if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
152  mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
153  mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
154  mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
155  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
156  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
157  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
158 
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");
165 
166  const bool applyConstantTerm = params.getParameter<bool> ("applyConstantTerm");
167  const double rmsConstantTerm = params.getParameter<double> ("ConstantTerm");
168 
169  const bool addNoise = params.getParameter<bool> ("doENoise");
170  const bool cosmicsPhase = params.getParameter<bool> ("cosmicsPhase");
171  const double cosmicsShift = params.getParameter<double> ("cosmicsShift");
172 
173 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
174 
175  // further phase for cosmics studies
176  if( cosmicsPhase )
177  {
178  m_EBResponse->setPhaseShift( 1. + cosmicsShift ) ;
179  m_EEResponse->setPhaseShift( 1. + cosmicsShift ) ;
180  }
181 
182  EcalCorrMatrix ebMatrix[ 3 ] ;
183  EcalCorrMatrix eeMatrix[ 3 ] ;
184 
185  assert( ebCorMatG12.size() == m_readoutFrameSize ) ;
186  assert( eeCorMatG12.size() == m_readoutFrameSize ) ;
187  assert( ebCorMatG06.size() == m_readoutFrameSize ) ;
188  assert( eeCorMatG06.size() == m_readoutFrameSize ) ;
189  assert( ebCorMatG01.size() == m_readoutFrameSize ) ;
190  assert( eeCorMatG01.size() == m_readoutFrameSize ) ;
191 
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 ) ) ;
198 
199  for ( unsigned int row ( 0 ) ; row != m_readoutFrameSize ; ++row )
200  {
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] ) ;
207  for ( unsigned int column ( 0 ) ; column <= row ; ++column )
208  {
209  const unsigned int index ( row - column ) ;
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 ] ;
216  }
217  }
218 
219  m_EBCorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[0] ) ;
220  m_EECorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[0] ) ;
221  m_EBCorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[1] ) ;
222  m_EECorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[1] ) ;
223  m_EBCorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[2] ) ;
224  m_EECorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[2] ) ;
225 
226  m_Coder = new EcalCoder( addNoise ,
227  m_PreMix1 ,
228  m_EBCorrNoise[0] ,
229  m_EECorrNoise[0] ,
230  m_EBCorrNoise[1] ,
231  m_EECorrNoise[1] ,
232  m_EBCorrNoise[2] ,
233  m_EECorrNoise[2] ) ;
234 
236  m_Coder ,
237  applyConstantTerm ,
238  rmsConstantTerm ) ;
239 
240  if( m_apdSeparateDigi )
241  {
242  m_APDCoder = new EcalCoder( false ,
243  m_EBCorrNoise[0] ,
244  m_EECorrNoise[0] ,
245  m_EBCorrNoise[1] ,
246  m_EECorrNoise[1] ,
247  m_EBCorrNoise[2] ,
248  m_EECorrNoise[2] ) ;
249 
251  m_APDCoder ,
252  applyConstantTerm ,
253  rmsConstantTerm ) ;
254 
257  false ) ;
258  }
259 
262  addNoise ) ;
263 
266  addNoise ) ;
267 }
EEDigitizer * m_EndcapDigitizer
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CaloHitResponse * m_ESOldResponse
CaloTDigitizer< ESOldDigitizerTraits > ESOldDigitizer
EcalTDigitizer< EEDigitizerTraits > EEDigitizer
CorrelatedNoisifier< EcalCorrMatrix > * m_EBCorrNoise[3]
const APDShape m_APDShape
const std::string m_ESdigiCollection
const EcalSimParameterMap * m_ParameterMap
const std::string m_hitsProducerTag
assert(m_qm.get())
ESOldDigitizer * m_ESOldDigitizer
const std::string m_EEdigiCollection
ESElectronicsSimFast * m_ESElectronicsSimFast
ESDigitizer * m_ESDigitizer
const APDSimParameters * m_apdParameters
const bool m_addESNoise
CorrelatedNoisifier< EcalCorrMatrix > * m_EECorrNoise[3]
const unsigned int m_readoutFrameSize
EcalElectronicsSim * m_ElectronicsSim
EBHitResponse * m_APDResponse
Creates electronics signals from hits.
const double m_EBs25notCont
EBHitResponse * m_EBResponse
void setPhaseShift(double phaseShift)
ESElectronicsSim * m_ESElectronicsSim
EBDigitizer * m_BarrelDigitizer
math::ErrorD< CaloSamples::MAXSAMPLES >::type EcalCorrMatrix
const CaloGeometry * m_Geometry
EcalCoder * m_APDCoder
ESHitResponse * m_ESResponse
#define column(...)
Definition: DbCore.h:74
EcalTDigitizer< EBDigitizerTraits > EBDigitizer
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
const std::string m_apdDigiTag
const EEShape m_EEShape
const EBShape m_EBShape
const std::string m_EBdigiCollection
EcalElectronicsSim * m_APDElectronicsSim
const double m_EEs25notCont
EEHitResponse * m_EEResponse
EcalDigiProducer::EcalDigiProducer ( const edm::ParameterSet params,
edm::ConsumesCollector iC 
)

Definition at line 271 of file EcalDigiProducer.cc.

References assert(), column, edm::ConsumesCollector::consumes(), alignCSCRings::e, edm::ParameterSet::getParameter(), cmsHarvester::index, HLT_25ns14e33_v1_cff::InputTag, m_APDCoder, m_APDDigitizer, m_APDElectronicsSim, m_APDResponse, m_apdSeparateDigi, m_BarrelDigitizer, m_Coder, m_EBCorrNoise, m_EBResponse, m_EECorrNoise, m_EEResponse, m_ElectronicsSim, m_EndcapDigitizer, m_hitsProducerTag, m_ParameterMap, m_PreMix1, m_readoutFrameSize, and EcalHitResponse::setPhaseShift().

271  :
273  m_APDShape ( params.getParameter<double>( "apdShapeTstart" ) ,
274  params.getParameter<double>( "apdShapeTau" ) ) ,
275  m_EBShape ( ) ,
276  m_EEShape ( ) ,
277  m_ESShape ( ) ,
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") ) ,
284 
285  m_EBs25notCont ( params.getParameter<double> ("EBs25notContainment") ) ,
286  m_EEs25notCont ( params.getParameter<double> ("EEs25notContainment") ) ,
287 
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") ) ) ,
300 
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" ) ,
310  m_apdDigiTag ,
311  params.getParameter<std::vector<double> > ( "apdNonlParms" ) ) ) ,
312 
315  &m_EBShape ,
316  true ,
318  &m_APDShape ) ) ,
319 
321  &m_EBShape ,
322  false , // barrel
324  &m_APDShape ) ) ,
325 
327  &m_EEShape ) ) ,
330 
331  m_addESNoise ( params.getParameter<bool> ("doESNoise") ) ,
332  m_PreMix1 ( params.getParameter<bool> ("EcalPreMixStage1") ) ,
333  m_PreMix2 ( params.getParameter<bool> ("EcalPreMixStage2") ) ,
334 
335  m_doFastES ( params.getParameter<bool> ("doFast" ) ) ,
336 
338  new ESElectronicsSim( m_addESNoise ) ) ,
339 
343  m_addESNoise ) ) ,
344 
347  m_PreMix1 ) ) ,
348 
349  m_ESDigitizer ( !m_doFastES ? 0 :
352  m_addESNoise ) ) ,
353 
354  m_APDDigitizer ( 0 ) ,
355  m_BarrelDigitizer ( 0 ) ,
356  m_EndcapDigitizer ( 0 ) ,
357  m_ElectronicsSim ( 0 ) ,
358  m_Coder ( 0 ) ,
359  m_APDElectronicsSim ( 0 ) ,
360  m_APDCoder ( 0 ) ,
361  m_Geometry ( 0 ) ,
362  m_EBCorrNoise ( ) ,
363  m_EECorrNoise ( )
364 {
365  // "produces" statements taken care of elsewhere.
366  // if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
367  // mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
368  // mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
369  // mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
370  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
371  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
372  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
373 
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");
380 
381  const bool applyConstantTerm = params.getParameter<bool> ("applyConstantTerm");
382  const double rmsConstantTerm = params.getParameter<double> ("ConstantTerm");
383 
384  const bool addNoise = params.getParameter<bool> ("doENoise");
385  const bool cosmicsPhase = params.getParameter<bool> ("cosmicsPhase");
386  const double cosmicsShift = params.getParameter<double> ("cosmicsShift");
387 
388 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
389 
390  // further phase for cosmics studies
391  if( cosmicsPhase )
392  {
393  m_EBResponse->setPhaseShift( 1. + cosmicsShift ) ;
394  m_EEResponse->setPhaseShift( 1. + cosmicsShift ) ;
395  }
396 
397  EcalCorrMatrix ebMatrix[ 3 ] ;
398  EcalCorrMatrix eeMatrix[ 3 ] ;
399 
400  assert( ebCorMatG12.size() == m_readoutFrameSize ) ;
401  assert( eeCorMatG12.size() == m_readoutFrameSize ) ;
402  assert( ebCorMatG06.size() == m_readoutFrameSize ) ;
403  assert( eeCorMatG06.size() == m_readoutFrameSize ) ;
404  assert( ebCorMatG01.size() == m_readoutFrameSize ) ;
405  assert( eeCorMatG01.size() == m_readoutFrameSize ) ;
406 
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 ) ) ;
413 
414  for ( unsigned int row ( 0 ) ; row != m_readoutFrameSize ; ++row )
415  {
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] ) ;
422  for ( unsigned int column ( 0 ) ; column <= row ; ++column )
423  {
424  const unsigned int index ( row - column ) ;
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 ] ;
431  }
432  }
433 
434  m_EBCorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[0] ) ;
435  m_EECorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[0] ) ;
436  m_EBCorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[1] ) ;
437  m_EECorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[1] ) ;
438  m_EBCorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[2] ) ;
439  m_EECorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[2] ) ;
440 
441  m_Coder = new EcalCoder( addNoise ,
442  m_PreMix1 ,
443  m_EBCorrNoise[0] ,
444  m_EECorrNoise[0] ,
445  m_EBCorrNoise[1] ,
446  m_EECorrNoise[1] ,
447  m_EBCorrNoise[2] ,
448  m_EECorrNoise[2] ) ;
449 
451  m_Coder ,
452  applyConstantTerm ,
453  rmsConstantTerm ) ;
454 
455  if( m_apdSeparateDigi )
456  {
457  m_APDCoder = new EcalCoder( false ,
458  m_EBCorrNoise[0] ,
459  m_EECorrNoise[0] ,
460  m_EBCorrNoise[1] ,
461  m_EECorrNoise[1] ,
462  m_EBCorrNoise[2] ,
463  m_EECorrNoise[2] ) ;
464 
466  m_APDCoder ,
467  applyConstantTerm ,
468  rmsConstantTerm ) ;
469 
472  false ) ;
473  }
474 
477  addNoise ) ;
478 
481  addNoise ) ;
482 }
EEDigitizer * m_EndcapDigitizer
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CaloHitResponse * m_ESOldResponse
CaloTDigitizer< ESOldDigitizerTraits > ESOldDigitizer
EcalTDigitizer< EEDigitizerTraits > EEDigitizer
CorrelatedNoisifier< EcalCorrMatrix > * m_EBCorrNoise[3]
const APDShape m_APDShape
const std::string m_ESdigiCollection
const EcalSimParameterMap * m_ParameterMap
const std::string m_hitsProducerTag
assert(m_qm.get())
ESOldDigitizer * m_ESOldDigitizer
const std::string m_EEdigiCollection
ESElectronicsSimFast * m_ESElectronicsSimFast
ESDigitizer * m_ESDigitizer
const APDSimParameters * m_apdParameters
const bool m_addESNoise
CorrelatedNoisifier< EcalCorrMatrix > * m_EECorrNoise[3]
const unsigned int m_readoutFrameSize
EcalElectronicsSim * m_ElectronicsSim
EBHitResponse * m_APDResponse
Creates electronics signals from hits.
const double m_EBs25notCont
EBHitResponse * m_EBResponse
void setPhaseShift(double phaseShift)
ESElectronicsSim * m_ESElectronicsSim
EBDigitizer * m_BarrelDigitizer
math::ErrorD< CaloSamples::MAXSAMPLES >::type EcalCorrMatrix
const CaloGeometry * m_Geometry
EcalCoder * m_APDCoder
ESHitResponse * m_ESResponse
#define column(...)
Definition: DbCore.h:74
EcalTDigitizer< EBDigitizerTraits > EBDigitizer
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
const std::string m_apdDigiTag
const EEShape m_EEShape
const EBShape m_EBShape
const std::string m_EBdigiCollection
EcalElectronicsSim * m_APDElectronicsSim
const double m_EEs25notCont
EEHitResponse * m_EEResponse
EcalDigiProducer::~EcalDigiProducer ( )
virtual

Definition at line 485 of file EcalDigiProducer.cc.

References m_APDCoder, m_APDDigitizer, m_APDElectronicsSim, m_apdParameters, m_APDResponse, m_BarrelDigitizer, m_Coder, m_EBCorrNoise, m_EBResponse, m_EECorrNoise, m_EEResponse, m_ElectronicsSim, m_EndcapDigitizer, m_ESDigitizer, m_ESElectronicsSim, m_ESElectronicsSimFast, m_ESOldDigitizer, m_ESOldResponse, m_ESResponse, and m_ParameterMap.

486 {
487  delete m_EndcapDigitizer ;
488  delete m_BarrelDigitizer ;
489  delete m_APDDigitizer ;
490  delete m_APDElectronicsSim ;
491  delete m_APDCoder ;
492  delete m_ElectronicsSim ;
493  delete m_Coder ;
494  delete m_EBCorrNoise[0] ;
495  delete m_EECorrNoise[0] ;
496  delete m_EBCorrNoise[1] ;
497  delete m_EECorrNoise[1] ;
498  delete m_EBCorrNoise[2] ;
499  delete m_EECorrNoise[2] ;
500 
501  delete m_ESDigitizer ;
502  delete m_ESElectronicsSimFast ;
503  delete m_ESOldDigitizer ;
504  delete m_ESElectronicsSim ;
505 
506  delete m_ESOldResponse ;
507  delete m_ESResponse ;
508  delete m_EEResponse ;
509  delete m_EBResponse ;
510  delete m_APDResponse ;
511 
512  delete m_apdParameters ;
513  delete m_ParameterMap ;
514 }
EEDigitizer * m_EndcapDigitizer
CaloHitResponse * m_ESOldResponse
CorrelatedNoisifier< EcalCorrMatrix > * m_EBCorrNoise[3]
const EcalSimParameterMap * m_ParameterMap
ESOldDigitizer * m_ESOldDigitizer
ESElectronicsSimFast * m_ESElectronicsSimFast
ESDigitizer * m_ESDigitizer
const APDSimParameters * m_apdParameters
CorrelatedNoisifier< EcalCorrMatrix > * m_EECorrNoise[3]
EcalElectronicsSim * m_ElectronicsSim
EBHitResponse * m_APDResponse
EBHitResponse * m_EBResponse
ESElectronicsSim * m_ESElectronicsSim
EBDigitizer * m_BarrelDigitizer
EcalCoder * m_APDCoder
ESHitResponse * m_ESResponse
EBDigitizer * m_APDDigitizer
EcalElectronicsSim * m_APDElectronicsSim
EEHitResponse * m_EEResponse

Member Function Documentation

void EcalDigiProducer::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 556 of file EcalDigiProducer.cc.

References accumulateCaloHits(), edm::Event::getByLabel(), m_hitsProducerTag, randomEngine(), and edm::Event::streamID().

Referenced by edm::DataMixingEcalDigiWorkerProd::addEcalSignals().

556  {
557  // Step A: Get Inputs
558  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
560  e.getByLabel(ebTag, ebHandle);
561 
562  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
564  e.getByLabel(eeTag, eeHandle);
565 
566  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
568  e.getByLabel(esTag, esHandle);
569 
570  accumulateCaloHits(ebHandle, eeHandle, esHandle, 0, randomEngine(e.streamID()));
571 }
const std::string m_hitsProducerTag
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing, CLHEP::HepRandomEngine *)
void EcalDigiProducer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 574 of file EcalDigiProducer.cc.

References accumulateCaloHits(), PileUpEventPrincipal::bunchCrossing(), PileUpEventPrincipal::getByLabel(), m_hitsProducerTag, and randomEngine().

574  {
575  // Step A: Get Inputs
576  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
578  e.getByLabel(ebTag, ebHandle);
579 
580  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
582  e.getByLabel(eeTag, eeHandle);
583 
584  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
586  e.getByLabel(esTag, esHandle);
587 
588  accumulateCaloHits(ebHandle, eeHandle, esHandle, e.bunchCrossing(), randomEngine(streamID));
589 }
const std::string m_hitsProducerTag
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing, CLHEP::HepRandomEngine *)
void EcalDigiProducer::accumulateCaloHits ( HitsHandle const &  ebHandle,
HitsHandle const &  eeHandle,
HitsHandle const &  esHandle,
int  bunchCrossing,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 533 of file EcalDigiProducer.cc.

References EcalTDigitizer< Traits >::add(), CaloTDigitizer< Traits >::add(), edm::HandleBase::isValid(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_doFastES, m_EndcapDigitizer, m_ESDigitizer, m_ESOldDigitizer, and edm::Handle< T >::product().

Referenced by accumulate().

533  {
534  if(ebHandle.isValid()) {
535  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing, engine);
536 
537  if(m_apdSeparateDigi) {
538  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing, engine);
539  }
540  }
541 
542  if(eeHandle.isValid()) {
543  m_EndcapDigitizer->add(*eeHandle.product(), bunchCrossing, engine);
544  }
545 
546  if(esHandle.isValid()) {
547  if(m_doFastES) {
548  m_ESDigitizer->add(*esHandle.product(), bunchCrossing, engine);
549  } else {
550  m_ESOldDigitizer->add(*esHandle.product(), bunchCrossing, engine);
551  }
552  }
553 }
EEDigitizer * m_EndcapDigitizer
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *)
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *engine)
ESOldDigitizer * m_ESOldDigitizer
ESDigitizer * m_ESDigitizer
EBDigitizer * m_BarrelDigitizer
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
void EcalDigiProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 635 of file EcalDigiProducer.cc.

References edm::hlt::Exception, edm::RandomNumberGenerator::getEngine(), edm::LuminosityBlock::index(), EBHitResponse::initialize(), edm::Service< T >::isAvailable(), m_APDResponse, and m_EBResponse.

Referenced by edm::DataMixingEcalDigiWorkerProd::beginLuminosityBlock().

636 {
638  if ( ! rng.isAvailable() ) {
639  throw cms::Exception("Configuration") <<
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.";
643  }
644  CLHEP::HepRandomEngine* engine = &rng->getEngine(lumi.index());
645 
646  if( 0 != m_APDResponse ) m_APDResponse->initialize(engine);
647  m_EBResponse->initialize(engine);
648 }
tuple lumi
Definition: fjr2json.py:35
EBHitResponse * m_APDResponse
EBHitResponse * m_EBResponse
bool isAvailable() const
Definition: Service.h:46
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
void initialize(CLHEP::HepRandomEngine *)
virtual void EcalDigiProducer::cacheEBDigis ( const EBDigiCollection ebDigiPtr) const
inlineprivatevirtual

Reimplemented in EcalTBDigiProducer.

Definition at line 79 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

79 { }
virtual void EcalDigiProducer::cacheEEDigis ( const EEDigiCollection eeDigiPtr) const
inlineprivatevirtual

Reimplemented in EcalTBDigiProducer.

Definition at line 80 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

80 { }
void EcalDigiProducer::checkCalibrations ( const edm::Event event,
const edm::EventSetup eventSetup 
)
private

Definition at line 651 of file EcalDigiProducer.cc.

References EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), edm::EventSetup::get(), EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), EcalCondDBWriter_cfi::laser, LogDebug, m_APDCoder, m_APDResponse, m_Coder, m_doFastES, m_EBResponse, m_EBs25notCont, m_EEResponse, m_EEs25notCont, m_ESDigitizer, m_ESElectronicsSim, m_ESElectronicsSimFast, m_ESOldDigitizer, m_ESShape, m_useLCcorrection, EcalCoder::MAXADC, EcalCoder::NGAINS, edm::ESHandle< class >::product(), EcalHitResponse::setEventTime(), EcalCoder::setFullScaleEnergy(), ESShape::setGain(), ESElectronicsSim::setGain(), ESDigitizer::setGain(), EcalCoder::setGainRatios(), EBHitResponse::setIntercal(), EcalCoder::setIntercalibConstants(), EcalHitResponse::setLaserConstants(), ESElectronicsSim::setMIPs(), ESElectronicsSimFast::setMIPs(), ESElectronicsSim::setMIPToGeV(), ESElectronicsSimFast::setMIPToGeV(), ESElectronicsSim::setPedestals(), ESElectronicsSimFast::setPedestals(), and EcalCoder::setPedestals().

Referenced by initializeEvent().

652 {
653  // Pedestals from event setup
654 
656  eventSetup.get<EcalPedestalsRcd>().get( dbPed ) ;
657  const EcalPedestals* pedestals ( dbPed.product() ) ;
658 
659  m_Coder->setPedestals( pedestals ) ;
660  if( 0 != m_APDCoder ) m_APDCoder->setPedestals( pedestals ) ;
661 
662  // Ecal Intercalibration Constants
664  eventSetup.get<EcalIntercalibConstantsMCRcd>().get( pIcal ) ;
665  const EcalIntercalibConstantsMC* ical ( pIcal.product() ) ;
666 
668  if( 0 != m_APDCoder) m_APDCoder->setIntercalibConstants( ical ) ;
669 
670  m_EBResponse->setIntercal( ical ) ;
671  if( 0 != m_APDResponse ) m_APDResponse->setIntercal( ical ) ;
672 
673  // Ecal LaserCorrection Constants
675  eventSetup.get<EcalLaserDbRecord>().get(laser);
676  const edm::TimeValue_t eventTimeValue = event.time().value();
677 
678  m_EBResponse->setEventTime(eventTimeValue);
680 
681  m_EEResponse->setEventTime(eventTimeValue);
683 
684  // ADC -> GeV Scale
686  eventSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
687  const EcalADCToGeVConstant* agc = pAgc.product();
688 
689  // Gain Ratios
691  eventSetup.get<EcalGainRatiosRcd>().get(pRatio);
692  const EcalGainRatios* gr = pRatio.product();
693 
694  m_Coder->setGainRatios( gr );
695  if( 0 != m_APDCoder) m_APDCoder->setGainRatios( gr );
696 
697  EcalMGPAGainRatio * defaultRatios = new EcalMGPAGainRatio();
698 
699  double theGains[m_Coder->NGAINS+1];
700  theGains[0] = 0.;
701  theGains[3] = 1.;
702  theGains[2] = defaultRatios->gain6Over1() ;
703  theGains[1] = theGains[2]*(defaultRatios->gain12Over6()) ;
704 
705  LogDebug("EcalDigi") << " Gains: " << "\n" << " g1 = " << theGains[1]
706  << "\n" << " g2 = " << theGains[2]
707  << "\n" << " g3 = " << theGains[3] ;
708 
709  delete defaultRatios;
710 
711  const double EBscale (
712  ( agc->getEBValue())*theGains[1]*(m_Coder->MAXADC)*m_EBs25notCont ) ;
713 
714  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEBValue()
715  << "\n" << " notCont = " << m_EBs25notCont
716  << "\n" << " saturation for EB = " << EBscale
717  << ", " << m_EBs25notCont ;
718 
719  const double EEscale (
720  (agc->getEEValue())*theGains[1]*(m_Coder->MAXADC)*m_EEs25notCont ) ;
721 
722  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEEValue()
723  << "\n" << " notCont = " << m_EEs25notCont
724  << "\n" << " saturation for EB = " << EEscale
725  << ", " << m_EEs25notCont ;
726 
727  m_Coder->setFullScaleEnergy( EBscale ,
728  EEscale ) ;
729  if( 0 != m_APDCoder ) m_APDCoder->setFullScaleEnergy( EBscale ,
730  EEscale ) ;
731 
732  if( 0 != m_ESOldDigitizer ||
733  0 != m_ESDigitizer )
734  {
735  // ES condition objects
736  edm::ESHandle<ESGain> hesgain ;
738  edm::ESHandle<ESPedestals> hesPedestals ;
740 
741  eventSetup.get<ESGainRcd>(). get( hesgain ) ;
742  eventSetup.get<ESMIPToGeVConstantRcd>(). get( hesMIPToGeV ) ;
743  eventSetup.get<ESPedestalsRcd>(). get( hesPedestals ) ;
744  eventSetup.get<ESIntercalibConstantsRcd>().get( hesMIPs ) ;
745 
746  const ESGain* esgain ( hesgain.product() ) ;
747  const ESPedestals* espeds ( hesPedestals.product() ) ;
748  const ESIntercalibConstants* esmips ( hesMIPs.product() ) ;
749  const ESMIPToGeVConstant* esMipToGeV ( hesMIPToGeV.product() ) ;
750  const int ESGain ( 1.1 > esgain->getESGain() ? 1 : 2 ) ;
751  const double ESMIPToGeV ( ( 1 == ESGain ) ?
752  esMipToGeV->getESValueLow() :
753  esMipToGeV->getESValueHigh() ) ;
754 
756 
757  if( !m_doFastES )
758  {
760  m_ESElectronicsSim->setPedestals( espeds ) ;
761  m_ESElectronicsSim->setMIPs( esmips ) ;
762  m_ESElectronicsSim->setMIPToGeV( ESMIPToGeV ) ;
763  }
764  else
765  {
768  m_ESElectronicsSimFast->setMIPs( esmips ) ;
769  m_ESElectronicsSimFast->setMIPToGeV( ESMIPToGeV ) ;
770  }
771  }
772 }
#define LogDebug(id)
void setMIPToGeV(double MIPToGeV)
void setGain(const int gain)
Definition: ESGain.h:7
void setGain(const int gain)
Definition: ESShape.h:26
void setEventTime(const edm::TimeValue_t &iTime)
void setMIPs(const ESIntercalibConstants *mips)
void setMIPToGeV(const double MIPToGeV)
void setIntercalibConstants(const EcalIntercalibConstantsMC *ical)
Definition: EcalCoder.cc:63
ESOldDigitizer * m_ESOldDigitizer
ESElectronicsSimFast * m_ESElectronicsSimFast
ESDigitizer * m_ESDigitizer
void setPedestals(const ESPedestals *peds)
void setPedestals(const ESPedestals *peds)
void setLaserConstants(const EcalLaserDbService *laser, bool &useLCcorrection)
void setIntercal(const EcalIntercalibConstantsMC *ical)
EBHitResponse * m_APDResponse
const double m_EBs25notCont
void setPedestals(const EcalPedestals *pedestals)
can be fetched every event from the EventSetup
Definition: EcalCoder.cc:51
EBHitResponse * m_EBResponse
void setGain(const int gain)
Definition: ESDigitizer.cc:44
ESElectronicsSim * m_ESElectronicsSim
float gain6Over1() const
unsigned long long TimeValue_t
Definition: Timestamp.h:28
EcalCoder * m_APDCoder
void setGainRatios(const EcalGainRatios *gainRatios)
Definition: EcalCoder.cc:57
void setFullScaleEnergy(double EBscale, double EEscale)
Definition: EcalCoder.cc:42
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
float gain12Over6() const
void setMIPs(const ESIntercalibConstants *mips)
const double m_EEs25notCont
EEHitResponse * m_EEResponse
void EcalDigiProducer::checkGeometry ( const edm::EventSetup eventSetup)
private

Definition at line 775 of file EcalDigiProducer.cc.

References edm::EventSetup::get(), m_Geometry, and updateGeometry().

Referenced by initializeEvent().

776 {
777  // TODO find a way to avoid doing this every event
778  edm::ESHandle<CaloGeometry> hGeometry ;
779  eventSetup.get<CaloGeometryRecord>().get( hGeometry ) ;
780 
781  const CaloGeometry* pGeometry = &*hGeometry;
782 
783  if( pGeometry != m_Geometry )
784  {
785  m_Geometry = pGeometry;
786  updateGeometry();
787  }
788 }
const CaloGeometry * m_Geometry
const T & get() const
Definition: EventSetup.h:55
void EcalDigiProducer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Reimplemented in EcalTBDigiProducer.

Definition at line 592 of file EcalDigiProducer.cc.

References cacheEBDigis(), cacheEEDigis(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_doFastES, m_EBdigiCollection, m_EEdigiCollection, m_EndcapDigitizer, m_ESdigiCollection, m_ESDigitizer, m_ESOldDigitizer, randomEngine(), ESDigitizer::run(), EcalTDigitizer< Traits >::run(), CaloTDigitizer< Traits >::run(), and edm::Event::streamID().

Referenced by EcalTBDigiProducer::finalizeEvent(), and edm::DataMixingEcalDigiWorkerProd::putEcal().

592  {
593  // Step B: Create empty output
594  std::auto_ptr<EBDigiCollection> apdResult ( !m_apdSeparateDigi ? 0 :
595  new EBDigiCollection() ) ;
596  std::auto_ptr<EBDigiCollection> barrelResult ( new EBDigiCollection() ) ;
597  std::auto_ptr<EEDigiCollection> endcapResult ( new EEDigiCollection() ) ;
598  std::auto_ptr<ESDigiCollection> preshowerResult( new ESDigiCollection() ) ;
599 
600  // run the algorithm
601 
602  m_BarrelDigitizer->run( *barrelResult, randomEngine(event.streamID()) ) ;
603  cacheEBDigis( &*barrelResult ) ;
604 
605  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size() ;
606 
607  if( m_apdSeparateDigi ) {
608  m_APDDigitizer->run( *apdResult, randomEngine(event.streamID()) ) ;
609  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size() ;
610  }
611 
612  m_EndcapDigitizer->run( *endcapResult, randomEngine(event.streamID()) ) ;
613  edm::LogInfo("EcalDigi") << "EE Digis: " << endcapResult->size() ;
614  cacheEEDigis( &*endcapResult ) ;
615 
616  if(m_doFastES) {
617  m_ESDigitizer->run( *preshowerResult, randomEngine(event.streamID()) ) ;
618  } else {
619  m_ESOldDigitizer->run( *preshowerResult, randomEngine(event.streamID()) ) ;
620  }
621  edm::LogInfo("EcalDigi") << "ES Digis: " << preshowerResult->size();
622 
623 
624  // Step D: Put outputs into event
625  if( m_apdSeparateDigi ) {
626  //event.put( apdResult, m_apdDigiTag ) ;
627  }
628 
629  event.put( barrelResult, m_EBdigiCollection ) ;
630  event.put( endcapResult, m_EEdigiCollection ) ;
631  event.put( preshowerResult, m_ESdigiCollection ) ;
632 }
EEDigitizer * m_EndcapDigitizer
const std::string m_ESdigiCollection
ESOldDigitizer * m_ESOldDigitizer
const std::string m_EEdigiCollection
ESDigitizer * m_ESDigitizer
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
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
virtual void cacheEBDigis(const EBDigiCollection *ebDigiPtr) const
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
virtual void run(DigiCollection &output, CLHEP::HepRandomEngine *)
virtual void run(ESDigiCollection &output, CLHEP::HepRandomEngine *) override
turns hits into digis
Definition: ESDigitizer.cc:167
virtual void cacheEEDigis(const EEDigiCollection *eeDigiPtr) const
const std::string m_EBdigiCollection
void EcalDigiProducer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Reimplemented in EcalTBDigiProducer.

Definition at line 517 of file EcalDigiProducer.cc.

References checkCalibrations(), checkGeometry(), EcalTDigitizer< Traits >::initializeHits(), CaloTDigitizer< Traits >::initializeHits(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_doFastES, m_EndcapDigitizer, m_ESDigitizer, and m_ESOldDigitizer.

Referenced by EcalTBDigiProducer::initializeEvent(), and edm::DataMixingEcalDigiWorkerProd::initializeEvent().

517  {
518  checkGeometry( eventSetup );
519  checkCalibrations( event, eventSetup );
521  if(m_apdSeparateDigi) {
523  }
525  if(m_doFastES) {
527  } else {
529  }
530 }
EEDigitizer * m_EndcapDigitizer
void initializeHits()
ESOldDigitizer * m_ESOldDigitizer
virtual void initializeHits()
ESDigitizer * m_ESDigitizer
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
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
void checkGeometry(const edm::EventSetup &eventSetup)
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
CLHEP::HepRandomEngine * EcalDigiProducer::randomEngine ( edm::StreamID const &  streamID)
private

Definition at line 821 of file EcalDigiProducer.cc.

References edm::RandomNumberGenerator::getEngine(), cmsHarvester::index, randomEngines_, and edm::StreamID::value().

Referenced by accumulate(), and finalizeEvent().

821  {
822  unsigned int index = streamID.value();
823  if(index >= randomEngines_.size()) {
824  randomEngines_.resize(index + 1, nullptr);
825  }
826  CLHEP::HepRandomEngine* ptr = randomEngines_[index];
827  if(!ptr) {
829  ptr = &rng->getEngine(streamID);
830  randomEngines_[index] = ptr;
831  }
832  return ptr;
833 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
std::vector< CLHEP::HepRandomEngine * > randomEngines_
void EcalDigiProducer::setEBNoiseSignalGenerator ( EcalBaseSignalGenerator noiseGenerator)

Definition at line 835 of file EcalDigiProducer.cc.

References m_BarrelDigitizer, and EcalTDigitizer< Traits >::setNoiseSignalGenerator().

835  {
836  //noiseGenerator->setParameterMap(theParameterMap);
838 }
void setNoiseSignalGenerator(EcalBaseSignalGenerator *noiseSignalGenerator)
EBDigitizer * m_BarrelDigitizer
void EcalDigiProducer::setEENoiseSignalGenerator ( EcalBaseSignalGenerator noiseGenerator)

Definition at line 840 of file EcalDigiProducer.cc.

References m_EndcapDigitizer, and EcalTDigitizer< Traits >::setNoiseSignalGenerator().

840  {
841  //noiseGenerator->setParameterMap(theParameterMap);
843 }
EEDigitizer * m_EndcapDigitizer
void setNoiseSignalGenerator(EcalBaseSignalGenerator *noiseSignalGenerator)
void EcalDigiProducer::setESNoiseSignalGenerator ( EcalBaseSignalGenerator noiseGenerator)

Definition at line 845 of file EcalDigiProducer.cc.

References m_ESDigitizer, and EcalTDigitizer< Traits >::setNoiseSignalGenerator().

845  {
846  //noiseGenerator->setParameterMap(theParameterMap);
848 }
void setNoiseSignalGenerator(EcalBaseSignalGenerator *noiseSignalGenerator)
ESDigitizer * m_ESDigitizer
void EcalDigiProducer::updateGeometry ( )
private

Definition at line 791 of file EcalDigiProducer.cc.

References DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, CaloGeometry::getSubdetectorGeometry(), CaloSubdetectorGeometry::getValidDetIds(), m_APDResponse, m_doFastES, m_EBResponse, m_EEResponse, m_ESDigitizer, m_ESOldDigitizer, m_ESOldResponse, m_ESResponse, m_Geometry, ESDigitizer::setDetIds(), CaloTDigitizer< Traits >::setDetIds(), EcalHitResponse::setGeometry(), and CaloHitResponse::setGeometry().

Referenced by checkGeometry().

792 {
802 
803  const std::vector<DetId>* theESDets (
806 
807  if( !m_doFastES )
808  {
809  if( 0 != m_ESOldDigitizer &&
810  0 != theESDets )
811  m_ESOldDigitizer->setDetIds( *theESDets ) ;
812  }
813  else
814  {
815  if( 0 != m_ESDigitizer &&
816  0 != theESDets )
817  m_ESDigitizer->setDetIds( *theESDets ) ;
818  }
819 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
CaloHitResponse * m_ESOldResponse
void setDetIds(const std::vector< DetId > &detIds)
tell the digitizer which cells exist; cannot change during a run
Definition: ESDigitizer.cc:36
ESOldDigitizer * m_ESOldDigitizer
ESDigitizer * m_ESDigitizer
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)
EBHitResponse * m_APDResponse
EBHitResponse * m_EBResponse
const CaloGeometry * m_Geometry
ESHitResponse * m_ESResponse
void setGeometry(const CaloSubdetectorGeometry *geometry)
void setDetIds(const std::vector< DetId > &detIds)
EEHitResponse * m_EEResponse

Member Data Documentation

const bool EcalDigiProducer::m_addESNoise
private

Definition at line 125 of file EcalDigiProducer.h.

EcalCoder* EcalDigiProducer::m_APDCoder
private

Definition at line 144 of file EcalDigiProducer.h.

Referenced by checkCalibrations(), EcalDigiProducer(), and ~EcalDigiProducer().

const std::string EcalDigiProducer::m_apdDigiTag
private

Definition at line 114 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer().

EBDigitizer* EcalDigiProducer::m_APDDigitizer
private
EcalElectronicsSim* EcalDigiProducer::m_APDElectronicsSim
private

Definition at line 143 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and ~EcalDigiProducer().

const APDSimParameters* EcalDigiProducer::m_apdParameters
private

Definition at line 115 of file EcalDigiProducer.h.

Referenced by ~EcalDigiProducer().

EBHitResponse* EcalDigiProducer::m_APDResponse
private
const bool EcalDigiProducer::m_apdSeparateDigi
private
const APDShape EcalDigiProducer::m_APDShape
private

Definition at line 93 of file EcalDigiProducer.h.

EBDigitizer* EcalDigiProducer::m_BarrelDigitizer
private
EcalCoder* EcalDigiProducer::m_Coder
private

Definition at line 141 of file EcalDigiProducer.h.

Referenced by checkCalibrations(), EcalDigiProducer(), and ~EcalDigiProducer().

const bool EcalDigiProducer::m_doFastES
private
CorrelatedNoisifier<EcalCorrMatrix>* EcalDigiProducer::m_EBCorrNoise[3]
private

Definition at line 148 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and ~EcalDigiProducer().

const std::string EcalDigiProducer::m_EBdigiCollection
private

Definition at line 98 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

EBHitResponse* EcalDigiProducer::m_EBResponse
protected
const double EcalDigiProducer::m_EBs25notCont
private

Definition at line 107 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EBShape EcalDigiProducer::m_EBShape
private

Definition at line 94 of file EcalDigiProducer.h.

CorrelatedNoisifier<EcalCorrMatrix>* EcalDigiProducer::m_EECorrNoise[3]
private

Definition at line 149 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and ~EcalDigiProducer().

const std::string EcalDigiProducer::m_EEdigiCollection
private

Definition at line 99 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

EEHitResponse* EcalDigiProducer::m_EEResponse
protected
const double EcalDigiProducer::m_EEs25notCont
private

Definition at line 108 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EEShape EcalDigiProducer::m_EEShape
private

Definition at line 95 of file EcalDigiProducer.h.

EcalElectronicsSim* EcalDigiProducer::m_ElectronicsSim
private

Definition at line 140 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and ~EcalDigiProducer().

EEDigitizer* EcalDigiProducer::m_EndcapDigitizer
private
const std::string EcalDigiProducer::m_ESdigiCollection
private

Definition at line 100 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

ESDigitizer* EcalDigiProducer::m_ESDigitizer
private
ESElectronicsSim* EcalDigiProducer::m_ESElectronicsSim
private

Definition at line 131 of file EcalDigiProducer.h.

Referenced by checkCalibrations(), and ~EcalDigiProducer().

ESElectronicsSimFast* EcalDigiProducer::m_ESElectronicsSimFast
private

Definition at line 133 of file EcalDigiProducer.h.

Referenced by checkCalibrations(), and ~EcalDigiProducer().

ESOldDigitizer* EcalDigiProducer::m_ESOldDigitizer
private
CaloHitResponse* EcalDigiProducer::m_ESOldResponse
private

Definition at line 123 of file EcalDigiProducer.h.

Referenced by updateGeometry(), and ~EcalDigiProducer().

ESHitResponse* EcalDigiProducer::m_ESResponse
private

Definition at line 122 of file EcalDigiProducer.h.

Referenced by updateGeometry(), and ~EcalDigiProducer().

ESShape EcalDigiProducer::m_ESShape
private

Definition at line 96 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const CaloGeometry* EcalDigiProducer::m_Geometry
private

Definition at line 146 of file EcalDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

const std::string EcalDigiProducer::m_hitsProducerTag
private

Definition at line 101 of file EcalDigiProducer.h.

Referenced by accumulate(), and EcalDigiProducer().

const EcalSimParameterMap* EcalDigiProducer::m_ParameterMap
protected
const bool EcalDigiProducer::m_PreMix1
private

Definition at line 126 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer().

const bool EcalDigiProducer::m_PreMix2
private

Definition at line 127 of file EcalDigiProducer.h.

const unsigned int EcalDigiProducer::m_readoutFrameSize
private

Definition at line 110 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer().

bool EcalDigiProducer::m_useLCcorrection
private

Definition at line 103 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

std::vector<CLHEP::HepRandomEngine*> EcalDigiProducer::randomEngines_
private

Definition at line 151 of file EcalDigiProducer.h.

Referenced by randomEngine().