CMS 3D CMS Logo

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