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