60 m_EBdigiCollection(params.getParameter<std::
string>(
"EBdigiCollectionPh2")),
62 m_hitsProducerTag(params.getParameter<std::
string>(
"hitsProducer")),
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),
70 m_ParameterMap(std::make_unique<
EcalSimParameterMap>(params.getParameter<double>(
"simHitToPhotoelectronsBarrel"),
72 params.getParameter<double>(
"photoelectronsToAnalogBarrel"),
74 params.getParameter<double>(
"samplingFactor"),
75 params.getParameter<double>(
"timePhase"),
77 params.getParameter<int>(
"binOfMaximum"),
78 params.getParameter<bool>(
"doPhotostatistics"),
79 params.getParameter<bool>(
"syncPhase"))),
81 m_apdDigiTag(params.getParameter<std::
string>(
"apdDigiTag")),
82 m_apdParameters(std::make_unique<
APDSimParameters>(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"),
90 params.getParameter<std::
vector<double>>(
"apdNonlParms"))),
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),
110 m_APDElectronicsSim(nullptr),
116 iC.consumes<std::vector<PCaloHit>>(
edm::InputTag(m_hitsProducerTag,
"EcalHitsEB"));
123 const std::vector<double>
ebCorMatG10Ph2 =
params.getParameter<std::vector<double>>(
"EBCorrNoiseMatrixG10Ph2");
124 const std::vector<double>
ebCorMatG01Ph2 =
params.getParameter<std::vector<double>>(
"EBCorrNoiseMatrixG01Ph2");
135 m_EBResponse->setPhaseShift(1. + cosmicsShift);
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());
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);
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.";
267 m_Coder->setPedestals(pedestals);
274 m_Coder->setIntercalibConstants(ical);
299 LogDebug(
"EcalDigi") <<
" GeV/ADC = " << agc->getEBValue() <<
"\n"
303 m_Coder->setFullScaleEnergy(EBscale);
int bunchCrossing() const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
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_
const bool applyConstantTerm
~EcalDigiProducer_Ph2() override
LuminosityBlockIndex index() const
const bool m_apdSeparateDigi
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const std::string m_apdDigiTag
edm::ESGetToken< EcalLaserDbService, EcalLaserDbRecord > laserToken_
std::unique_ptr< EBDigitizer_Ph2 > m_APDDigitizer
const double errorCorrelation
EcalCorrMatrix_Ph2 ebMatrix[2]
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
static constexpr float gains[NGAINS]
void checkCalibrations(const edm::Event &event, const edm::EventSetup &eventSetup)
bool getData(T &iHolder) const
virtual void cacheEBDigis(const EBDigiCollectionPh2 *ebDigiPtr) const
const std::string m_hitsProducerTag
const double rmsConstantTerm
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
const CaloGeometry * m_Geometry
unsigned long long TimeValue_t
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void checkGeometry(const edm::EventSetup &eventSetup)
const double cosmicsShift
Log< level::Info, false > LogInfo
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > icalToken_
void beginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
T const * product() const
const std::vector< double > ebCorMatG01Ph2
edm::ESGetToken< EcalLiteDTUPedestalsMap, EcalLiteDTUPedestalsRcd > pedestalToken_
EcalIntercalibConstantMap EcalIntercalibConstants
EcalDigiProducer_Ph2(const edm::ParameterSet ¶ms, edm::ProducesCollector producesCollector, edm::ConsumesCollector &iC)
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
void setEventSetup(const edm::EventSetup &evtSetup)
const std::vector< double > ebCorMatG10Ph2
void setEBNoiseSignalGenerator(EcalBaseSignalGenerator *noiseGenerator)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
std::unique_ptr< EBDigitizer_Ph2 > m_BarrelDigitizer
static constexpr unsigned int MAXADC