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 "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 81 of file EcalTrigPrimProducer.cc.

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

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

Referenced by EcalTrigPrimProducer::beginRun().

edm::LogInfo
Definition: MessageLogger.h:254
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
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:855