CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TriggerSummaryAnalyzerRAW.cc
Go to the documentation of this file.
1 
11 
18 
19 //
20 // class declaration
21 //
23 public:
25 
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
27  void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override;
28 
29 private:
33 };
34 
35 //
36 // constructors and destructor
37 //
39  : inputTag_(ps.getParameter<edm::InputTag>("inputTag")),
40  inputToken_(consumes<trigger::TriggerEventWithRefs>(inputTag_)) {}
41 
42 //
43 // member functions
44 //
45 
48  desc.add<edm::InputTag>("inputTag", edm::InputTag("hltTriggerSummaryRAW"));
49  descriptions.add("triggerSummaryAnalyzerRAW", desc);
50 }
51 
52 // ------------ method called to produce the data ------------
54  using namespace std;
55  using namespace edm;
56  using namespace reco;
57  using namespace l1extra;
58  using namespace trigger;
59  using namespace l1t;
60 
61  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
62  LogVerbatim("TriggerSummaryAnalyzerRAW")
63  << "TriggerSummaryAnalyzerRAW: content of TriggerEventWithRefs: " << inputTag_.encode();
64 
66  iEvent.getByToken(inputToken_, handle);
67  if (handle.isValid()) {
68  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Used Processname: " << handle->usedProcessName() << endl;
69  const size_type nFO(handle->size());
70  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Number of TriggerFilterObjects: " << nFO << endl;
71  LogVerbatim("TriggerSummaryAnalyzerRAW") << "The TriggerFilterObjects: #, tag" << endl;
72  for (size_type iFO = 0; iFO != nFO; ++iFO) {
73  LogVerbatim("TriggerSummaryAnalyzerRAW") << iFO << " " << handle->filterTag(iFO).encode() << endl;
74  LogVerbatim("TriggerSummaryAnalyzerRAW") << " # of objects:";
75 
76  const unsigned int nPhotons(handle->photonSlice(iFO).second - handle->photonSlice(iFO).first);
77  if (nPhotons > 0)
78  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Photons: " << nPhotons;
79 
80  const unsigned int nElectrons(handle->electronSlice(iFO).second - handle->electronSlice(iFO).first);
81  if (nElectrons > 0)
82  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Electrons: " << nElectrons;
83 
84  const unsigned int nMuons(handle->muonSlice(iFO).second - handle->muonSlice(iFO).first);
85  if (nMuons > 0)
86  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Muons: " << nMuons;
87 
88  const unsigned int nJets(handle->jetSlice(iFO).second - handle->jetSlice(iFO).first);
89  if (nJets > 0)
90  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Jets: " << nJets;
91 
92  const unsigned int nComposites(handle->compositeSlice(iFO).second - handle->compositeSlice(iFO).first);
93  if (nComposites > 0)
94  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Composites: " << nComposites;
95 
96  const unsigned int nBaseMETs(handle->basemetSlice(iFO).second - handle->basemetSlice(iFO).first);
97  if (nBaseMETs > 0)
98  LogVerbatim("TriggerSummaryAnalyzerRAW") << " BaseMETs: " << nBaseMETs;
99 
100  const unsigned int nCaloMETs(handle->calometSlice(iFO).second - handle->calometSlice(iFO).first);
101  if (nCaloMETs > 0)
102  LogVerbatim("TriggerSummaryAnalyzerRAW") << " CaloMETs: " << nCaloMETs;
103 
104  const unsigned int nPixTracks(handle->pixtrackSlice(iFO).second - handle->pixtrackSlice(iFO).first);
105  if (nPixTracks > 0)
106  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PixTracks: " << nPixTracks;
107 
108  const unsigned int nL1EM(handle->l1emSlice(iFO).second - handle->l1emSlice(iFO).first);
109  if (nL1EM > 0)
110  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EM: " << nL1EM;
111 
112  const unsigned int nL1Muon(handle->l1muonSlice(iFO).second - handle->l1muonSlice(iFO).first);
113  if (nL1Muon > 0)
114  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Muon: " << nL1Muon;
115 
116  const unsigned int nL1Jet(handle->l1jetSlice(iFO).second - handle->l1jetSlice(iFO).first);
117  if (nL1Jet > 0)
118  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Jet: " << nL1Jet;
119 
120  const unsigned int nL1EtMiss(handle->l1etmissSlice(iFO).second - handle->l1etmissSlice(iFO).first);
121  if (nL1EtMiss > 0)
122  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EtMiss: " << nL1EtMiss;
123 
124  const unsigned int nL1HfRings(handle->l1hfringsSlice(iFO).second - handle->l1hfringsSlice(iFO).first);
125  if (nL1HfRings > 0)
126  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1HfRings: " << nL1HfRings;
127 
128  const unsigned int nPFJets(handle->pfjetSlice(iFO).second - handle->pfjetSlice(iFO).first);
129  if (nPFJets > 0)
130  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFJets: " << nPFJets;
131 
132  const unsigned int nPFTaus(handle->pftauSlice(iFO).second - handle->pftauSlice(iFO).first);
133  if (nPFTaus > 0)
134  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFTaus: " << nPFTaus;
135 
136  const unsigned int nPFMETs(handle->pfmetSlice(iFO).second - handle->pfmetSlice(iFO).first);
137  if (nPFMETs > 0)
138  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFMETs: " << nPFMETs;
139 
140  const unsigned int nL1TMuon(handle->l1tmuonSlice(iFO).second - handle->l1tmuonSlice(iFO).first);
141  if (nL1TMuon > 0)
142  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TMuon: " << nL1TMuon;
143 
144  const unsigned int nL1TEGamma(handle->l1tegammaSlice(iFO).second - handle->l1tegammaSlice(iFO).first);
145  if (nL1TEGamma > 0)
146  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEGamma: " << nL1TEGamma;
147 
148  const unsigned int nL1TJet(handle->l1tjetSlice(iFO).second - handle->l1tjetSlice(iFO).first);
149  if (nL1TJet > 0)
150  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TJet: " << nL1TJet;
151 
152  const unsigned int nL1TTau(handle->l1ttauSlice(iFO).second - handle->l1ttauSlice(iFO).first);
153  if (nL1TTau > 0)
154  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTau: " << nL1TTau;
155 
156  const unsigned int nL1TEtSum(handle->l1tetsumSlice(iFO).second - handle->l1tetsumSlice(iFO).first);
157  if (nL1TEtSum > 0)
158  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEtSum: " << nL1TEtSum;
159 
160  /* Phase-2 */
161  const unsigned int nL1TTkMuon(handle->l1ttkmuonSlice(iFO).second - handle->l1ttkmuonSlice(iFO).first);
162  if (nL1TTkMuon > 0)
163  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkMuon: " << nL1TTkMuon;
164 
165  const unsigned int nL1TTkEle(handle->l1ttkeleSlice(iFO).second - handle->l1ttkeleSlice(iFO).first);
166  if (nL1TTkEle > 0)
167  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkEle: " << nL1TTkEle;
168 
169  const unsigned int nL1TTkEm(handle->l1ttkemSlice(iFO).second - handle->l1ttkemSlice(iFO).first);
170  if (nL1TTkEm > 0)
171  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkEm: " << nL1TTkEm;
172 
173  const unsigned int nL1TPFJet(handle->l1tpfjetSlice(iFO).second - handle->l1tpfjetSlice(iFO).first);
174  if (nL1TPFJet > 0)
175  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFJet: " << nL1TPFJet;
176 
177  const unsigned int nL1TPFTau(handle->l1tpftauSlice(iFO).second - handle->l1tpftauSlice(iFO).first);
178  if (nL1TPFTau > 0)
179  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFTau: " << nL1TPFTau;
180 
181  const unsigned int nL1THPSPFTau(handle->l1thpspftauSlice(iFO).second - handle->l1thpspftauSlice(iFO).first);
182  if (nL1THPSPFTau > 0)
183  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1THPSPFTau: " << nL1THPSPFTau;
184 
185  const unsigned int nL1TPFTrack(handle->l1tpftrackSlice(iFO).second - handle->l1tpftrackSlice(iFO).first);
186  if (nL1TPFTrack > 0)
187  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFTrack: " << nL1TPFTrack;
188 
189  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
190  }
191  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Elements in linearised collections of Refs: " << endl;
192  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Photons: " << handle->photonSize() << endl;
193  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Electrons: " << handle->electronSize() << endl;
194  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Muons: " << handle->muonSize() << endl;
195  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Jets: " << handle->jetSize() << endl;
196  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Composites: " << handle->compositeSize() << endl;
197  LogVerbatim("TriggerSummaryAnalyzerRAW") << " BaseMETs: " << handle->basemetSize() << endl;
198  LogVerbatim("TriggerSummaryAnalyzerRAW") << " CaloMETs: " << handle->calometSize() << endl;
199  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Pixtracks: " << handle->pixtrackSize() << endl;
200  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EM: " << handle->l1emSize() << endl;
201  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Muon: " << handle->l1muonSize() << endl;
202  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Jet: " << handle->l1jetSize() << endl;
203  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EtMiss: " << handle->l1etmissSize() << endl;
204  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1HfRings: " << handle->l1hfringsSize() << endl;
205  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFJets: " << handle->pfjetSize() << endl;
206  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFTaus: " << handle->pftauSize() << endl;
207  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFMETs: " << handle->pfmetSize() << endl;
208  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TMuon: " << handle->l1tmuonSize() << endl;
209  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEGamma: " << handle->l1tegammaSize() << endl;
210  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TJet: " << handle->l1tjetSize() << endl;
211  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTau: " << handle->l1ttauSize() << endl;
212  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEtSum: " << handle->l1tetsumSize() << endl;
213  /* Phase-2 */
214  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkMuon: " << handle->l1ttkmuonSize() << endl;
215  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkEle: " << handle->l1ttkeleSize() << endl;
216  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTkEm: " << handle->l1ttkemSize() << endl;
217  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFJet: " << handle->l1tpfjetSize() << endl;
218  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFTau: " << handle->l1tpftauSize() << endl;
219  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1THPSPFTau: " << handle->l1thpspftauSize() << endl;
220  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TPFTrack: " << handle->l1tpftrackSize() << endl;
221 
222  } else {
223  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Handle invalid! Check InputTag provided." << endl;
224  }
225  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
226 
227  return;
228 }
229 
Log< level::Info, true > LogVerbatim
TriggerSummaryAnalyzerRAW(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:159
const edm::InputTag inputTag_
InputTag of TriggerEventWithRefs to analyze.
int iEvent
Definition: GenABIO.cc:224
void analyze(edm::StreamID, const edm::Event &, const edm::EventSetup &) const override
tuple handle
Definition: patZpeak.py:23
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< trigger::TriggerEventWithRefs > inputToken_