CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GctTimingAnalyzer Class Reference

#include <L1Trigger/L1GctAnalzyer/src/GctTimingAnalyzer.cc>

Inheritance diagram for GctTimingAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 GctTimingAnalyzer (const edm::ParameterSet &)
 
 ~GctTimingAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::InputTag m_cenJetsSource
 
bool m_doElectrons
 
bool m_doESums
 
bool m_doHFRings
 
bool m_doInternal
 
bool m_doJets
 
unsigned m_evtNum
 
edm::InputTag m_forJetsSource
 
edm::InputTag m_gctSource
 
edm::InputTag m_isoEmSource
 
edm::InputTag m_nonIsoEmSource
 
std::ofstream m_outputFile
 
std::string m_outputFileName
 
edm::InputTag m_tauJetsSource
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Analyse the timing of all of the GCT pipelines

Definition at line 36 of file GctTimingAnalyzer.h.

Constructor & Destructor Documentation

◆ GctTimingAnalyzer()

GctTimingAnalyzer::GctTimingAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file GctTimingAnalyzer.cc.

References m_outputFile, and m_outputFileName.

21  : m_outputFileName(iConfig.getUntrackedParameter<std::string>("outFile", "gctTiming.txt")),
22  m_gctSource(iConfig.getUntrackedParameter<edm::InputTag>("gctSource")),
23  m_isoEmSource(iConfig.getUntrackedParameter<edm::InputTag>("isoEmSource")),
24  m_nonIsoEmSource(iConfig.getUntrackedParameter<edm::InputTag>("nonIsoEmSource")),
25  m_cenJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("cenJetsSource")),
26  m_forJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("forJetsSource")),
27  m_tauJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("tauJetsSource")),
28  m_doInternal(iConfig.getUntrackedParameter<bool>("doInternal")),
29  m_doElectrons(iConfig.getUntrackedParameter<bool>("doElectrons")),
30  m_doJets(iConfig.getUntrackedParameter<bool>("doJets")),
31  m_doHFRings(iConfig.getUntrackedParameter<bool>("doHFRings")),
32  m_doESums(iConfig.getUntrackedParameter<bool>("doESums")),
33  m_evtNum(0) {
34  m_outputFile.open(m_outputFileName.c_str());
35 }
edm::InputTag m_tauJetsSource
edm::InputTag m_cenJetsSource
edm::InputTag m_gctSource
T getUntrackedParameter(std::string const &, T const &) const
std::string m_outputFileName
edm::InputTag m_isoEmSource
edm::InputTag m_nonIsoEmSource
edm::InputTag m_forJetsSource
std::ofstream m_outputFile

◆ ~GctTimingAnalyzer()

GctTimingAnalyzer::~GctTimingAnalyzer ( )
override

Definition at line 37 of file GctTimingAnalyzer.cc.

References m_outputFile.

37 { m_outputFile.close(); }
std::ofstream m_outputFile

Member Function Documentation

◆ analyze()

void GctTimingAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 39 of file GctTimingAnalyzer.cc.

References TauDecayModes::dec, MillePedeFileConverter_cfg::e, photonIsolationHIProducer_cfi::hf, iEvent, edm::HandleBase::isValid(), dqmiolumiharvest::j, m_cenJetsSource, m_doElectrons, m_doESums, m_doHFRings, m_doInternal, m_doJets, m_evtNum, m_forJetsSource, m_gctSource, m_isoEmSource, m_nonIsoEmSource, m_outputFile, m_tauJetsSource, and BTaggingMonitor_cfi::met.

