CMS 3D CMS Logo

Functions
EcalTrigPrimProducer.cc File Reference
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
#include "DataFormats/Provenance/interface/ParameterSetID.h"
#include "DataFormats/Provenance/interface/ProductID.h"
#include "DataFormats/Provenance/interface/Provenance.h"
#include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
#include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
#include "EcalTrigPrimProducer.h"
#include <memory>
#include "SimCalorimetry/EcalTrigPrimAlgos/interface/EcalTrigPrimFunctionalAlgo.h"

Go to the source code of this file.

Functions

static int findBinOfMaximum (bool iFillFromHistory, int iPSetValue, edm::ProcessHistory const &iHistory)
 

Function Documentation

◆ findBinOfMaximum()

static int findBinOfMaximum ( bool  iFillFromHistory,
int  iPSetValue,
edm::ProcessHistory const &  iHistory 
)
static

Definition at line 84 of file EcalTrigPrimProducer.cc.

84  {
85  // get binOfMax
86  // try first in cfg, then in ProcessHistory
87  // =6 is default (1-10 possible values)
88  int binOfMaximum = 0; // starts at 1!
89  if (not iFillFromHistory) {
90  binOfMaximum = iPSetValue;
91  edm::LogInfo("EcalTPG") << "EcalTrigPrimProducer is using binOfMaximum found in cfg file : " << binOfMaximum;
92  }
93 
94  // search backwards in history looking for the particular module
95  const std::string kModuleName{"ecalUnsuppressedDigis"};
96  for (auto it = iHistory.rbegin(), itEnd = iHistory.rend(); it != itEnd; ++it) {
97  auto const &topLevelPSet = getParameterSet(it->parameterSetID());
98  if (topLevelPSet.exists(kModuleName)) {
99  int psetBinOfMax = topLevelPSet.getParameter<edm::ParameterSet>(kModuleName).getParameter<int>("binOfMaximum");
100 
101  if (not iFillFromHistory) {
102  if (psetBinOfMax != binOfMaximum)
103  edm::LogWarning("EcalTPG") << "binofMaximum given in configuration (=" << binOfMaximum
104  << ") is different from the one found in ProductRegistration(=" << psetBinOfMax
105  << ")!!!";
106  } else {
107  binOfMaximum = psetBinOfMax;
108  edm::LogInfo("EcalTPG") << "EcalTrigPrimProducer is using binOfMaximum "
109  "found in ProductRegistry : "
110  << binOfMaximum;
111  }
112  break;
113  }
114  }
115  if (binOfMaximum == 0) {
116  binOfMaximum = 6;
117  edm::LogWarning("EcalTPG") << "Could not find product registry of EBDigiCollection (label "
118  "ecalUnsuppressedDigis), had to set the following parameters by "
119  "Hand: binOfMaximum="
120  << binOfMaximum;
121  }
122  return binOfMaximum;
123 }

References ecalEBTriggerPrimitiveDigis_cfi::binOfMaximum, edm::getParameterSet(), edm::ProcessHistory::rbegin(), edm::ProcessHistory::rend(), AlCaHLTBitMon_QueryRunRegistry::string, and topLevelPSet().

Referenced by EcalTrigPrimProducer::beginRun().

edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
topLevelPSet
static std::string topLevelPSet(std::string const &iName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)
Definition: EdmProvDump.cc:266
ecalEBTriggerPrimitiveDigis_cfi.binOfMaximum
binOfMaximum
Definition: ecalEBTriggerPrimitiveDigis_cfi.py:9
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862