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
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 }
53 
54  aReader.readConfig(&params);
55 
56  return true;
57 }
61 
62  l1t::LUT chargeLUT;
63  aReader.readLUT(&chargeLUT,params,"iCharge");
64  params.setChargeLUT(chargeLUT);
65 
66  l1t::LUT etaLUT;
67  aReader.readLUT(&etaLUT,params, "iEta");
68  params.setEtaLUT(etaLUT);
69 
70  l1t::LUT ptLUT;
71  aReader.readLUT(&ptLUT,params, "iPt");
72  params.setPtLUT(ptLUT);
73 
74  l1t::LUT meanDistPhiLUT;
75  aReader.readLUT(&meanDistPhiLUT,params, "meanDistPhi");
76  params.setMeanDistPhiLUT(meanDistPhiLUT);
77 
78  l1t::LUT pdfLUT;
79  aReader.readLUT(&pdfLUT,params, "pdf");
80  params.setPdfLUT(pdfLUT);
81 
82  return true;
83 }
88 {
89  using namespace edm::es;
90  boost::shared_ptr<L1TMuonOverlapParams> aL1TMTFOverlapParams;
91 
92  aL1TMTFOverlapParams = boost::shared_ptr<L1TMuonOverlapParams>(new L1TMuonOverlapParams(params));
93  return aL1TMTFOverlapParams;
94 }
99 
T getParameter(std::string const &) const
void setMeanDistPhiLUT(const l1t::LUT &lut)
void setEtaLUT(const l1t::LUT &lut)
unsigned fwVersion() const
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setChargeLUT(const l1t::LUT &lut)
ReturnType produceParams(const L1TMuonOverlapParamsRcd &)
void readLUT(l1t::LUT *lut, const L1TMuonOverlapParams &aConfig, const std::string &type)
bool readPatternsXML(XMLConfigReader &aReader)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setPtLUT(const l1t::LUT &lut)
bool readConnectionsXML(const XMLConfigReader &aReader)
Read Connections from single XML file.
void readConfig(const std::string fName)
unsigned int getPatternsVersion() const
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
boost::shared_ptr< L1TMuonOverlapParams > ReturnType
void setFwVersion(unsigned fwVersion)
tuple fileNames
Definition: LaserDQM_cfg.py:34
std::string fullPath() const
Definition: FileInPath.cc:184
void setPdfLUT(const l1t::LUT &lut)