39  {
40  using namespace edm;
41  using namespace std;
42 
43  // Electrons
44  if (m_doElectrons) {
45  // Isolated EM cands in GCT output
47  iEvent.getByLabel(m_isoEmSource, isoEm);
48 
49  for (L1GctEmCandCollection::const_iterator em = isoEm->begin(); em != isoEm->end(); em++) {
50  if (em->rank() > 0) {
51  m_outputFile << "BX = " << dec << m_evtNum << " " << (*em) << std::endl;
52  }
53  }
54 
55  // Non-Isolated EM cands in GCT output
57  iEvent.getByLabel(m_nonIsoEmSource, nonIsoEm);
58 
59  for (L1GctEmCandCollection::const_iterator em = nonIsoEm->begin(); em != nonIsoEm->end(); em++) {
60  if (em->rank() > 0) {
61  m_outputFile << "BX = " << dec << m_evtNum << " " << (*em) << std::endl;
62  }
63  }
64 
65  if (m_doInternal) {
66  // Internal GCT EM cands
68  iEvent.getByLabel(m_gctSource, internEm);
69 
70  if (internEm.isValid()) {
71  for (L1GctInternEmCandCollection::const_iterator em = internEm->begin(); em != internEm->end(); em++) {
72  if (em->rank() > 0) {
73  m_outputFile << "BX = " << dec << m_evtNum << " " << (*em) << std::endl;
74  }
75  }
76  }
77  }
78 
79  // RCT EM cands
81  iEvent.getByLabel(m_gctSource, rctEm);
82 
83  for (L1CaloEmCollection::const_iterator em = rctEm->begin(); em != rctEm->end(); em++) {
84  if (em->rank() > 0) {
85  m_outputFile << "BX = " << dec << m_evtNum << " " << (*em) << std::endl;
86  }
87  }
88  }
89 
90  // Jets
91  if (m_doJets) {
92  // Central jet cands in GCT output
94  iEvent.getByLabel(m_cenJetsSource, cenJets);
95 
96  for (L1GctJetCandCollection::const_iterator cj = cenJets->begin(); cj != cenJets->end(); cj++) {
97  if (cj->rank() > 0) {
98  m_outputFile << "BX = " << dec << m_evtNum << " " << (*cj) << std::endl;
99  }
100  }
101 
102  // Forward jet cands in GCT output
104  iEvent.getByLabel(m_forJetsSource, forJets);
105 
106  for (L1GctJetCandCollection::const_iterator fj = forJets->begin(); fj != forJets->end(); fj++) {
107  if (fj->rank() > 0) {
108  m_outputFile << "BX = " << dec << m_evtNum << " " << (*fj) << std::endl;
109  }
110  }
111 
112  // Tau jet cands in GCT output
114  iEvent.getByLabel(m_tauJetsSource, tauJets);
115 
116  for (L1GctJetCandCollection::const_iterator tj = tauJets->begin(); tj != tauJets->end(); tj++) {
117  if (tj->rank() > 0) {
118  m_outputFile << "BX = " << dec << m_evtNum << " " << (*tj) << std::endl;
119  }
120  }
121 
122  if (m_doInternal) {
123  // Internal GCT jet cands
125  iEvent.getByLabel(m_gctSource, internJets);
126 
127  if (internJets.isValid()) {
128  for (L1GctInternJetDataCollection::const_iterator j = internJets->begin(); j != internJets->end(); j++) {
129  if ((j->et() > 0) || (j->rank() > 0)) {
130  m_outputFile << "BX = " << dec << m_evtNum << " " << (*j) << std::endl;
131  }
132  }
133  }
134  }
135  }
136 
137  // RCT regions
139  iEvent.getByLabel(m_gctSource, rctRn);
140 
141  for (L1CaloRegionCollection::const_iterator rn = rctRn->begin(); rn != rctRn->end(); rn++) {
142  if (rn->et() > 0) {
143  m_outputFile << "BX = " << dec << m_evtNum << " " << (*rn) << std::endl;
144  }
145  }
146 
147  // HF Rings
148  if (m_doHFRings) {
149  // HFRing counts
151  iEvent.getByLabel(m_gctSource, hfBitCnt);
152 
153  for (L1GctHFBitCountsCollection::const_iterator jc = hfBitCnt->begin(); jc != hfBitCnt->end(); jc++) {
154  if (jc->bitCount(0) || jc->bitCount(1) || jc->bitCount(2) || jc->bitCount(3)) {
155  m_outputFile << "BX = " << dec << m_evtNum << " " << (*jc) << std::endl;
156  }
157  }
158 
159  // HFRing Et sums
161  iEvent.getByLabel(m_gctSource, hfEtSums);
162 
163  for (L1GctHFRingEtSumsCollection::const_iterator js = hfEtSums->begin(); js != hfEtSums->end(); js++) {
164  if (js->etSum(0) || js->etSum(1) || js->etSum(2) || js->etSum(3)) {
165  m_outputFile << "BX = " << dec << m_evtNum << " " << (*js) << std::endl;
166  }
167  }
168 
169  if (m_doInternal) {
170  // Internal HF data
172  iEvent.getByLabel(m_gctSource, internHF);
173 
174  if (internHF.isValid()) {
175  for (L1GctInternHFDataCollection::const_iterator hf = internHF->begin(); hf != internHF->end(); hf++) {
176  if (hf->value(0) || hf->value(1) || hf->value(2) || hf->value(3)) {
177  m_outputFile << "BX = " << dec << m_evtNum << " " << (*hf) << std::endl;
178  }
179  }
180  }
181  }
182  }
183 
184  // HT, MET and ET
185  if (m_doESums) {
186  // MET
188  iEvent.getByLabel(m_gctSource, missEt);
189 
190  for (L1GctEtMissCollection::const_iterator met = missEt->begin(); met != missEt->end(); met++) {
191  if (met->et() > 0) {
192  m_outputFile << "BX = " << dec << m_evtNum << " " << (*met) << std::endl;
193  }
194  }
195 
196  // Total Et
198  iEvent.getByLabel(m_gctSource, totEt);
199 
200  for (L1GctEtTotalCollection::const_iterator tet = totEt->begin(); tet != totEt->end(); tet++) {
201  if (tet->et() > 0) {
202  m_outputFile << "BX = " << dec << m_evtNum << " " << (*tet) << std::endl;
203  }
204  }
205 
206  // Ht
208  iEvent.getByLabel(m_gctSource, hadEt);
209 
210  for (L1GctEtHadCollection::const_iterator ht = hadEt->begin(); ht != hadEt->end(); ht++) {
211  if (ht->et() > 0) {
212  m_outputFile << "BX = " << dec << m_evtNum << " " << (*ht) << std::endl;
213  }
214  }
215 
216  if (m_doInternal) {
217  // Internal GCT Et sums
219  iEvent.getByLabel(m_gctSource, Et);
220 
221  if (Et.isValid()) {
222  for (L1GctInternEtSumCollection::const_iterator e = Et->begin(); e != Et->end(); e++) {
223  if (e->et() > 0) {
224  m_outputFile << "BX = " << dec << m_evtNum << " " << (*e) << std::endl;
225  }
226  }
227  }
228  }
229  }
230 
231  m_evtNum++;
232 }
edm::InputTag m_tauJetsSource
edm::InputTag m_cenJetsSource
edm::InputTag m_gctSource
edm::InputTag m_isoEmSource
int iEvent
Definition: GenABIO.cc:224
edm::InputTag m_nonIsoEmSource
edm::InputTag m_forJetsSource
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
std::ofstream m_outputFile

