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