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)
 
 EcalDigiProducer (const edm::ParameterSet &params, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
 
virtual void finalizeEvent (edm::Event &e, edm::EventSetup const &c)
 
virtual void initializeEvent (edm::Event const &e, edm::EventSetup const &c)
 
virtual ~EcalDigiProducer ()
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
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 void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
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)
 
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)
 
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 unsigned int m_readoutFrameSize
 
bool m_useLCcorrection
 

Detailed Description

Definition at line 54 of file EcalDigiProducer.h.

Member Typedef Documentation

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

Definition at line 70 of file EcalDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file EcalDigiProducer.cc.

References column, edm::ConsumesCollector::consumes(), alignCSCRings::e, edm::ParameterSet::getParameter(), getHLTprescales::index, 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_readoutFrameSize, and EcalHitResponse::setPhaseShift().

51  :
53  m_APDShape ( params.getParameter<double>( "apdShapeTstart" ) ,
54  params.getParameter<double>( "apdShapeTau" ) ) ,
55  m_EBShape ( ) ,
56  m_EEShape ( ) ,
57  m_ESShape ( ) ,
58  m_EBdigiCollection ( params.getParameter<std::string>("EBdigiCollection") ) ,
59  m_EEdigiCollection ( params.getParameter<std::string>("EEdigiCollection") ) ,
60  m_ESdigiCollection ( params.getParameter<std::string>("ESdigiCollection") ) ,
61  m_hitsProducerTag ( params.getParameter<std::string>("hitsProducer" ) ) ,
62  m_useLCcorrection ( params.getUntrackedParameter<bool>("UseLCcorrection") ) ,
63  m_apdSeparateDigi ( params.getParameter<bool> ("apdSeparateDigi") ) ,
64 
65  m_EBs25notCont ( params.getParameter<double> ("EBs25notContainment") ) ,
66  m_EEs25notCont ( params.getParameter<double> ("EEs25notContainment") ) ,
67 
68  m_readoutFrameSize ( params.getParameter<int> ("readoutFrameSize") ) ,
70  params.getParameter<double> ("simHitToPhotoelectronsBarrel") ,
71  params.getParameter<double> ("simHitToPhotoelectronsEndcap") ,
72  params.getParameter<double> ("photoelectronsToAnalogBarrel") ,
73  params.getParameter<double> ("photoelectronsToAnalogEndcap") ,
74  params.getParameter<double> ("samplingFactor") ,
75  params.getParameter<double> ("timePhase") ,
77  params.getParameter<int> ("binOfMaximum") ,
78  params.getParameter<bool> ("doPhotostatistics") ,
79  params.getParameter<bool> ("syncPhase") ) ) ,
80 
81  m_apdDigiTag ( params.getParameter<std::string> ("apdDigiTag" ) ) ,
83  params.getParameter<bool> ("apdAddToBarrel" ) ,
85  params.getParameter<double> ("apdSimToPELow" ) ,
86  params.getParameter<double> ("apdSimToPEHigh" ) ,
87  params.getParameter<double> ("apdTimeOffset" ) ,
88  params.getParameter<double> ("apdTimeOffWidth" ) ,
89  params.getParameter<bool> ("apdDoPEStats" ) ,
90  m_apdDigiTag ,
91  params.getParameter<std::vector<double> > ( "apdNonlParms" ) ) ) ,
92 
95  &m_EBShape ,
96  true ,
98  &m_APDShape ) ) ,
99 
101  &m_EBShape ,
102  false , // barrel
104  &m_APDShape ) ) ,
105 
107  &m_EEShape ) ) ,
110 
111  m_addESNoise ( params.getParameter<bool> ("doESNoise") ) ,
112  m_doFastES ( params.getParameter<bool> ("doFast" ) ) ,
113 
115  new ESElectronicsSim( m_addESNoise ) ) ,
116 
120  m_addESNoise ) ) ,
121 
124 
125  m_ESDigitizer ( !m_doFastES ? 0 :
128  m_addESNoise ) ) ,
129 
130  m_APDDigitizer ( 0 ) ,
131  m_BarrelDigitizer ( 0 ) ,
132  m_EndcapDigitizer ( 0 ) ,
133  m_ElectronicsSim ( 0 ) ,
134  m_Coder ( 0 ) ,
135  m_APDElectronicsSim ( 0 ) ,
136  m_APDCoder ( 0 ) ,
137  m_Geometry ( 0 ) ,
138  m_EBCorrNoise ( ) ,
139  m_EECorrNoise ( )
140 {
141  if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
142  mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
143  mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
144  mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
145  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
146  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
147  iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
148 
149  const std::vector<double> ebCorMatG12 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG12");
150  const std::vector<double> eeCorMatG12 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG12");
151  const std::vector<double> ebCorMatG06 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG06");
152  const std::vector<double> eeCorMatG06 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG06");
153  const std::vector<double> ebCorMatG01 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG01");
154  const std::vector<double> eeCorMatG01 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG01");
155 
156  const bool applyConstantTerm = params.getParameter<bool> ("applyConstantTerm");
157  const double rmsConstantTerm = params.getParameter<double> ("ConstantTerm");
158 
159  const bool addNoise = params.getParameter<bool> ("doNoise");
160  const bool cosmicsPhase = params.getParameter<bool> ("cosmicsPhase");
161  const double cosmicsShift = params.getParameter<double> ("cosmicsShift");
162 
163 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
164 
165  // further phase for cosmics studies
166  if( cosmicsPhase )
167  {
168  m_EBResponse->setPhaseShift( 1. + cosmicsShift ) ;
169  m_EEResponse->setPhaseShift( 1. + cosmicsShift ) ;
170  }
171 
172  EcalCorrMatrix ebMatrix[ 3 ] ;
173  EcalCorrMatrix eeMatrix[ 3 ] ;
174 
175  assert( ebCorMatG12.size() == m_readoutFrameSize ) ;
176  assert( eeCorMatG12.size() == m_readoutFrameSize ) ;
177  assert( ebCorMatG06.size() == m_readoutFrameSize ) ;
178  assert( eeCorMatG06.size() == m_readoutFrameSize ) ;
179  assert( ebCorMatG01.size() == m_readoutFrameSize ) ;
180  assert( eeCorMatG01.size() == m_readoutFrameSize ) ;
181 
182  assert( 1.e-7 > fabs( ebCorMatG12[0] - 1.0 ) ) ;
183  assert( 1.e-7 > fabs( ebCorMatG06[0] - 1.0 ) ) ;
184  assert( 1.e-7 > fabs( ebCorMatG01[0] - 1.0 ) ) ;
185  assert( 1.e-7 > fabs( eeCorMatG12[0] - 1.0 ) ) ;
186  assert( 1.e-7 > fabs( eeCorMatG06[0] - 1.0 ) ) ;
187  assert( 1.e-7 > fabs( eeCorMatG01[0] - 1.0 ) ) ;
188 
189  for ( unsigned int row ( 0 ) ; row != m_readoutFrameSize ; ++row )
190  {
191  assert( 0 == row || 1. >= ebCorMatG12[row] ) ;
192  assert( 0 == row || 1. >= ebCorMatG06[row] ) ;
193  assert( 0 == row || 1. >= ebCorMatG01[row] ) ;
194  assert( 0 == row || 1. >= eeCorMatG12[row] ) ;
195  assert( 0 == row || 1. >= eeCorMatG06[row] ) ;
196  assert( 0 == row || 1. >= eeCorMatG01[row] ) ;
197  for ( unsigned int column ( 0 ) ; column <= row ; ++column )
198  {
199  const unsigned int index ( row - column ) ;
200  ebMatrix[0]( row, column ) = ebCorMatG12[ index ] ;
201  eeMatrix[0]( row, column ) = eeCorMatG12[ index ] ;
202  ebMatrix[1]( row, column ) = ebCorMatG06[ index ] ;
203  eeMatrix[1]( row, column ) = eeCorMatG06[ index ] ;
204  ebMatrix[2]( row, column ) = ebCorMatG01[ index ] ;
205  eeMatrix[2]( row, column ) = eeCorMatG01[ index ] ;
206  }
207  }
208 
209  m_EBCorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[0] ) ;
210  m_EECorrNoise[0] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[0] ) ;
211  m_EBCorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[1] ) ;
212  m_EECorrNoise[1] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[1] ) ;
213  m_EBCorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[2] ) ;
214  m_EECorrNoise[2] = new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[2] ) ;
215 
216  m_Coder = new EcalCoder( addNoise ,
217  m_EBCorrNoise[0] ,
218  m_EECorrNoise[0] ,
219  m_EBCorrNoise[1] ,
220  m_EECorrNoise[1] ,
221  m_EBCorrNoise[2] ,
222  m_EECorrNoise[2] ) ;
223 
225  m_Coder ,
226  applyConstantTerm ,
227  rmsConstantTerm ) ;
228 
229  if( m_apdSeparateDigi )
230  {
231  m_APDCoder = new EcalCoder( false ,
232  m_EBCorrNoise[0] ,
233  m_EECorrNoise[0] ,
234  m_EBCorrNoise[1] ,
235  m_EECorrNoise[1] ,
236  m_EBCorrNoise[2] ,
237  m_EECorrNoise[2] ) ;
238 
240  m_APDCoder ,
241  applyConstantTerm ,
242  rmsConstantTerm ) ;
243 
246  false ) ;
247  }
248 
251  addNoise ) ;
252 
255  addNoise ) ;
256 }
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
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 258 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.

