CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
EcalDigiProducer_Ph2 Class Reference

#include <EcalDigiProducer_Ph2.h>

Inheritance diagram for EcalDigiProducer_Ph2:
DigiAccumulatorMixMod

Public Types

typedef EcalTDigitizer< EBDigitizerTraits_Ph2EBDigitizer_Ph2
 
typedef EBDigitizerTraits_Ph2::ElectronicsSim EcalElectronicsSim_Ph2
 

Public Member Functions

void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
 EcalDigiProducer_Ph2 (const edm::ParameterSet &params, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
 
 EcalDigiProducer_Ph2 (const edm::ParameterSet &params, edm::ConsumesCollector &iC)
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
void setEBNoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
 ~EcalDigiProducer_Ph2 () override
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
 DigiAccumulatorMixMod (DigiAccumulatorMixMod const &)=delete
 
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)
 
DigiAccumulatorMixMod const & operator= (DigiAccumulatorMixMod const &)=delete
 
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

std::unique_ptr< EBHitResponse_Ph2m_EBResponse
 
std::unique_ptr< const EcalSimParameterMapm_ParameterMap
 

Private Types

typedef CaloTSamples< float, ecalPh2::sampleSizeEcalSamples_Ph2
 
typedef edm::Handle< std::vector< PCaloHit > > HitsHandle
 

Private Member Functions

void accumulateCaloHits (HitsHandle const &ebHandle, int bunchCrossing)
 
virtual void cacheEBDigis (const EBDigiCollectionPh2 *ebDigiPtr) const
 
void checkCalibrations (const edm::Event &event, const edm::EventSetup &eventSetup)
 
void checkGeometry (const edm::EventSetup &eventSetup)
 
void updateGeometry ()
 

Private Attributes

edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcdagcToken_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeom_token_
 
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcdicalToken_
 
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecordlaserToken_
 
std::unique_ptr< EcalLiteDTUCoderm_APDCoder
 
const std::string m_apdDigiTag
 
std::unique_ptr< EBDigitizer_Ph2m_APDDigitizer
 
std::unique_ptr< EcalElectronicsSim< EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2 > > m_APDElectronicsSim
 
std::unique_ptr< const APDSimParametersm_apdParameters
 
std::unique_ptr< EBHitResponse_Ph2m_APDResponse
 
const bool m_apdSeparateDigi
 
APDShape m_APDShape
 
std::unique_ptr< EBDigitizer_Ph2m_BarrelDigitizer
 
std::unique_ptr< EcalLiteDTUCoderm_Coder
 
std::unique_ptr< EcalLiteDTUCoderm_ComponentCoder
 
const std::string m_componentDigiTag
 
std::unique_ptr< EBDigitizer_Ph2m_ComponentDigitizer
 
std::unique_ptr< EcalElectronicsSim< EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2 > > m_ComponentElectronicsSim
 
std::unique_ptr< const ComponentSimParameterMapm_componentParameters
 
std::unique_ptr< EBHitResponse_Ph2m_ComponentResponse
 
const bool m_componentSeparateDigi
 
ComponentShapeCollection m_ComponentShapes
 
std::array< std::unique_ptr< CorrelatedNoisifier< EcalCorrMatrix_Ph2 > >, 2 > m_EBCorrNoise
 
const std::string m_EBdigiCollection
 
const double m_EBs25notCont
 
EBShape m_EBShape
 
std::unique_ptr< EcalElectronicsSim_Ph2m_ElectronicsSim
 
const CaloGeometrym_Geometry
 
const edm::EDGetTokenT< std::vector< PCaloHit > > m_HitsEBToken
 
const std::string m_hitsProducerTag
 
const bool m_PreMix1
 
const bool m_PreMix2
 
const unsigned int m_readoutFrameSize
 
bool m_useLCcorrection
 
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcdpedestalToken_
 
CLHEP::HepRandomEngine * randomEngine_ = nullptr
 

Detailed Description

Definition at line 55 of file EcalDigiProducer_Ph2.h.

Member Typedef Documentation

◆ EBDigitizer_Ph2

Definition at line 57 of file EcalDigiProducer_Ph2.h.

◆ EcalElectronicsSim_Ph2

Definition at line 58 of file EcalDigiProducer_Ph2.h.

◆ EcalSamples_Ph2

Definition at line 138 of file EcalDigiProducer_Ph2.h.

