CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerSummaryAnalyzerRAW.cc
Go to the documentation of this file.
1 
14 
15 //
16 // constructors and destructor
17 //
19  inputTag_(ps.getParameter<edm::InputTag>("inputTag"))
20 { }
21 
23 {
24 }
25 
26 //
27 // member functions
28 //
29 
30 // ------------ method called to produce the data ------------
31 void
33 {
34  using namespace std;
35  using namespace edm;
36  using namespace reco;
37  using namespace l1extra;
38  using namespace trigger;
39 
40  cout << endl;
41  cout << "TriggerSummaryAnalyzerRAW: content of TriggerEventWithRefs: " << inputTag_.encode();
42 
44  iEvent.getByLabel(inputTag_,handle);
45  if (handle.isValid()) {
46  cout << "Used Processname: " << handle->usedProcessName() << endl;
47  const size_type nFO(handle->size());
48  cout << "Number of TriggerFilterObjects: " << nFO << endl;
49  cout << "The TriggerFilterObjects: #, tag" << endl;
50  for (size_type iFO=0; iFO!=nFO; ++iFO) {
51  cout << iFO << " " << handle->filterTag(iFO).encode() << endl;
52  cout << " # of objects:";
53 
54  const unsigned int nPhotons(handle->photonSlice(iFO).second-
55  handle->photonSlice(iFO).first);
56  if (nPhotons>0) cout << " Photons: " << nPhotons;
57 
58  const unsigned int nElectrons(handle->electronSlice(iFO).second-
59  handle->electronSlice(iFO).first);
60  if (nElectrons>0) cout << " Electrons: " << nElectrons;
61 
62  const unsigned int nMuons(handle->muonSlice(iFO).second-
63  handle->muonSlice(iFO).first);
64  if (nMuons>0) cout << " Muons: " << nMuons;
65 
66  const unsigned int nJets(handle->jetSlice(iFO).second-
67  handle->jetSlice(iFO).first);
68  if (nJets>0) cout << " Jets: " << nJets;
69 
70  const unsigned int nComposites(handle->compositeSlice(iFO).second-
71  handle->compositeSlice(iFO).first);
72  if (nComposites>0) cout << " Composites: " << nComposites;
73 
74  const unsigned int nBaseMETs(handle->basemetSlice(iFO).second-
75  handle->basemetSlice(iFO).first);
76  if (nBaseMETs>0) cout << " BaseMETs: " << nBaseMETs;
77 
78  const unsigned int nCaloMETs(handle->calometSlice(iFO).second-
79  handle->calometSlice(iFO).first);
80  if (nCaloMETs>0) cout << " CaloMETs: " << nCaloMETs;
81 
82  const unsigned int nPixTracks(handle->pixtrackSlice(iFO).second-
83  handle->pixtrackSlice(iFO).first);
84  if (nPixTracks>0) cout << " PixTracks: " << nPixTracks;
85 
86  const unsigned int nL1EM(handle->l1emSlice(iFO).second-
87  handle->l1emSlice(iFO).first);
88  if (nL1EM>0) cout << " L1EM: " << nL1EM;
89 
90  const unsigned int nL1Muon(handle->l1muonSlice(iFO).second-
91  handle->l1muonSlice(iFO).first);
92  if (nL1Muon>0) cout << " L1Muon: " << nL1Muon;
93 
94  const unsigned int nL1Jet(handle->l1jetSlice(iFO).second-
95  handle->l1jetSlice(iFO).first);
96  if (nL1Jet>0) cout << " L1Jet: " << nL1Jet;
97 
98  const unsigned int nL1EtMiss(handle->l1etmissSlice(iFO).second-
99  handle->l1etmissSlice(iFO).first);
100  if (nL1EtMiss>0) cout << " L1EtMiss: " << nL1EtMiss;
101 
102  const unsigned int nL1HfRings(handle->l1hfringsSlice(iFO).second-
103  handle->l1hfringsSlice(iFO).first);
104  if (nL1HfRings>0) cout << " L1HfRings: " << nL1HfRings;
105 
106  const unsigned int nPFJets(handle->pfjetSlice(iFO).second-
107  handle->pfjetSlice(iFO).first);
108  if (nPFJets>0) cout << " PFJets: " << nPFJets;
109 
110  const unsigned int nPFTaus(handle->pftauSlice(iFO).second-
111  handle->pftauSlice(iFO).first);
112  if (nPFTaus>0) cout << " PFTaus: " << nPFTaus;
113 
114  cout << endl;
115  }
116  cout << "Elements in linearised collections of Refs: " << endl;
117  cout << " Photons: " << handle->photonSize() << endl;
118  cout << " Electrons: " << handle->electronSize() << endl;
119  cout << " Muons: " << handle->muonSize() << endl;
120  cout << " Jets: " << handle->jetSize() << endl;
121  cout << " Composites: " << handle->compositeSize() << endl;
122  cout << " BaseMETs: " << handle->basemetSize() << endl;
123  cout << " CaloMETs: " << handle->calometSize() << endl;
124  cout << " Pixtracks: " << handle->pixtrackSize() << endl;
125  cout << " L1EM: " << handle->l1emSize() << endl;
126  cout << " L1Muon: " << handle->l1muonSize() << endl;
127  cout << " L1Jet: " << handle->l1jetSize() << endl;
128  cout << " L1EtMiss: " << handle->l1etmissSize() << endl;
129  cout << " L1HfRings: " << handle->l1hfringsSize() << endl;
130  cout << " PFJets: " << handle->pfjetSize() << endl;
131  cout << " PFTaus: " << handle->pftauSize() << endl;
132  } else {
133  cout << "Handle invalid! Check InputTag provided." << endl;
134  }
135  cout << endl;
136 
137  return;
138 }
TriggerSummaryAnalyzerRAW(const edm::ParameterSet &)
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:72
int iEvent
Definition: GenABIO.cc:243
virtual void analyze(const edm::Event &, const edm::EventSetup &)
tuple handle
Definition: patZpeak.py:22
edm::InputTag inputTag_
InputTag of TriggerEventWithRefs to analyze.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple cout
Definition: gather_cfg.py:121