CMS 3D CMS Logo

L1TMuonOverlapObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 #include <iostream>
4 
6 private:
7 
8 public:
9  virtual void fillObjectKeys( ReturnType pL1TriggerKey ) override ;
10 
13 };
14 
16  : L1ObjectKeysOnlineProdBaseExt( iConfig ){
17 }
18 
19 
21 
22  std::string OMTFKey = pL1TriggerKey->subsystemKey( L1TriggerKeyExt::kOMTF ) ;
23 
24  std::string stage2Schema = "CMS_TRG_L1_CONF" ;
25 
26  if( OMTFKey.empty() ){
27  edm::LogError( "L1-O2O: L1TMuonOverlapObjectKeysOnlineProd" ) << "Key is empty ... do nothing, but that'll probably crash things later on";
28  return;
29  }
30 
31  std::string tscKey = OMTFKey.substr(0, OMTFKey.find(":") );
32  std::string rsKey = OMTFKey.substr( OMTFKey.find(":")+1, std::string::npos );
33 
34  std::vector< std::string > queryStrings ;
35  queryStrings.push_back( "ALGO" ) ;
36 
37  std::string algo_key;
38 
39  // select ALGO from CMS_TRG_L1_CONF.OMTF_KEYS where ID = tscKey ;
40  l1t::OMDSReader::QueryResults queryResult =
41  m_omdsReader.basicQuery( queryStrings,
42  stage2Schema,
43  "OMTF_KEYS",
44  "OMTF_KEYS.ID",
46  ) ;
47 
48  if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
49  edm::LogError( "L1-O2O" ) << "Cannot get OMTF_KEYS.ALGO "<<" do nothing, but that'll probably crash things later on";
50  return;
51  }
52 
53  if( !queryResult.fillVariable( "ALGO", algo_key) ) algo_key = "";
54 
55  // simply assign the algo key to the record
56  pL1TriggerKey->add( "L1TMuonOverlapParamsO2ORcd",
57  "L1TMuonOverlapParams",
58  algo_key) ;
59 }
60 
61 
62 //define this as a plug-in
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::shared_ptr< L1TriggerKeyExt > ReturnType
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
virtual void fillObjectKeys(ReturnType pL1TriggerKey) override
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60