65 : barrelOnly_(iConfig.getParameter<
bool>(
"BarrelOnly")),
66 tcpFormat_(iConfig.getParameter<
bool>(
"TcpOutput")),
67 debug_(iConfig.getParameter<
bool>(
"Debug")),
68 famos_(iConfig.getParameter<
bool>(
"Famos")),
73 binOfMaximum_(iConfig.getParameter<
int>(
"binOfMaximum")),
74 fillBinOfMaximumFromHistory_(-1 == binOfMaximum_) {
76 produces<EcalTrigPrimDigiCollection>();
78 produces<EcalTrigPrimDigiCollection>(
"formatTCP");
86 if (not iFillFromHistory) {
87 binOfMaximum = iPSetValue;
92 const std::string kModuleName{
"ecalUnsuppressedDigis"};
93 for (
auto it = iHistory.
rbegin(), itEnd = iHistory.
rend(); it != itEnd; ++it) {
98 if (not iFillFromHistory) {
99 if (psetBinOfMax != binOfMaximum)
100 edm::LogWarning(
"EcalTPG") <<
"binofMaximum given in configuration (=" << binOfMaximum
101 <<
") is different from the one found in ProductRegistration(=" << psetBinOfMax
104 binOfMaximum = psetBinOfMax;
105 edm::LogInfo(
"EcalTPG") <<
"EcalTrigPrimProducer is using binOfMaximum " 106 "found in ProductRegistry : " 112 if (binOfMaximum == 0) {
114 edm::LogWarning(
"EcalTPG") <<
"Could not find product registry of EBDigiCollection (label " 115 "ecalUnsuppressedDigis), had to set the following parameters by " 116 "Hand: binOfMaximum=" 166 algo_->setPointers(ecaltpLin,
205 algo_->setPointers2(ecaltpgFgEBGroup,
209 ecaltpgFineGrainTowerEE,
239 edm::LogWarning(
"EcalTPG") <<
" Couldnt find Barrel dataframes with producer " << labels.
module <<
" and label " 247 edm::LogWarning(
"EcalTPG") <<
" Couldnt find Endcap dataframes with producer " << labels.
module <<
" and label " 251 if (!barrel && !endcap) {
254 throw cms::Exception(
" ProductNotFound") <<
"No EBDataFrames(EEDataFrames) with producer " << labels.
module 259 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id() <<
", Number of EBDataFrames " 262 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id() <<
", Number of EBDataFrames " 265 auto pOut = std::make_unique<EcalTrigPrimDigiCollection>();
266 auto pOutTcp = std::make_unique<EcalTrigPrimDigiCollection>();
274 algo_->run(iSetup, ebdc, *pOut, *pOutTcp);
279 algo_->run(iSetup, eedc, *pOut, *pOutTcp);
282 edm::LogInfo(
"produce") <<
"For Barrel + Endcap, " << pOut->size() <<
" TP Digis were produced";
286 for (
unsigned int i = 0;
i < pOut->size(); ++
i) {
288 for (
int isam = 0; isam < (*pOut)[
i].size(); ++isam) {
289 if ((*pOut)[
i][isam].raw())
293 LogDebug(
"EcalTPG") <<
" For tower " << (((*pOut)[
i])).id() <<
", TP is " << (*pOut)[
i];
296 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel , " << pOut->size()
297 <<
" TP Digis were produced (including zero ones)";
299 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel + Endcap, " << pOut->size()
300 <<
" TP Digis were produced (including zero ones)";
311 desc.
add<
bool>(
"BarrelOnly",
false);
312 desc.
add<
bool>(
"TcpOutput",
false);
313 desc.
add<
bool>(
"Debug",
false);
314 desc.
add<
bool>(
"Famos",
false);
319 "A value of -1 will make the module lookup the value of 'binOfMaximum' " 320 "from the module 'ecalUnsuppressedDigis' from the process history. " 321 "Allowed values are -1 and from 1-10.");
324 desc.
add<
int>(
"binOfMaximum", -1)->setComment(kComment);
const_reverse_iterator rbegin() const
unsigned long long cacheIdentifier() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void endRun(const edm::Run &, const edm::EventSetup &) override
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static int findBinOfMaximum(bool iFillFromHistory, int iPSetValue, edm::ProcessHistory const &iHistory)
ParameterSet const & getParameterSet(ParameterSetID const &id)
EcalTrigPrimProducer(const edm::ParameterSet &conf)
S & print(S &os, JobReport::InputFile const &f)
~EcalTrigPrimProducer() override
std::unique_ptr< EcalTrigPrimFunctionalAlgo > algo_
void produce(edm::Event &e, const edm::EventSetup &c) override
unsigned long long cacheID_
bool fillBinOfMaximumFromHistory_
void addDefault(ParameterSetDescription const &psetDescription)
const_reverse_iterator rend() const
unsigned long long getRecords(edm::EventSetup const &setup)
static const char *const kComment
ProcessHistory const & processHistory() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< EBDigiCollection > tokenEB_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
char const * productInstance
edm::EDGetTokenT< EEDigiCollection > tokenEE_
T const * product() const
static std::string topLevelPSet(std::string const &iName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)