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::EDProducer &mixMod)
 
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 51 of file EcalDigiProducer.h.

Member Typedef Documentation

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

Definition at line 67 of file EcalDigiProducer.h.

Constructor & Destructor Documentation

EcalDigiProducer::EcalDigiProducer ( const edm::ParameterSet params,
edm::EDProducer mixMod 
)

Definition at line 50 of file EcalDigiProducer.cc.

References 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_ParameterMap, m_readoutFrameSize, and EcalHitResponse::setPhaseShift().

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

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

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

325  {
326  // Step A: Get Inputs
327  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
329  e.getByLabel(ebTag, ebHandle);
330 
331  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
333  e.getByLabel(eeTag, eeHandle);
334 
335  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
337  e.getByLabel(esTag, esHandle);
338 
339  accumulateCaloHits(ebHandle, eeHandle, esHandle, 0);
340 }
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 343 of file EcalDigiProducer.cc.

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

343  {
344  // Step A: Get Inputs
345  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
347  e.getByLabel(ebTag, ebHandle);
348 
349  edm::InputTag eeTag(m_hitsProducerTag, "EcalHitsEE");
351  e.getByLabel(eeTag, eeHandle);
352 
353  edm::InputTag esTag(m_hitsProducerTag, "EcalHitsES");
355  e.getByLabel(esTag, esHandle);
356 
357  accumulateCaloHits(ebHandle, eeHandle, esHandle, e.bunchCrossing());
358 }
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 302 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().

302  {
303  if(ebHandle.isValid()) {
304  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
305 
306  if(m_apdSeparateDigi) {
307  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing);
308  }
309  }
310 
311  if(eeHandle.isValid()) {
312  m_EndcapDigitizer->add(*eeHandle.product(), bunchCrossing);
313  }
314 
315  if(esHandle.isValid()) {
316  if(m_doFastES) {
317  m_ESDigitizer->add(*esHandle.product(), bunchCrossing);
318  } else {
319  m_ESOldDigitizer->add(*esHandle.product(), bunchCrossing);
320  }
321  }
322 }
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 64 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

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

Reimplemented in EcalTBDigiProducer.

Definition at line 65 of file EcalDigiProducer.h.

Referenced by finalizeEvent().

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

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

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

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

Referenced by initializeEvent().

529 {
530  // TODO find a way to avoid doing this every event
531  edm::ESHandle<CaloGeometry> hGeometry ;
532  eventSetup.get<CaloGeometryRecord>().get( hGeometry ) ;
533 
534  const CaloGeometry* pGeometry = &*hGeometry;
535 
536  if( pGeometry != m_Geometry )
537  {
538  m_Geometry = pGeometry;
539  updateGeometry();
540  }
541 }
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 361 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().

361  {
362  // Step B: Create empty output
363  std::auto_ptr<EBDigiCollection> apdResult ( !m_apdSeparateDigi ? 0 :
364  new EBDigiCollection() ) ;
365  std::auto_ptr<EBDigiCollection> barrelResult ( new EBDigiCollection() ) ;
366  std::auto_ptr<EEDigiCollection> endcapResult ( new EEDigiCollection() ) ;
367  std::auto_ptr<ESDigiCollection> preshowerResult( new ESDigiCollection() ) ;
368 
369  // run the algorithm
370 
371  m_BarrelDigitizer->run( *barrelResult ) ;
372  cacheEBDigis( &*barrelResult ) ;
373 
374  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size() ;
375 
376  if( m_apdSeparateDigi ) {
377  m_APDDigitizer->run( *apdResult ) ;
378  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size() ;
379  }
380 
381  m_EndcapDigitizer->run( *endcapResult ) ;
382  edm::LogInfo("EcalDigi") << "EE Digis: " << endcapResult->size() ;
383  cacheEEDigis( &*endcapResult ) ;
384 
385  if(m_doFastES) {
386  m_ESDigitizer->run( *preshowerResult ) ;
387  } else {
388  m_ESOldDigitizer->run( *preshowerResult ) ;
389  }
390  edm::LogInfo("EcalDigi") << "ES Digis: " << preshowerResult->size();
391 
392 
393  // Step D: Put outputs into event
394  if( m_apdSeparateDigi ) {
395  event.put( apdResult, m_apdDigiTag ) ;
396  }
397 
398  event.put( barrelResult, m_EBdigiCollection ) ;
399  event.put( endcapResult, m_EEdigiCollection ) ;
400  event.put( preshowerResult, m_ESdigiCollection ) ;
401 }
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 286 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().

286  {
287  checkGeometry( eventSetup );
288  checkCalibrations( event, eventSetup );
290  if(m_apdSeparateDigi) {
292  }
294  if(m_doFastES) {
296  } else {
298  }
299 }
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 544 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().

545 {
555 
556  const std::vector<DetId>* theESDets (
559 
560  if( !m_doFastES )
561  {
562  if( 0 != m_ESOldDigitizer &&
563  0 != theESDets )
564  m_ESOldDigitizer->setDetIds( *theESDets ) ;
565  }
566  else
567  {
568  if( 0 != m_ESDigitizer &&
569  0 != theESDets )
570  m_ESDigitizer->setDetIds( *theESDets ) ;
571  }
572 }
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 108 of file EcalDigiProducer.h.

EcalCoder* EcalDigiProducer::m_APDCoder
private

Definition at line 125 of file EcalDigiProducer.h.

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

const std::string EcalDigiProducer::m_apdDigiTag
private

Definition at line 97 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 124 of file EcalDigiProducer.h.

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

const APDSimParameters* EcalDigiProducer::m_apdParameters
private

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

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

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

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

const std::string EcalDigiProducer::m_EBdigiCollection
private

Definition at line 81 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 90 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EBShape EcalDigiProducer::m_EBShape
private

Definition at line 77 of file EcalDigiProducer.h.

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

Definition at line 130 of file EcalDigiProducer.h.

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

const std::string EcalDigiProducer::m_EEdigiCollection
private

Definition at line 82 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 91 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const EEShape EcalDigiProducer::m_EEShape
private

Definition at line 78 of file EcalDigiProducer.h.

EcalElectronicsSim* EcalDigiProducer::m_ElectronicsSim
private

Definition at line 121 of file EcalDigiProducer.h.

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

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

Definition at line 83 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer(), and finalizeEvent().

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

Definition at line 112 of file EcalDigiProducer.h.

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

ESElectronicsSimFast* EcalDigiProducer::m_ESElectronicsSimFast
private

Definition at line 114 of file EcalDigiProducer.h.

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

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

Definition at line 106 of file EcalDigiProducer.h.

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

ESHitResponse* EcalDigiProducer::m_ESResponse
private

Definition at line 105 of file EcalDigiProducer.h.

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

ESShape EcalDigiProducer::m_ESShape
private

Definition at line 79 of file EcalDigiProducer.h.

Referenced by checkCalibrations().

const CaloGeometry* EcalDigiProducer::m_Geometry
private

Definition at line 127 of file EcalDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

const std::string EcalDigiProducer::m_hitsProducerTag
private

Definition at line 84 of file EcalDigiProducer.h.

Referenced by accumulate().

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

Definition at line 93 of file EcalDigiProducer.h.

Referenced by EcalDigiProducer().

bool EcalDigiProducer::m_useLCcorrection
private

Definition at line 86 of file EcalDigiProducer.h.

Referenced by checkCalibrations().