259 {
260  delete m_EndcapDigitizer ;
261  delete m_BarrelDigitizer ;
262  delete m_APDDigitizer ;
263  delete m_APDElectronicsSim ;
264  delete m_APDCoder ;
265  delete m_ElectronicsSim ;
266  delete m_Coder ;
267  delete m_EBCorrNoise[0] ;
268  delete m_EECorrNoise[0] ;
269  delete m_EBCorrNoise[1] ;
270  delete m_EECorrNoise[1] ;
271  delete m_EBCorrNoise[2] ;
272  delete m_EECorrNoise[2] ;
273 
274  delete m_ESDigitizer ;
275  delete m_ESElectronicsSimFast ;
276  delete m_ESOldDigitizer ;
277  delete m_ESElectronicsSim ;
278 
279  delete m_ESOldResponse ;
280  delete m_ESResponse ;
281  delete m_EEResponse ;
282  delete m_EBResponse ;
283  delete m_APDResponse ;
284 
285  delete m_apdParameters ;
286  delete m_ParameterMap ;
287 }
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 329 of file EcalDigiProducer.cc.

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

329  {
330  // Step A: Get Inputs
331  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
333  e.getByLabel(ebTag, ebHandle);
334 
335  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
337  e.getByLabel(eeTag, eeHandle);
338 
339  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
341  e.getByLabel(esTag, esHandle);
342 
343  accumulateCaloHits(ebHandle, eeHandle, esHandle, 0);
344 }
const std::string m_hitsProducerTag
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing)
void EcalDigiProducer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Definition at line 347 of file EcalDigiProducer.cc.

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

