test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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/Provenance/interface/ProductID.h"
#include "DataFormats/Provenance/interface/ParameterSetID.h"
#include "DataFormats/Provenance/interface/Provenance.h"
#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
#include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
#include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
#include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
#include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
#include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h"
#include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.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 79 of file EcalTrigPrimProducer.cc.

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

Referenced by EcalTrigPrimProducer::beginRun().

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