CMS 3D CMS Logo

List of all members | Public Member Functions
L1TMuonBarrelParamsOnlineProd Class Reference
Inheritance diagram for L1TMuonBarrelParamsOnlineProd:
L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1TMuonBarrelParamsOnlineProd (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1TMuonBarrelParamsnewObject (const std::string &objectKey, const L1TMuonBarrelParamsO2ORcd &record) override
 
 ~L1TMuonBarrelParamsOnlineProd (void)
 
- Public Member Functions inherited from L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
 L1ConfigOnlineProdBaseExt (const edm::ParameterSet &)
 
std::shared_ptr< L1TMuonBarrelParamsproduce (const L1TMuonBarrelParamsO2ORcd &iRecord)
 
 ~L1ConfigOnlineProdBaseExt ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
bool getObjectKey (const L1TMuonBarrelParamsO2ORcd &record, std::shared_ptr< L1TMuonBarrelParams > 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())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 16 of file L1TMuonBarrelParamsOnlineProd.cc.

Constructor & Destructor Documentation

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

Definition at line 22 of file L1TMuonBarrelParamsOnlineProd.cc.

22 {}

Member Function Documentation

std::shared_ptr< L1TMuonBarrelParams > L1TMuonBarrelParamsOnlineProd::newObject ( const std::string &  objectKey,
const L1TMuonBarrelParamsO2ORcd record 
)
overridevirtual

Implements L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >.

Definition at line 27 of file L1TMuonBarrelParamsOnlineProd.cc.

References mps_setup::append, L1TMuonBarrelParamsHelper::configFromDB(), DEFINE_FWK_EVENTSETUP_MODULE, MillePedeFileConverter_cfg::e, l1t::OnlineDBqueryHelper::fetch(), edm::eventsetup::EventSetupRecord::get(), relativeConstraints::keys, L1ConfigOnlineProdBaseExt< L1TMuonBarrelParamsO2ORcd, L1TMuonBarrelParams >::m_omdsReader, convertSQLitetoXML_cfg::output, l1t::XmlConfigParser::readDOMFromString(), l1t::XmlConfigParser::readRootElement(), l1t::TriggerSystem::setConfigured(), and AlCaHLTBitMon_QueryRunRegistry::string.

27  {
28  using namespace edm::es;
29 
30  const L1TMuonBarrelParamsRcd& baseRcd = record.template getRecord< L1TMuonBarrelParamsRcd >() ;
32  baseRcd.get( baseSettings ) ;
33 
34 
35  if (objectKey.empty()) {
36  edm::LogError( "L1-O2O: L1TMuonBarrelParamsOnlineProd" ) << "Key is empty, returning empty L1TMuonBarrelParams";
37  throw std::runtime_error("Empty objectKey");
38  }
39 
40  std::string tscKey = objectKey.substr(0, objectKey.find(":") );
41  std::string rsKey = objectKey.substr( objectKey.find(":")+1, std::string::npos );
42 
43 
44  edm::LogInfo( "L1-O2O: L1TMuonBarrelParamsOnlineProd" ) << "Producing L1TMuonBarrelParams with TSC key = " << tscKey << " and RS key = " << rsKey ;
45 
46  std::string algo_key, hw_key;
47  std::string mp7_key, amc13_key;
48  std::string hw_payload, algo_payload, mp7_payload, amc13_payload;
49  try {
50  std::map<std::string,std::string> keys =
51  l1t::OnlineDBqueryHelper::fetch( {"ALGO","HW"},
52  "BMTF_KEYS",
53  tscKey,
55  );
56  algo_key = keys["ALGO"];
57  hw_key = keys["HW"];
58 
59  hw_payload =
61  "BMTF_CLOBS",
62  hw_key,
64  ) ["CONF"];
65 
66  algo_payload =
68  "BMTF_CLOBS",
69  algo_key,
71  ) ["CONF"];
72 
73  std::map<std::string,std::string> rsKeys =
74  l1t::OnlineDBqueryHelper::fetch( {"MP7","AMC13"},
75  "BMTF_RS_KEYS",
76  rsKey,
78  );
79  mp7_key = rsKeys["MP7"];
80  amc13_key = rsKeys["AMC13"];
81 
82  mp7_payload =
84  "BMTF_CLOBS",
85  mp7_key,
87  ) ["CONF"];
88  amc13_payload =
90  "BMTF_CLOBS",
91  amc13_key,
93  ) ["CONF"];
94 
95  } catch ( std::runtime_error &e ) {
96  edm::LogError( "L1-O2O: L1TMuonBarrelParamsOnlineProd" ) << e.what();
97  throw std::runtime_error("Broken key");
98  }
99 
100 
101  // for debugging dump the configs to local files
102  {
103  std::ofstream output(std::string("/tmp/").append(hw_key.substr(0,hw_key.find("/"))).append(".xml"));
104  output << hw_payload;
105  output.close();
106  }
107  {
108  std::ofstream output(std::string("/tmp/").append(algo_key.substr(0,algo_key.find("/"))).append(".xml"));
109  output << algo_payload;
110  output.close();
111  }
112  {
113  std::ofstream output(std::string("/tmp/").append(mp7_key.substr(0,mp7_key.find("/"))).append(".xml"));
114  output << mp7_payload;
115  output.close();
116  }
117  {
118  std::ofstream output(std::string("/tmp/").append(amc13_key.substr(0,amc13_key.find("/"))).append(".xml"));
119  output << amc13_payload;
120  output.close();
121  }
122 
123  // finally, push all payloads to the XML parser and construct the TrigSystem objects with each of those
124  l1t::XmlConfigParser xmlRdr;
125  l1t::TriggerSystem parsedXMLs;
126 
127  // HW settings should always go first
128  xmlRdr.readDOMFromString( hw_payload );
129  xmlRdr.readRootElement ( parsedXMLs );
130 
131  // now let's parse ALGO settings
132  xmlRdr.readDOMFromString( algo_payload );
133  xmlRdr.readRootElement ( parsedXMLs );
134 
135  // remaining RS settings
136  xmlRdr.readDOMFromString( mp7_payload );
137  xmlRdr.readRootElement ( parsedXMLs );
138 
139  xmlRdr.readDOMFromString( amc13_payload );
140  xmlRdr.readRootElement ( parsedXMLs );
141  parsedXMLs.setConfigured();
142 
143  L1TMuonBarrelParamsHelper m_params_helper( *(baseSettings.product()) );
144  m_params_helper.configFromDB( parsedXMLs );
145  std::shared_ptr< L1TMuonBarrelParams > retval = std::make_shared< L1TMuonBarrelParams>( m_params_helper );
146 
147  return retval;
148 }
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="")