test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMuonEndcapObjectKeysOnlineProd.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 EMTFKey = pL1TriggerKey->subsystemKey( L1TriggerKeyExt::kEMTF ) ;
23 
24  std::string stage2Schema = "CMS_TRG_L1_CONF" ;
25 
26  if( EMTFKey.empty() ){
27  edm::LogError( "L1-O2O: L1TMuonEndcapObjectKeysOnlineProd" ) << "Key is empty ... do nothing, but that'll probably crash things later on";
28  return;
29  }
30 
31  std::string tscKey = EMTFKey.substr(0, EMTFKey.find(":") );
32  std::string rsKey = EMTFKey.substr( EMTFKey.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.EMTF_KEYS where ID = tscKey ;
40  l1t::OMDSReader::QueryResults queryResult =
41  m_omdsReader.basicQuery( queryStrings,
42  stage2Schema,
43  "EMTF_KEYS",
44  "EMTF_KEYS.ID",
46  ) ;
47 
48  if( queryResult.queryFailed() || queryResult.numberRows() != 1 ){
49  edm::LogError( "L1-O2O" ) << "Cannot get EMTF_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( "L1TMuonEndcapParamsO2ORcd",
57  "L1TMuonEndCapParams",
58  algo_key) ;
59 
60 }
61 
62 
63 //define this as a plug-in
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:312
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:296
virtual void fillObjectKeys(ReturnType pL1TriggerKey) override
L1TMuonEndcapObjectKeysOnlineProd(const edm::ParameterSet &)
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
boost::shared_ptr< L1TriggerKeyExt > ReturnType