Member Data Documentation

◆ m_cenJetsSource

edm::InputTag GctTimingAnalyzer::m_cenJetsSource
private

Definition at line 50 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_doElectrons

bool GctTimingAnalyzer::m_doElectrons
private

Definition at line 55 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_doESums

bool GctTimingAnalyzer::m_doESums
private

Definition at line 58 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_doHFRings

bool GctTimingAnalyzer::m_doHFRings
private

Definition at line 57 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_doInternal

bool GctTimingAnalyzer::m_doInternal
private

Definition at line 54 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_doJets

bool GctTimingAnalyzer::m_doJets
private

Definition at line 56 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_evtNum

unsigned GctTimingAnalyzer::m_evtNum
private

Definition at line 60 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_forJetsSource

edm::InputTag GctTimingAnalyzer::m_forJetsSource
private

Definition at line 51 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_gctSource

edm::InputTag GctTimingAnalyzer::m_gctSource
private

Definition at line 47 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_isoEmSource

edm::InputTag GctTimingAnalyzer::m_isoEmSource
private

Definition at line 48 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_nonIsoEmSource

edm::InputTag GctTimingAnalyzer::m_nonIsoEmSource
private

Definition at line 49 of file GctTimingAnalyzer.h.

Referenced by analyze().

◆ m_outputFile

std::ofstream GctTimingAnalyzer::m_outputFile
private

Definition at line 45 of file GctTimingAnalyzer.h.

Referenced by analyze(), GctTimingAnalyzer(), and ~GctTimingAnalyzer().

◆ m_outputFileName

std::string GctTimingAnalyzer::m_outputFileName
private

Definition at line 44 of file GctTimingAnalyzer.h.

Referenced by GctTimingAnalyzer().

◆ m_tauJetsSource

edm::InputTag GctTimingAnalyzer::m_tauJetsSource
private

Definition at line 52 of file GctTimingAnalyzer.h.

Referenced by analyze().