CMS 3D CMS Logo

L1GtRunSettingsViewer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1GtRunSettingsViewer
4 // Class: L1GtRunSettingsViewer
5 //
13 //
14 // Original Author: Werner Man-Li Sun
15 // Created: Thu May 19 04:32:54 CEST 2011
16 //
17 //
18 
19 // system include files
20 #include <iostream>
21 #include <memory>
22 #include <sstream>
23 
24 // user include files
27 
32 
34 
39 
48 
51 
52 //
53 // class decleration
54 //
55 
57 public:
59  ~L1GtRunSettingsViewer() override;
60 
61 private:
62  void beginJob() override;
63  void analyze(const edm::Event&, const edm::EventSetup&) override;
64  void endJob() override;
65 
66  // ----------member data ---------------------------
72 };
73 
74 //
75 // constants, enums and typedefs
76 //
77 
78 //
79 // static data member definitions
80 //
81 
82 //
83 // constructors and destructor
84 //
86  : m_prescalesKey(iConfig.getParameter<std::string>("prescalesKey")),
87  m_maskAlgoKey(iConfig.getParameter<std::string>("maskAlgoKey")),
88  m_maskTechKey(iConfig.getParameter<std::string>("maskTechKey")),
89  m_maskVetoAlgoKey(iConfig.getParameter<std::string>("maskVetoAlgoKey")),
90  m_maskVetoTechKey(iConfig.getParameter<std::string>("maskVetoTechKey")) {
91  //now do what ever initialization is needed
92 }
93 
95  // do anything here that needs to be done at desctruction time
96  // (e.g. close files, deallocate resources etc.)
97 }
98 
99 //
100 // member functions
101 //
102 
103 // ------------ method called to for each event ------------
105  using namespace edm;
106 
107  // Utility class
108  l1t::DataWriter dataWriter;
109 
110  // Get most recent L1TriggerKeyList
111  L1TriggerKeyList keyList;
112  dataWriter.fillLastTriggerKeyList(keyList);
113 
114  // For the given GTRS key, find the corresponding payload tokens.
115  // Use the payload tokens to retrieve the corresponding objects.
116  // Call the print functions for these objects.
117 
118  if (!m_prescalesKey.empty()) {
119  std::string pfAlgoToken = keyList.token("L1GtPrescaleFactorsAlgoTrigRcd", "L1GtPrescaleFactors", m_prescalesKey);
120  if (pfAlgoToken.empty()) {
121  edm::LogError("L1-O2O") << "No payload for L1GtPrescaleFactorsAlgoTrigRcd with key " << m_prescalesKey;
122  } else {
124  dataWriter.readObject(pfAlgoToken, pfAlgo);
125  pfAlgo.print(std::cout);
126  }
127 
128  std::string pfTechToken = keyList.token("L1GtPrescaleFactorsTechTrigRcd", "L1GtPrescaleFactors", m_prescalesKey);
129  if (pfTechToken.empty()) {
130  edm::LogError("L1-O2O") << "No payload for L1GtPrescaleFactorsTechTrigRcd with key " << m_prescalesKey;
131  } else {
132  L1GtPrescaleFactors pfTech;
133  dataWriter.readObject(pfTechToken, pfTech);
134  pfTech.print(std::cout);
135  }
136  }
137 
138  if (!m_maskAlgoKey.empty()) {
139  std::string token = keyList.token("L1GtTriggerMaskAlgoTrigRcd", "L1GtTriggerMask", m_maskAlgoKey);
140  if (token.empty()) {
141  edm::LogError("L1-O2O") << "No payload for L1GtTriggerMaskAlgoTrigRcd with key " << m_maskAlgoKey;
142  } else {
143  L1GtTriggerMask mask;
144  dataWriter.readObject(token, mask);
145  mask.print(std::cout);
146  }
147  }
148 
149  if (!m_maskTechKey.empty()) {
150  std::string token = keyList.token("L1GtTriggerMaskTechTrigRcd", "L1GtTriggerMask", m_maskTechKey);
151  if (token.empty()) {
152  edm::LogError("L1-O2O") << "No payload for L1GtTriggerMaskTechTrigRcd with key " << m_maskTechKey;
153  } else {
154  L1GtTriggerMask mask;
155  dataWriter.readObject(token, mask);
156  mask.print(std::cout);
157  }
158  }
159 
160  if (!m_maskVetoAlgoKey.empty()) {
161  std::string token = keyList.token("L1GtTriggerMaskVetoAlgoTrigRcd", "L1GtTriggerMask", m_maskVetoAlgoKey);
162  if (token.empty()) {
163  edm::LogError("L1-O2O") << "No payload for L1GtTriggerMaskVetoAlgoTrigRcd with key " << m_maskVetoAlgoKey;
164  } else {
165  L1GtTriggerMask mask;
166  dataWriter.readObject(token, mask);
167  mask.print(std::cout);
168  }
169  }
170 
171  if (!m_maskVetoTechKey.empty()) {
172  std::string token = keyList.token("L1GtTriggerMaskVetoTechTrigRcd", "L1GtTriggerMask", m_maskVetoTechKey);
173  if (token.empty()) {
174  edm::LogError("L1-O2O") << "No payload for L1GtTriggerMaskVetoTechTrigRcd with key " << m_maskVetoTechKey;
175  } else {
176  L1GtTriggerMask mask;
177  dataWriter.readObject(token, mask);
178  mask.print(std::cout);
179  }
180  }
181 }
182 
183 // ------------ method called once each job just before starting event loop ------------
185 
186 // ------------ method called once each job just after ending the event loop ------------
188 
189 //define this as a plug-in
L1GtRunSettingsViewer::m_maskVetoTechKey
std::string m_maskVetoTechKey
Definition: L1GtRunSettingsViewer.cc:71
DataWriter.h
L1GtRunSettingsViewer::L1GtRunSettingsViewer
L1GtRunSettingsViewer(const edm::ParameterSet &)
Definition: L1GtRunSettingsViewer.cc:85
L1GtPrescaleFactors
Definition: L1GtPrescaleFactors.h:32
L1GtTriggerMaskAlgoTrigRcd.h
Exception.h
L1GtTriggerMask.h
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1GtRunSettingsViewer
Definition: L1GtRunSettingsViewer.cc:56
L1GtTriggerMaskTechTrigRcd.h
EDAnalyzer.h
L1GtRunSettingsViewer::~L1GtRunSettingsViewer
~L1GtRunSettingsViewer() override
Definition: L1GtRunSettingsViewer.cc:94
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
MakerMacros.h
L1GtRunSettingsViewer::m_prescalesKey
std::string m_prescalesKey
Definition: L1GtRunSettingsViewer.cc:67
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TriggerKey.h
L1GtTriggerMask
Definition: L1GtTriggerMask.h:33
L1GtRunSettingsViewer::m_maskVetoAlgoKey
std::string m_maskVetoAlgoKey
Definition: L1GtRunSettingsViewer.cc:70
L1GtPrescaleFactors::print
void print(std::ostream &) const
print the prescale factors
Definition: L1GtPrescaleFactors.cc:47
L1GtRunSettingsViewer::m_maskAlgoKey
std::string m_maskAlgoKey
Definition: L1GtRunSettingsViewer.cc:68
L1GtRunSettingsViewer::m_maskTechKey
std::string m_maskTechKey
Definition: L1GtRunSettingsViewer.cc:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtTriggerMaskVetoTechTrigRcd.h
L1TriggerKeyList
Definition: L1TriggerKeyList.h:32
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtPrescaleFactorsAlgoTrigRcd.h
L1TriggerKeyList.h
L1GtRunSettingsViewer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1GtRunSettingsViewer.cc:104
edm::EventSetup
Definition: EventSetup.h:57
L1TriggerKeyRcd.h
l1t::DataWriter::readObject
void readObject(const std::string &payloadToken, T &outputObject)
Definition: DataWriter.h:72
l1t::DataWriter::fillLastTriggerKeyList
bool fillLastTriggerKeyList(L1TriggerKeyList &output)
Definition: DataWriter.cc:147
std
Definition: JetResolutionObject.h:76
Frameworkfwd.h
EventSetup.h
l1t::DataWriter
Definition: DataWriter.h:35
L1GtTriggerMask::print
void print(std::ostream &) const
print the mask
Definition: L1GtTriggerMask.cc:43
ParameterSet.h
L1TriggerKeyList::token
std::string token(const std::string &tscKey) const
Definition: L1TriggerKeyList.cc:96
L1GtTriggerMaskVetoAlgoTrigRcd.h
edm::Event
Definition: Event.h:73
L1GtRunSettingsViewer::beginJob
void beginJob() override
Definition: L1GtRunSettingsViewer.cc:184
l1ParticleFlow_cff.pfAlgo
pfAlgo
Definition: l1ParticleFlow_cff.py:145
L1GtRunSettingsViewer::endJob
void endJob() override
Definition: L1GtRunSettingsViewer.cc:187
L1GtPrescaleFactors.h
L1TriggerKeyListRcd.h
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
L1GtPrescaleFactorsTechTrigRcd.h