CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
L1TMuonOverlapParamsESProducer Class Reference

#include <L1TMuonOverlapParamsESProducer.h>

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

Public Types

typedef std::shared_ptr< L1TMuonOverlapParamsReturnType
 
- 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
 

Public Member Functions

 L1TMuonOverlapParamsESProducer (const edm::ParameterSet &)
 
ReturnType produceParams (const L1TMuonOverlapParamsRcd &)
 
ReturnType producePatterns (const L1TMuonOverlapParamsRcd &)
 
 ~L1TMuonOverlapParamsESProducer ()
 
- 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)
 

Private Member Functions

bool readConnectionsXML (const XMLConfigReader &aReader)
 Read Connections from single XML file. More...
 
bool readPatternsXML (XMLConfigReader &aReader)
 

Private Attributes

L1TMuonOverlapParams params
 
L1TMuonOverlapParams patterns
 

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

Detailed Description

Definition at line 15 of file L1TMuonOverlapParamsESProducer.h.

Member Typedef Documentation

Definition at line 21 of file L1TMuonOverlapParamsESProducer.h.

Constructor & Destructor Documentation

L1TMuonOverlapParamsESProducer::L1TMuonOverlapParamsESProducer ( const edm::ParameterSet theConfig)

WARNING: filling the CondFormats objects works only for a single XML patterns file.

Definition at line 17 of file L1TMuonOverlapParamsESProducer.cc.

References edm::ParameterSet::exists(), LaserTracksInput_cfi::fileNames, edm::FileInPath::fullPath(), hgcalDigitizer_cfi::fwVersion, L1TMuonOverlapParams::fwVersion(), edm::ParameterSet::getParameter(), XMLConfigReader::getPatternsVersion(), params, produceParams(), readConnectionsXML(), readPatternsXML(), XMLConfigReader::setConfigFile(), L1TMuonOverlapParams::setFwVersion(), XMLConfigReader::setPatternsFile(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

17  {
18  //the following line is needed to tell the framework what
19  // data is being produced
21 
22  if (!theConfig.exists("configXMLFile") ) return;
23  std::string fName = theConfig.getParameter<edm::FileInPath>("configXMLFile").fullPath();
24 
26  if (!theConfig.exists("patternsXMLFiles") ) return;
27  std::vector<std::string> fileNames;
28  for(auto it: theConfig.getParameter<std::vector<edm::ParameterSet> >("patternsXMLFiles")){
29  fileNames.push_back(it.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
30  }
31 
32  XMLConfigReader myReader;
33  myReader.setConfigFile(fName);
34  readConnectionsXML(myReader);
35 
36  for(auto it: fileNames){
37  myReader.setPatternsFile(it);
38  readPatternsXML(myReader);
39  }
40 
41  unsigned int patternsVersion = myReader.getPatternsVersion();
42  unsigned int fwVersion = params.fwVersion();
43 
44  params.setFwVersion((fwVersion<<16) + patternsVersion);
45 
46 }
T getParameter(std::string const &) const
unsigned fwVersion() const
bool exists(std::string const &parameterName) const
checks if a parameter exists
ReturnType produceParams(const L1TMuonOverlapParamsRcd &)
bool readPatternsXML(XMLConfigReader &aReader)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
bool readConnectionsXML(const XMLConfigReader &aReader)
Read Connections from single XML file.
unsigned int getPatternsVersion() const
void setPatternsFile(const std::string &fName)
void setConfigFile(const std::string &fName)
void setFwVersion(unsigned fwVersion)
std::string fullPath() const
Definition: FileInPath.cc:184
L1TMuonOverlapParamsESProducer::~L1TMuonOverlapParamsESProducer ( )

Definition at line 49 of file L1TMuonOverlapParamsESProducer.cc.

49 {}

Member Function Documentation

L1TMuonOverlapParamsESProducer::ReturnType L1TMuonOverlapParamsESProducer::produceParams ( const L1TMuonOverlapParamsRcd iRecord)

Definition at line 83 of file L1TMuonOverlapParamsESProducer.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, and params.

Referenced by L1TMuonOverlapParamsESProducer().

84 {
85  using namespace edm::es;
86 
87  return std::shared_ptr<L1TMuonOverlapParams>(new L1TMuonOverlapParams(params));
88 }
ReturnType L1TMuonOverlapParamsESProducer::producePatterns ( const L1TMuonOverlapParamsRcd )
bool L1TMuonOverlapParamsESProducer::readConnectionsXML ( const XMLConfigReader aReader)
private

Read Connections from single XML file.

Definition at line 52 of file L1TMuonOverlapParamsESProducer.cc.

References params, and XMLConfigReader::readConfig().

Referenced by L1TMuonOverlapParamsESProducer().

52  {
53 
54  aReader.readConfig(&params);
55 
56  return true;
57 }
void readConfig(const std::string fName)
bool L1TMuonOverlapParamsESProducer::readPatternsXML ( XMLConfigReader aReader)
private

Read Golden Patters from single XML file. XMLConfigReader state is modified, as it hold cache of the Golden Patters read from XML file.

Definition at line 60 of file L1TMuonOverlapParamsESProducer.cc.

References params, XMLConfigReader::readLUTs(), L1TMuonOverlapParams::setChargeLUT(), L1TMuonOverlapParams::setEtaLUT(), L1TMuonOverlapParams::setMeanDistPhiLUT(), L1TMuonOverlapParams::setPdfLUT(), L1TMuonOverlapParams::setPtLUT(), and cutBasedMuonId_MuonPOG_V0_cff::types.

Referenced by L1TMuonOverlapParamsESProducer().

60  {
61 
62  l1t::LUT chargeLUT;
63  l1t::LUT etaLUT;
64  l1t::LUT ptLUT;
65  l1t::LUT meanDistPhiLUT;
66  l1t::LUT pdfLUT;
67 
68  std::vector<l1t::LUT*> luts={ &chargeLUT, &etaLUT, &ptLUT, &meanDistPhiLUT, &pdfLUT};
69  std::vector<std::string> types= {"iCharge", "iEta", "iPt", "meanDistPhi", "pdf"};
70  aReader.readLUTs(luts,params,types);
71 
72  params.setChargeLUT(chargeLUT);
73  params.setEtaLUT(etaLUT);
74  params.setPtLUT(ptLUT);
75  params.setMeanDistPhiLUT(meanDistPhiLUT);
76  params.setPdfLUT(pdfLUT);
77 
78  return true;
79 }
void setMeanDistPhiLUT(const l1t::LUT &lut)
void setEtaLUT(const l1t::LUT &lut)
void setChargeLUT(const l1t::LUT &lut)
void setPtLUT(const l1t::LUT &lut)
Definition: LUT.h:29
void readLUTs(std::vector< l1t::LUT * > luts, const L1TMuonOverlapParams &aConfig, const std::vector< std::string > &types)
void setPdfLUT(const l1t::LUT &lut)

Member Data Documentation

L1TMuonOverlapParams L1TMuonOverlapParamsESProducer::params
private
L1TMuonOverlapParams L1TMuonOverlapParamsESProducer::patterns
private

Definition at line 38 of file L1TMuonOverlapParamsESProducer.h.