CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GtTscObjectKeysOnlineProd Class Reference

#include <L1GtTscObjectKeysOnlineProd.h>

Inheritance diagram for L1GtTscObjectKeysOnlineProd:
L1ObjectKeysOnlineProdBase edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

virtual void fillObjectKeys (ReturnType pL1TriggerKey)
 public methods More...
 
 L1GtTscObjectKeysOnlineProd (const edm::ParameterSet &)
 constructor More...
 
 ~L1GtTscObjectKeysOnlineProd ()
 destructor More...
 
- Public Member Functions inherited from L1ObjectKeysOnlineProdBase
 L1ObjectKeysOnlineProdBase (const edm::ParameterSet &)
 
ReturnType produce (const L1TriggerKeyRcd &)
 
 ~L1ObjectKeysOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Member Functions

std::string keyL1GtParameters (const std::string &subsystemKey, const std::string &gtSchema)
 keys for individual objects More...
 
std::string keyL1GtPsbSetup (const std::string &subsystemKey, const std::string &gtSchema)
 
std::string keyL1GtTriggerMenu (const std::string &subsystemKey, const std::string &gtSchema)
 

Private Attributes

bool m_enableL1GtParameters
 enable key search for each record More...
 
bool m_enableL1GtPsbSetup
 
bool m_enableL1GtTriggerMenu
 

Additional Inherited Members

- Public Types inherited from L1ObjectKeysOnlineProdBase
typedef boost::shared_ptr
< L1TriggerKey
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ObjectKeysOnlineProdBase
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: online producer for L1 GT record keys starting from TSC key.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 26 of file L1GtTscObjectKeysOnlineProd.h.

Constructor & Destructor Documentation

L1GtTscObjectKeysOnlineProd::L1GtTscObjectKeysOnlineProd ( const edm::ParameterSet parSet)

constructor

Definition at line 26 of file L1GtTscObjectKeysOnlineProd.cc.

26  :
29  parSet.getParameter<bool> ("EnableL1GtParameters")),
31  parSet.getParameter<bool> ("EnableL1GtTriggerMenu")),
33  parSet.getParameter<bool> ("EnableL1GtPsbSetup")) {
34 
35  // empty
36 
37 }
T getParameter(std::string const &) const
bool m_enableL1GtParameters
enable key search for each record
L1ObjectKeysOnlineProdBase(const edm::ParameterSet &)
L1GtTscObjectKeysOnlineProd::~L1GtTscObjectKeysOnlineProd ( )

destructor

Definition at line 40 of file L1GtTscObjectKeysOnlineProd.cc.

40  {
41 
42  // empty
43 
44 }

Member Function Documentation

void L1GtTscObjectKeysOnlineProd::fillObjectKeys ( ReturnType  pL1TriggerKey)
virtual

public methods

Implements L1ObjectKeysOnlineProdBase.

Definition at line 129 of file L1GtTscObjectKeysOnlineProd.cc.

References keyL1GtParameters(), keyL1GtPsbSetup(), keyL1GtTriggerMenu(), L1TriggerKey::kGT, m_enableL1GtParameters, m_enableL1GtPsbSetup, and m_enableL1GtTriggerMenu.

129  {
130 
131  // kMYSUBSYSTEM = kCSCTF, kDTTF, kRPC, kGMT, kRCT, mkGCT, kGT, or kTSP0
132  // subsystemKey = TRIGGERSUP_CONF.{CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY}
133 
134  std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGT);
135  const std::string gtSchema = "CMS_GT";
136 
137  //
139  const std::string& objectKey = keyL1GtParameters(subsystemKey, gtSchema);
140  if (!objectKey.empty()) {
141  pL1TriggerKey->add("L1GtParametersRcd", "L1GtParameters", objectKey);
142  }
143  }
144 
145  //
147  const std::string& objectKey = keyL1GtTriggerMenu(subsystemKey, gtSchema);
148  if (!objectKey.empty()) {
149  pL1TriggerKey->add("L1GtTriggerMenuRcd", "L1GtTriggerMenu", objectKey);
150  }
151  }
152 
153  //
154  if (m_enableL1GtPsbSetup) {
155  const std::string& objectKey = keyL1GtPsbSetup(subsystemKey, gtSchema);
156  if (!objectKey.empty()) {
157  pL1TriggerKey->add("L1GtPsbSetupRcd", "L1GtPsbSetup", objectKey);
158  }
159  }
160 
161 }
std::string keyL1GtPsbSetup(const std::string &subsystemKey, const std::string &gtSchema)
std::string keyL1GtParameters(const std::string &subsystemKey, const std::string &gtSchema)
keys for individual objects
bool m_enableL1GtParameters
enable key search for each record
std::string keyL1GtTriggerMenu(const std::string &subsystemKey, const std::string &gtSchema)
std::string L1GtTscObjectKeysOnlineProd::keyL1GtParameters ( const std::string &  subsystemKey,
const std::string &  gtSchema 
)
private

