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

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

Definition at line 83 of file EcalTrigPrimProducer.cc.

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

Referenced by EcalTrigPrimProducer::beginRun().

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")
92  << "EcalTrigPrimProducer is using binOfMaximum found in cfg file : "
93  << binOfMaximum;
94  }
95 
96  // search backwards in history looking for the particular module
97  const std::string kModuleName{"ecalUnsuppressedDigis"};
98  for (auto it = iHistory.rbegin(), itEnd = iHistory.rend(); it != itEnd;
99  ++it) {
100  auto const &topLevelPSet = getParameterSet(it->parameterSetID());
101  if (topLevelPSet.exists(kModuleName)) {
102  int psetBinOfMax =
103  topLevelPSet.getParameter<edm::ParameterSet>(kModuleName)
104  .getParameter<int>("binOfMaximum");
105 
106  if (not iFillFromHistory) {
107  if (psetBinOfMax != binOfMaximum)
108  edm::LogWarning("EcalTPG")
109  << "binofMaximum given in configuration (=" << binOfMaximum
110  << ") is different from the one found in ProductRegistration(="
111  << psetBinOfMax << ")!!!";
112  } else {
113  binOfMaximum = psetBinOfMax;
114  edm::LogInfo("EcalTPG") << "EcalTrigPrimProducer is using binOfMaximum "
115  "found in ProductRegistry : "
116  << binOfMaximum;
117  }
118  break;
119  }
120  }
121  if (binOfMaximum == 0) {
122  binOfMaximum = 6;
123  edm::LogWarning("EcalTPG")
124  << "Could not find product registry of EBDigiCollection (label "
125  "ecalUnsuppressedDigis), had to set the following parameters by "
126  "Hand: binOfMaximum="
127  << binOfMaximum;
128  }
129  return binOfMaximum;
130 }
ParameterSet const & getParameterSet(ParameterSetID const &id)
static std::string topLevelPSet(std::string const &iName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)
Definition: EdmProvDump.cc:266