CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTParametersKeysOnlineProd.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // \class L1MuGMTParametersOnlineProd
4 //
5 // Description: A key producer to deduce the GMT LUT keys from the master
6 // GMT configuration key, closely following the example of
7 //
8 // https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideL1ConfigOnlineProd r11
9 //
10 // $Date: 2009/03/13 17:55:39 $
11 // $Revision: 1.2 $
12 //
13 // Author :
14 // Thomas Themel
15 //
16 //--------------------------------------------------
17 
20 
21 
23  public:
25  : L1ObjectKeysOnlineProdBase( iConfig )
26  {
27  LogDebug( "L1-O2O" ) << "L1MuGMTParametersKeysOnlineProd created" << std::endl;
28  }
30 
31  virtual void fillObjectKeys( ReturnType pL1TriggerKey ) ;
32  private:
33 };
34 
35 
36 
37 void
39 {
40 
41  std::string subsystemKey = pL1TriggerKey->subsystemKey( L1TriggerKey::kGMT ) ;
42 
43  if( !subsystemKey.empty() )
44  {
45 
46  l1t::OMDSReader::QueryResults lutKeyResults =
48  // SELECTed column
49  "LUT_KEY",
50  // schema name
51  "CMS_GMT",
52  // table name
53  "GMT_CONFIG",
54  // WHERE lhs
55  "GMT_CONFIG.KEY",
56  // WHERE rhs
57  m_omdsReader.singleAttribute( subsystemKey ) );
58 
59  if( lutKeyResults.queryFailed() || lutKeyResults.numberRows() != 1 ) // check if query was successful
60  {
61  edm::LogError( "L1-O2O" ) << "Problem extracting GMT LUT key from GMT config key." ;
62  return ;
63  }
64 
65  l1t::OMDSReader::QueryResults softwareConfigKeyResults =
67  // SELECTed column
68  "GMT_SOFTWARE_CONFIG",
69  // schema name
70  "CMS_GMT",
71  // table name
72  "GMT_LUTS",
73  // WHERE lhs
74  "GMT_LUTS.KEY",
75  // WHERE rhs
76  lutKeyResults);
77 
78  if( softwareConfigKeyResults.queryFailed() || softwareConfigKeyResults.numberRows() != 1 ) // check if query was successful
79  {
80  edm::LogError( "L1-O2O" ) << "Problem extracting GMT software config key from GMT config key." ;
81  return ;
82  }
83 
84  std::string objectKey ;
85  softwareConfigKeyResults.fillVariable(objectKey) ;
86 
87  pL1TriggerKey->add( "L1MuGMTParametersRcd", "L1MuGMTParameters", objectKey ) ;
88  }
89 }
90 
#define LogDebug(id)
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
boost::shared_ptr< L1TriggerKey > 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="") const
Definition: OMDSReader.cc:87
virtual void fillObjectKeys(ReturnType pL1TriggerKey)
L1MuGMTParametersKeysOnlineProd(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60