test
CMS 3D CMS Logo

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

#include <L1SubsystemKeysOnlineProdExt.h>

Inheritance diagram for L1SubsystemKeysOnlineProdExt:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef boost::shared_ptr
< L1TriggerKeyExt
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 L1SubsystemKeysOnlineProdExt (const edm::ParameterSet &)
 
ReturnType produce (const L1TriggerKeyExtRcd &)
 
 ~L1SubsystemKeysOnlineProdExt ()
 
- 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 Attributes

bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 
std::string m_tscKey
 

Additional Inherited Members

- 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 &)
 

Detailed Description

Definition at line 16 of file L1SubsystemKeysOnlineProdExt.h.

Member Typedef Documentation

Definition at line 21 of file L1SubsystemKeysOnlineProdExt.h.

Constructor & Destructor Documentation

L1SubsystemKeysOnlineProdExt::L1SubsystemKeysOnlineProdExt ( const edm::ParameterSet iConfig)

Definition at line 13 of file L1SubsystemKeysOnlineProdExt.cc.

References edm::ESProducer::setWhatProduced().

14  : m_tscKey( iConfig.getParameter< std::string >( "tscKey" ) ),
16  iConfig.getParameter< std::string >( "onlineDB" ),
17  iConfig.getParameter< std::string >( "onlineAuthentication" ) ),
18  m_forceGeneration( iConfig.getParameter< bool >( "forceGeneration" ) )
19 {
20  //the following line is needed to tell the framework what
21  // data is being produced
22  setWhatProduced(this, "SubsystemKeysOnly");
23 
24  //now do what ever other initialization is needed
25 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
L1SubsystemKeysOnlineProdExt::~L1SubsystemKeysOnlineProdExt ( )

Definition at line 28 of file L1SubsystemKeysOnlineProdExt.cc.

29 {
30 
31  // do anything here that needs to be done at desctruction time
32  // (e.g. close files, deallocate resources etc.)
33 
34 }

Member Function Documentation

L1SubsystemKeysOnlineProdExt::ReturnType L1SubsystemKeysOnlineProdExt::produce ( const L1TriggerKeyExtRcd iRecord)

Definition at line 43 of file L1SubsystemKeysOnlineProdExt.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1TriggerKeyExt::kuGT, m_forceGeneration, m_omdsReader, m_tscKey, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

44 {
45  using namespace edm::es;
46  boost::shared_ptr<L1TriggerKeyExt> pL1TriggerKey ;
47 
48  // Get L1TriggerKeyListExt
49  L1TriggerKeyListExt keyList ;
50  l1t::DataWriterExt dataWriter ;
51  if( !dataWriter.fillLastTriggerKeyList( keyList ) )
52  {
53  edm::LogError( "L1-O2O" )
54  << "Problem getting last L1TriggerKeyListExt" ;
55  }
56 
57  // If L1TriggerKeyListExt does not contain TSC key, token is empty
58  if( keyList.token( m_tscKey ) == std::string() ||
60  {
61  // Instantiate new L1TriggerKey
62  pL1TriggerKey = boost::shared_ptr< L1TriggerKeyExt >(
63  new L1TriggerKeyExt() ) ;
64  pL1TriggerKey->setTSCKey( m_tscKey ) ;
65 
66  edm::LogVerbatim( "L1-O2O" ) << "TSC KEY " << m_tscKey ;
67 
68  // Get subsystem keys from OMDS
69 
70  // SELECT uGT_KEY FROM TRIGGERSUP_CONF WHERE TRIGGERSUP_CONF.TS_KEY = m_tscKey
71  std::vector< std::string > queryStrings ;
72  queryStrings.push_back( "UGT_KEY" ) ;
73 
74  l1t::OMDSReader::QueryResults subkeyResults =
75  m_omdsReader.basicQuery( queryStrings,
76  "CMS_TRG_L1_CONF",
77  "L1_TRG_CONF_KEYS",
78  "L1_TRG_CONF_KEYS.ID",
80 
81  if( subkeyResults.queryFailed() ||
82  subkeyResults.numberRows() != 1 ) // check query successful
83  {
84  edm::LogError( "L1-O2O" ) << "Problem with subsystem keys." ;
85  return pL1TriggerKey ;
86  }
87 
88  std::string uGTKey;
89 
90  subkeyResults.fillVariable( "UGT_KEY", uGTKey ) ;
91  pL1TriggerKey->setSubsystemKey( L1TriggerKeyExt::kuGT, uGTKey ) ;
92  edm::LogVerbatim( "L1-O2O" ) << "UGT_KEY " << uGTKey ;
93 
94  }
95  else
96  {
98  "L1TriggerKeyExt for TSC key " + m_tscKey + " already in CondDB." ) ;
99  }
100 
101  return pL1TriggerKey ;
102 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:312
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:296
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

Member Data Documentation

bool L1SubsystemKeysOnlineProdExt::m_forceGeneration
private

Definition at line 28 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

l1t::OMDSReader L1SubsystemKeysOnlineProdExt::m_omdsReader
private

Definition at line 27 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().

std::string L1SubsystemKeysOnlineProdExt::m_tscKey
private

Definition at line 26 of file L1SubsystemKeysOnlineProdExt.h.

Referenced by produce().