90 std::unique_ptr<EcalTrigPrimFunctionalAlgo>
algo_;
140 : barrelOnly_(iConfig.getParameter<bool>(
"BarrelOnly")),
141 tcpFormat_(iConfig.getParameter<bool>(
"TcpOutput")),
142 debug_(iConfig.getParameter<bool>(
"Debug")),
143 famos_(iConfig.getParameter<bool>(
"Famos")),
144 tpInfoPrintout_(iConfig.getParameter<bool>(
"TPinfoPrintout")),
146 edm::
InputTag(iConfig.getParameter<std::
string>(
"Label"), iConfig.getParameter<std::
string>(
"InstanceEB")))),
148 edm::
InputTag(iConfig.getParameter<std::
string>(
"Label"), iConfig.getParameter<std::
string>(
"InstanceEE")))),
168 binOfMaximum_(iConfig.getParameter<int>(
"binOfMaximum")),
169 fillBinOfMaximumFromHistory_(-1 == binOfMaximum_),
172 produces<EcalTrigPrimDigiCollection>();
174 produces<EcalTrigPrimDigiCollection>(
"formatTCP");
186 if (not iFillFromHistory) {
187 binOfMaximum = iPSetValue;
192 const std::string kModuleName{
"ecalUnsuppressedDigis"};
193 for (
auto it = iHistory.
rbegin(), itEnd = iHistory.
rend(); it != itEnd; ++it) {
198 if (not iFillFromHistory) {
199 if (psetBinOfMax != binOfMaximum)
200 edm::LogWarning(
"EcalTPG") <<
"binofMaximum given in configuration (=" << binOfMaximum
201 <<
") is different from the one found in ProductRegistration(=" << psetBinOfMax
204 binOfMaximum = psetBinOfMax;
205 edm::LogInfo(
"EcalTPG") <<
"EcalTrigPrimProducer is using binOfMaximum "
206 "found in ProductRegistry : "
212 if (binOfMaximum == 0) {
214 edm::LogWarning(
"EcalTPG") <<
"Could not find product registry of EBDigiCollection (label "
215 "ecalUnsuppressedDigis), had to set the following parameters by "
216 "Hand: binOfMaximum="
228 algo_ = std::make_unique<EcalTrigPrimFunctionalAlgo>(
233 algo_ = std::make_unique<EcalTrigPrimFunctionalAlgo>(
262 algo_->setPointers(ecaltpLin,
268 ecaltpgOddWeightGroup,
284 algo_->setPointers2(ecaltpgFgEBGroup,
288 ecaltpgFineGrainTowerEE,
319 edm::LogWarning(
"EcalTPG") <<
" Couldnt find Barrel dataframes with producer " << labels.
module <<
" and label "
327 edm::LogWarning(
"EcalTPG") <<
" Couldnt find Endcap dataframes with producer " << labels.
module <<
" and label "
331 if (!barrel && !endcap) {
334 throw cms::Exception(
" ProductNotFound") <<
"No EBDataFrames(EEDataFrames) with producer " << labels.
module
339 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id() <<
", Number of EBDataFrames "
340 << ebDigis.
product()->size() <<
", Number of EEDataFrames " << eeDigis.
product()->size();
342 LogDebug(
"EcalTPG") <<
" =================> Treating event " << e.
id() <<
", Number of EBDataFrames "
345 auto pOut = std::make_unique<EcalTrigPrimDigiCollection>();
346 auto pOutTcp = std::make_unique<EcalTrigPrimDigiCollection>();
354 algo_->run(ebdc, *pOut, *pOutTcp);
359 algo_->run(eedc, *pOut, *pOutTcp);
362 edm::LogInfo(
"produce") <<
"For Barrel + Endcap, " << pOut->size() <<
" TP Digis were produced";
366 for (
unsigned int i = 0;
i < pOut->size(); ++
i) {
368 for (
int isam = 0; isam < (*pOut)[
i].size(); ++isam) {
369 if ((*pOut)[
i][isam].raw())
373 LogDebug(
"EcalTPG") <<
" For tower " << (((*pOut)[
i])).id() <<
", TP is " << (*pOut)[
i];
376 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel , " << pOut->size()
377 <<
" TP Digis were produced (including zero ones)";
379 LogDebug(
"EcalTPG") <<
"\n =================> For Barrel + Endcap, " << pOut->size()
380 <<
" TP Digis were produced (including zero ones)";
391 desc.
add<
bool>(
"BarrelOnly",
false);
392 desc.
add<
bool>(
"TcpOutput",
false);
393 desc.
add<
bool>(
"Debug",
false);
394 desc.
add<
bool>(
"Famos",
false);
399 "A value of -1 will make the module lookup the value of 'binOfMaximum' "
400 "from the module 'ecalUnsuppressedDigis' from the process history. "
401 "Allowed values are -1 and from 1-10.");
404 desc.
add<
int>(
"binOfMaximum", -1)->setComment(kComment);
405 desc.
add<
bool>(
"TPinfoPrintout",
false);
const_reverse_iterator rbegin() const
edm::ESGetToken< EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd > tokenEcalTPGSlidingWindow_
edm::ESGetToken< EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd > tokenEcalTPGFineGrainStripEE_
unsigned long long cacheIdentifier() const
edm::ESGetToken< EcalTPGLutIdMap, EcalTPGLutIdMapRcd > tokenEcalTPGLutIdMap_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EventSetup & c
void endRun(const edm::Run &, const edm::EventSetup &) override
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcd > tokenEcalTPGTowerStatus_
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
static int findBinOfMaximum(bool iFillFromHistory, int iPSetValue, edm::ProcessHistory const &iHistory)
ParameterSet const & getParameterSet(ParameterSetID const &id)
edm::ESGetToken< EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd > tokenEcalTPGFineGrainTowerEE_
EcalTrigPrimProducer(const edm::ParameterSet &conf)
edm::ESGetToken< EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd > tokenEcalTPGCrystalStatus_
edm::ESGetToken< EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcd > tokenEcalTPGOddWeightGroup_
~EcalTrigPrimProducer() override
std::unique_ptr< EcalTrigPrimFunctionalAlgo > algo_
void produce(edm::Event &e, const edm::EventSetup &c) override
unsigned long long cacheID_
bool getData(T &iHolder) const
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > tokenEcalMapping_
bool fillBinOfMaximumFromHistory_
void addDefault(ParameterSetDescription const &psetDescription)
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > tokenETTMap_
const_reverse_iterator rend() const
edm::ESGetToken< EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd > tokenEcalTPGWeightIdMap_
unsigned long long getRecords(edm::EventSetup const &setup)
static const char *const kComment
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
ProcessHistory const & processHistory() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< EBDigiCollection > tokenEB_
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcd > tokenEcalTPGStripStatus_
edm::ESGetToken< EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd > tokenEcalTPGLinearization_
edm::ESGetToken< EcalTPGPedestals, EcalTPGPedestalsRcd > tokenEcalTPGPedestals_
Log< level::Info, false > LogInfo
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< EcalTPGTPMode, EcalTPGTPModeRcd > tokenEcalTPGTPMode_
T const * product() const
edm::ESGetToken< EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd > tokenEcalTPGFineGrainEBIdMap_
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecord > tokenEndcapGeom_
char const * productInstance
edm::ESGetToken< EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcd > tokenEcalTPGOddWeightIdMap_
edm::EDGetTokenT< EEDigiCollection > tokenEE_
edm::ESGetToken< EcalTPGLutGroup, EcalTPGLutGroupRcd > tokenEcalTPGLutGroup_
edm::ESGetToken< EcalTPGSpike, EcalTPGSpikeRcd > tokenEcalTPGSpike_
Log< level::Warning, false > LogWarning
edm::ESGetToken< EcalTPGWeightGroup, EcalTPGWeightGroupRcd > tokenEcalTPGWeightGroup_
edm::ESGetToken< EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd > tokenEcalTPGFineGrainEBGroup_
static std::string topLevelPSet(std::string const &iName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)