59 m_EBdigiCollection(
params.getParameter<
std::
string>(
"EBdigiCollectionPh2")),
62 m_useLCcorrection(
params.getUntrackedParameter<
bool>(
"UseLCcorrection")),
63 m_apdSeparateDigi(
params.getParameter<
bool>(
"apdSeparateDigi")),
65 m_EBs25notCont(
params.getParameter<double>(
"EBs25notContainment")),
67 m_readoutFrameSize(
ecalPh2::sampleSize),
71 params.getParameter<double>(
"photoelectronsToAnalogBarrel"),
73 params.getParameter<double>(
"samplingFactor"),
74 params.getParameter<double>(
"timePhase"),
77 params.getParameter<
bool>(
"doPhotostatistics"),
83 params.getParameter<double>(
"apdSimToPELow"),
84 params.getParameter<double>(
"apdSimToPEHigh"),
85 params.getParameter<double>(
"apdTimeOffset"),
86 params.getParameter<double>(
"apdTimeOffWidth"),
91 m_APDResponse(!m_apdSeparateDigi
94 m_ParameterMap.
get(), &m_EBShape,
true, m_apdParameters.
get(), &m_APDShape)),
99 m_apdParameters.
get(),
102 m_PreMix1(
params.getParameter<
bool>(
"EcalPreMixStage1")),
103 m_PreMix2(
params.getParameter<
bool>(
"EcalPreMixStage2")),
106 m_APDDigitizer(nullptr),
107 m_BarrelDigitizer(nullptr),
108 m_ElectronicsSim(nullptr),
110 m_APDElectronicsSim(nullptr),
113 m_EBCorrNoise({{
nullptr,
nullptr}})
116 iC.consumes<std::vector<PCaloHit>>(
edm::InputTag(m_hitsProducerTag,
"EcalHitsEB"));
117 pedestalToken_ = iC.esConsumes();
123 const std::vector<double> ebCorMatG10Ph2 =
params.getParameter<std::vector<double>>(
"EBCorrNoiseMatrixG10Ph2");
124 const std::vector<double> ebCorMatG01Ph2 =
params.getParameter<std::vector<double>>(
"EBCorrNoiseMatrixG01Ph2");
127 const double rmsConstantTerm =
params.getParameter<
double>(
"ConstantTerm");
129 const bool addNoise =
params.getParameter<
bool>(
"doENoise");
139 const double errorCorrelation = 1.e-7;
140 assert(ebCorMatG10Ph2.size() == m_readoutFrameSize);
141 assert(ebCorMatG01Ph2.size() == m_readoutFrameSize);
146 for (
unsigned int row(0); row != m_readoutFrameSize; ++row) {
147 assert(0 == row || 1. >= ebCorMatG10Ph2[row]);
148 assert(0 == row || 1. >= ebCorMatG01Ph2[row]);
151 const unsigned int index(row - column);
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);
162 if (m_apdSeparateDigi) {
163 m_APDCoder = std::make_unique<EcalLiteDTUCoder>(
false, m_PreMix1, m_EBCorrNoise[0].get(), m_EBCorrNoise[1].get());
165 m_APDElectronicsSim = std::make_unique<EcalElectronicsSim_Ph2>(
168 m_APDDigitizer = std::make_unique<EBDigitizer_Ph2>(m_APDResponse.get(), m_APDElectronicsSim.get(),
false);
171 m_BarrelDigitizer = std::make_unique<EBDigitizer_Ph2>(m_EBResponse.get(), m_ElectronicsSim.get(), addNoise);
216 e.getByLabel(ebTag, ebHandle);
223 std::unique_ptr<EBDigiCollectionPh2> apdResult(
nullptr);
224 std::unique_ptr<EBDigiCollectionPh2> barrelResult = std::make_unique<EBDigiCollectionPh2>();
226 apdResult = std::make_unique<EBDigiCollectionPh2>();
233 edm::LogInfo(
"DigiInfo") <<
"EB Digis: " << barrelResult->size();
237 edm::LogInfo(
"DigiInfo") <<
"APD Digis: " << apdResult->size();
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.";
254 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
lumi.index());
265 m_Coder->setPedestals(pedestals);
272 m_Coder->setIntercalibConstants(ical);
297 LogDebug(
"EcalDigi") <<
" GeV/ADC = " << agc->getEBValue() <<
"\n" 301 m_Coder->setFullScaleEnergy(EBscale);
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
std::unique_ptr< EBHitResponse_Ph2 > m_EBResponse
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
CLHEP::HepRandomEngine * randomEngine_
~EcalDigiProducer_Ph2() override
const bool m_apdSeparateDigi
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const std::string m_apdDigiTag
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > laserToken_
T const * product() const
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
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unique_ptr< EcalLiteDTUCoder > m_Coder
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
const std::string m_hitsProducerTag
const edm::EDGetTokenT< std::vector< PCaloHit > > m_HitsEBToken
const double m_EBs25notCont
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geom_token_
const std::string m_EBdigiCollection
Abs< T >::type abs(const T &t)
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
static constexpr const float * gains
virtual void cacheEBDigis(const EBDigiCollectionPh2 *ebDigiPtr) const
const CaloGeometry * m_Geometry
unsigned long long TimeValue_t
void checkGeometry(const edm::EventSetup &eventSetup)
Log< level::Info, false > LogInfo
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > icalToken_
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
EcalIntercalibConstantMap EcalIntercalibConstants
EcalDigiProducer_Ph2(const edm::ParameterSet ¶ms, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
void setEventSetup(const edm::EventSetup &evtSetup)
void setEBNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
static constexpr unsigned int MAXADC