347  {
348  // Step A: Get Inputs
349  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
351  e.getByLabel(ebTag, ebHandle);
352 
353  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
355  e.getByLabel(eeTag, eeHandle);
356 
357  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
359  e.getByLabel(esTag, esHandle);
360 
361  accumulateCaloHits(ebHandle, eeHandle, esHandle, e.bunchCrossing());
362 }
const std::string m_hitsProducerTag
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, HitsHandle const &esHandle, int bunchCrossing)
void EcalDigiProducer::accumulateCaloHits ( HitsHandle const &  ebHandle,
HitsHandle const &  eeHandle,
HitsHandle const &  esHandle,
int  bunchCrossing 
)
private

Definition at line 306 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().

306  {
307  if(ebHandle.isValid()) {
308  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
309 
310  if(m_apdSeparateDigi) {
311  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing);
312  }
313  }
314 
315  if(eeHandle.isValid()) {
316  m_EndcapDigitizer->add(*eeHandle.product(), bunchCrossing);
317  }
318 
319  if(esHandle.isValid()) {
320  if(m_doFastES) {
321  m_ESDigitizer->add(*esHandle.product(), bunchCrossing);
322  } else {
323  m_ESOldDigitizer->add(*esHandle.product(), bunchCrossing);
324  }
325  }
326 }
EEDigitizer * m_EndcapDigitizer
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
ESOldDigitizer * m_ESOldDigitizer
ESDigitizer * m_ESDigitizer
EBDigitizer * m_BarrelDigitizer
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
virtual void EcalDigiProducer::cacheEBDigis ( const EBDigiCollection ebDigiPtr) const
inlineprivatevirtual

