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