◆ HitsHandle

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

Definition at line 77 of file EcalDigiProducer_Ph2.h.

Constructor & Destructor Documentation

◆ EcalDigiProducer_Ph2() [1/2]

EcalDigiProducer_Ph2::EcalDigiProducer_Ph2 ( const edm::ParameterSet params,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)

Definition at line 44 of file EcalDigiProducer_Ph2.cc.

References m_apdDigiTag, m_apdSeparateDigi, m_componentDigiTag, m_componentSeparateDigi, m_EBdigiCollection, and edm::ProducesCollector::produces().

49  producesCollector.produces<EBDigiCollectionPh2>(m_apdDigiTag);
50 
53 
55 }
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const std::string m_apdDigiTag
const std::string m_EBdigiCollection
EcalDigiProducer_Ph2(const edm::ParameterSet &params, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
const std::string m_componentDigiTag

◆ EcalDigiProducer_Ph2() [2/2]

EcalDigiProducer_Ph2::EcalDigiProducer_Ph2 ( const edm::ParameterSet params,
edm::ConsumesCollector iC 
)

Definition at line 58 of file EcalDigiProducer_Ph2.cc.

60  m_APDShape(iC),
62  m_EBShape(iC),
63 
64  m_EBdigiCollection(params.getParameter<std::string>("EBdigiCollectionPh2")),
65 
66  m_hitsProducerTag(params.getParameter<std::string>("hitsProducer")),
67  m_useLCcorrection(params.getUntrackedParameter<bool>("UseLCcorrection")),
68  m_apdSeparateDigi(params.getParameter<bool>("apdSeparateDigi")),
69  m_componentSeparateDigi(params.getParameter<bool>("componentSeparateDigi")),
70 
71  m_EBs25notCont(params.getParameter<double>("EBs25notContainment")),
72 
74 
75  m_ParameterMap(std::make_unique<EcalSimParameterMap>(params.getParameter<double>("simHitToPhotoelectronsBarrel"),
76  0, // endcap parameters not needed
77  params.getParameter<double>("photoelectronsToAnalogBarrel"),
78  0,
79  params.getParameter<double>("samplingFactor"),
80  params.getParameter<double>("timePhase"),
82  params.getParameter<int>("binOfMaximum"),
83  params.getParameter<bool>("doPhotostatistics"),
84  params.getParameter<bool>("syncPhase"))),
85 
86  m_apdDigiTag(params.getParameter<std::string>("apdDigiTag")),
87  m_apdParameters(std::make_unique<APDSimParameters>(params.getParameter<bool>("apdAddToBarrel"),
89  params.getParameter<double>("apdSimToPELow"),
90  params.getParameter<double>("apdSimToPEHigh"),
91  params.getParameter<double>("apdTimeOffset"),
92  params.getParameter<double>("apdTimeOffWidth"),
93  params.getParameter<bool>("apdDoPEStats"),
95  params.getParameter<std::vector<double>>("apdNonlParms"))),
96 
97  m_componentDigiTag(params.getParameter<std::string>("componentDigiTag")),
99  std::make_unique<ComponentSimParameterMap>(params.getParameter<bool>("componentAddToBarrel"),
101  params.getParameter<double>("simHitToPhotoelectronsBarrel"),
102  0, // endcap parameters not needed
103  params.getParameter<double>("photoelectronsToAnalogBarrel"),
104  0,
105  params.getParameter<double>("samplingFactor"),
106  params.getParameter<double>("componentTimePhase"),
108  params.getParameter<int>("binOfMaximum"),
109  params.getParameter<bool>("doPhotostatistics"),
110  params.getParameter<bool>("syncPhase"))),
111 
113  : std::make_unique<EBHitResponse_Ph2>(m_ParameterMap.get(),
114  &m_EBShape,
115  true,
116  false,
117  m_apdParameters.get(),
118  &m_APDShape,
119  m_componentParameters.get(),
121 
123  : std::make_unique<EBHitResponse_Ph2>(m_ParameterMap.get(),
124  &m_EBShape,
125  false,
126  true,
127  m_apdParameters.get(),
128  &m_APDShape,
129  m_componentParameters.get(),
131 
132  m_EBResponse(std::make_unique<EBHitResponse_Ph2>(m_ParameterMap.get(),
133  &m_EBShape,
134  false, // barrel
135  false, // not component-based
136  m_apdParameters.get(),
137  &m_APDShape,
138  m_componentParameters.get(),
140 
141  m_PreMix1(params.getParameter<bool>("EcalPreMixStage1")),
142  m_PreMix2(params.getParameter<bool>("EcalPreMixStage2")),
143  m_HitsEBToken(iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"))),
144 
145  m_APDDigitizer(nullptr),
146  m_ComponentDigitizer(nullptr),
147  m_BarrelDigitizer(nullptr),
148  m_ElectronicsSim(nullptr),
149  m_Coder(nullptr),
150  m_APDElectronicsSim(nullptr),
151  m_APDCoder(nullptr),
152  m_Geometry(nullptr),
153  m_EBCorrNoise({{nullptr, nullptr}})
154 
155 {
156  iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
157  pedestalToken_ = iC.esConsumes();
162 
163  const std::vector<double> ebCorMatG10Ph2 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG10Ph2");
164  const std::vector<double> ebCorMatG01Ph2 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG01Ph2");
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  // further phase for cosmics studies
174  if (cosmicsPhase) {
175  m_EBResponse->setPhaseShift(1. + cosmicsShift);
176  }
177 
178  EcalCorrMatrix_Ph2 ebMatrix[2];
179  const double errorCorrelation = 1.e-7;
180  assert(ebCorMatG10Ph2.size() == m_readoutFrameSize);
181  assert(ebCorMatG01Ph2.size() == m_readoutFrameSize);
182 
183  assert(errorCorrelation > std::abs(ebCorMatG10Ph2[0] - 1.0));
184  assert(errorCorrelation > std::abs(ebCorMatG01Ph2[0] - 1.0));
185 
186  for (unsigned int row(0); row != m_readoutFrameSize; ++row) {
187  assert(0 == row || 1. >= ebCorMatG10Ph2[row]);
188  assert(0 == row || 1. >= ebCorMatG01Ph2[row]);
189 
190  for (unsigned int column(0); column <= row; ++column) {
191  const unsigned int index(row - column);
192  ebMatrix[0](row, column) = ebCorMatG10Ph2[index];
193  ebMatrix[1](row, column) = ebCorMatG01Ph2[index];
194  }
195  }
196  m_EBCorrNoise[0] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix_Ph2>>(ebMatrix[0]);
197  m_EBCorrNoise[1] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix_Ph2>>(ebMatrix[1]);
198  m_Coder = std::make_unique<EcalLiteDTUCoder>(addNoise, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
200  std::make_unique<EcalElectronicsSim_Ph2>(m_ParameterMap.get(), m_Coder.get(), applyConstantTerm, rmsConstantTerm);
201 
202  if (m_apdSeparateDigi) {
203  m_APDCoder = std::make_unique<EcalLiteDTUCoder>(false, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
204 
205  m_APDElectronicsSim = std::make_unique<EcalElectronicsSim_Ph2>(
206  m_ParameterMap.get(), m_APDCoder.get(), applyConstantTerm, rmsConstantTerm);
207 
208  m_APDDigitizer = std::make_unique<EBDigitizer_Ph2>(m_APDResponse.get(), m_APDElectronicsSim.get(), false);
209  }
212  std::make_unique<EcalLiteDTUCoder>(addNoise, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
213  m_ComponentElectronicsSim = std::make_unique<EcalElectronicsSim_Ph2>(
214  m_ParameterMap.get(), m_ComponentCoder.get(), applyConstantTerm, rmsConstantTerm);
216  std::make_unique<EBDigitizer_Ph2>(m_ComponentResponse.get(), m_ComponentElectronicsSim.get(), addNoise);
217  }
218 
219  m_BarrelDigitizer = std::make_unique<EBDigitizer_Ph2>(m_EBResponse.get(), m_ElectronicsSim.get(), addNoise);
220 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ComponentShapeCollection m_ComponentShapes
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
const unsigned int m_readoutFrameSize
std::unique_ptr< EBDigitizer_Ph2 > m_ComponentDigitizer
std::unique_ptr< EcalElectronicsSim_Ph2 > m_ElectronicsSim
const std::string m_apdDigiTag
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > laserToken_
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
std::unique_ptr< EBHitResponse_Ph2 > m_APDResponse
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > agcToken_
std::unique_ptr< EcalLiteDTUCoder > m_APDCoder
assert(be >=bs)
std::unique_ptr< EcalLiteDTUCoder > m_Coder
std::unique_ptr< const APDSimParameters > m_apdParameters
std::unique_ptr< EBHitResponse_Ph2 > m_ComponentResponse
std::array< std::unique_ptr< CorrelatedNoisifier< EcalCorrMatrix_Ph2 > >, 2 > m_EBCorrNoise
const std::string m_hitsProducerTag
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:36
const edm::EDGetTokenT< std::vector< PCaloHit > > m_HitsEBToken
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geom_token_
const std::string m_EBdigiCollection
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::unique_ptr< const EcalSimParameterMap > m_ParameterMap
const CaloGeometry * m_Geometry
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > icalToken_
std::unique_ptr< const ComponentSimParameterMap > m_componentParameters
std::unique_ptr< EcalElectronicsSim< EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2 > > m_ComponentElectronicsSim
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
EcalIntercalibConstantMap EcalIntercalibConstants
std::unique_ptr< EcalElectronicsSim< EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2 > > m_APDElectronicsSim
const std::string m_componentDigiTag
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
math::ErrorD< ecalPh2::sampleSize >::type EcalCorrMatrix_Ph2
std::unique_ptr< EcalLiteDTUCoder > m_ComponentCoder

◆ ~EcalDigiProducer_Ph2()

EcalDigiProducer_Ph2::~EcalDigiProducer_Ph2 ( )
override

Definition at line 222 of file EcalDigiProducer_Ph2.cc.

222 {}

Member Function Documentation

◆ accumulate() [1/2]

void EcalDigiProducer_Ph2::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 253 of file EcalDigiProducer_Ph2.cc.

References accumulateCaloHits(), MillePedeFileConverter_cfg::e, options_cfi::eventSetup, m_APDShape, m_ComponentShapes, m_EBShape, m_HitsEBToken, ComponentShapeCollection::setEventSetup(), and EcalShapeBase::setEventSetup().

253  {
254  // Step A: Get Inputs
255 
259  const edm::Handle<std::vector<PCaloHit>>& ebHandle = e.getHandle(m_HitsEBToken);
260 
261  accumulateCaloHits(ebHandle, 0);
262 }
ComponentShapeCollection m_ComponentShapes
const edm::EDGetTokenT< std::vector< PCaloHit > > m_HitsEBToken
void setEventSetup(const edm::EventSetup &evtSetup)
void setEventSetup(const edm::EventSetup &evtSetup, bool normalize=true)
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)

◆ accumulate() [2/2]

void EcalDigiProducer_Ph2::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &  streamID 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 264 of file EcalDigiProducer_Ph2.cc.

References accumulateCaloHits(), MillePedeFileConverter_cfg::e, and m_hitsProducerTag.

266  {
267  // Step A: Get Inputs
269 
270  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
271  e.getByLabel(ebTag, ebHandle);
272 
273  accumulateCaloHits(ebHandle, e.bunchCrossing());
274 }
const std::string m_hitsProducerTag
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)

◆ accumulateCaloHits()

void EcalDigiProducer_Ph2::accumulateCaloHits ( HitsHandle const &  ebHandle,
int  bunchCrossing 
)
private

Definition at line 240 of file EcalDigiProducer_Ph2.cc.

References edm::HandleBase::isValid(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_ComponentDigitizer, m_componentSeparateDigi, edm::Handle< T >::product(), and randomEngine_.

Referenced by accumulate().

240  {
241  if (ebHandle.isValid()) {
242  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
243 
244  if (m_apdSeparateDigi) {
245  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
246  }
248  m_ComponentDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
249  }
250  }
251 }
CLHEP::HepRandomEngine * randomEngine_
std::unique_ptr< EBDigitizer_Ph2 > m_ComponentDigitizer
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer

◆ beginLuminosityBlock()

void EcalDigiProducer_Ph2::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overridevirtual

Reimplemented from DigiAccumulatorMixMod.

Definition at line 313 of file EcalDigiProducer_Ph2.cc.

References Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), m_APDResponse, m_ComponentResponse, and m_EBResponse.

313  {
315  if (!rng.isAvailable()) {
316  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
317  "You must add the service in the configuration file\n"
318  "or remove the module that requires it.";
319  }
320  CLHEP::HepRandomEngine* engine = &rng->getEngine(lumi.index());
321 
322  if (nullptr != m_APDResponse)
323  m_APDResponse->initialize(engine);
324  if (nullptr != m_ComponentResponse)
325  m_ComponentResponse->initialize(engine);
326  m_EBResponse->initialize(engine);
327 }
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
std::unique_ptr< EBHitResponse_Ph2 > m_APDResponse
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unique_ptr< EBHitResponse_Ph2 > m_ComponentResponse
bool isAvailable() const
Definition: Service.h:40

◆ cacheEBDigis()

virtual void EcalDigiProducer_Ph2::cacheEBDigis ( const EBDigiCollectionPh2 ebDigiPtr) const
inlineprivatevirtual

Definition at line 75 of file EcalDigiProducer_Ph2.h.

Referenced by finalizeEvent().

75 {}

◆ checkCalibrations()

void EcalDigiProducer_Ph2::checkCalibrations ( const edm::Event event,
const edm::EventSetup eventSetup 
)
private

Definition at line 329 of file EcalDigiProducer_Ph2.cc.

References agcToken_, options_cfi::eventSetup, ecalPh2::gains, icalToken_, EcalCondDBWriter_cfi::laser, laserToken_, LogDebug, m_APDCoder, m_APDResponse, m_Coder, m_ComponentCoder, m_ComponentResponse, m_EBResponse, m_EBs25notCont, m_useLCcorrection, ecalPh2::MAXADC, and pedestalToken_.

Referenced by initializeEvent().

329  {
330  // Pedestals from event setup
331  auto pedestals = &eventSetup.getData(pedestalToken_);
332 
333  m_Coder->setPedestals(pedestals);
334  if (nullptr != m_APDCoder)
335  m_APDCoder->setPedestals(pedestals);
336  if (nullptr != m_ComponentCoder)
337  m_ComponentCoder->setPedestals(pedestals);
338 
339  // Ecal Intercalibration Constants
340  auto ical = &eventSetup.getData(icalToken_);
341 
342  m_Coder->setIntercalibConstants(ical);
343  if (nullptr != m_APDCoder)
344  m_APDCoder->setIntercalibConstants(ical);
345  if (nullptr != m_ComponentCoder)
346  m_ComponentCoder->setIntercalibConstants(ical);
347 
348  m_EBResponse->setIntercal(ical);
349  if (nullptr != m_APDResponse)
350  m_APDResponse->setIntercal(ical);
351  if (nullptr != m_ComponentResponse)
352  m_ComponentResponse->setIntercal(ical);
353 
354  // Ecal LaserCorrection Constants
355  auto laser = &eventSetup.getData(laserToken_);
356 
357  const edm::TimeValue_t eventTimeValue = event.time().value();
358 
359  m_EBResponse->setEventTime(eventTimeValue);
360  m_EBResponse->setLaserConstants(laser, m_useLCcorrection);
361 
362  // ADC -> GeV Scale
363  auto agc = &eventSetup.getData(agcToken_);
364 
365  m_Coder->setGainRatios(ecalPh2::gains[0] / ecalPh2::gains[1]);
366  if (nullptr != m_APDCoder)
367  m_APDCoder->setGainRatios(ecalPh2::gains[0] / ecalPh2::gains[1]);
368  if (nullptr != m_ComponentCoder)
369  m_ComponentCoder->setGainRatios(ecalPh2::gains[0] / ecalPh2::gains[1]);
370 
371  const double EBscale((agc->getEBValue()) * ecalPh2::gains[1] * (ecalPh2::MAXADC)*m_EBs25notCont);
372 
373  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEBValue() << "\n"
374  << " notCont = " << m_EBs25notCont << "\n"
375  << " saturation for EB = " << EBscale << ", " << m_EBs25notCont;
376 
377  m_Coder->setFullScaleEnergy(EBscale);
378  if (nullptr != m_APDCoder)
379  m_APDCoder->setFullScaleEnergy(EBscale);
380  if (nullptr != m_ComponentCoder)
381  m_ComponentCoder->setFullScaleEnergy(EBscale);
382 }
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > laserToken_
std::unique_ptr< EBHitResponse_Ph2 > m_APDResponse
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > agcToken_
std::unique_ptr< EcalLiteDTUCoder > m_APDCoder
std::unique_ptr< EcalLiteDTUCoder > m_Coder
std::unique_ptr< EBHitResponse_Ph2 > m_ComponentResponse
static constexpr const float * gains
Definition: EcalConstants.h:33
unsigned long long TimeValue_t
Definition: Timestamp.h:21
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > icalToken_
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
static constexpr unsigned int MAXADC
Definition: EcalConstants.h:38
std::unique_ptr< EcalLiteDTUCoder > m_ComponentCoder
#define LogDebug(id)

◆ checkGeometry()

void EcalDigiProducer_Ph2::checkGeometry ( const edm::EventSetup eventSetup)
private

Definition at line 384 of file EcalDigiProducer_Ph2.cc.

References options_cfi::eventSetup, geom_token_, m_Geometry, and updateGeometry().

Referenced by initializeEvent().

384  {
385  // TODO find a way to avoid doing this every event
386  edm::ESHandle<CaloGeometry> hGeometry = eventSetup.getHandle(geom_token_);
387  const CaloGeometry* pGeometry = &*hGeometry;
388 
389  if (pGeometry != m_Geometry) {
390  m_Geometry = pGeometry;
391  updateGeometry();
392  }
393 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geom_token_
const CaloGeometry * m_Geometry

◆ finalizeEvent()

void EcalDigiProducer_Ph2::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 276 of file EcalDigiProducer_Ph2.cc.

References cacheEBDigis(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_componentDigiTag, m_ComponentDigitizer, m_componentSeparateDigi, m_EBdigiCollection, eostools::move(), and randomEngine_.

276  {
277  // Step B: Create empty output
278  std::unique_ptr<EBDigiCollectionPh2> apdResult(nullptr);
279  std::unique_ptr<EBDigiCollectionPh2> componentResult(nullptr);
280  std::unique_ptr<EBDigiCollectionPh2> barrelResult = std::make_unique<EBDigiCollectionPh2>();
281  if (m_apdSeparateDigi) {
282  apdResult = std::make_unique<EBDigiCollectionPh2>();
283  }
285  componentResult = std::make_unique<EBDigiCollectionPh2>();
286  }
287  // run the algorithm
288 
289  m_BarrelDigitizer->run(*barrelResult, randomEngine_);
290  cacheEBDigis(&*barrelResult);
291 
292  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size();
293 
294  if (m_apdSeparateDigi) {
295  m_APDDigitizer->run(*apdResult, randomEngine_);
296  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size();
297  }
299  m_ComponentDigitizer->run(*componentResult, randomEngine_);
300  edm::LogInfo("DigiInfo") << "Component Digis: " << componentResult->size();
301  }
302 
303  // Step D: Put outputs into event
304 
305  event.put(std::move(barrelResult), m_EBdigiCollection);
307  event.put(std::move(componentResult), m_componentDigiTag);
308  }
309 
310  randomEngine_ = nullptr; // to prevent access outside event
311 }
CLHEP::HepRandomEngine * randomEngine_
std::unique_ptr< EBDigitizer_Ph2 > m_ComponentDigitizer
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
const std::string m_EBdigiCollection
virtual void cacheEBDigis(const EBDigiCollectionPh2 *ebDigiPtr) const
Log< level::Info, false > LogInfo
const std::string m_componentDigiTag
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
def move(src, dest)
Definition: eostools.py:511

◆ initializeEvent()

void EcalDigiProducer_Ph2::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 224 of file EcalDigiProducer_Ph2.cc.

References checkCalibrations(), checkGeometry(), options_cfi::eventSetup, edm::RandomNumberGenerator::getEngine(), m_APDDigitizer, m_apdSeparateDigi, m_BarrelDigitizer, m_ComponentDigitizer, m_componentSeparateDigi, and randomEngine_.

224  {
226  randomEngine_ = &rng->getEngine(event.streamID());
227 
230 
231  m_BarrelDigitizer->initializeHits();
232  if (m_apdSeparateDigi) {
233  m_APDDigitizer->initializeHits();
234  }
236  m_ComponentDigitizer->initializeHits();
237  }
238 }
CLHEP::HepRandomEngine * randomEngine_
std::unique_ptr< EBDigitizer_Ph2 > m_ComponentDigitizer
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
void checkGeometry(const edm::EventSetup &eventSetup)
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
Definition: event.py:1

◆ setEBNoiseSignalGenerator()

void EcalDigiProducer_Ph2::setEBNoiseSignalGenerator ( EcalBaseSignalGenerator noiseGenerator)

Definition at line 403 of file EcalDigiProducer_Ph2.cc.

References m_BarrelDigitizer.

403  {
404  m_BarrelDigitizer->setNoiseSignalGenerator(noiseGenerator);
405 }
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer

◆ updateGeometry()

void EcalDigiProducer_Ph2::updateGeometry ( )
private

Definition at line 395 of file EcalDigiProducer_Ph2.cc.

References DetId::Ecal, EcalBarrel, CaloGeometry::getSubdetectorGeometry(), m_APDResponse, m_ComponentResponse, m_EBResponse, and m_Geometry.

Referenced by checkGeometry().

395  {
396  if (nullptr != m_APDResponse)
398  if (nullptr != m_ComponentResponse)
401 }
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
std::unique_ptr< EBHitResponse_Ph2 > m_APDResponse
std::unique_ptr< EBHitResponse_Ph2 > m_ComponentResponse
const CaloGeometry * m_Geometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

Member Data Documentation

◆ agcToken_

edm::ESGetToken<EcalADCToGeVConstant, EcalADCToGeVConstantRcd> EcalDigiProducer_Ph2::agcToken_
private

Definition at line 81 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ geom_token_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalDigiProducer_Ph2::geom_token_
private

Definition at line 83 of file EcalDigiProducer_Ph2.h.

Referenced by checkGeometry().

◆ icalToken_

edm::ESGetToken<EcalIntercalibConstants, EcalIntercalibConstantsRcd> EcalDigiProducer_Ph2::icalToken_
private

Definition at line 82 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ laserToken_

edm::ESGetToken<EcalLaserDbService, EcalLaserDbRecord> EcalDigiProducer_Ph2::laserToken_
private

Definition at line 80 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_APDCoder

std::unique_ptr<EcalLiteDTUCoder> EcalDigiProducer_Ph2::m_APDCoder
private

Definition at line 140 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_apdDigiTag

const std::string EcalDigiProducer_Ph2::m_apdDigiTag
private

Definition at line 112 of file EcalDigiProducer_Ph2.h.

Referenced by EcalDigiProducer_Ph2().

◆ m_APDDigitizer

std::unique_ptr<EBDigitizer_Ph2> EcalDigiProducer_Ph2::m_APDDigitizer
private

Definition at line 131 of file EcalDigiProducer_Ph2.h.

Referenced by accumulateCaloHits(), finalizeEvent(), and initializeEvent().

◆ m_APDElectronicsSim

std::unique_ptr<EcalElectronicsSim<EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2> > EcalDigiProducer_Ph2::m_APDElectronicsSim
private

Definition at line 139 of file EcalDigiProducer_Ph2.h.

◆ m_apdParameters

std::unique_ptr<const APDSimParameters> EcalDigiProducer_Ph2::m_apdParameters
private

Definition at line 113 of file EcalDigiProducer_Ph2.h.

◆ m_APDResponse

std::unique_ptr<EBHitResponse_Ph2> EcalDigiProducer_Ph2::m_APDResponse
private

Definition at line 118 of file EcalDigiProducer_Ph2.h.

Referenced by beginLuminosityBlock(), checkCalibrations(), and updateGeometry().

◆ m_apdSeparateDigi

const bool EcalDigiProducer_Ph2::m_apdSeparateDigi
private

◆ m_APDShape

APDShape EcalDigiProducer_Ph2::m_APDShape
private

Definition at line 92 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_BarrelDigitizer

std::unique_ptr<EBDigitizer_Ph2> EcalDigiProducer_Ph2::m_BarrelDigitizer
private

◆ m_Coder

std::unique_ptr<EcalLiteDTUCoder> EcalDigiProducer_Ph2::m_Coder
private

Definition at line 136 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_ComponentCoder

std::unique_ptr<EcalLiteDTUCoder> EcalDigiProducer_Ph2::m_ComponentCoder
private

Definition at line 142 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_componentDigiTag

const std::string EcalDigiProducer_Ph2::m_componentDigiTag
private

Definition at line 115 of file EcalDigiProducer_Ph2.h.

Referenced by EcalDigiProducer_Ph2(), and finalizeEvent().

◆ m_ComponentDigitizer

std::unique_ptr<EBDigitizer_Ph2> EcalDigiProducer_Ph2::m_ComponentDigitizer
private

Definition at line 132 of file EcalDigiProducer_Ph2.h.

Referenced by accumulateCaloHits(), finalizeEvent(), and initializeEvent().

◆ m_ComponentElectronicsSim

std::unique_ptr<EcalElectronicsSim<EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2> > EcalDigiProducer_Ph2::m_ComponentElectronicsSim
private

Definition at line 141 of file EcalDigiProducer_Ph2.h.

◆ m_componentParameters

std::unique_ptr<const ComponentSimParameterMap> EcalDigiProducer_Ph2::m_componentParameters
private

Definition at line 116 of file EcalDigiProducer_Ph2.h.

◆ m_ComponentResponse

std::unique_ptr<EBHitResponse_Ph2> EcalDigiProducer_Ph2::m_ComponentResponse
private

Definition at line 120 of file EcalDigiProducer_Ph2.h.

Referenced by beginLuminosityBlock(), checkCalibrations(), and updateGeometry().

◆ m_componentSeparateDigi

const bool EcalDigiProducer_Ph2::m_componentSeparateDigi
private

◆ m_ComponentShapes

ComponentShapeCollection EcalDigiProducer_Ph2::m_ComponentShapes
private

Definition at line 93 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_EBCorrNoise

std::array<std::unique_ptr<CorrelatedNoisifier<EcalCorrMatrix_Ph2> >, 2> EcalDigiProducer_Ph2::m_EBCorrNoise
private

Definition at line 146 of file EcalDigiProducer_Ph2.h.

◆ m_EBdigiCollection

const std::string EcalDigiProducer_Ph2::m_EBdigiCollection
private

Definition at line 96 of file EcalDigiProducer_Ph2.h.

Referenced by EcalDigiProducer_Ph2(), and finalizeEvent().

◆ m_EBResponse

std::unique_ptr<EBHitResponse_Ph2> EcalDigiProducer_Ph2::m_EBResponse
protected

Definition at line 123 of file EcalDigiProducer_Ph2.h.

Referenced by beginLuminosityBlock(), checkCalibrations(), and updateGeometry().

◆ m_EBs25notCont

const double EcalDigiProducer_Ph2::m_EBs25notCont
private

Definition at line 104 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_EBShape

EBShape EcalDigiProducer_Ph2::m_EBShape
private

Definition at line 94 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_ElectronicsSim

std::unique_ptr<EcalElectronicsSim_Ph2> EcalDigiProducer_Ph2::m_ElectronicsSim
private

Definition at line 135 of file EcalDigiProducer_Ph2.h.

◆ m_Geometry

const CaloGeometry* EcalDigiProducer_Ph2::m_Geometry
private

Definition at line 144 of file EcalDigiProducer_Ph2.h.

Referenced by checkGeometry(), and updateGeometry().

◆ m_HitsEBToken

const edm::EDGetTokenT<std::vector<PCaloHit> > EcalDigiProducer_Ph2::m_HitsEBToken
private

Definition at line 129 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_hitsProducerTag

const std::string EcalDigiProducer_Ph2::m_hitsProducerTag
private

Definition at line 97 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_ParameterMap

std::unique_ptr<const EcalSimParameterMap> EcalDigiProducer_Ph2::m_ParameterMap
protected

Definition at line 109 of file EcalDigiProducer_Ph2.h.

◆ m_PreMix1

const bool EcalDigiProducer_Ph2::m_PreMix1
private

Definition at line 126 of file EcalDigiProducer_Ph2.h.

◆ m_PreMix2

const bool EcalDigiProducer_Ph2::m_PreMix2
private

Definition at line 127 of file EcalDigiProducer_Ph2.h.

◆ m_readoutFrameSize

const unsigned int EcalDigiProducer_Ph2::m_readoutFrameSize
private

Definition at line 106 of file EcalDigiProducer_Ph2.h.

◆ m_useLCcorrection

bool EcalDigiProducer_Ph2::m_useLCcorrection
private

Definition at line 99 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ pedestalToken_

edm::ESGetToken<EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd> EcalDigiProducer_Ph2::pedestalToken_
private

Definition at line 79 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ randomEngine_

CLHEP::HepRandomEngine* EcalDigiProducer_Ph2::randomEngine_ = nullptr
private

Definition at line 148 of file EcalDigiProducer_Ph2.h.

Referenced by accumulateCaloHits(), finalizeEvent(), and initializeEvent().