Reimplemented in EcalTBDigiProducer.

Definition at line 67 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

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

Reimplemented in EcalTBDigiProducer.

Definition at line 68 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

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

Definition at line 408 of file EcalDigiProducer.cc.

References EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), edm::EventSetup::get(), EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), 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(), ESElectronicsSim::setGain(), ESShape::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().

409 {
410  // Pedestals from event setup
411 
413  eventSetup.get<EcalPedestalsRcd>().get( dbPed ) ;
414  const EcalPedestals* pedestals ( dbPed.product() ) ;
415 
416  m_Coder->setPedestals( pedestals ) ;
417  if( 0 != m_APDCoder ) m_APDCoder->setPedestals( pedestals ) ;
418 
419  // Ecal Intercalibration Constants
421  eventSetup.get<EcalIntercalibConstantsMCRcd>().get( pIcal ) ;
422  const EcalIntercalibConstantsMC* ical ( pIcal.product() ) ;
423 
425  if( 0 != m_APDCoder) m_APDCoder->setIntercalibConstants( ical ) ;
426 
427  m_EBResponse->setIntercal( ical ) ;
428  if( 0 != m_APDResponse ) m_APDResponse->setIntercal( ical ) ;
429 
430  // Ecal LaserCorrection Constants
432  eventSetup.get<EcalLaserDbRecord>().get(laser);
433  const edm::TimeValue_t eventTimeValue = event.time().value();
434 
435  m_EBResponse->setEventTime(eventTimeValue);
437 
438  m_EEResponse->setEventTime(eventTimeValue);
440 
441  // ADC -> GeV Scale
443  eventSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
444  const EcalADCToGeVConstant* agc = pAgc.product();
445 
446  // Gain Ratios
448  eventSetup.get<EcalGainRatiosRcd>().get(pRatio);
449  const EcalGainRatios* gr = pRatio.product();
450 
451  m_Coder->setGainRatios( gr );
452  if( 0 != m_APDCoder) m_APDCoder->setGainRatios( gr );
453 
454  EcalMGPAGainRatio * defaultRatios = new EcalMGPAGainRatio();
455 
456  double theGains[m_Coder->NGAINS+1];
457  theGains[0] = 0.;
458  theGains[3] = 1.;
459  theGains[2] = defaultRatios->gain6Over1() ;
460  theGains[1] = theGains[2]*(defaultRatios->gain12Over6()) ;
461 
462  LogDebug("EcalDigi") << " Gains: " << "\n" << " g1 = " << theGains[1]
463  << "\n" << " g2 = " << theGains[2]
464  << "\n" << " g3 = " << theGains[3] ;
465 
466  delete defaultRatios;
467 
468  const double EBscale (
469  ( agc->getEBValue())*theGains[1]*(m_Coder->MAXADC)*m_EBs25notCont ) ;
470 
471  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEBValue()
472  << "\n" << " notCont = " << m_EBs25notCont
473  << "\n" << " saturation for EB = " << EBscale
474  << ", " << m_EBs25notCont ;
475 
476  const double EEscale (
477  (agc->getEEValue())*theGains[1]*(m_Coder->MAXADC)*m_EEs25notCont ) ;
478 
479  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEEValue()
480  << "\n" << " notCont = " << m_EEs25notCont
481  << "\n" << " saturation for EB = " << EEscale
482  << ", " << m_EEs25notCont ;
483 
484  m_Coder->setFullScaleEnergy( EBscale ,
485  EEscale ) ;
486  if( 0 != m_APDCoder ) m_APDCoder->setFullScaleEnergy( EBscale ,
487  EEscale ) ;
488 
489  if( 0 != m_ESOldDigitizer ||
490  0 != m_ESDigitizer )
491  {
492  // ES condition objects
493  edm::ESHandle<ESGain> hesgain ;
495  edm::ESHandle<ESPedestals> hesPedestals ;
497 
498  eventSetup.get<ESGainRcd>(). get( hesgain ) ;
499  eventSetup.get<ESMIPToGeVConstantRcd>(). get( hesMIPToGeV ) ;
500  eventSetup.get<ESPedestalsRcd>(). get( hesPedestals ) ;
501  eventSetup.get<ESIntercalibConstantsRcd>().get( hesMIPs ) ;
502 
503  const ESGain* esgain ( hesgain.product() ) ;
504  const ESPedestals* espeds ( hesPedestals.product() ) ;
505  const ESIntercalibConstants* esmips ( hesMIPs.product() ) ;
506  const ESMIPToGeVConstant* esMipToGeV ( hesMIPToGeV.product() ) ;
507  const int ESGain ( 1.1 > esgain->getESGain() ? 1 : 2 ) ;
508  const double ESMIPToGeV ( ( 1 == ESGain ) ?
509  esMipToGeV->getESValueLow() :
510  esMipToGeV->getESValueHigh() ) ;
511 
513 
514  if( !m_doFastES )
515  {
517  m_ESElectronicsSim->setPedestals( espeds ) ;
518  m_ESElectronicsSim->setMIPs( esmips ) ;
519  m_ESElectronicsSim->setMIPToGeV( ESMIPToGeV ) ;
520  }
521  else
522  {
525  m_ESElectronicsSimFast->setMIPs( esmips ) ;
526  m_ESElectronicsSimFast->setMIPToGeV( ESMIPToGeV ) ;
527  }
528  }
529 }
#define LogDebug(id)
void setMIPToGeV(double MIPToGeV)
void setGain(const int gain)
Definition: ESGain.h:5
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:61
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:49
EBHitResponse * m_EBResponse
void setGain(const int gain)
Definition: ESDigitizer.cc:61
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:55
void setFullScaleEnergy(double EBscale, double EEscale)
Definition: EcalCoder.cc:40
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
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 532 of file EcalDigiProducer.cc.

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

