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 
33  XMLConfigReader myReader;
34  myReader.setConfigFile(fName);
35  readConnectionsXML(&myReader);
36 
39  myOMTFConfig = new OMTFConfiguration(theConfig);
40  std::shared_ptr<L1TMuonOverlapParams> aL1TMTFOverlapParams = std::shared_ptr<L1TMuonOverlapParams>(new L1TMuonOverlapParams(m_params));
41  myOMTFConfig->configure(aL1TMTFOverlapParams);
42 
43  for(auto it: fileNames){
44  myReader.setPatternsFile(it);
45  readPatternsXML(&myReader);
46  }
47 }
54 
55  aReader->readConfig(&m_params);
56 
57  return true;
58 
59 }
63 
64  l1t::LUT chargeLUT;
65  aReader->readLUT(&chargeLUT,"iCharge");
66  m_params.setChargeLUT(chargeLUT);
67 
68  l1t::LUT etaLUT;
69  aReader->readLUT(&etaLUT,"iEta");
70  m_params.setEtaLUT(etaLUT);
71 
72  l1t::LUT ptLUT;
73  aReader->readLUT(&ptLUT,"iPt");
74  m_params.setPtLUT(ptLUT);
75 
76  l1t::LUT meanDistPhiLUT;
77  aReader->readLUT(&meanDistPhiLUT,"meanDistPhi");
78  m_params.setMeanDistPhiLUT(meanDistPhiLUT);
79 
80  l1t::LUT pdfLUT;
81  aReader->readLUT(&pdfLUT,"pdf");
82  m_params.setPdfLUT(pdfLUT);
83 
84  return true;
85 }
90 {
91  using namespace edm::es;
92  boost::shared_ptr<L1TMuonOverlapParams> aL1TMTFOverlapParams;
93 
94  aL1TMTFOverlapParams = boost::shared_ptr<L1TMuonOverlapParams>(new L1TMuonOverlapParams(m_params));
95  return aL1TMTFOverlapParams;
96 }
99 
102 
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.