CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Public Member Functions

 GctTimingAnalyzer (const edm::ParameterSet &)
 
 ~GctTimingAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: Analyse the timing of all of the GCT pipelines

Definition at line 37 of file GctTimingAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file GctTimingAnalyzer.cc.

References m_outputFile, and m_outputFileName.

21  :
22  m_outputFileName(iConfig.getUntrackedParameter<std::string>("outFile", "gctTiming.txt")),
23  m_gctSource(iConfig.getUntrackedParameter<edm::InputTag>("gctSource")),
24  m_isoEmSource(iConfig.getUntrackedParameter<edm::InputTag>("isoEmSource")),
25  m_nonIsoEmSource(iConfig.getUntrackedParameter<edm::InputTag>("nonIsoEmSource")),
26  m_cenJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("cenJetsSource")),
27  m_forJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("forJetsSource")),
28  m_tauJetsSource(iConfig.getUntrackedParameter<edm::InputTag>("tauJetsSource")),
29  m_doInternal(iConfig.getUntrackedParameter<bool>("doInternal")),
30  m_doElectrons(iConfig.getUntrackedParameter<bool>("doElectrons")),
31  m_doJets(iConfig.getUntrackedParameter<bool>("doJets")),
32  m_doHFRings(iConfig.getUntrackedParameter<bool>("doHFRings")),
33  m_doESums(iConfig.getUntrackedParameter<bool>("doESums")),
34  m_evtNum(0)
35 {
36  m_outputFile.open(m_outputFileName.c_str());
37 }
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 39 of file GctTimingAnalyzer.cc.

References m_outputFile.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 44 of file GctTimingAnalyzer.cc.

References ExpressReco_HICollisions_FallBack::e, edm::Event::getByLabel(), edm::HandleBase::isValid(), 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 CaloMET_cfi::met.

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

Member Data Documentation

edm::InputTag GctTimingAnalyzer::m_cenJetsSource
private

Definition at line 54 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doElectrons
private

Definition at line 59 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doESums
private

Definition at line 62 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doHFRings
private

Definition at line 61 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doInternal
private

Definition at line 58 of file GctTimingAnalyzer.h.

Referenced by analyze().

bool GctTimingAnalyzer::m_doJets
private

Definition at line 60 of file GctTimingAnalyzer.h.

Referenced by analyze().

unsigned GctTimingAnalyzer::m_evtNum
private

Definition at line 64 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_forJetsSource
private

Definition at line 55 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_gctSource
private

Definition at line 51 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_isoEmSource
private

Definition at line 52 of file GctTimingAnalyzer.h.

Referenced by analyze().

edm::InputTag GctTimingAnalyzer::m_nonIsoEmSource
private

Definition at line 53 of file GctTimingAnalyzer.h.

Referenced by analyze().

std::ofstream GctTimingAnalyzer::m_outputFile
private

Definition at line 49 of file GctTimingAnalyzer.h.

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

std::string GctTimingAnalyzer::m_outputFileName
private

Definition at line 48 of file GctTimingAnalyzer.h.

Referenced by GctTimingAnalyzer().

edm::InputTag GctTimingAnalyzer::m_tauJetsSource
private

Definition at line 56 of file GctTimingAnalyzer.h.

Referenced by analyze().