Referenced by initializeEvent().

533 {
534  // TODO find a way to avoid doing this every event
535  edm::ESHandle<CaloGeometry> hGeometry ;
536  eventSetup.get<CaloGeometryRecord>().get( hGeometry ) ;
537 
538  const CaloGeometry* pGeometry = &*hGeometry;
539 
540  if( pGeometry != m_Geometry )
541  {
542  m_Geometry = pGeometry;
543  updateGeometry();
544  }
545 }
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 365 of file EcalDigiProducer.cc.

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

Referenced by EcalTBDigiProducer::finalizeEvent().

365  {
366  // Step B: Create empty output
367  std::auto_ptr<EBDigiCollection> apdResult ( !m_apdSeparateDigi ? 0 :
368  new EBDigiCollection() ) ;
369  std::auto_ptr<EBDigiCollection> barrelResult ( new EBDigiCollection() ) ;
370  std::auto_ptr<EEDigiCollection> endcapResult ( new EEDigiCollection() ) ;
371  std::auto_ptr<ESDigiCollection> preshowerResult( new ESDigiCollection() ) ;
372 
373  // run the algorithm
374 
375  m_BarrelDigitizer->run( *barrelResult ) ;
376  cacheEBDigis( &*barrelResult ) ;
377 
378  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size() ;
379 
380  if( m_apdSeparateDigi ) {
381  m_APDDigitizer->run( *apdResult ) ;
382  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size() ;
383  }
384 
385  m_EndcapDigitizer->run( *endcapResult ) ;
386  edm::LogInfo("EcalDigi") << "EE Digis: " << endcapResult->size() ;
387  cacheEEDigis( &*endcapResult ) ;
388 
389  if(m_doFastES) {
390  m_ESDigitizer->run( *preshowerResult ) ;
391  } else {
392  m_ESOldDigitizer->run( *preshowerResult ) ;
393  }
394  edm::LogInfo("EcalDigi") << "ES Digis: " << preshowerResult->size();
395 
396 
397  // Step D: Put outputs into event
398  if( m_apdSeparateDigi ) {
399  event.put( apdResult, m_apdDigiTag ) ;
400  }
401 
402  event.put( barrelResult, m_EBdigiCollection ) ;
403  event.put( endcapResult, m_EEdigiCollection ) ;
404  event.put( preshowerResult, m_ESdigiCollection ) ;
405 }
EEDigitizer * m_EndcapDigitizer
const std::string m_ESdigiCollection
ESOldDigitizer * m_ESOldDigitizer
const std::string m_EEdigiCollection
ESDigitizer * m_ESDigitizer
EBDigitizer * m_BarrelDigitizer
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
virtual void cacheEBDigis(const EBDigiCollection *ebDigiPtr) const
EBDigitizer * m_APDDigitizer
const bool m_apdSeparateDigi
const std::string m_apdDigiTag
virtual void run(DigiCollection &output)
virtual void cacheEEDigis(const EEDigiCollection *eeDigiPtr) const
const std::string m_EBdigiCollection
virtual void run(ESDigiCollection &output)
turns hits into digis
Definition: ESDigitizer.cc:189
void EcalDigiProducer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
virtual

