60 m_EBdigiCollection(
params.getParameter<
std::
string>(
"EBdigiCollectionPh2")),
63 m_useLCcorrection(
params.getUntrackedParameter<
bool>(
"UseLCcorrection")),
64 m_apdSeparateDigi(
params.getParameter<
bool>(
"apdSeparateDigi")),
66 m_EBs25notCont(
params.getParameter<double>(
"EBs25notContainment")),
68 m_readoutFrameSize(
ecalPh2::sampleSize),
72 params.getParameter<double>(
"photoelectronsToAnalogBarrel"),
74 params.getParameter<double>(
"samplingFactor"),
75 params.getParameter<double>(
"timePhase"),
78 params.getParameter<
bool>(
"doPhotostatistics"),
84 params.getParameter<double>(
"apdSimToPELow"),
85 params.getParameter<double>(
"apdSimToPEHigh"),
86 params.getParameter<double>(
"apdTimeOffset"),
87 params.getParameter<double>(
"apdTimeOffWidth"),
92 m_APDResponse(!m_apdSeparateDigi
95 m_ParameterMap.
get(), &m_EBShape,
true, m_apdParameters.
get(), &m_APDShape)),
100 m_apdParameters.
get(),
103 m_PreMix1(
params.getParameter<
bool>(
"EcalPreMixStage1")),
104 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]);
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];
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);
206 e.getByLabel(ebTag, ebHandle);
218 e.getByLabel(ebTag, ebHandle);
225 std::unique_ptr<EBDigiCollectionPh2> apdResult(
nullptr);
226 std::unique_ptr<EBDigiCollectionPh2> barrelResult = std::make_unique<EBDigiCollectionPh2>();
228 apdResult = std::make_unique<EBDigiCollectionPh2>();
235 edm::LogInfo(
"DigiInfo") <<
"EB Digis: " << barrelResult->size();
239 edm::LogInfo(
"DigiInfo") <<
"APD Digis: " << apdResult->size();
252 throw cms::Exception(
"Configuration") <<
"RandomNumberGenerator service is not available.\n"
253 "You must add the service in the configuration file\n"
254 "or remove the module that requires it.";
256 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
lumi.index());
267 m_Coder->setPedestals(pedestals);
274 m_Coder->setIntercalibConstants(ical);
299 LogDebug(
"EcalDigi") <<
" GeV/ADC = " << agc->getEBValue() <<
"\n"
303 m_Coder->setFullScaleEnergy(EBscale);