CMS 3D CMS Logo

L1TMuonOverlapObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 #include <iostream>
4 
6 private:
8 public:
9  void fillObjectKeys( L1TriggerKeyExt* pL1TriggerKey ) override ;
10 
13 };
14 
16  : L1ObjectKeysOnlineProdBaseExt( iConfig ){
17  transactionSafe = iConfig.getParameter<bool>("transactionSafe");
18 }
19 
20 
22 
23  std::string OMTFKey = pL1TriggerKey->subsystemKey( L1TriggerKeyExt::kOMTF ) ;
24 
25  std::string stage2Schema = "CMS_TRG_L1_CONF" ;
26 
27  std::string tscKey = OMTFKey.substr(0, OMTFKey.find(":") );
28 
29  std::vector< std::string > queryStrings ;
30  queryStrings.push_back( "ALGO" ) ;
31 
32  std::string algo_key;
33 
34  // select ALGO from CMS_TRG_L1_CONF.OMTF_KEYS where ID = tscKey ;
35  l1t::OMDSReader::QueryResults queryResult =
36  m_omdsReader.basicQuery( queryStrings,
37  stage2Schema,
38  "OMTF_KEYS",
39  "OMTF_KEYS.ID",
41  ) ;
42 
43  if( queryResult.queryFailed() || queryResult.numberRows() != 1 || !queryResult.fillVariable( "ALGO", algo_key) ){
44  edm::LogError( "L1-O2O L1TMuonOverlapObjectKeysOnlineProd" ) << "Cannot get OMTF_KEYS.ALGO ";
45 
46  if( transactionSafe )
47  throw std::runtime_error("SummaryForFunctionManager: OMTF | Faulty | Broken key");
48  else {
49  edm::LogError( "L1-O2O: L1TMuonOverlapObjectKeysOnlineProd" ) << "forcing L1TMuonOverlapParams key to be = 'OMTF_ALGO_EMPTY' (known to exist)";
50  pL1TriggerKey->add( "L1TMuonOverlapParamsO2ORcd",
51  "L1TMuonOverlapParams",
52  "OMTF_ALGO_EMPTY") ;
53  return;
54  }
55  }
56 
57  // simply assign the algo key to the record
58  pL1TriggerKey->add( "L1TMuonOverlapParamsO2ORcd",
59  "L1TMuonOverlapParams",
60  algo_key) ;
61 }
62 
63 
64 //define this as a plug-in
T getParameter(std::string const &) const
void fillObjectKeys(L1TriggerKeyExt *pL1TriggerKey) override
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
void add(const std::string &record, const std::string &type, const std::string &key)
const std::string & subsystemKey(L1Subsystems subsystem) const
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:86
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60