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::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 53 of file EcalDigiProducer_Ph2.h.

Member Typedef Documentation

◆ EBDigitizer_Ph2

Definition at line 55 of file EcalDigiProducer_Ph2.h.

◆ EcalElectronicsSim_Ph2

Definition at line 56 of file EcalDigiProducer_Ph2.h.

◆ EcalSamples_Ph2

Definition at line 128 of file EcalDigiProducer_Ph2.h.

◆ HitsHandle

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

Definition at line 75 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 43 of file EcalDigiProducer_Ph2.cc.

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

48  producesCollector.produces<EBDigiCollectionPh2>(m_apdDigiTag);
49 
51 }
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)

◆ EcalDigiProducer_Ph2() [2/2]

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

Definition at line 54 of file EcalDigiProducer_Ph2.cc.

56  m_APDShape(iC),
57  m_EBShape(iC),
58 
59  m_EBdigiCollection(params.getParameter<std::string>("EBdigiCollectionPh2")),
60 
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 
68 
69  m_ParameterMap(std::make_unique<EcalSimParameterMap>(params.getParameter<double>("simHitToPhotoelectronsBarrel"),
70  0, // endcap parameters not needed
71  params.getParameter<double>("photoelectronsToAnalogBarrel"),
72  0,
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")),
81  m_apdParameters(std::make_unique<APDSimParameters>(params.getParameter<bool>("apdAddToBarrel"),
83  params.getParameter<double>("apdSimToPELow"),
84  params.getParameter<double>("apdSimToPEHigh"),
85  params.getParameter<double>("apdTimeOffset"),
86  params.getParameter<double>("apdTimeOffWidth"),
87  params.getParameter<bool>("apdDoPEStats"),
89  params.getParameter<std::vector<double>>("apdNonlParms"))),
90 
92  ? nullptr
93  : std::make_unique<EBHitResponse_Ph2>(
94  m_ParameterMap.get(), &m_EBShape, true, m_apdParameters.get(), &m_APDShape)),
95 
96  m_EBResponse(std::make_unique<EBHitResponse_Ph2>(m_ParameterMap.get(),
97  &m_EBShape,
98  false, // barrel
99  m_apdParameters.get(),
100  &m_APDShape)),
101 
102  m_PreMix1(params.getParameter<bool>("EcalPreMixStage1")),
103  m_PreMix2(params.getParameter<bool>("EcalPreMixStage2")),
104  m_HitsEBToken(iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"))),
105 
106  m_APDDigitizer(nullptr),
107  m_BarrelDigitizer(nullptr),
108  m_ElectronicsSim(nullptr),
109  m_Coder(nullptr),
110  m_APDElectronicsSim(nullptr),
111  m_APDCoder(nullptr),
112  m_Geometry(nullptr),
113  m_EBCorrNoise({{nullptr, nullptr}})
114 
115 {
116  iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
117  pedestalToken_ = iC.esConsumes();
122 
123  const std::vector<double> ebCorMatG10Ph2 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG10Ph2");
124  const std::vector<double> ebCorMatG01Ph2 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG01Ph2");
125 
126  const bool applyConstantTerm = params.getParameter<bool>("applyConstantTerm");
127  const double rmsConstantTerm = params.getParameter<double>("ConstantTerm");
128 
129  const bool addNoise = params.getParameter<bool>("doENoise");
130  const bool cosmicsPhase = params.getParameter<bool>("cosmicsPhase");
131  const double cosmicsShift = params.getParameter<double>("cosmicsShift");
132 
133  // further phase for cosmics studies
134  if (cosmicsPhase) {
135  m_EBResponse->setPhaseShift(1. + cosmicsShift);
136  }
137 
138  EcalCorrMatrix_Ph2 ebMatrix[2];
139  const double errorCorrelation = 1.e-7;
140  assert(ebCorMatG10Ph2.size() == m_readoutFrameSize);
141  assert(ebCorMatG01Ph2.size() == m_readoutFrameSize);
142 
143  assert(errorCorrelation > std::abs(ebCorMatG10Ph2[0] - 1.0));
144  assert(errorCorrelation > std::abs(ebCorMatG01Ph2[0] - 1.0));
145 
146  for (unsigned int row(0); row != m_readoutFrameSize; ++row) {
147  assert(0 == row || 1. >= ebCorMatG10Ph2[row]);
148  assert(0 == row || 1. >= ebCorMatG01Ph2[row]);
149 
150  for (unsigned int column(0); column <= row; ++column) {
151  const unsigned int index(row - column);
152  ebMatrix[0](row, column) = ebCorMatG10Ph2[index];
153  ebMatrix[1](row, column) = ebCorMatG01Ph2[index];
154  }
155  }
156  m_EBCorrNoise[0] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix_Ph2>>(ebMatrix[0]);
157  m_EBCorrNoise[1] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix_Ph2>>(ebMatrix[1]);
158  m_Coder = std::make_unique<EcalLiteDTUCoder>(addNoise, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
160  std::make_unique<EcalElectronicsSim_Ph2>(m_ParameterMap.get(), m_Coder.get(), applyConstantTerm, rmsConstantTerm);
161 
162  if (m_apdSeparateDigi) {
163  m_APDCoder = std::make_unique<EcalLiteDTUCoder>(false, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
164 
165  m_APDElectronicsSim = std::make_unique<EcalElectronicsSim_Ph2>(
166  m_ParameterMap.get(), m_APDCoder.get(), applyConstantTerm, rmsConstantTerm);
167 
168  m_APDDigitizer = std::make_unique<EBDigitizer_Ph2>(m_APDResponse.get(), m_APDElectronicsSim.get(), false);
169  }
170 
171  m_BarrelDigitizer = std::make_unique<EBDigitizer_Ph2>(m_EBResponse.get(), m_ElectronicsSim.get(), addNoise);
172 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
const unsigned int m_readoutFrameSize
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::array< std::unique_ptr< CorrelatedNoisifier< EcalCorrMatrix_Ph2 > >, 2 > m_EBCorrNoise
const std::string m_hitsProducerTag
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:27
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_
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
EcalIntercalibConstantMap EcalIntercalibConstants
std::unique_ptr< EcalElectronicsSim< EcalLiteDTUCoder, EcalSamples_Ph2, EcalDataFrame_Ph2 > > m_APDElectronicsSim
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
math::ErrorD< ecalPh2::sampleSize >::type EcalCorrMatrix_Ph2

◆ ~EcalDigiProducer_Ph2()

EcalDigiProducer_Ph2::~EcalDigiProducer_Ph2 ( )
override

Definition at line 174 of file EcalDigiProducer_Ph2.cc.

174 {}

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 199 of file EcalDigiProducer_Ph2.cc.

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

199  {
200  // Step A: Get Inputs
201 
204  const edm::Handle<std::vector<PCaloHit>>& ebHandle = e.getHandle(m_HitsEBToken);
205 
206  accumulateCaloHits(ebHandle, 0);
207 }
const edm::EDGetTokenT< std::vector< PCaloHit > > m_HitsEBToken
void setEventSetup(const edm::EventSetup &evtSetup)
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 209 of file EcalDigiProducer_Ph2.cc.

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

211  {
212  // Step A: Get Inputs
214 
215  edm::InputTag ebTag(m_hitsProducerTag, "EcalHitsEB");
216  e.getByLabel(ebTag, ebHandle);
217 
218  accumulateCaloHits(ebHandle, e.bunchCrossing());
219 }
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 189 of file EcalDigiProducer_Ph2.cc.

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

Referenced by accumulate().

189  {
190  if (ebHandle.isValid()) {
191  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
192 
193  if (m_apdSeparateDigi) {
194  m_APDDigitizer->add(*ebHandle.product(), bunchCrossing, randomEngine_);
195  }
196  }
197 }
CLHEP::HepRandomEngine * randomEngine_
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 247 of file EcalDigiProducer_Ph2.cc.

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

247  {
249  if (!rng.isAvailable()) {
250  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
251  "You must add the service in the configuration file\n"
252  "or remove the module that requires it.";
253  }
254  CLHEP::HepRandomEngine* engine = &rng->getEngine(lumi.index());
255 
256  if (nullptr != m_APDResponse)
257  m_APDResponse->initialize(engine);
258  m_EBResponse->initialize(engine);
259 }
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.
bool isAvailable() const
Definition: Service.h:40

◆ cacheEBDigis()

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

Definition at line 73 of file EcalDigiProducer_Ph2.h.

Referenced by finalizeEvent().

73 {}

◆ checkCalibrations()

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

Definition at line 261 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_EBResponse, m_EBs25notCont, m_useLCcorrection, ecalPh2::MAXADC, and pedestalToken_.

Referenced by initializeEvent().

261  {
262  // Pedestals from event setup
263  auto pedestals = &eventSetup.getData(pedestalToken_);
264 
265  m_Coder->setPedestals(pedestals);
266  if (nullptr != m_APDCoder)
267  m_APDCoder->setPedestals(pedestals);
268 
269  // Ecal Intercalibration Constants
270  auto ical = &eventSetup.getData(icalToken_);
271 
272  m_Coder->setIntercalibConstants(ical);
273  if (nullptr != m_APDCoder)
274  m_APDCoder->setIntercalibConstants(ical);
275 
276  m_EBResponse->setIntercal(ical);
277  if (nullptr != m_APDResponse)
278  m_APDResponse->setIntercal(ical);
279 
280  // Ecal LaserCorrection Constants
281  auto laser = &eventSetup.getData(laserToken_);
282 
283  const edm::TimeValue_t eventTimeValue = event.time().value();
284 
285  m_EBResponse->setEventTime(eventTimeValue);
286  m_EBResponse->setLaserConstants(laser, m_useLCcorrection);
287 
288  // ADC -> GeV Scale
289  auto agc = &eventSetup.getData(agcToken_);
290 
291  m_Coder->setGainRatios(ecalPh2::gains[0] / ecalPh2::gains[1]);
292  if (nullptr != m_APDCoder)
293  m_APDCoder->setGainRatios(ecalPh2::gains[0] / ecalPh2::gains[1]);
294 
295  const double EBscale((agc->getEBValue()) * ecalPh2::gains[1] * (ecalPh2::MAXADC)*m_EBs25notCont);
296 
297  LogDebug("EcalDigi") << " GeV/ADC = " << agc->getEBValue() << "\n"
298  << " notCont = " << m_EBs25notCont << "\n"
299  << " saturation for EB = " << EBscale << ", " << m_EBs25notCont;
300 
301  m_Coder->setFullScaleEnergy(EBscale);
302  if (nullptr != m_APDCoder)
303  m_APDCoder->setFullScaleEnergy(EBscale);
304 }
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
static constexpr const float * gains
Definition: EcalConstants.h:24
unsigned long long TimeValue_t
Definition: Timestamp.h:28
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > icalToken_
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
static constexpr unsigned int MAXADC
Definition: EcalConstants.h:29
#define LogDebug(id)

◆ checkGeometry()

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

Definition at line 306 of file EcalDigiProducer_Ph2.cc.

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

Referenced by initializeEvent().

306  {
307  // TODO find a way to avoid doing this every event
308  edm::ESHandle<CaloGeometry> hGeometry = eventSetup.getHandle(geom_token_);
309  const CaloGeometry* pGeometry = &*hGeometry;
310 
311  if (pGeometry != m_Geometry) {
312  m_Geometry = pGeometry;
313  updateGeometry();
314  }
315 }
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 221 of file EcalDigiProducer_Ph2.cc.

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

221  {
222  // Step B: Create empty output
223  std::unique_ptr<EBDigiCollectionPh2> apdResult(nullptr);
224  std::unique_ptr<EBDigiCollectionPh2> barrelResult = std::make_unique<EBDigiCollectionPh2>();
225  if (m_apdSeparateDigi) {
226  apdResult = std::make_unique<EBDigiCollectionPh2>();
227  }
228  // run the algorithm
229 
230  m_BarrelDigitizer->run(*barrelResult, randomEngine_);
231  cacheEBDigis(&*barrelResult);
232 
233  edm::LogInfo("DigiInfo") << "EB Digis: " << barrelResult->size();
234 
235  if (m_apdSeparateDigi) {
236  m_APDDigitizer->run(*apdResult, randomEngine_);
237  edm::LogInfo("DigiInfo") << "APD Digis: " << apdResult->size();
238  }
239 
240  // Step D: Put outputs into event
241 
242  event.put(std::move(barrelResult), m_EBdigiCollection);
243 
244  randomEngine_ = nullptr; // to prevent access outside event
245 }
CLHEP::HepRandomEngine * randomEngine_
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
const std::string m_EBdigiCollection
virtual void cacheEBDigis(const EBDigiCollectionPh2 *ebDigiPtr) const
Log< level::Info, false > LogInfo
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 176 of file EcalDigiProducer_Ph2.cc.

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

176  {
178  randomEngine_ = &rng->getEngine(event.streamID());
179 
182 
183  m_BarrelDigitizer->initializeHits();
184  if (m_apdSeparateDigi) {
185  m_APDDigitizer->initializeHits();
186  }
187 }
CLHEP::HepRandomEngine * randomEngine_
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 323 of file EcalDigiProducer_Ph2.cc.

References m_BarrelDigitizer.

323  {
324  m_BarrelDigitizer->setNoiseSignalGenerator(noiseGenerator);
325 }
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer

◆ updateGeometry()

void EcalDigiProducer_Ph2::updateGeometry ( )
private

Definition at line 317 of file EcalDigiProducer_Ph2.cc.

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

Referenced by checkGeometry().

317  {
318  if (nullptr != m_APDResponse)
321 }
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
std::unique_ptr< EBHitResponse_Ph2 > m_APDResponse
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 79 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ geom_token_

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

Definition at line 81 of file EcalDigiProducer_Ph2.h.

Referenced by checkGeometry().

◆ icalToken_

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

Definition at line 80 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ laserToken_

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

Definition at line 78 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_APDCoder

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

Definition at line 130 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_apdDigiTag

const std::string EcalDigiProducer_Ph2::m_apdDigiTag
private

Definition at line 108 of file EcalDigiProducer_Ph2.h.

Referenced by EcalDigiProducer_Ph2().

◆ m_APDDigitizer

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

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

◆ m_apdParameters

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

Definition at line 109 of file EcalDigiProducer_Ph2.h.

◆ m_APDResponse

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

Definition at line 111 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 90 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 126 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_EBCorrNoise

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

Definition at line 134 of file EcalDigiProducer_Ph2.h.

◆ m_EBdigiCollection

const std::string EcalDigiProducer_Ph2::m_EBdigiCollection
private

Definition at line 93 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 114 of file EcalDigiProducer_Ph2.h.

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

◆ m_EBs25notCont

const double EcalDigiProducer_Ph2::m_EBs25notCont
private

Definition at line 100 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ m_EBShape

EBShape EcalDigiProducer_Ph2::m_EBShape
private

Definition at line 91 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_ElectronicsSim

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

Definition at line 125 of file EcalDigiProducer_Ph2.h.

◆ m_Geometry

const CaloGeometry* EcalDigiProducer_Ph2::m_Geometry
private

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

Referenced by accumulate().

◆ m_hitsProducerTag

const std::string EcalDigiProducer_Ph2::m_hitsProducerTag
private

Definition at line 94 of file EcalDigiProducer_Ph2.h.

Referenced by accumulate().

◆ m_ParameterMap

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

Definition at line 105 of file EcalDigiProducer_Ph2.h.

◆ m_PreMix1

const bool EcalDigiProducer_Ph2::m_PreMix1
private

Definition at line 117 of file EcalDigiProducer_Ph2.h.

◆ m_PreMix2

const bool EcalDigiProducer_Ph2::m_PreMix2
private

Definition at line 118 of file EcalDigiProducer_Ph2.h.

◆ m_readoutFrameSize

const unsigned int EcalDigiProducer_Ph2::m_readoutFrameSize
private

Definition at line 102 of file EcalDigiProducer_Ph2.h.

◆ m_useLCcorrection

bool EcalDigiProducer_Ph2::m_useLCcorrection
private

Definition at line 96 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ pedestalToken_

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

Definition at line 77 of file EcalDigiProducer_Ph2.h.

Referenced by checkCalibrations().

◆ randomEngine_

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

Definition at line 136 of file EcalDigiProducer_Ph2.h.

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