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::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 GctTimingAnalyzer (const edm::ParameterSet &)
 
 ~GctTimingAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file GctTimingAnalyzer.cc.

References m_outputFile, and m_outputFileName.

20  :
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 {
35  m_outputFile.open(m_outputFileName.c_str());
36 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag m_tauJetsSource
edm::InputTag m_cenJetsSource
edm::InputTag m_gctSource
std::string m_outputFileName
edm::InputTag m_isoEmSource
edm::InputTag m_nonIsoEmSource
edm::InputTag m_forJetsSource
std::ofstream m_outputFile
GctTimingAnalyzer::~GctTimingAnalyzer ( )

Definition at line 38 of file GctTimingAnalyzer.cc.

References m_outputFile.

39 {
40  m_outputFile.close();
41 }
std::ofstream m_outputFile

Member Function Documentation

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

Definition at line 43 of file GctTimingAnalyzer.cc.

References TauDecayModes::dec, MillePedeFileConverter_cfg::e, edm::Event::getByLabel(), photonIsolationHIProducer_cfi::hf, edm::HandleBase::isValid(), 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 RazorAnalyzer::met.

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

Member Data Documentation

edm::InputTag GctTimingAnalyzer::m_cenJetsSource
private

Definition at line 53 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doElectrons
private

Definition at line 58 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doESums
private

Definition at line 61 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doHFRings
private

Definition at line 60 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doInternal
private

Definition at line 57 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doJets
private

Definition at line 59 of file GctTimingAnalyzer.h.

Referenced by analyze().

unsigned GctTimingAnalyzer::m_evtNum
private

Definition at line 63 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_forJetsSource
private

Definition at line 54 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_gctSource
private

Definition at line 50 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_isoEmSource
private

Definition at line 51 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_nonIsoEmSource
private

Definition at line 52 of file GctTimingAnalyzer.h.

Referenced by analyze().

std::ofstream GctTimingAnalyzer::m_outputFile
private

Definition at line 48 of file GctTimingAnalyzer.h.

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

std::string GctTimingAnalyzer::m_outputFileName
private

Definition at line 47 of file GctTimingAnalyzer.h.

Referenced by GctTimingAnalyzer().

edm::InputTag GctTimingAnalyzer::m_tauJetsSource
private

Definition at line 55 of file GctTimingAnalyzer.h.

Referenced by analyze().