CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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"))
23  return;
24  std::string fName = theConfig.getParameter<edm::FileInPath>("configXMLFile").fullPath();
25 
27  if (!theConfig.exists("patternsXMLFiles"))
28  return;
29  std::vector<std::string> fileNames;
30  for (const auto& it : theConfig.getParameter<std::vector<edm::ParameterSet> >("patternsXMLFiles")) {
31  fileNames.push_back(it.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
32  }
33 
34  XMLConfigReader myReader;
35  myReader.setConfigFile(fName);
36  readConnectionsXML(myReader);
37 
38  for (const auto& it : fileNames) {
39  myReader.setPatternsFile(it);
40  readPatternsXML(myReader);
41  }
42 
43  unsigned int patternsVersion = myReader.getPatternsVersion();
44  unsigned int fwVersion = params.fwVersion();
45 
46  params.setFwVersion((fwVersion << 16) + patternsVersion);
47 }
54  aReader.readConfig(&params);
55 
56  return true;
57 }
61  l1t::LUT chargeLUT;
62  l1t::LUT etaLUT;
63  l1t::LUT ptLUT;
64  l1t::LUT meanDistPhiLUT;
65  l1t::LUT pdfLUT;
66 
67  std::vector<l1t::LUT*> luts = {&chargeLUT, &etaLUT, &ptLUT, &meanDistPhiLUT, &pdfLUT};
68  std::vector<std::string> types = {"iCharge", "iEta", "iPt", "meanDistPhi", "pdf"};
69  aReader.readLUTs(luts, params, types);
70 
71  params.setChargeLUT(chargeLUT);
72  params.setEtaLUT(etaLUT);
73  params.setPtLUT(ptLUT);
74  params.setMeanDistPhiLUT(meanDistPhiLUT);
75  params.setPdfLUT(pdfLUT);
76 
77  return true;
78 }
82  const L1TMuonOverlapParamsRcd& iRecord) {
83  return std::make_unique<L1TMuonOverlapParams>(params);
84 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
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 &)
bool readPatternsXML(XMLConfigReader &aReader)
void setPtLUT(const l1t::LUT &lut)
bool readConnectionsXML(const XMLConfigReader &aReader)
Read Connections from single XML file.
void readConfig(const std::string fName)
std::unique_ptr< L1TMuonOverlapParams > ReturnType
unsigned int getPatternsVersion() const
void setPatternsFile(const std::string &fName)
void setConfigFile(const std::string &fName)
Definition: LUT.h:29
L1TMuonOverlapParamsESProducer(const edm::ParameterSet &)
void readLUTs(std::vector< l1t::LUT * > luts, const L1TMuonOverlapParams &aConfig, const std::vector< std::string > &types)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::string fullPath() const
Definition: FileInPath.cc:161
void setFwVersion(unsigned fwVersion)
tuple fileNames
Definition: LaserDQM_cfg.py:34
void setPdfLUT(const l1t::LUT &lut)