CMS 3D CMS Logo

List of all members | Public Member Functions
L1TMuonGlobalParamsOnlineProd Class Reference
Inheritance diagram for L1TMuonGlobalParamsOnlineProd:
L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1TMuonGlobalParamsOnlineProd (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1TMuonGlobalParamsnewObject (const std::string &objectKey, const L1TMuonGlobalParamsO2ORcd &record) override
 
 ~L1TMuonGlobalParamsOnlineProd (void)
 
- Public Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams >
 L1ConfigOnlineProdBaseExt (const edm::ParameterSet &)
 
std::shared_ptr< L1TMuonGlobalParamsproduce (const L1TMuonGlobalParamsO2ORcd &iRecord)
 
 ~L1ConfigOnlineProdBaseExt ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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 () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams >
bool getObjectKey (const L1TMuonGlobalParamsO2ORcd &record, std::shared_ptr< L1TMuonGlobalParams > data, std::string &objectKey)
 
- 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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_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 L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 15 of file L1TMuonGlobalParamsOnlineProd.cc.

Constructor & Destructor Documentation

L1TMuonGlobalParamsOnlineProd::L1TMuonGlobalParamsOnlineProd ( const edm::ParameterSet iConfig)
L1TMuonGlobalParamsOnlineProd::~L1TMuonGlobalParamsOnlineProd ( void  )
inline

Definition at line 21 of file L1TMuonGlobalParamsOnlineProd.cc.

21 {}

Member Function Documentation

std::shared_ptr< L1TMuonGlobalParams > L1TMuonGlobalParamsOnlineProd::newObject ( const std::string &  objectKey,
const L1TMuonGlobalParamsO2ORcd record 
)
overridevirtual

Implements L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams >.

Definition at line 26 of file L1TMuonGlobalParamsOnlineProd.cc.

References mps_alisetup::append, cast_to_L1TMuonGlobalParams(), DEFINE_FWK_EVENTSETUP_MODULE, MillePedeFileConverter_cfg::e, l1t::OnlineDBqueryHelper::fetch(), edm::eventsetup::EventSetupRecord::get(), crabWrapper::key, relativeConstraints::keys, L1TMuonGlobalParamsHelper::loadFromOnline(), L1ConfigOnlineProdBaseExt< L1TMuonGlobalParamsO2ORcd, L1TMuonGlobalParams >::m_omdsReader, convertSQLitetoXML_cfg::output, l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), l1t::TriggerSystem::setConfigured(), and AlCaHLTBitMon_QueryRunRegistry::string.

26  {
27  using namespace edm::es;
28 
29  const L1TMuonGlobalParamsRcd& baseRcd = record.template getRecord< L1TMuonGlobalParamsRcd >() ;
31  baseRcd.get( baseSettings ) ;
32 
33  if( objectKey.empty() ){
34  edm::LogError( "L1-O2O: L1TMuonGlobalParamsOnlineProd" ) << "Key is empty";
35  throw std::runtime_error("Empty objectKey");
36  }
37 
38  std::string tscKey = objectKey.substr(0, objectKey.find(":") );
39  std::string rsKey = objectKey.substr( objectKey.find(":")+1, std::string::npos );
40 
41  edm::LogInfo( "L1-O2O: L1TMuonGlobalParamsOnlineProd" ) << "Producing L1TMuonGlobalParams with TSC key =" << tscKey << " and RS key = " << rsKey ;
42 
43  std::string algo_key, hw_key;
44  std::string hw_payload;
45  std::map<std::string,std::string> rs_payloads, algo_payloads;
46  try {
47  std::map<std::string,std::string> keys =
48  l1t::OnlineDBqueryHelper::fetch( {"ALGO","HW"},
49  "UGMT_KEYS",
50  tscKey,
52  );
53  algo_key = keys["ALGO"];
54  hw_key = keys["HW"];
55 
56  hw_payload = l1t::OnlineDBqueryHelper::fetch( {"CONF"},
57  "UGMT_CLOBS",
58  hw_key,
60  ) ["CONF"];
61 
62  std::map<std::string,std::string> rsKeys =
63  l1t::OnlineDBqueryHelper::fetch( {"MP7","MP7_MONI","AMC13_MONI"},
64  "UGMT_RS_KEYS",
65  rsKey,
67  );
68 
69  std::map<std::string,std::string> algoKeys =
70  l1t::OnlineDBqueryHelper::fetch( {"MP7","LUTS"},
71  "UGMT_ALGO_KEYS",
72  algo_key,
74  );
75 
76  for(auto &key : rsKeys)
77  rs_payloads[ key.second ] =
79  "UGMT_CLOBS",
80  key.second,
82  ) ["CONF"];
83 
84  for(auto &key : algoKeys)
85  algo_payloads[ key.second ] =
87  "UGMT_CLOBS",
88  key.second,
90  ) ["CONF"];
91  } catch ( std::runtime_error &e ) {
92  edm::LogError( "L1-O2O: L1TMuonGlobalParamsOnlineProd" ) << e.what();
93  throw std::runtime_error("Broken key");
94  }
95 
96 
97  // for debugging dump the configs to local files
98  {
99  std::ofstream output(std::string("/tmp/").append(hw_key.substr(0,hw_key.find("/"))).append(".xml"));
100  output << hw_payload;
101  output.close();
102  }
103  for(auto &conf : rs_payloads){
104  std::ofstream output(std::string("/tmp/").append(conf.first.substr(0,conf.first.find("/"))).append(".xml"));
105  output<<conf.second;
106  output.close();
107  }
108  for(auto &conf : algo_payloads){
109  std::ofstream output(std::string("/tmp/").append(conf.first.substr(0,conf.first.find("/"))).append(".xml"));
110  output<<conf.second;
111  output.close();
112  }
113 
114  // finally, push all payloads to the XML parser and construct the TrigSystem objects with each of those
115  l1t::XmlConfigParser xmlRdr;
116  l1t::TriggerSystem trgSys;
117 
118  // HW settings should always go first
119  xmlRdr.readDOMFromString( hw_payload );
120  xmlRdr.readRootElement ( trgSys );
121 
122  // now let's parse ALGO and then RS settings
123  for(auto &conf : algo_payloads){
124  xmlRdr.readDOMFromString( conf.second );
125  xmlRdr.readRootElement ( trgSys );
126  }
127  for(auto &conf : rs_payloads){
128  xmlRdr.readDOMFromString( conf.second );
129  xmlRdr.readRootElement ( trgSys );
130  }
131  trgSys.setConfigured();
132 
133  L1TMuonGlobalParamsHelper m_params_helper( *(baseSettings.product()) );
134  m_params_helper.loadFromOnline(trgSys);
135 
136  std::shared_ptr< L1TMuonGlobalParams > retval = std::make_shared< L1TMuonGlobalParams >( cast_to_L1TMuonGlobalParams(m_params_helper) );
137 
138  return retval ;
139 }
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:73
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
static std::map< std::string, std::string > fetch(const std::vector< std::string > &queryColumns, const std::string &table, const std::string &key, l1t::OMDSReader &m_omdsReader)
void get(HolderT &iHolder) const
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")