65 : barrelOnly_(iConfig.getParameter<
bool>(
"BarrelOnly")),
66 tcpFormat_(iConfig.getParameter<
bool>(
"TcpOutput")),
67 debug_(iConfig.getParameter<
bool>(
"Debug")),
68 famos_(iConfig.getParameter<
bool>(
"Famos")),
70 edm::InputTag(iConfig.getParameter<
std::
string>(
"Label"),
71 iConfig.getParameter<
std::
string>(
"InstanceEB")))),
73 edm::InputTag(iConfig.getParameter<
std::
string>(
"Label"),
74 iConfig.getParameter<
std::
string>(
"InstanceEE")))),
75 binOfMaximum_(iConfig.getParameter<
int>(
"binOfMaximum")),
76 fillBinOfMaximumFromHistory_(-1 == binOfMaximum_) {
78 produces<EcalTrigPrimDigiCollection>();
80 produces<EcalTrigPrimDigiCollection>(
"formatTCP");
89 if (not iFillFromHistory) {
90 binOfMaximum = iPSetValue;
92 <<
"EcalTrigPrimProducer is using binOfMaximum found in cfg file : " 97 const std::string kModuleName{
"ecalUnsuppressedDigis"};
98 for (
auto it = iHistory.
rbegin(), itEnd = iHistory.
rend(); it != itEnd;
104 .getParameter<int>(
"binOfMaximum");
106 if (not iFillFromHistory) {
107 if (psetBinOfMax != binOfMaximum)
109 <<
"binofMaximum given in configuration (=" << binOfMaximum
110 <<
") is different from the one found in ProductRegistration(=" 111 << psetBinOfMax <<
")!!!";
113 binOfMaximum = psetBinOfMax;
114 edm::LogInfo(
"EcalTPG") <<
"EcalTrigPrimProducer is using binOfMaximum " 115 "found in ProductRegistry : " 121 if (binOfMaximum == 0) {
124 <<
"Could not find product registry of EBDigiCollection (label " 125 "ecalUnsuppressedDigis), had to set the following parameters by " 126 "Hand: binOfMaximum=" 159 theEcalTPGLinearization_handle.
product();
166 theEcalTPGCrystalStatus_handle.
product();
172 theEcalTPGSlidingWindow_handle.
product();
176 theEcalTPGWEightIdMap_handle.
product();
180 theEcalTPGWEightGroup_handle.
product();
183 theEcalTPGFineGrainStripEE_handle);
185 theEcalTPGFineGrainStripEE_handle.
product();
189 theEcalTPGStripStatus_handle.
product();
191 algo_->setPointers(ecaltpLin, ecaltpPed, ecaltpgSlidW, ecaltpgWeightMap,
192 ecaltpgWeightGroup, ecaltpgFgStripEE, ecaltpgBadX,
199 theEcalTPGFineGrainEBGroup_handle);
201 theEcalTPGFineGrainEBGroup_handle.
product();
213 theEcalTPGFineGrainEBIdMap_handle);
215 theEcalTPGFineGrainEBIdMap_handle.
product();
219 theEcalTPGFineGrainTowerEE_handle);
221 theEcalTPGFineGrainTowerEE_handle.
product();
226 theEcalTPGTowerStatus_handle.
product();
232 algo_->setPointers2(ecaltpgFgEBGroup, ecaltpgLutGroup, ecaltpgLut,
233 ecaltpgFineGrainEB, ecaltpgFineGrainTowerEE, ecaltpgBadTT,
265 <<
" Couldnt find Barrel dataframes with producer " << labels.
module 274 <<
" Couldnt find Endcap dataframes with producer " << labels.
module 278 if (!barrel && !endcap) {
282 <<
"No EBDataFrames(EEDataFrames) with producer " << labels.
module 287 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id()
288 <<
", Number of EBDataFrames " 290 <<
", Number of EEDataFrames " 293 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id()
294 <<
", Number of EBDataFrames " 297 auto pOut = std::make_unique<EcalTrigPrimDigiCollection>();
298 auto pOutTcp = std::make_unique<EcalTrigPrimDigiCollection>();
306 algo_->run(iSetup, ebdc, *pOut, *pOutTcp);
311 algo_->run(iSetup, eedc, *pOut, *pOutTcp);
314 edm::LogInfo(
"produce") <<
"For Barrel + Endcap, " << pOut->size()
315 <<
" TP Digis were produced";
319 for (
unsigned int i = 0;
i < pOut->size(); ++
i) {
321 for (
int isam = 0; isam < (*pOut)[
i].size(); ++isam) {
322 if ((*pOut)[
i][isam].raw())
326 LogDebug(
"EcalTPG") <<
" For tower " << (((*pOut)[
i])).id() <<
", TP is " 330 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel , " << pOut->size()
331 <<
" TP Digis were produced (including zero ones)";
333 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel + Endcap, " 335 <<
" TP Digis were produced (including zero ones)";
348 desc.
add<
bool>(
"BarrelOnly",
false);
349 desc.
add<
bool>(
"TcpOutput",
false);
350 desc.
add<
bool>(
"Debug",
false);
351 desc.
add<
bool>(
"Famos",
false);
356 "A value of -1 will make the module lookup the value of 'binOfMaximum' " 357 "from the module 'ecalUnsuppressedDigis' from the process history. " 358 "Allowed values are -1 and from 1-10.");
361 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)
def setup(process, global_tag, zero_tesla=False)
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)