CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TMuonOverlapParamsESProducer.cc
Go to the documentation of this file.
1 #include "sstream"
2 
3 // user include files
8 
11 
14 
18  //the following line is needed to tell the framework what
19  // data is being produced
20  setWhatProduced(this);
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  myOMTFConfig = new OMTFConfiguration(theConfig);
33  XMLConfigReader myReader(myOMTFConfig);
34 
35  myReader.setConfigFile(fName);
36  readConnectionsXML(&myReader);
37 
41 
42  for(auto it: fileNames){
43  myReader.setPatternsFile(it);
44  readPatternsXML(&myReader);
45  }
46 }
53 
54  aReader->readConfig(&m_params);
55 
56  return true;
57 
58 }
62 
63  l1t::LUT chargeLUT;
64  aReader->readLUT(&chargeLUT,"iCharge");
65  m_params.setChargeLUT(chargeLUT);
66 
67  l1t::LUT etaLUT;
68  aReader->readLUT(&etaLUT,"iEta");
69  m_params.setEtaLUT(etaLUT);
70 
71  l1t::LUT ptLUT;
72  aReader->readLUT(&ptLUT,"iPt");
73  m_params.setPtLUT(ptLUT);
74 
75  l1t::LUT meanDistPhiLUT;
76  aReader->readLUT(&meanDistPhiLUT,"meanDistPhi");
77  m_params.setMeanDistPhiLUT(meanDistPhiLUT);
78 
79  l1t::LUT pdfLUT;
80  aReader->readLUT(&pdfLUT,"pdf");
81  m_params.setPdfLUT(pdfLUT);
82 
83  return true;
84 }
89 {
90  using namespace edm::es;
91  boost::shared_ptr<L1TMuonOverlapParams> aL1TMTFOverlapParams;
92 
93  aL1TMTFOverlapParams = boost::shared_ptr<L1TMuonOverlapParams>(new L1TMuonOverlapParams(m_params));
94  return aL1TMTFOverlapParams;
95 }
98 
101 
T getParameter(std::string const &) const
void setMeanDistPhiLUT(const l1t::LUT &lut)
void setEtaLUT(const l1t::LUT &lut)
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setChargeLUT(const l1t::LUT &lut)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setPtLUT(const l1t::LUT &lut)
void configure(XMLConfigReader *aReader)
void readLUT(l1t::LUT *lut, const std::string &type)
void readConfig(const std::string fName)
ReturnType produce(const L1TMuonOverlapParamsRcd &)
void setPatternsFile(const std::string &fName)
void setConfigFile(const std::string &fName)
Definition: LUT.h:29
L1TMuonOverlapParamsESProducer(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
bool readConnectionsXML(XMLConfigReader *aReader)
Read Connections from single XML file.
boost::shared_ptr< L1TMuonOverlapParams > ReturnType
tuple fileNames
Definition: LaserDQM_cfg.py:34
std::string fullPath() const
Definition: FileInPath.cc:184
void setPdfLUT(const l1t::LUT &lut)
bool readPatternsXML(XMLConfigReader *aReader)
Read Golden Patters from single XML file.