CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerMenuXmlProducer.cc
Go to the documentation of this file.
1 
12 // this class header
13 #include "TriggerMenuXmlProducer.h"
14 
15 // system include files
16 #include <memory>
17 
18 #include "boost/shared_ptr.hpp"
19 
20 
21 // user include files
22 // base class
24 
27 
30 
33 
36 
37 #include "TriggerMenuXmlParser.h"
38 
39 
40 
41 // forward declarations
42 
43 // constructor(s)
45  const edm::ParameterSet& parSet)
46 {
47  // tell the framework what data is being produced
49 
50 
51  // now do what ever other initialization is needed
52 
53 
54  // directory in /data/Luminosity for the trigger menu
55  std::string menuDir = parSet.getParameter<std::string>("TriggerMenuLuminosity");
56 
57 
58  // def.xml file
59  std::string defXmlFileName = parSet.getParameter<std::string>("DefXmlFile");
60 
61  edm::FileInPath f1("L1Trigger/L1TGlobal/data/Luminosity/" +
62  menuDir + "/" + defXmlFileName);
63 
64  m_defXmlFile = f1.fullPath();
65 
66 
67  // vme.xml file
68  std::string vmeXmlFileName = parSet.getParameter<std::string>("VmeXmlFile");
69 
70  if (vmeXmlFileName != "") {
71  edm::FileInPath f2("L1Trigger/L1TGlobal/data/Luminosity/" +
72  menuDir + "/" + vmeXmlFileName);
73 
74  m_vmeXmlFile = f2.fullPath();
75 
76  }
77 
78  edm::LogInfo("L1TGlobal")
79  << "\n\nL1 Trigger Menu: "
80  << "\n\n def.xml file: \n " << m_defXmlFile
81  << "\n\n vme.xml file: \n " << m_vmeXmlFile
82  << "\n\n"
83  << std::endl;
84 
85 }
86 
87 // destructor
89 {
90 
91  // empty
92 
93 }
94 
95 
96 // method called to produce the data
98  const L1TGlobalTriggerMenuRcd& l1MenuRecord)
99 {
100 
101  // get the parameters needed from other records
102  const L1TGlobalStableParametersRcd& stableParametersRcd =
103  l1MenuRecord.getRecord<L1TGlobalStableParametersRcd>();
104 
105  edm::ESHandle<GlobalStableParameters> stableParameters;
106  stableParametersRcd.get(stableParameters);
107 
108  unsigned int numberConditionChips = stableParameters->gtNumberConditionChips();
109  unsigned int pinsOnConditionChip = stableParameters->gtPinsOnConditionChip();
110  std::vector<int> orderConditionChip = stableParameters->gtOrderConditionChip();
111  unsigned int numberPhysTriggers = stableParameters->gtNumberPhysTriggers();
112  unsigned int numberTechTriggers = stableParameters->gtNumberTechnicalTriggers();
113  unsigned int numberL1JetCounts = stableParameters->gtNumberL1JetCounts();
114 
115  LogDebug("l1t|Global")
116  << "\n\t numberConditionChips = " << numberConditionChips
117  << "\n\t pinsOnConditionChip = " << pinsOnConditionChip
118  << "\n\t orderConditionChip.size() = " << orderConditionChip.size()
119  << std::endl;
120  for( int i=0; i<int(orderConditionChip.size()); i++ ){
121  LogDebug("l1t|Global") << "\t\t " << i << "\t" << orderConditionChip[i] << std::endl;
122  }
123  LogDebug("l1t|Global")
124  << "\n\t numberPhysTriggers = " << numberPhysTriggers
125  << "\n\t numberTechTriggers = " << numberTechTriggers
126  << "\n\t numberL1JetCounts = " << numberL1JetCounts
127  << std::endl;
128 
129 
130 
131  // Added by DP 4/25/2014
132 
134  unsigned int gtNumberPhysTriggers = stableParameters->gtNumberPhysTriggers();
136  unsigned int gtNumberPhysTriggersExtended = stableParameters->gtNumberPhysTriggersExtended();
138  unsigned int gtNumberTechnicalTriggers = stableParameters->gtNumberTechnicalTriggers();
140  unsigned int gtNumberL1Mu = stableParameters->gtNumberL1Mu();
142  unsigned int gtNumberL1NoIsoEG = stableParameters->gtNumberL1NoIsoEG();
144  unsigned int gtNumberL1IsoEG = stableParameters->gtNumberL1IsoEG();
146  unsigned int gtNumberL1CenJet = stableParameters->gtNumberL1CenJet();
148  unsigned int gtNumberL1ForJet = stableParameters->gtNumberL1ForJet();
150  unsigned int gtNumberL1TauJet = stableParameters->gtNumberL1TauJet();
152  unsigned int gtNumberL1JetCounts = stableParameters->gtNumberL1JetCounts();
153 
155 
157  unsigned int gtNumberConditionChips = stableParameters->gtNumberConditionChips();
159  unsigned int gtPinsOnConditionChip = stableParameters->gtPinsOnConditionChip();
162  std::vector<int> gtOrderConditionChip = stableParameters->gtOrderConditionChip();
164  int gtNumberPsbBoards = stableParameters->gtNumberPsbBoards();
166  unsigned int gtIfCaloEtaNumberBits = stableParameters->gtIfCaloEtaNumberBits();
168  unsigned int gtIfMuEtaNumberBits = stableParameters->gtIfMuEtaNumberBits();
170  int gtWordLength = stableParameters->gtWordLength();
172  int gtUnitLength = stableParameters->gtUnitLength();
173 
174  std::cout
175  << "\n\t gtNumberPhysTriggers = " << gtNumberPhysTriggers
176  << "\n\t gtNumberPhysTriggersExtended = " << gtNumberPhysTriggersExtended
177  << "\n\t gtNumberTechnicalTriggers = " << gtNumberTechnicalTriggers
178  << "\n\t gtNumberL1Mu = " << gtNumberL1Mu
179  << "\n\t gtNumberL1NoIsoEG = " << gtNumberL1NoIsoEG
180  << "\n\t gtNumberL1IsoEG = " << gtNumberL1IsoEG
181  << "\n\t gtNumberL1CenJet = " << gtNumberL1CenJet
182  << "\n\t gtNumberL1ForJet = " << gtNumberL1ForJet
183  << "\n\t gtNumberL1TauJet = " << gtNumberL1TauJet
184  << "\n\t gtNumberL1JetCounts = " << gtNumberL1JetCounts
185  << "\n\t gtNumberConditionChips = " << gtNumberConditionChips
186  << "\n\t gtPinsOnConditionChip = " << gtPinsOnConditionChip
187  << "\n\t gtNumberPsbBoards = " << gtNumberPsbBoards
188  << "\n\t gtIfCaloEtaNumberBits = " << gtIfCaloEtaNumberBits
189  << "\n\t gtIfMuEtaNumberBits = " << gtIfMuEtaNumberBits
190  << "\n\t gtWordLength = " << gtWordLength
191  << "\n\t gtUnitLength = " << gtUnitLength
192  << std::endl;
193 
194  for( int i=0; i<int(gtOrderConditionChip.size()); i++ ){
195  std::cout << "\t\t " << i << "\t" << gtOrderConditionChip[i] << std::endl;
196  }
197 
198  // End add
199 
201 
202  gtXmlParser.setGtNumberConditionChips(numberConditionChips);
203  gtXmlParser.setGtPinsOnConditionChip(pinsOnConditionChip);
204  gtXmlParser.setGtOrderConditionChip(orderConditionChip);
205  gtXmlParser.setGtNumberPhysTriggers(numberPhysTriggers);
206  gtXmlParser.setGtNumberTechTriggers(numberTechTriggers);
207  gtXmlParser.setGtNumberL1JetCounts(numberL1JetCounts);
208 
209  gtXmlParser.parseXmlFile(m_defXmlFile, m_vmeXmlFile);
210 
211  // transfer the condition map and algorithm map from parser to L1uGtTriggerMenu
212 
213  boost::shared_ptr<TriggerMenu> pL1uGtTriggerMenu = boost::shared_ptr<TriggerMenu>(
214  new TriggerMenu(gtXmlParser.gtTriggerMenuName(), numberConditionChips,
215  gtXmlParser.vecMuonTemplate(),
216  gtXmlParser.vecCaloTemplate(),
217  gtXmlParser.vecEnergySumTemplate(),
218  gtXmlParser.vecJetCountsTemplate(),
219  gtXmlParser.vecCastorTemplate(),
220  gtXmlParser.vecHfBitCountsTemplate(),
221  gtXmlParser.vecHfRingEtSumsTemplate(),
222  gtXmlParser.vecBptxTemplate(),
223  gtXmlParser.vecExternalTemplate(),
224  gtXmlParser.vecCorrelationTemplate(),
225  gtXmlParser.corMuonTemplate(),
226  gtXmlParser.corCaloTemplate(),
227  gtXmlParser.corEnergySumTemplate()) );
228 
229 
230  pL1uGtTriggerMenu->setGtTriggerMenuInterface(gtXmlParser.gtTriggerMenuInterface());
231  pL1uGtTriggerMenu->setGtTriggerMenuImplementation(gtXmlParser.gtTriggerMenuImplementation());
232  pL1uGtTriggerMenu->setGtScaleDbKey(gtXmlParser.gtScaleDbKey());
233 
234  pL1uGtTriggerMenu->setGtAlgorithmMap(gtXmlParser.gtAlgorithmMap());
235  pL1uGtTriggerMenu->setGtAlgorithmAliasMap(gtXmlParser.gtAlgorithmAliasMap());
236  pL1uGtTriggerMenu->setGtTechnicalTriggerMap(gtXmlParser.gtTechnicalTriggerMap());
237 
238  //LogDebug("L1TGlobalConfig")
239  //<< "\n\nReturning L1 Trigger Menu!"
240  //<< "\n\n"
241  //<< std::endl;
242 
243  return pL1uGtTriggerMenu ;
244 }
245 
#define LogDebug(id)
const std::string & gtScaleDbKey() const
menu associated scale key
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
const std::vector< std::vector< CorrelationTemplate > > & vecCorrelationTemplate() const
void setGtNumberL1JetCounts(const unsigned int &)
std::string m_vmeXmlFile
XML file for Global Trigger VME configuration (vme.xml)
std::string m_defXmlFile
XML file for Global Trigger menu (def.xml)
const std::vector< std::vector< L1GtHfBitCountsTemplate > > & vecHfBitCountsTemplate() const
boost::shared_ptr< TriggerMenu > produceGtTriggerMenu(const L1TGlobalTriggerMenuRcd &)
public methods
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
void setGtOrderConditionChip(const std::vector< int > &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void setGtNumberPhysTriggers(const unsigned int &)
void parseXmlFile(const std::string &defXmlFile, const std::string &vmeXmlFile)
parse def.xml and vme.xml files
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
void get(HolderT &iHolder) const
const std::vector< std::vector< CaloTemplate > > & vecCaloTemplate() const
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate() const
const std::vector< std::vector< L1GtEnergySumTemplate > > & corEnergySumTemplate() const
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
const std::string & gtTriggerMenuName() const
const std::vector< std::vector< MuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
TriggerMenuXmlProducer(const edm::ParameterSet &)
constructor
void setGtPinsOnConditionChip(const unsigned int &)
const std::string & gtTriggerMenuImplementation() const
const std::vector< std::vector< L1GtJetCountsTemplate > > & vecJetCountsTemplate() const
void setGtNumberConditionChips(const unsigned int &)
tuple cout
Definition: gather_cfg.py:121
const std::vector< std::vector< L1GtCastorTemplate > > & vecCastorTemplate() const
std::string fullPath() const
Definition: FileInPath.cc:165
const std::vector< std::vector< L1GtExternalTemplate > > & vecExternalTemplate() const
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
void setGtNumberTechTriggers(const unsigned int &)
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > & vecHfRingEtSumsTemplate() const
const std::vector< std::vector< L1GtBptxTemplate > > & vecBptxTemplate() const