Implements DigiAccumulatorMixMod.

Reimplemented in EcalTBDigiProducer.

Definition at line 290 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().

290  {
291  checkGeometry( eventSetup );
292  checkCalibrations( event, eventSetup );
294  if(m_apdSeparateDigi) {
296  }
298  if(m_doFastES) {
300  } else {
302  }
303 }
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
void EcalDigiProducer::updateGeometry ( )
private

Definition at line 548 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().

549 {
559 
560  const std::vector<DetId>* theESDets (
563 
564  if( !m_doFastES )
565  {
566  if( 0 != m_ESOldDigitizer &&
567  0 != theESDets )
568  m_ESOldDigitizer->setDetIds( *theESDets ) ;
569  }
570  else
571  {
572  if( 0 != m_ESDigitizer &&
573  0 != theESDets )
574  m_ESDigitizer->setDetIds( *theESDets ) ;
575  }
576 }
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:53
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 111 of file EcalDigiProducer.h.

EcalCoder* EcalDigiProducer::m_APDCoder
private

Definition at line 128 of file EcalDigiProducer.h.

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

const std::string EcalDigiProducer::m_apdDigiTag
private

Definition at line 100 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 127 of file EcalDigiProducer.h.

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

const APDSimParameters* EcalDigiProducer::m_apdParameters
private

Definition at line 101 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 79 of file EcalDigiProducer.h.

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

Definition at line 125 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 132 of file EcalDigiProducer.h.

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

const std::string EcalDigiProducer::m_EBdigiCollection
private

Definition at line 84 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 93 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EBShape EcalDigiProducer::m_EBShape
private

Definition at line 80 of file EcalDigiProducer.h.

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

Definition at line 133 of file EcalDigiProducer.h.

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

const std::string EcalDigiProducer::m_EEdigiCollection
private

Definition at line 85 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 94 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EEShape EcalDigiProducer::m_EEShape
private

Definition at line 81 of file EcalDigiProducer.h.

EcalElectronicsSim* EcalDigiProducer::m_ElectronicsSim
private

Definition at line 124 of file EcalDigiProducer.h.

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

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

Definition at line 86 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 115 of file EcalDigiProducer.h.

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

ESElectronicsSimFast* EcalDigiProducer::m_ESElectronicsSimFast
private

Definition at line 117 of file EcalDigiProducer.h.

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

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

Definition at line 109 of file EcalDigiProducer.h.

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

ESHitResponse* EcalDigiProducer::m_ESResponse
private

Definition at line 108 of file EcalDigiProducer.h.

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

ESShape EcalDigiProducer::m_ESShape
private

Definition at line 82 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const CaloGeometry* EcalDigiProducer::m_Geometry
private

Definition at line 130 of file EcalDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

const std::string EcalDigiProducer::m_hitsProducerTag
private

Definition at line 87 of file EcalDigiProducer.h.

Referenced by accumulate(), and EcalDigiProducer().

const EcalSimParameterMap* EcalDigiProducer::m_ParameterMap
protected
const unsigned int EcalDigiProducer::m_readoutFrameSize
private

Definition at line 96 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer().

bool EcalDigiProducer::m_useLCcorrection
private

Definition at line 89 of file EcalDigiProducer.h.

Referenced by checkCalibrations().