CMS 3D CMS Logo

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 (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 (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 }
L1TMuonOverlapParamsRcd
Definition: L1TMuonOverlapParamsRcd.h:23
amcDumpToRaw_cfi.fwVersion
fwVersion
Definition: amcDumpToRaw_cfi.py:11
L1TMuonOverlapParamsESProducer::params
L1TMuonOverlapParams params
Definition: L1TMuonOverlapParamsESProducer.h:36
ESHandle.h
L1TMuonOverlapParamsESProducer.h
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
ESProducer.h
L1TMuonOverlapParamsESProducer::~L1TMuonOverlapParamsESProducer
~L1TMuonOverlapParamsESProducer() override
Definition: L1TMuonOverlapParamsESProducer.cc:50
XMLConfigReader.h
L1TMuonOverlapParams::fwVersion
unsigned fwVersion() const
Definition: L1TMuonOverlapParams.h:129
L1TMuonOverlapParams::setChargeLUT
void setChargeLUT(const l1t::LUT &lut)
Definition: L1TMuonOverlapParams.h:208
MainPageGenerator.fName
fName
Definition: MainPageGenerator.py:301
edm::FileInPath
Definition: FileInPath.h:64
MakerMacros.h
L1TMuonOverlapParamsESProducer
Definition: L1TMuonOverlapParamsESProducer.h:16
XMLConfigReader::setPatternsFile
void setPatternsFile(const std::string &fName)
Definition: XMLConfigReader.h:35
L1TMuonOverlapParams.h
L1TMuonOverlapParams::setPdfLUT
void setPdfLUT(const l1t::LUT &lut)
Definition: L1TMuonOverlapParams.h:220
L1TMuonOverlapParamsESProducer::ReturnType
std::unique_ptr< L1TMuonOverlapParams > ReturnType
Definition: L1TMuonOverlapParamsESProducer.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ESProducts.h
L1TMuonOverlapParams::setFwVersion
void setFwVersion(unsigned fwVersion)
Definition: L1TMuonOverlapParams.h:130
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
edm::ParameterSet
Definition: ParameterSet.h:36
L1TMuonOverlapParams::setEtaLUT
void setEtaLUT(const l1t::LUT &lut)
Definition: L1TMuonOverlapParams.h:212
L1TMuonOverlapParamsESProducer::L1TMuonOverlapParamsESProducer
L1TMuonOverlapParamsESProducer(const edm::ParameterSet &)
Definition: L1TMuonOverlapParamsESProducer.cc:17
XMLConfigReader
Definition: XMLConfigReader.h:26
L1TMuonOverlapParams::setPtLUT
void setPtLUT(const l1t::LUT &lut)
Definition: L1TMuonOverlapParams.h:216
XMLConfigReader::readLUTs
void readLUTs(std::vector< l1t::LUT * > luts, const L1TMuonOverlapParams &aConfig, const std::vector< std::string > &types)
Definition: XMLConfigReader.cc:59
L1TMuonOverlapParamsESProducer::readConnectionsXML
bool readConnectionsXML(const XMLConfigReader &aReader)
Read Connections from single XML file.
Definition: L1TMuonOverlapParamsESProducer.cc:53
XMLConfigReader::readConfig
void readConfig(const std::string fName)
XMLConfigReader::setConfigFile
void setConfigFile(const std::string &fName)
Definition: XMLConfigReader.h:33
types
types
Definition: AlignPCLThresholds_PayloadInspector.cc:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
XMLConfigReader::getPatternsVersion
unsigned int getPatternsVersion() const
Definition: XMLConfigReader.cc:132
l1t::LUT
Definition: LUT.h:29
L1TMuonOverlapParams::setMeanDistPhiLUT
void setMeanDistPhiLUT(const l1t::LUT &lut)
Definition: L1TMuonOverlapParams.h:224
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
L1TMuonOverlapParamsESProducer::produceParams
ReturnType produceParams(const L1TMuonOverlapParamsRcd &)
Definition: L1TMuonOverlapParamsESProducer.cc:81
L1TMuonOverlapParamsESProducer::readPatternsXML
bool readPatternsXML(XMLConfigReader &aReader)
Definition: L1TMuonOverlapParamsESProducer.cc:60
LaserTracksInput_cfi.fileNames
fileNames
Definition: LaserTracksInput_cfi.py:8
L1TMuonOverlapParamsRcd.h
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163