keys for individual objects

Definition at line 48 of file L1GtTscObjectKeysOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1ObjectKeysOnlineProdBase::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by fillObjectKeys().

49  {
50 
51  std::string objectKey;
52 
53  if (!subsystemKey.empty()) {
54 
55  // Execute SQL queries to get keys from OMDS.
56 
57  // SELECT GTFE_SETUP_FK FROM CMS_GT.GT_SETUP WHERE GT_SETUP.ID = MyKey
59  "GTFE_SETUP_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
60  subsystemKey));
61 
62  // check if query was successful
63  if (objectKeyResults.queryFailed()) {
64  edm::LogError("L1-O2O")
65  << "Problem with key for record L1GtParametersRcd: query failed ";
66  return objectKey;
67  } else if ( ( objectKeyResults.numberRows() != 1 )) {
68  edm::LogError("L1-O2O") << "Problem with key for record L1GtParametersRcd: "
69  << ( objectKeyResults.numberRows() ) << " rows were returned";
70  return objectKey;
71  }
72 
73  objectKeyResults.fillVariable(objectKey);
74  }
75 
76  return objectKey;
77 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
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
std::string L1GtTscObjectKeysOnlineProd::keyL1GtPsbSetup ( const std::string &  subsystemKey,
const std::string &  gtSchema 
)
private

Definition at line 111 of file L1GtTscObjectKeysOnlineProd.cc.

Referenced by fillObjectKeys().

112  {
113 
114  std::string objectKey;
115 
116  if (!subsystemKey.empty()) {
117 
118  // no need to query OMDS, one uses the GT_SETUP key to get the individual PSB keys.
119  // the L1GtPsbSetup key is GT_SETUP key
120  objectKey = subsystemKey;
121 
122  }
123 
124  return objectKey;
125 
126 }
std::string L1GtTscObjectKeysOnlineProd::keyL1GtTriggerMenu ( const std::string &  subsystemKey,
const std::string &  gtSchema 
)
private

Definition at line 79 of file L1GtTscObjectKeysOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1ObjectKeysOnlineProdBase::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by fillObjectKeys().

80  {
81 
82  std::string objectKey;
83 
84  if (!subsystemKey.empty()) {
85 
86  // Execute SQL queries to get keys from OMDS.
87 
88  // SELECT L1T_MENU_FK FROM CMS_GT.GT_SETUP WHERE GT_SETUP.ID = MyKey
90  "L1T_MENU_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
91  subsystemKey));
92 
93  // check if query was successful
94  if (objectKeyResults.queryFailed()) {
95  edm::LogError("L1-O2O")
96  << "Problem with key for record L1GtTriggerMenuRcd: query failed ";
97  return objectKey;
98  } else if ( ( objectKeyResults.numberRows() != 1 )) {
99  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMenuRcd: "
100  << ( objectKeyResults.numberRows() ) << " rows were returned";
101  return objectKey;
102  }
103 
104  objectKeyResults.fillVariable(objectKey);
105  }
106 
107  return objectKey;
108 
109 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
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

Member Data Documentation

bool L1GtTscObjectKeysOnlineProd::m_enableL1GtParameters
private

enable key search for each record

Definition at line 51 of file L1GtTscObjectKeysOnlineProd.h.

Referenced by fillObjectKeys().

bool L1GtTscObjectKeysOnlineProd::m_enableL1GtPsbSetup
private

Definition at line 53 of file L1GtTscObjectKeysOnlineProd.h.

Referenced by fillObjectKeys().

bool L1GtTscObjectKeysOnlineProd::m_enableL1GtTriggerMenu
private

Definition at line 52 of file L1GtTscObjectKeysOnlineProd.h.

Referenced by fillObjectKeys().