CMS 3D CMS Logo

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 
22 
23 //
24 // member functions
25 //
26 
29  desc.add<edm::InputTag>("inputTag", edm::InputTag("hltTriggerSummaryRAW"));
30  descriptions.add("triggerSummaryAnalyzerRAW", desc);
31 }
32 
33 // ------------ method called to produce the data ------------
35  using namespace std;
36  using namespace edm;
37  using namespace reco;
38  using namespace l1extra;
39  using namespace trigger;
40  using namespace l1t;
41 
42  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
43  LogVerbatim("TriggerSummaryAnalyzerRAW")
44  << "TriggerSummaryAnalyzerRAW: content of TriggerEventWithRefs: " << inputTag_.encode();
45 
47  iEvent.getByToken(inputToken_, handle);
48  if (handle.isValid()) {
49  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Used Processname: " << handle->usedProcessName() << endl;
50  const size_type nFO(handle->size());
51  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Number of TriggerFilterObjects: " << nFO << endl;
52  LogVerbatim("TriggerSummaryAnalyzerRAW") << "The TriggerFilterObjects: #, tag" << endl;
53  for (size_type iFO = 0; iFO != nFO; ++iFO) {
54  LogVerbatim("TriggerSummaryAnalyzerRAW") << iFO << " " << handle->filterTag(iFO).encode() << endl;
55  LogVerbatim("TriggerSummaryAnalyzerRAW") << " # of objects:";
56 
57  const unsigned int nPhotons(handle->photonSlice(iFO).second - handle->photonSlice(iFO).first);
58  if (nPhotons > 0)
59  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Photons: " << nPhotons;
60 
61  const unsigned int nElectrons(handle->electronSlice(iFO).second - handle->electronSlice(iFO).first);
62  if (nElectrons > 0)
63  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Electrons: " << nElectrons;
64 
65  const unsigned int nMuons(handle->muonSlice(iFO).second - handle->muonSlice(iFO).first);
66  if (nMuons > 0)
67  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Muons: " << nMuons;
68 
69  const unsigned int nJets(handle->jetSlice(iFO).second - handle->jetSlice(iFO).first);
70  if (nJets > 0)
71  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Jets: " << nJets;
72 
73  const unsigned int nComposites(handle->compositeSlice(iFO).second - handle->compositeSlice(iFO).first);
74  if (nComposites > 0)
75  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Composites: " << nComposites;
76 
77  const unsigned int nBaseMETs(handle->basemetSlice(iFO).second - handle->basemetSlice(iFO).first);
78  if (nBaseMETs > 0)
79  LogVerbatim("TriggerSummaryAnalyzerRAW") << " BaseMETs: " << nBaseMETs;
80 
81  const unsigned int nCaloMETs(handle->calometSlice(iFO).second - handle->calometSlice(iFO).first);
82  if (nCaloMETs > 0)
83  LogVerbatim("TriggerSummaryAnalyzerRAW") << " CaloMETs: " << nCaloMETs;
84 
85  const unsigned int nPixTracks(handle->pixtrackSlice(iFO).second - handle->pixtrackSlice(iFO).first);
86  if (nPixTracks > 0)
87  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PixTracks: " << nPixTracks;
88 
89  const unsigned int nL1EM(handle->l1emSlice(iFO).second - handle->l1emSlice(iFO).first);
90  if (nL1EM > 0)
91  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EM: " << nL1EM;
92 
93  const unsigned int nL1Muon(handle->l1muonSlice(iFO).second - handle->l1muonSlice(iFO).first);
94  if (nL1Muon > 0)
95  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Muon: " << nL1Muon;
96 
97  const unsigned int nL1Jet(handle->l1jetSlice(iFO).second - handle->l1jetSlice(iFO).first);
98  if (nL1Jet > 0)
99  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Jet: " << nL1Jet;
100 
101  const unsigned int nL1EtMiss(handle->l1etmissSlice(iFO).second - handle->l1etmissSlice(iFO).first);
102  if (nL1EtMiss > 0)
103  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EtMiss: " << nL1EtMiss;
104 
105  const unsigned int nL1HfRings(handle->l1hfringsSlice(iFO).second - handle->l1hfringsSlice(iFO).first);
106  if (nL1HfRings > 0)
107  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1HfRings: " << nL1HfRings;
108 
109  const unsigned int nPFJets(handle->pfjetSlice(iFO).second - handle->pfjetSlice(iFO).first);
110  if (nPFJets > 0)
111  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFJets: " << nPFJets;
112 
113  const unsigned int nPFTaus(handle->pftauSlice(iFO).second - handle->pftauSlice(iFO).first);
114  if (nPFTaus > 0)
115  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFTaus: " << nPFTaus;
116 
117  const unsigned int nPFMETs(handle->pfmetSlice(iFO).second - handle->pfmetSlice(iFO).first);
118  if (nPFMETs > 0)
119  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFMETs: " << nPFMETs;
120 
121  const unsigned int nL1TMuon(handle->l1tmuonSlice(iFO).second - handle->l1tmuonSlice(iFO).first);
122  if (nL1TMuon > 0)
123  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TMuon: " << nL1TMuon;
124 
125  const unsigned int nL1TEGamma(handle->l1tegammaSlice(iFO).second - handle->l1tegammaSlice(iFO).first);
126  if (nL1TEGamma > 0)
127  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEGamma: " << nL1TEGamma;
128 
129  const unsigned int nL1TJet(handle->l1tjetSlice(iFO).second - handle->l1tjetSlice(iFO).first);
130  if (nL1TJet > 0)
131  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TJet: " << nL1TJet;
132 
133  const unsigned int nL1TTau(handle->l1ttauSlice(iFO).second - handle->l1ttauSlice(iFO).first);
134  if (nL1TTau > 0)
135  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTau: " << nL1TTau;
136 
137  const unsigned int nL1TEtSum(handle->l1tetsumSlice(iFO).second - handle->l1tetsumSlice(iFO).first);
138  if (nL1TEtSum > 0)
139  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEtSum: " << nL1TEtSum;
140 
141  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
142  }
143  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Elements in linearised collections of Refs: " << endl;
144  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Photons: " << handle->photonSize() << endl;
145  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Electrons: " << handle->electronSize() << endl;
146  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Muons: " << handle->muonSize() << endl;
147  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Jets: " << handle->jetSize() << endl;
148  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Composites: " << handle->compositeSize() << endl;
149  LogVerbatim("TriggerSummaryAnalyzerRAW") << " BaseMETs: " << handle->basemetSize() << endl;
150  LogVerbatim("TriggerSummaryAnalyzerRAW") << " CaloMETs: " << handle->calometSize() << endl;
151  LogVerbatim("TriggerSummaryAnalyzerRAW") << " Pixtracks: " << handle->pixtrackSize() << endl;
152  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EM: " << handle->l1emSize() << endl;
153  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Muon: " << handle->l1muonSize() << endl;
154  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1Jet: " << handle->l1jetSize() << endl;
155  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1EtMiss: " << handle->l1etmissSize() << endl;
156  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1HfRings: " << handle->l1hfringsSize() << endl;
157  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFJets: " << handle->pfjetSize() << endl;
158  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFTaus: " << handle->pftauSize() << endl;
159  LogVerbatim("TriggerSummaryAnalyzerRAW") << " PFMETs: " << handle->pfmetSize() << endl;
160  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TMuon: " << handle->l1tmuonSize() << endl;
161  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEGamma: " << handle->l1tegammaSize() << endl;
162  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TJet: " << handle->l1tjetSize() << endl;
163  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TTau: " << handle->l1ttauSize() << endl;
164  LogVerbatim("TriggerSummaryAnalyzerRAW") << " L1TEtSum: " << handle->l1tetsumSize() << endl;
165  } else {
166  LogVerbatim("TriggerSummaryAnalyzerRAW") << "Handle invalid! Check InputTag provided." << endl;
167  }
168  LogVerbatim("TriggerSummaryAnalyzerRAW") << endl;
169 
170  return;
171 }
std::pair< size_type, size_type > l1jetSlice(size_type filter) const
TriggerSummaryAnalyzerRAW(const edm::ParameterSet &)
std::pair< size_type, size_type > l1ttauSlice(size_type filter) const
std::pair< size_type, size_type > l1muonSlice(size_type filter) const
std::pair< size_type, size_type > l1tegammaSlice(size_type filter) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::pair< size_type, size_type > l1etmissSlice(size_type filter) const
std::pair< size_type, size_type > jetSlice(size_type filter) const
const std::string & usedProcessName() const
getters - for user access
void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::InputTag filterTag(size_type filterIndex) const
tag from index
delete x;
Definition: CaloConfig.h:22
~TriggerSummaryAnalyzerRAW() override
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:159
std::pair< size_type, size_type > electronSlice(size_type filter) const
const edm::InputTag inputTag_
InputTag of TriggerEventWithRefs to analyze.
std::pair< size_type, size_type > pixtrackSlice(size_type filter) const
std::pair< size_type, size_type > l1tmuonSlice(size_type filter) const
int iEvent
Definition: GenABIO.cc:224
std::pair< size_type, size_type > l1emSlice(size_type filter) const
std::pair< size_type, size_type > photonSlice(size_type filter) const
slices of objects for a specific filter: [begin,end[
size_type photonSize() const
low-level getters for data members
std::pair< size_type, size_type > muonSlice(size_type filter) const
std::pair< size_type, size_type > l1tjetSlice(size_type filter) const
std::pair< size_type, size_type > l1tetsumSlice(size_type filter) const
std::pair< size_type, size_type > compositeSlice(size_type filter) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:70
std::pair< size_type, size_type > basemetSlice(size_type filter) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
size_type size() const
number of filters
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::pair< size_type, size_type > calometSlice(size_type filter) const
fixed size matrix
HLT enums.
std::pair< size_type, size_type > pfjetSlice(size_type filter) const
std::pair< size_type, size_type > l1hfringsSlice(size_type filter) const
std::pair< size_type, size_type > pftauSlice(size_type filter) const
std::pair< size_type, size_type > pfmetSlice(size_type filter) const
const edm::EDGetTokenT< trigger::TriggerEventWithRefs > inputToken_