CMS 3D CMS Logo

L1GtPrescaleFactorsAndMasksTester.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <iomanip>
20 #include <iostream>
21 
22 // user include files
23 // base class
25 
28 
31 
33 
36 
38 
41 
44 
47 
48 // forward declarations
49 
50 // constructor(s)
52  : m_testerPrescaleFactors(parSet.getParameter<bool>("TesterPrescaleFactors")),
53  m_testerTriggerMask(parSet.getParameter<bool>("TesterTriggerMask")),
54  m_testerTriggerVetoMask(parSet.getParameter<bool>("TesterTriggerVetoMask")),
55  m_retrieveInBeginRun(parSet.getParameter<bool>("RetrieveInBeginRun")),
56  m_retrieveInBeginLuminosityBlock(parSet.getParameter<bool>("RetrieveInBeginLuminosityBlock")),
57  m_retrieveInAnalyze(parSet.getParameter<bool>("RetrieveInAnalyze")),
58  m_printInBeginRun(parSet.getParameter<bool>("PrintInBeginRun")),
59  m_printInBeginLuminosityBlock(parSet.getParameter<bool>("PrintInBeginLuminosityBlock")),
60  m_printInAnalyze(parSet.getParameter<bool>("PrintInAnalyze")),
61  m_printOutput(parSet.getUntrackedParameter<int>("PrintOutput", 3)) {
62  // empty
63 }
64 
65 // destructor
67  // empty
68 }
69 
70 // begin job
72 
73 // begin run
76  retrieveL1EventSetup(evSetup);
77  }
78 
79  if (m_printInBeginRun) {
80  printL1EventSetup(evSetup);
81  }
82 }
83 
84 // begin luminosity block
86  const edm::EventSetup& evSetup) {
88  retrieveL1EventSetup(evSetup);
89  }
90 
92  printL1EventSetup(evSetup);
93  }
94 }
95 
96 // loop over events
98  if (m_retrieveInAnalyze) {
99  retrieveL1EventSetup(evSetup);
100  }
101 
102  if (m_printInAnalyze) {
103  printL1EventSetup(evSetup);
104  }
105 }
106 
107 // end luminosity block
109  const edm::EventSetup& evSetup) {}
110 
111 // end run
113 
114 // end job
116 
119  // get / update the prescale factors from the EventSetup
120 
122  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
123  m_l1GtPfAlgo = l1GtPfAlgo.product();
124 
126  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
127  m_l1GtPfTech = l1GtPfTech.product();
128  }
129 
130  if (m_testerTriggerMask) {
131  // get / update the trigger mask from the EventSetup
132 
134  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
135  m_l1GtTmAlgo = l1GtTmAlgo.product();
136 
138  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
139  m_l1GtTmTech = l1GtTmTech.product();
140  }
141 
143  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
144  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
145  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
146 
147  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
148  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
149  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
150  }
151 }
152 
154  // define an output stream to print into
155  // it can then be directed to whatever log level is desired
156  std::ostringstream myCout;
157 
159  myCout << "\nL1 GT prescale factors for algorithm triggers" << std::endl;
160  m_l1GtPfAlgo->print(myCout);
161 
162  myCout << "\nL1 GT prescale factors for technical triggers" << std::endl;
163  m_l1GtPfTech->print(myCout);
164  }
165 
166  //
167  if (m_testerTriggerMask) {
168  myCout << "\nL1 GT trigger masks for algorithm triggers" << std::endl;
169  m_l1GtTmAlgo->print(myCout);
170 
171  myCout << "\nL1 GT trigger masks for technical triggers" << std::endl;
172  m_l1GtTmTech->print(myCout);
173  }
174 
175  //
177  myCout << "\nL1 GT trigger veto masks for algorithm triggers" << std::endl;
178  m_l1GtTmVetoAlgo->print(myCout);
179 
180  myCout << "\nL1 GT trigger veto masks for technical triggers" << std::endl;
181  m_l1GtTmVetoTech->print(myCout);
182  }
183 
184  switch (m_printOutput) {
185  case 0: {
186  std::cout << myCout.str() << std::endl;
187 
188  }
189 
190  break;
191  case 1: {
192  LogTrace("L1GtPrescaleFactorsAndMasksTester") << myCout.str() << std::endl;
193 
194  } break;
195 
196  case 2: {
197  edm::LogVerbatim("L1GtPrescaleFactorsAndMasksTester") << myCout.str() << std::endl;
198 
199  }
200 
201  break;
202  case 3: {
203  edm::LogInfo("L1GtPrescaleFactorsAndMasksTester") << myCout.str();
204 
205  }
206 
207  break;
208  default: {
209  myCout << "\n\n L1GtPrescaleFactorsAndMasksTester: Error - no print output = " << m_printOutput
210  << " defined! \n Check available values in the cfi file."
211  << "\n"
212  << std::endl;
213 
214  } break;
215  }
216 }
L1GtPrescaleFactorsAndMasksTester::m_printOutput
int m_printOutput
print output
Definition: L1GtPrescaleFactorsAndMasksTester.h:88
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtPrescaleFactorsAndMasksTester::m_l1GtTmVetoAlgo
const L1GtTriggerMask * m_l1GtTmVetoAlgo
Definition: L1GtPrescaleFactorsAndMasksTester.h:99
electrons_cff.bool
bool
Definition: electrons_cff.py:393
L1GtPrescaleFactorsAndMasksTester::m_l1GtTmAlgo
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
Definition: L1GtPrescaleFactorsAndMasksTester.h:96
MessageLogger.h
L1GtTriggerMaskAlgoTrigRcd.h
L1GtTriggerMask.h
ESHandle.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
L1GtPrescaleFactorsAndMasksTester::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
begin luminosity block
Definition: L1GtPrescaleFactorsAndMasksTester.cc:85
edm::Run
Definition: Run.h:45
L1GtPrescaleFactorsAndMasksTester::m_printInBeginRun
bool m_printInBeginRun
print the records in beginRun, beginLuminosityBlock, analyze, respectively
Definition: L1GtPrescaleFactorsAndMasksTester.h:83
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1GtTriggerMaskTechTrigRcd.h
L1GtPrescaleFactorsAndMasksTester::m_l1GtTmTech
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtPrescaleFactorsAndMasksTester.h:97
L1GtTriggerMaskVetoTechTrigRcd
Definition: L1GtTriggerMaskVetoTechTrigRcd.h:39
L1GtPrescaleFactorsAndMasksTester::m_testerTriggerMask
bool m_testerTriggerMask
Definition: L1GtPrescaleFactorsAndMasksTester.h:74
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
L1GtPrescaleFactorsTechTrigRcd
Definition: L1GtPrescaleFactorsTechTrigRcd.h:38
L1GtPrescaleFactorsAndMasksTester::beginJob
void beginJob() override
begin job
Definition: L1GtPrescaleFactorsAndMasksTester.cc:71
L1GtPrescaleFactorsAndMasksTester::m_testerTriggerVetoMask
bool m_testerTriggerVetoMask
Definition: L1GtPrescaleFactorsAndMasksTester.h:75
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
L1GtPrescaleFactorsAndMasksTester::m_retrieveInAnalyze
bool m_retrieveInAnalyze
Definition: L1GtPrescaleFactorsAndMasksTester.h:80
L1GtPrescaleFactorsAndMasksTester::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
begin run
Definition: L1GtPrescaleFactorsAndMasksTester.cc:74
L1GtPrescaleFactorsAndMasksTester::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
end luminosity block
Definition: L1GtPrescaleFactorsAndMasksTester.cc:108
L1GtTriggerMaskTechTrigRcd
Definition: L1GtTriggerMaskTechTrigRcd.h:39
L1GtPrescaleFactorsAndMasksTester::printL1EventSetup
void printL1EventSetup(const edm::EventSetup &)
print the requred records
Definition: L1GtPrescaleFactorsAndMasksTester.cc:153
L1GtPrescaleFactorsAndMasksTester::m_testerPrescaleFactors
bool m_testerPrescaleFactors
input parameters
Definition: L1GtPrescaleFactorsAndMasksTester.h:73
L1GtTriggerMaskAlgoTrigRcd
Definition: L1GtTriggerMaskAlgoTrigRcd.h:39
edm::ESHandle
Definition: DTSurvey.h:22
L1GtPrescaleFactorsAndMasksTester::m_l1GtPfAlgo
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtPrescaleFactorsAndMasksTester.h:92
L1GtPrescaleFactors::print
void print(std::ostream &) const
print the prescale factors
Definition: L1GtPrescaleFactors.cc:47
L1GtTriggerMaskVetoTechTrigRcd.h
L1GtPrescaleFactorsAndMasksTester::m_l1GtPfTech
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtPrescaleFactorsAndMasksTester.h:93
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1GtPrescaleFactorsAndMasksTester::retrieveL1EventSetup
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records
Definition: L1GtPrescaleFactorsAndMasksTester.cc:117
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtPrescaleFactorsAlgoTrigRcd.h
L1GtPrescaleFactorsAndMasksTester::m_l1GtTmVetoTech
const L1GtTriggerMask * m_l1GtTmVetoTech
Definition: L1GtPrescaleFactorsAndMasksTester.h:100
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
L1GtPrescaleFactorsAndMasksTester::endJob
void endJob() override
end job
Definition: L1GtPrescaleFactorsAndMasksTester.cc:115
L1GtTriggerMaskVetoAlgoTrigRcd
Definition: L1GtTriggerMaskVetoAlgoTrigRcd.h:39
L1GtPrescaleFactorsAndMasksTester::endRun
void endRun(const edm::Run &, const edm::EventSetup &) override
end run
Definition: L1GtPrescaleFactorsAndMasksTester.cc:112
L1GtPrescaleFactorsAndMasksTester::m_retrieveInBeginLuminosityBlock
bool m_retrieveInBeginLuminosityBlock
Definition: L1GtPrescaleFactorsAndMasksTester.h:79
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
L1GtPrescaleFactorsAndMasksTester::m_printInAnalyze
bool m_printInAnalyze
Definition: L1GtPrescaleFactorsAndMasksTester.h:85
EventSetup.h
L1GtPrescaleFactorsAndMasksTester::L1GtPrescaleFactorsAndMasksTester
L1GtPrescaleFactorsAndMasksTester(const edm::ParameterSet &)
Definition: L1GtPrescaleFactorsAndMasksTester.cc:51
L1GtPrescaleFactorsAndMasksTester::m_retrieveInBeginRun
bool m_retrieveInBeginRun
retrieve the records in beginRun, beginLuminosityBlock, analyze, respectively
Definition: L1GtPrescaleFactorsAndMasksTester.h:78
L1GtTriggerMask::print
void print(std::ostream &) const
print the mask
Definition: L1GtTriggerMask.cc:43
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
ParameterSet.h
L1GtPrescaleFactorsAndMasksTester::~L1GtPrescaleFactorsAndMasksTester
~L1GtPrescaleFactorsAndMasksTester() override
Definition: L1GtPrescaleFactorsAndMasksTester.cc:66
L1GtPrescaleFactorsAlgoTrigRcd
Definition: L1GtPrescaleFactorsAlgoTrigRcd.h:38
L1GtTriggerMaskVetoAlgoTrigRcd.h
edm::Event
Definition: Event.h:73
L1GtPrescaleFactorsAndMasksTester.h
L1GtPrescaleFactorsAndMasksTester::m_printInBeginLuminosityBlock
bool m_printInBeginLuminosityBlock
Definition: L1GtPrescaleFactorsAndMasksTester.h:84
L1GtPrescaleFactors.h
L1GtPrescaleFactorsAndMasksTester::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
analyze
Definition: L1GtPrescaleFactorsAndMasksTester.cc:97
L1GtPrescaleFactorsTechTrigRcd.h