CMS 3D CMS Logo

L1TMuonOverlapObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 #include <iostream>
4 #include "OnlineDBqueryHelper.h"
5 
7 private:
9 
10 public:
11  void fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) override;
12 
14  ~L1TMuonOverlapObjectKeysOnlineProd(void) override = default;
15 };
16 
19  transactionSafe = iConfig.getParameter<bool>("transactionSafe");
20 }
21 
24 
25  std::string tscKey = OMTFKey.substr(0, OMTFKey.find(':'));
26  std::string algo_key, infra_key;
27 
28  // L1TMuonOverlapFwVersion and L1TMuonOverlapParams keys to be found from INFRA and ALGO, respectively
29 
30  try {
31  std::map<std::string, std::string> keys =
32  l1t::OnlineDBqueryHelper::fetch({"ALGO", "INFRA"}, "OMTF_KEYS", tscKey, m_omdsReader);
33  algo_key = keys["ALGO"];
34  infra_key = keys["INFRA"];
35 
36  } catch (std::runtime_error& e) {
37  edm::LogError("L1-O2O L1TMuonOverlapObjectKeysOnlineProd") << "Cannot get OMTF_KEYS ";
38 
39  if (transactionSafe)
40  throw std::runtime_error("SummaryForFunctionManager: OMTF | Faulty | Broken key");
41  else {
42  edm::LogError("L1-O2O: L1TMuonOverlapObjectKeysOnlineProd")
43  << "forcing L1TMuonOverlapFwVersion key to be = 'OMTF_INFRA_EMPTY' with baseline settings";
44  pL1TriggerKey->add("L1TMuonOverlapFwVersionO2ORcd", "L1TMuonOverlapFwVersion", "OMTF_INFRA_EMPTY");
45  edm::LogError("L1-O2O: L1TMuonOverlapObjectKeysOnlineProd")
46  << "forcing L1TMuonOverlapParams key to be = 'OMTF_ALGO_EMPTY' (known to exist)";
47  pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", "OMTF_ALGO_EMPTY");
48  return;
49  }
50  }
51 
52  pL1TriggerKey->add("L1TMuonOverlapFwVersionO2ORcd", "L1TMuonOverlapFwVersion", infra_key);
53 
54  pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", algo_key);
55 }
56 
57 //define this as a plug-in
const std::string & subsystemKey(L1Subsystems subsystem) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void fillObjectKeys(L1TriggerKeyExt *pL1TriggerKey) override
~L1TMuonOverlapObjectKeysOnlineProd(void) override=default
void add(const std::string &record, const std::string &type, const std::string &key)
Log< level::Error, false > LogError
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)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61