CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TCaloParamsOnlineProd Class Reference
Inheritance diagram for L1TCaloParamsOnlineProd:
L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams > edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 L1TCaloParamsOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< const l1t::CaloParamsnewObject (const std::string &objectKey, const L1TCaloParamsO2ORcd &record) override
 
 ~L1TCaloParamsOnlineProd (void) override
 
- Public Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams >
 L1ConfigOnlineProdBaseExt (const edm::ParameterSet &)
 
std::unique_ptr< const l1t::CaloParamsproduce (const L1TCaloParamsO2ORcd &iRecord)
 
 ~L1ConfigOnlineProdBaseExt () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Member Functions

bool readCaloLayer1OnlineSettings (l1t::CaloParamsHelperO2O &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
 
bool readCaloLayer2OnlineSettings (l1t::CaloParamsHelperO2O &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
 

Private Attributes

const edm::ESGetToken< l1t::CaloParams, L1TCaloParamsRcdbaseSettings_token
 
const unsigned int exclusiveLayer
 
const bool transactionSafe
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams >
bool getObjectKey (const L1TCaloParamsO2ORcd &record, std::string &objectKey)
 
edm::ESConsumesCollectorT< L1TCaloParamsO2ORcdwrappedSetWhatProduced (const edm::ParameterSet &)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 20 of file L1TCaloParamsOnlineProd.cc.

Constructor & Destructor Documentation

◆ L1TCaloParamsOnlineProd()

L1TCaloParamsOnlineProd::L1TCaloParamsOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 218 of file L1TCaloParamsOnlineProd.cc.

220  baseSettings_token(wrappedSetWhatProduced(iConfig).consumes()),
221  exclusiveLayer(iConfig.getParameter<uint32_t>("exclusiveLayer")),
222  transactionSafe(iConfig.getParameter<bool>("transactionSafe")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< l1t::CaloParams, L1TCaloParamsRcd > baseSettings_token
edm::ESConsumesCollectorT< L1TCaloParamsO2ORcd > wrappedSetWhatProduced(const edm::ParameterSet &)

◆ ~L1TCaloParamsOnlineProd()

L1TCaloParamsOnlineProd::~L1TCaloParamsOnlineProd ( void  )
inlineoverride

Definition at line 38 of file L1TCaloParamsOnlineProd.cc.

38 {}

Member Function Documentation

◆ newObject()

std::unique_ptr< const l1t::CaloParams > L1TCaloParamsOnlineProd::newObject ( const std::string &  objectKey,
const L1TCaloParamsO2ORcd record 
)
overridevirtual

Implements L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams >.

Definition at line 224 of file L1TCaloParamsOnlineProd.cc.

References l1t::TriggerSystem::addProcessor(), mps_setup::append, baseSettings_token, MillePedeFileConverter_cfg::e, exclusiveLayer, l1t::OnlineDBqueryHelper::fetch(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), l1t::TriggerSystem::getParameters(), submitPVResolutionJobs::key, L1ConfigOnlineProdBaseExt< L1TCaloParamsO2ORcd, l1t::CaloParams >::m_omdsReader, convertSQLitetoXML_cfg::output, readCaloLayer1OnlineSettings(), readCaloLayer2OnlineSettings(), l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), AlCaHarvesting_cff::record, l1t::TriggerSystem::setConfigured(), AlCaHLTBitMon_QueryRunRegistry::string, and transactionSafe.

225  {
226  const L1TCaloParamsRcd& baseRcd = record.template getRecord<L1TCaloParamsRcd>();
227  auto const& baseSettings = baseRcd.get(baseSettings_token);
228 
229  if (objectKey.empty()) {
230  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << "Key is empty";
231  if (transactionSafe)
232  throw std::runtime_error("SummaryForFunctionManager: Calo | Faulty | Empty objectKey");
233  else {
234  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << "returning unmodified prototype of l1t::CaloParams";
235  return std::make_unique<const l1t::CaloParams>(baseSettings);
236  }
237  }
238 
239  std::string tscKey = objectKey.substr(0, objectKey.find(':'));
240  std::string rsKey = objectKey.substr(objectKey.find(':') + 1, std::string::npos);
241 
242  edm::LogInfo("L1-O2O: L1TCaloParamsOnlineProd")
243  << "Producing L1TCaloParamsOnlineProd with TSC key = " << tscKey << " and RS key = " << rsKey;
244 
245  std::string calol1_top_key, calol1_algo_key;
246  std::string calol1_algo_payload;
247  std::string calol2_top_key, calol2_algo_key, calol2_hw_key;
248  std::string calol2_hw_payload;
249  std::map<std::string, std::string> calol2_algo_payloads; // key -> XML payload
250  try {
251  std::map<std::string, std::string> topKeys =
252  l1t::OnlineDBqueryHelper::fetch({"CALOL1_KEY", "CALOL2_KEY"}, "L1_TRG_CONF_KEYS", tscKey, m_omdsReader);
253 
254  if (exclusiveLayer == 0 || exclusiveLayer == 1) {
255  calol1_top_key = topKeys["CALOL1_KEY"];
256 
257  calol1_algo_key = l1t::OnlineDBqueryHelper::fetch({"ALGO"}, "CALOL1_KEYS", calol1_top_key, m_omdsReader)["ALGO"];
258 
259  calol1_algo_payload =
260  l1t::OnlineDBqueryHelper::fetch({"CONF"}, "CALOL1_CLOBS", calol1_algo_key, m_omdsReader)["CONF"];
261  }
262 
263  if (exclusiveLayer == 0 || exclusiveLayer == 2) {
264  calol2_top_key = topKeys["CALOL2_KEY"];
265 
266  std::map<std::string, std::string> calol2_keys =
267  l1t::OnlineDBqueryHelper::fetch({"ALGO", "HW"}, "CALOL2_KEYS", calol2_top_key, m_omdsReader);
268 
269  calol2_hw_key = calol2_keys["HW"];
270  calol2_hw_payload =
271  l1t::OnlineDBqueryHelper::fetch({"CONF"}, "CALOL2_CLOBS", calol2_hw_key, m_omdsReader)["CONF"];
272 
273  calol2_algo_key = calol2_keys["ALGO"];
274 
275  std::map<std::string, std::string> calol2_algo_keys =
276  l1t::OnlineDBqueryHelper::fetch({"DEMUX", "MPS_COMMON", "MPS_JET", "MP_EGAMMA", "MP_SUM", "MP_TAU"},
277  "CALOL2_ALGO_KEYS",
278  calol2_algo_key,
279  m_omdsReader);
280 
281  for (auto& key : calol2_algo_keys)
282  calol2_algo_payloads[key.second] =
283  l1t::OnlineDBqueryHelper::fetch({"CONF"}, "CALOL2_CLOBS", key.second, m_omdsReader)["CONF"];
284  }
285 
286  } catch (std::runtime_error& e) {
287  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << e.what();
288  if (transactionSafe)
289  throw std::runtime_error(std::string("SummaryForFunctionManager: Calo | Faulty | ") + e.what());
290  else {
291  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << "returning unmodified prototype of l1t::CaloParams";
292  return std::make_unique<const l1t::CaloParams>(baseSettings);
293  }
294  }
295 
296  if (exclusiveLayer == 0 || exclusiveLayer == 2) {
297  // for debugging purposes dump the configs to local files
298  for (auto& conf : calol2_algo_payloads) {
299  std::ofstream output(std::string("/tmp/").append(conf.first.substr(0, conf.first.find("/"))).append(".xml"));
300  output << conf.second;
301  output.close();
302  }
303  std::ofstream output(std::string("/tmp/").append(calol2_hw_key.substr(0, calol2_hw_key.find('/'))).append(".xml"));
304  output << calol2_hw_payload;
305  output.close();
306  }
307  if (exclusiveLayer == 0 || exclusiveLayer == 1) {
308  std::ofstream output(
309  std::string("/tmp/").append(calol1_algo_key.substr(0, calol1_algo_key.find('/'))).append(".xml"));
310  output << calol1_algo_payload;
311  output.close();
312  }
313 
314  l1t::CaloParamsHelperO2O m_params_helper(baseSettings);
315 
316  if (exclusiveLayer == 0 || exclusiveLayer == 1) {
317  try {
318  l1t::XmlConfigParser xmlReader1;
319  xmlReader1.readDOMFromString(calol1_algo_payload);
320 
321  l1t::TriggerSystem calol1;
322  calol1.addProcessor("processors", "processors", "-1", "-1");
323  xmlReader1.readRootElement(calol1, "calol1");
324  calol1.setConfigured();
325 
326  std::map<std::string, l1t::Parameter> calol1_conf = calol1.getParameters("processors");
327  std::map<std::string, l1t::Mask> calol1_rs; //= calol1.getMasks ("processors");
328 
329  if (!readCaloLayer1OnlineSettings(m_params_helper, calol1_conf, calol1_rs))
330  throw std::runtime_error("Parsing error for CaloLayer1");
331 
332  } catch (std::runtime_error& e) {
333  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << e.what();
334  if (transactionSafe)
335  throw std::runtime_error(std::string("SummaryForFunctionManager: Calo | Faulty | ") + e.what());
336  else {
337  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << "returning unmodified prototype of l1t::CaloParams";
338  return std::make_unique<const l1t::CaloParams>(baseSettings);
339  }
340  }
341  }
342 
343  if (exclusiveLayer == 0 || exclusiveLayer == 2) {
344  try {
345  l1t::TriggerSystem calol2;
346  l1t::XmlConfigParser xmlReader2;
347  xmlReader2.readDOMFromString(calol2_hw_payload);
348  xmlReader2.readRootElement(calol2, "calol2");
349 
350  for (auto& conf : calol2_algo_payloads) {
351  xmlReader2.readDOMFromString(conf.second);
352  xmlReader2.readRootElement(calol2, "calol2");
353  }
354 
355  // calol2.setSystemId("calol2");
356  calol2.setConfigured();
357 
358  std::map<std::string, l1t::Parameter> calol2_conf = calol2.getParameters("MP1");
359  std::map<std::string, l1t::Parameter> calol2_conf_demux = calol2.getParameters("DEMUX");
360  calol2_conf.insert(calol2_conf_demux.begin(), calol2_conf_demux.end());
361  std::map<std::string, l1t::Mask> calol2_rs; //= calol2.getMasks ("processors");
362 
363  if (!readCaloLayer2OnlineSettings(m_params_helper, calol2_conf, calol2_rs))
364  throw std::runtime_error("Parsing error for CaloLayer2");
365 
366  } catch (std::runtime_error& e) {
367  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << e.what();
368  if (transactionSafe)
369  throw std::runtime_error(std::string("SummaryForFunctionManager: Calo | Faulty | ") + e.what());
370  else {
371  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd") << "returning unmodified prototype of l1t::CaloParams";
372  return std::make_unique<const l1t::CaloParams>(baseSettings);
373  }
374  }
375  }
376 
377  auto retval = std::make_unique<const l1t::CaloParams>(m_params_helper);
378 
379  edm::LogInfo("L1-O2O: L1TCaloParamsOnlineProd") << "SummaryForFunctionManager: Calo | OK | All looks good";
380  return retval;
381 }
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:74
Log< level::Error, false > LogError
const edm::ESGetToken< l1t::CaloParams, L1TCaloParamsRcd > baseSettings_token
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
const std::map< std::string, Parameter > & getParameters(const char *processor) const
static std::map< std::string, std::string > fetch(const std::vector< std::string > &queryColumns, const std::string &table, const std::string &key, l1t::OMDSReader &m_omdsReader)
bool readCaloLayer2OnlineSettings(l1t::CaloParamsHelperO2O &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
key
prepare the HTCondor submission files and eventually submit them
Log< level::Info, false > LogInfo
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
bool readCaloLayer1OnlineSettings(l1t::CaloParamsHelperO2O &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
void addProcessor(const char *processor, const char *role, const char *crate, const char *slot)
Definition: output.py:1

◆ readCaloLayer1OnlineSettings()

bool L1TCaloParamsOnlineProd::readCaloLayer1OnlineSettings ( l1t::CaloParamsHelperO2O paramsHelper,
std::map< std::string, l1t::Parameter > &  conf,
std::map< std::string, l1t::Mask > &   
)
private

Definition at line 41 of file L1TCaloParamsOnlineProd.cc.

References l1t::CaloParamsHelperO2O::setLayer1ECalScaleETBins(), l1t::CaloParamsHelperO2O::setLayer1ECalScaleFactors(), l1t::CaloParamsHelperO2O::setLayer1ECalScalePhiBins(), l1t::CaloParamsHelperO2O::setLayer1HCalFBLUTLower(), l1t::CaloParamsHelperO2O::setLayer1HCalFBLUTUpper(), l1t::CaloParamsHelperO2O::setLayer1HCalScaleETBins(), l1t::CaloParamsHelperO2O::setLayer1HCalScaleFactors(), l1t::CaloParamsHelperO2O::setLayer1HCalScalePhiBins(), l1t::CaloParamsHelperO2O::setLayer1HFScaleETBins(), l1t::CaloParamsHelperO2O::setLayer1HFScaleFactors(), l1t::CaloParamsHelperO2O::setLayer1HFScalePhiBins(), and l1t::CaloParamsHelperO2O::setLayer1SecondStageLUT().

Referenced by newObject().

43  {
44  const char* expectedParams[] = {
45  "layer1ECalScaleFactors",
46  "layer1HCalScaleFactors",
47  "layer1HFScaleFactors",
48  "layer1ECalScaleETBins",
49  "layer1HCalScaleETBins",
50  "layer1HFScaleETBins"
51  // Optional params
52  //"layer1ECalScalePhiBins",
53  //"layer1HCalScalePhiBins",
54  //"layer1HFScalePhiBins",
55  //"layer1SecondStageLUT",
56  //"layer1HCalFBLUTUpper",
57  //"layer1HCalFBLUTLower"
58  };
59  for (const auto param : expectedParams) {
60  if (conf.find(param) == conf.end()) {
61  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd")
62  << "Unable to locate expected CaloLayer1 parameter: " << param << " in L1 settings payload!";
63  return false;
64  }
65  }
66  // Layer 1 LUT specification
67  paramsHelper.setLayer1ECalScaleFactors((conf["layer1ECalScaleFactors"].getVector<double>()));
68  paramsHelper.setLayer1HCalScaleFactors((conf["layer1HCalScaleFactors"].getVector<double>()));
69  paramsHelper.setLayer1HFScaleFactors((conf["layer1HFScaleFactors"].getVector<double>()));
70  paramsHelper.setLayer1ECalScaleETBins(conf["layer1ECalScaleETBins"].getVector<int>());
71  paramsHelper.setLayer1HCalScaleETBins(conf["layer1HCalScaleETBins"].getVector<int>());
72  paramsHelper.setLayer1HFScaleETBins(conf["layer1HFScaleETBins"].getVector<int>());
73 
74  if (conf.find("layer1ECalScalePhiBins") != conf.end())
75  paramsHelper.setLayer1ECalScalePhiBins(
76  conf["layer1ECalScalePhiBins"].getVector<unsigned int>()); // std::vector<unsigned>(36,0)
77  if (conf.find("layer1HCalScalePhiBins") != conf.end())
78  paramsHelper.setLayer1HCalScalePhiBins(conf["layer1HCalScalePhiBins"].getVector<unsigned int>());
79  if (conf.find("layer1HFScalePhiBins") != conf.end())
80  paramsHelper.setLayer1HFScalePhiBins(conf["layer1HFScalePhiBins"].getVector<unsigned int>());
81  if (conf.find("layer1SecondStageLUT") != conf.end())
82  paramsHelper.setLayer1SecondStageLUT(conf["layer1SecondStageLUT"].getVector<unsigned int>());
83  if (conf.find("layer1HCalFBLUTUpper") != conf.end())
84  paramsHelper.setLayer1HCalFBLUTUpper(conf["layer1HCalFBLUTUpper"].getVector<unsigned int>());
85  if (conf.find("layer1HCalFBLUTLower") != conf.end())
86  paramsHelper.setLayer1HCalFBLUTLower(conf["layer1HCalFBLUTLower"].getVector<unsigned int>());
87 
88  return true;
89 }
void setLayer1HCalFBLUTUpper(const std::vector< unsigned > params)
void setLayer1HFScalePhiBins(const std::vector< unsigned > params)
void setLayer1HCalScaleFactors(const std::vector< double > params)
void setLayer1ECalScaleFactors(const std::vector< double > params)
void setLayer1SecondStageLUT(const std::vector< unsigned > &lut)
Log< level::Error, false > LogError
void setLayer1HCalScalePhiBins(const std::vector< unsigned > params)
void setLayer1HCalScaleETBins(const std::vector< int > params)
void setLayer1HFScaleETBins(const std::vector< int > params)
void setLayer1ECalScaleETBins(const std::vector< int > params)
void setLayer1ECalScalePhiBins(const std::vector< unsigned > params)
void setLayer1HCalFBLUTLower(const std::vector< unsigned > params)
void setLayer1HFScaleFactors(const std::vector< double > params)

◆ readCaloLayer2OnlineSettings()

bool L1TCaloParamsOnlineProd::readCaloLayer2OnlineSettings ( l1t::CaloParamsHelperO2O paramsHelper,
std::map< std::string, l1t::Parameter > &  conf,
std::map< std::string, l1t::Mask > &   
)
private

Definition at line 91 of file L1TCaloParamsOnlineProd.cc.

References l1t::convertToLUT(), caloParams_2018_v1_0_ECALZS_inconsistent_cfi::etSumEtaMax, mps_fire::i, l1t::CaloParamsHelperO2O::setEgBypassECALFG(), l1t::CaloParamsHelperO2O::setEgBypassEGVetos(), l1t::CaloParamsHelperO2O::setEgBypassExtHOverE(), l1t::CaloParamsHelperO2O::setEgBypassShape(), l1t::CaloParamsHelperO2O::setEgCalibrationLUT(), l1t::CaloParamsHelperO2O::setEgEtaCut(), l1t::CaloParamsHelperO2O::setEgHOverEcutBarrel(), l1t::CaloParamsHelperO2O::setEgHOverEcutEndcap(), l1t::CaloParamsHelperO2O::setEgIsolationLUT(), l1t::CaloParamsHelperO2O::setEgIsolationLUT2(), l1t::CaloParamsHelperO2O::setEgMaxPtHOverE(), l1t::CaloParamsHelperO2O::setEgNeighbourThreshold(), l1t::CaloParamsHelperO2O::setEgSeedThreshold(), l1t::CaloParamsHelperO2O::setEtSumCentLower(), l1t::CaloParamsHelperO2O::setEtSumCentUpper(), l1t::CaloParamsHelperO2O::setEtSumEcalSumCalibrationLUT(), l1t::CaloParamsHelperO2O::setEtSumEcalSumPUSLUT(), l1t::CaloParamsHelperO2O::setEtSumEtaMax(), l1t::CaloParamsHelperO2O::setEtSumEttCalibrationLUT(), l1t::CaloParamsHelperO2O::setEtSumEtThreshold(), l1t::CaloParamsHelperO2O::setEtSumEttPUSLUT(), l1t::CaloParamsHelperO2O::setEtSumMetPUSLUT(), l1t::CaloParamsHelperO2O::setIsoTauEtaMax(), l1t::CaloParamsHelperO2O::setJetBypassPUS(), l1t::CaloParamsHelperO2O::setJetCalibrationLUT(), l1t::CaloParamsHelperO2O::setJetPUSUsePhiRing(), l1t::CaloParamsHelperO2O::setJetSeedThreshold(), l1t::CaloParamsHelperO2O::setMetCalibrationLUT(), l1t::CaloParamsHelperO2O::setMetHFCalibrationLUT(), l1t::CaloParamsHelperO2O::setMetHFPhiCalibrationLUT(), l1t::CaloParamsHelperO2O::setMetPhiCalibrationLUT(), l1t::CaloParamsHelperO2O::setPileUpTowerThreshold(), l1t::CaloParamsHelperO2O::setTauCalibrationLUT(), l1t::CaloParamsHelperO2O::setTauIsolationLUT(), l1t::CaloParamsHelperO2O::setTauNeighbourThreshold(), l1t::CaloParamsHelperO2O::setTauSeedThreshold(), l1t::CaloParamsHelperO2O::setTauTrimmingShapeVetoLUT(), and parallelization::uint.

Referenced by newObject().

93  {
94  const char* expectedParams[] = {
95  "leptonSeedThreshold",
96  "leptonTowerThreshold",
97  "pileUpTowerThreshold",
98  "egammaRelaxationThreshold",
99  "egammaMaxEta",
100  "egammaBypassCuts",
101  "egammaBypassShape",
102  "egammaBypassEcalFG",
103  "egammaBypassExtendedHOverE",
104  "egammaHOverECut_iEtaLT15",
105  "egammaHOverECut_iEtaGTEq15",
106  "egammaEnergyCalibLUT",
107  "egammaIsoLUT1",
108  "egammaIsoLUT2",
109  "tauMaxEta",
110  "tauEnergyCalibLUT",
111  "tauIsoLUT",
112  "tauTrimmingLUT",
113  "jetSeedThreshold",
114  "HTMHT_maxJetEta",
115  "HT_jetThreshold",
116  "MHT_jetThreshold",
117  "jetBypassPileUpSub",
118  "jetEnergyCalibLUT",
119  "jetPUSUsePhiRing",
120  "towerCountThreshold",
121  "towerCountMaxEta",
122  "ETMET_maxTowerEta",
123  "ecalET_towerThresholdLUT",
124  "ET_towerThresholdLUT",
125  "MET_towerThresholdLUT",
126  "ET_centralityLowerThresholds",
127  "ET_centralityUpperThresholds",
128  "ET_energyCalibLUT",
129  "ecalET_energyCalibLUT",
130  "MET_energyCalibLUT",
131  "METHF_energyCalibLUT",
132  "MET_phiCalibLUT",
133  "METHF_phiCalibLUT",
134  };
135 
136  for (const auto param : expectedParams) {
137  if (conf.find(param) == conf.end()) {
138  edm::LogError("L1-O2O: L1TCaloParamsOnlineProd")
139  << "Unable to locate expected CaloLayer2 parameter: " << param << " in L1 settings payload!";
140  return false;
141  }
142  }
143  // Layer 2 params specification
144  paramsHelper.setEgSeedThreshold((conf["leptonSeedThreshold"].getValue<int>()) / 2.);
145  paramsHelper.setTauSeedThreshold((conf["leptonSeedThreshold"].getValue<int>()) / 2.);
146  paramsHelper.setEgNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>()) / 2.);
147  paramsHelper.setTauNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>()) / 2.);
148  paramsHelper.setPileUpTowerThreshold((conf["pileUpTowerThreshold"].getValue<int>()) / 2.);
149 
150  paramsHelper.setEgMaxPtHOverE((conf["egammaRelaxationThreshold"].getValue<int>()) / 2.);
151  paramsHelper.setEgEtaCut((conf["egammaMaxEta"].getValue<int>()));
152  paramsHelper.setEgBypassEGVetos(conf["egammaBypassCuts"].getValue<bool>());
153  paramsHelper.setEgBypassShape(conf["egammaBypassShape"].getValue<bool>());
154  paramsHelper.setEgBypassECALFG(conf["egammaBypassEcalFG"].getValue<bool>());
155  paramsHelper.setEgBypassExtHOverE(conf["egammaBypassExtendedHOverE"].getValue<bool>());
156  paramsHelper.setEgHOverEcutBarrel(conf["egammaHOverECut_iEtaLT15"].getValue<int>());
157  paramsHelper.setEgHOverEcutEndcap(conf["egammaHOverECut_iEtaGTEq15"].getValue<int>());
158  paramsHelper.setEgCalibrationLUT(l1t::convertToLUT(conf["egammaEnergyCalibLUT"].getVector<int>()));
159  paramsHelper.setEgIsolationLUT(l1t::convertToLUT(conf["egammaIsoLUT1"].getVector<int>()));
160  paramsHelper.setEgIsolationLUT2(l1t::convertToLUT(conf["egammaIsoLUT2"].getVector<int>()));
161 
162  paramsHelper.setIsoTauEtaMax((conf["tauMaxEta"].getValue<int>()));
163  paramsHelper.setTauCalibrationLUT(l1t::convertToLUT(conf["tauEnergyCalibLUT"].getVector<int>()));
164  paramsHelper.setTauIsolationLUT(l1t::convertToLUT(conf["tauIsoLUT"].getVector<int>()));
165  paramsHelper.setTauTrimmingShapeVetoLUT(l1t::convertToLUT(conf["tauTrimmingLUT"].getVector<int>()));
166 
167  paramsHelper.setJetSeedThreshold((conf["jetSeedThreshold"].getValue<int>()) / 2.);
168  paramsHelper.setJetBypassPUS(conf["jetBypassPileUpSub"].getValue<bool>());
169  paramsHelper.setJetPUSUsePhiRing(conf["jetPUSUsePhiRing"].getValue<bool>());
170  paramsHelper.setJetCalibrationLUT(l1t::convertToLUT(conf["jetEnergyCalibLUT"].getVector<uint32_t>()));
171 
172  std::vector<int> etSumEtaMax;
173  std::vector<int> etSumEtThresh;
174 
175  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
176  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
177  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
178  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
179  etSumEtaMax.push_back(conf["towerCountMaxEta"].getValue<int>());
180 
181  etSumEtThresh.push_back(0); //deprecated by EttPUSLUT
182  etSumEtThresh.push_back(conf["HT_jetThreshold"].getValue<int>() / 2.);
183  etSumEtThresh.push_back(0); //deprecated by MetPUSLUT
184  etSumEtThresh.push_back(conf["MHT_jetThreshold"].getValue<int>() / 2.);
185  etSumEtThresh.push_back(conf["towerCountThreshold"].getValue<int>() / 2.);
186 
187  for (uint i = 0; i < 5; ++i) {
188  paramsHelper.setEtSumEtaMax(i, etSumEtaMax.at(i));
189  paramsHelper.setEtSumEtThreshold(i, etSumEtThresh.at(i));
190  }
191 
192  paramsHelper.setEtSumMetPUSLUT(l1t::convertToLUT(conf["MET_towerThresholdLUT"].getVector<int>()));
193  paramsHelper.setEtSumEttPUSLUT(l1t::convertToLUT(conf["ET_towerThresholdLUT"].getVector<int>()));
194  paramsHelper.setEtSumEcalSumPUSLUT(l1t::convertToLUT(conf["ecalET_towerThresholdLUT"].getVector<int>()));
195 
196  std::vector<double> etSumCentLowerValues;
197  std::vector<double> etSumCentUpperValues;
198 
199  etSumCentLowerValues = conf["ET_centralityLowerThresholds"].getVector<double>();
200  etSumCentUpperValues = conf["ET_centralityUpperThresholds"].getVector<double>();
201 
202  for (uint i = 0; i < 8; ++i) {
203  paramsHelper.setEtSumCentLower(i, etSumCentLowerValues[i] / 2.);
204  paramsHelper.setEtSumCentUpper(i, etSumCentUpperValues[i] / 2.);
205  }
206 
207  // demux tower sum calib LUTs
208  paramsHelper.setEtSumEttCalibrationLUT(l1t::convertToLUT(conf["ET_energyCalibLUT"].getVector<int>()));
209  paramsHelper.setEtSumEcalSumCalibrationLUT(l1t::convertToLUT(conf["ecalET_energyCalibLUT"].getVector<int>()));
210  paramsHelper.setMetCalibrationLUT(l1t::convertToLUT(conf["MET_energyCalibLUT"].getVector<int>()));
211  paramsHelper.setMetHFCalibrationLUT(l1t::convertToLUT(conf["METHF_energyCalibLUT"].getVector<int>()));
212  paramsHelper.setMetPhiCalibrationLUT(l1t::convertToLUT(conf["MET_phiCalibLUT"].getVector<int>()));
213  paramsHelper.setMetHFPhiCalibrationLUT(l1t::convertToLUT(conf["METHF_phiCalibLUT"].getVector<int>()));
214 
215  return true;
216 }
void setTauIsolationLUT(const l1t::LUT &lut)
void setEgCalibrationLUT(const l1t::LUT &lut)
void setEtSumEttCalibrationLUT(const l1t::LUT &lut)
void setJetCalibrationLUT(const l1t::LUT &lut)
void setEgNeighbourThreshold(double thresh)
void setEtSumEcalSumCalibrationLUT(const l1t::LUT &lut)
Log< level::Error, false > LogError
void setEtSumEttPUSLUT(const l1t::LUT &lut)
void setTauCalibrationLUT(const l1t::LUT &lut)
void setJetSeedThreshold(double thresh)
void setEtSumCentLower(unsigned centClass, double loBound)
void setEtSumEtaMax(unsigned isum, int eta)
void setEgIsolationLUT(const l1t::LUT &lut)
void setTauSeedThreshold(double thresh)
void setTauNeighbourThreshold(double thresh)
void setPileUpTowerThreshold(int thresh)
void setMetHFPhiCalibrationLUT(const l1t::LUT &lut)
void setEgIsolationLUT2(const l1t::LUT &lut)
l1t::LUT convertToLUT(const std::vector< uint64_t > &v, int padding=-1) noexcept
Definition: ConvertToLUT.h:10
void setTauTrimmingShapeVetoLUT(const l1t::LUT &lut)
void setMetHFCalibrationLUT(const l1t::LUT &lut)
void setMetPhiCalibrationLUT(const l1t::LUT &lut)
void setEgBypassEGVetos(unsigned flag)
void setEtSumEcalSumPUSLUT(const l1t::LUT &lut)
void setEgBypassShape(unsigned flag)
void setEtSumCentUpper(unsigned centClass, double upBound)
void setEgSeedThreshold(double thresh)
void setEtSumEtThreshold(unsigned isum, double thresh)
void setEgBypassExtHOverE(unsigned flag)
void setJetPUSUsePhiRing(unsigned flag)
void setEgMaxPtHOverE(double thresh)
void setEtSumMetPUSLUT(const l1t::LUT &lut)
void setJetBypassPUS(unsigned flag)
void setEgBypassECALFG(unsigned flag)
void setMetCalibrationLUT(const l1t::LUT &lut)

Member Data Documentation

◆ baseSettings_token

const edm::ESGetToken<l1t::CaloParams, L1TCaloParamsRcd> L1TCaloParamsOnlineProd::baseSettings_token
private

Definition at line 22 of file L1TCaloParamsOnlineProd.cc.

Referenced by newObject().

◆ exclusiveLayer

const unsigned int L1TCaloParamsOnlineProd::exclusiveLayer
private

Definition at line 23 of file L1TCaloParamsOnlineProd.cc.

Referenced by newObject().

◆ transactionSafe

const bool L1TCaloParamsOnlineProd::transactionSafe
private

Definition at line 24 of file L1TCaloParamsOnlineProd.cc.

Referenced by newObject().