CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GtTriggerMenuXmlProducer.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
22 // base class
24 
27 
30 
33 
36 
38 
39 // forward declarations
40 
41 // constructor(s)
43  // tell the framework what data is being produced
45 
46  // now do what ever other initialization is needed
47 
48  // directory in /data/Luminosity for the trigger menu
49  std::string menuDir = parSet.getParameter<std::string>("TriggerMenuLuminosity");
50 
51  // def.xml file
52  std::string defXmlFileName = parSet.getParameter<std::string>("DefXmlFile");
53 
54  edm::FileInPath f1("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" + menuDir + "/" + defXmlFileName);
55 
56  m_defXmlFile = f1.fullPath();
57 
58  // vme.xml file
59  std::string vmeXmlFileName = parSet.getParameter<std::string>("VmeXmlFile");
60 
61  if (!vmeXmlFileName.empty()) {
62  edm::FileInPath f2("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" + menuDir + "/" + vmeXmlFileName);
63 
64  m_vmeXmlFile = f2.fullPath();
65  }
66 
67  edm::LogInfo("L1GtConfigProducers") << "\n\nL1 Trigger Menu: "
68  << "\n\n def.xml file: \n " << m_defXmlFile << "\n\n vme.xml file: \n "
69  << m_vmeXmlFile << "\n\n"
70  << std::endl;
71 }
72 
73 // destructor
75  // empty
76 }
77 
78 // member functions
79 
80 // method called to produce the data
81 std::unique_ptr<L1GtTriggerMenu> L1GtTriggerMenuXmlProducer::produceGtTriggerMenu(
83  // get the parameters needed from other records
84  const L1GtStableParametersRcd& stableParametersRcd = l1MenuRecord.getRecord<L1GtStableParametersRcd>();
85 
86  edm::ESHandle<L1GtStableParameters> stableParameters;
87  stableParametersRcd.get(stableParameters);
88 
89  unsigned int numberConditionChips = stableParameters->gtNumberConditionChips();
90  unsigned int pinsOnConditionChip = stableParameters->gtPinsOnConditionChip();
91  std::vector<int> orderConditionChip = stableParameters->gtOrderConditionChip();
92  unsigned int numberPhysTriggers = stableParameters->gtNumberPhysTriggers();
93  unsigned int numberTechTriggers = stableParameters->gtNumberTechnicalTriggers();
94  unsigned int numberL1JetCounts = stableParameters->gtNumberL1JetCounts();
95 
97 
98  gtXmlParser.setGtNumberConditionChips(numberConditionChips);
99  gtXmlParser.setGtPinsOnConditionChip(pinsOnConditionChip);
100  gtXmlParser.setGtOrderConditionChip(orderConditionChip);
101  gtXmlParser.setGtNumberPhysTriggers(numberPhysTriggers);
102  gtXmlParser.setGtNumberTechTriggers(numberTechTriggers);
103  gtXmlParser.setGtNumberL1JetCounts(numberL1JetCounts);
104 
105  gtXmlParser.parseXmlFile(m_defXmlFile, m_vmeXmlFile);
106 
107  // transfer the condition map and algorithm map from parser to L1GtTriggerMenu
108 
109  auto pL1GtTriggerMenu = std::make_unique<L1GtTriggerMenu>(gtXmlParser.gtTriggerMenuName(),
110  numberConditionChips,
111  gtXmlParser.vecMuonTemplate(),
112  gtXmlParser.vecCaloTemplate(),
113  gtXmlParser.vecEnergySumTemplate(),
114  gtXmlParser.vecJetCountsTemplate(),
115  gtXmlParser.vecCastorTemplate(),
116  gtXmlParser.vecHfBitCountsTemplate(),
117  gtXmlParser.vecHfRingEtSumsTemplate(),
118  gtXmlParser.vecBptxTemplate(),
119  gtXmlParser.vecExternalTemplate(),
120  gtXmlParser.vecCorrelationTemplate(),
121  gtXmlParser.corMuonTemplate(),
122  gtXmlParser.corCaloTemplate(),
123  gtXmlParser.corEnergySumTemplate());
124 
125  pL1GtTriggerMenu->setGtTriggerMenuInterface(gtXmlParser.gtTriggerMenuInterface());
126  pL1GtTriggerMenu->setGtTriggerMenuImplementation(gtXmlParser.gtTriggerMenuImplementation());
127  pL1GtTriggerMenu->setGtScaleDbKey(gtXmlParser.gtScaleDbKey());
128 
129  pL1GtTriggerMenu->setGtAlgorithmMap(gtXmlParser.gtAlgorithmMap());
130  pL1GtTriggerMenu->setGtAlgorithmAliasMap(gtXmlParser.gtAlgorithmAliasMap());
131  pL1GtTriggerMenu->setGtTechnicalTriggerMap(gtXmlParser.gtTechnicalTriggerMap());
132 
133  //LogDebug("L1GtConfigProducers")
134  //<< "\n\nReturning L1 Trigger Menu!"
135  //<< "\n\n"
136  //<< std::endl;
137 
138  return pL1GtTriggerMenu;
139 }
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
const std::vector< std::vector< L1GtCaloTemplate > > & vecCaloTemplate() const
const std::string & gtScaleDbKey() const
menu associated scale key
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate() const
void setGtPinsOnConditionChip(const unsigned int &)
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
const std::vector< std::vector< L1GtEnergySumTemplate > > & corEnergySumTemplate() const
const std::vector< std::vector< L1GtMuonTemplate > > & corMuonTemplate() const
void setGtNumberPhysTriggers(const unsigned int &)
const std::vector< std::vector< L1GtMuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
const std::string & gtTriggerMenuImplementation() const
const std::vector< std::vector< L1GtHfBitCountsTemplate > > & vecHfBitCountsTemplate() const
std::string m_vmeXmlFile
XML file for Global Trigger VME configuration (vme.xml)
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > & vecHfRingEtSumsTemplate() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const std::vector< std::vector< L1GtCastorTemplate > > & vecCastorTemplate() const
const std::vector< std::vector< L1GtJetCountsTemplate > > & vecJetCountsTemplate() const
const std::vector< std::vector< L1GtBptxTemplate > > & vecBptxTemplate() const
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
void parseXmlFile(const std::string &defXmlFile, const std::string &vmeXmlFile)
parse def.xml and vme.xml files
Log< level::Info, false > LogInfo
void setGtNumberConditionChips(const unsigned int &)
const std::vector< std::vector< L1GtCorrelationTemplate > > & vecCorrelationTemplate() const
const std::string & gtTriggerMenuName() const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
string l1MenuRecord
Definition: autoCondHLT.py:6
L1GtTriggerMenuXmlProducer(const edm::ParameterSet &)
constructor
void setGtNumberTechTriggers(const unsigned int &)
void setGtOrderConditionChip(const std::vector< int > &)
std::unique_ptr< L1GtTriggerMenu > produceGtTriggerMenu(const L1GtTriggerMenuRcd &)
public methods
std::string fullPath() const
Definition: FileInPath.cc:161
std::string m_defXmlFile
XML file for Global Trigger menu (def.xml)
const std::vector< std::vector< L1GtCaloTemplate > > & corCaloTemplate() const
const std::vector< std::vector< L1GtExternalTemplate > > & vecExternalTemplate() const
~L1GtTriggerMenuXmlProducer() override
destructor
void setGtNumberL1JetCounts(const unsigned int &)