CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 #include "boost/shared_ptr.hpp"
22 
23 
24 // user include files
25 // base class
27 
30 
33 
36 
39 
41 
42 
43 
44 // forward declarations
45 
46 // constructor(s)
48  const edm::ParameterSet& parSet)
49 {
50  // tell the framework what data is being produced
52 
53 
54  // now do what ever other initialization is needed
55 
56 
57  // directory in /data/Luminosity for the trigger menu
58  std::string menuDir = parSet.getParameter<std::string>("TriggerMenuLuminosity");
59 
60 
61  // def.xml file
62  std::string defXmlFileName = parSet.getParameter<std::string>("DefXmlFile");
63 
64  edm::FileInPath f1("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" +
65  menuDir + "/" + defXmlFileName);
66 
67  m_defXmlFile = f1.fullPath();
68 
69 
70  // vme.xml file
71  std::string vmeXmlFileName = parSet.getParameter<std::string>("VmeXmlFile");
72 
73  if (vmeXmlFileName != "") {
74  edm::FileInPath f2("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" +
75  menuDir + "/" + vmeXmlFileName);
76 
77  m_vmeXmlFile = f2.fullPath();
78 
79  }
80 
81  edm::LogInfo("L1GtConfigProducers")
82  << "\n\nL1 Trigger Menu: "
83  << "\n\n def.xml file: \n " << m_defXmlFile
84  << "\n\n vme.xml file: \n " << m_vmeXmlFile
85  << "\n\n"
86  << std::endl;
87 
88 }
89 
90 // destructor
92 {
93 
94  // empty
95 
96 }
97 
98 
99 // member functions
100 
101 // method called to produce the data
102 boost::shared_ptr<L1GtTriggerMenu> L1GtTriggerMenuXmlProducer::produceGtTriggerMenu(
104 {
105 
106  // get the parameters needed from other records
107  const L1GtStableParametersRcd& stableParametersRcd =
108  l1MenuRecord.getRecord<L1GtStableParametersRcd>();
109 
110  edm::ESHandle<L1GtStableParameters> stableParameters;
111  stableParametersRcd.get(stableParameters);
112 
113  unsigned int numberConditionChips = stableParameters->gtNumberConditionChips();
114  unsigned int pinsOnConditionChip = stableParameters->gtPinsOnConditionChip();
115  std::vector<int> orderConditionChip = stableParameters->gtOrderConditionChip();
116  unsigned int numberPhysTriggers = stableParameters->gtNumberPhysTriggers();
117  unsigned int numberTechTriggers = stableParameters->gtNumberTechnicalTriggers();
118  unsigned int numberL1JetCounts = stableParameters->gtNumberL1JetCounts();
119 
121 
122  gtXmlParser.setGtNumberConditionChips(numberConditionChips);
123  gtXmlParser.setGtPinsOnConditionChip(pinsOnConditionChip);
124  gtXmlParser.setGtOrderConditionChip(orderConditionChip);
125  gtXmlParser.setGtNumberPhysTriggers(numberPhysTriggers);
126  gtXmlParser.setGtNumberTechTriggers(numberTechTriggers);
127  gtXmlParser.setGtNumberL1JetCounts(numberL1JetCounts);
128 
129  gtXmlParser.parseXmlFile(m_defXmlFile, m_vmeXmlFile);
130 
131  // transfer the condition map and algorithm map from parser to L1GtTriggerMenu
132 
133  boost::shared_ptr<L1GtTriggerMenu> pL1GtTriggerMenu = boost::shared_ptr<L1GtTriggerMenu>(
134  new L1GtTriggerMenu(gtXmlParser.gtTriggerMenuName(), numberConditionChips,
135  gtXmlParser.vecMuonTemplate(),
136  gtXmlParser.vecCaloTemplate(),
137  gtXmlParser.vecEnergySumTemplate(),
138  gtXmlParser.vecJetCountsTemplate(),
139  gtXmlParser.vecCastorTemplate(),
140  gtXmlParser.vecHfBitCountsTemplate(),
141  gtXmlParser.vecHfRingEtSumsTemplate(),
142  gtXmlParser.vecBptxTemplate(),
143  gtXmlParser.vecExternalTemplate(),
144  gtXmlParser.vecCorrelationTemplate(),
145  gtXmlParser.corMuonTemplate(),
146  gtXmlParser.corCaloTemplate(),
147  gtXmlParser.corEnergySumTemplate()) );
148 
149 
150  pL1GtTriggerMenu->setGtTriggerMenuInterface(gtXmlParser.gtTriggerMenuInterface());
151  pL1GtTriggerMenu->setGtTriggerMenuImplementation(gtXmlParser.gtTriggerMenuImplementation());
152  pL1GtTriggerMenu->setGtScaleDbKey(gtXmlParser.gtScaleDbKey());
153 
154  pL1GtTriggerMenu->setGtAlgorithmMap(gtXmlParser.gtAlgorithmMap());
155  pL1GtTriggerMenu->setGtAlgorithmAliasMap(gtXmlParser.gtAlgorithmAliasMap());
156  pL1GtTriggerMenu->setGtTechnicalTriggerMap(gtXmlParser.gtTechnicalTriggerMap());
157 
158  //LogDebug("L1GtConfigProducers")
159  //<< "\n\nReturning L1 Trigger Menu!"
160  //<< "\n\n"
161  //<< std::endl;
162 
163  return pL1GtTriggerMenu ;
164 }
165 
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
T getParameter(std::string const &) const
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
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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
const std::vector< std::vector< L1GtCastorTemplate > > & vecCastorTemplate() const
const std::vector< std::vector< L1GtJetCountsTemplate > > & vecJetCountsTemplate() const
void get(HolderT &iHolder) 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
void setGtNumberConditionChips(const unsigned int &)
const std::vector< std::vector< L1GtCorrelationTemplate > > & vecCorrelationTemplate() const
const std::string & gtTriggerMenuName() const
string l1MenuRecord
Definition: autoCondHLT.py:5
L1GtTriggerMenuXmlProducer(const edm::ParameterSet &)
constructor
boost::shared_ptr< L1GtTriggerMenu > produceGtTriggerMenu(const L1GtTriggerMenuRcd &)
public methods
void setGtNumberTechTriggers(const unsigned int &)
void setGtOrderConditionChip(const std::vector< int > &)
std::string m_defXmlFile
XML file for Global Trigger menu (def.xml)
std::string fullPath() const
Definition: FileInPath.cc:184
const std::vector< std::vector< L1GtCaloTemplate > > & corCaloTemplate() const
const std::vector< std::vector< L1GtExternalTemplate > > & vecExternalTemplate() const
void setGtNumberL1JetCounts(const unsigned int &)