CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerSummaryAnalyzerAOD.cc
Go to the documentation of this file.
1 
14 
15 //
16 // constructors and destructor
17 //
19  inputTag_(ps.getParameter<edm::InputTag>("inputTag"))
20 { }
21 
23 {
24 }
25 
26 //
27 // member functions
28 //
29 
30 // ------------ method called to produce the data ------------
31 void
33 {
34  using namespace std;
35  using namespace edm;
36  using namespace reco;
37  using namespace trigger;
38 
39 
40  cout << endl;
41  cout << "TriggerSummaryAnalyzerAOD: content of TriggerEvent: " << inputTag_.encode() << endl;
42 
44  iEvent.getByLabel(inputTag_,handle);
45  if (handle.isValid()) {
46  cout << "Used Processname: " << handle->usedProcessName() << endl;
47  const size_type nC(handle->sizeCollections());
48  cout << "Number of packed Collections: " << nC << endl;
49  cout << "The Collections: #, tag, 1-past-end index" << endl;
50  for (size_type iC=0; iC!=nC; ++iC) {
51  cout << iC << " "
52  << handle->collectionTag(iC).encode() << " "
53  << handle->collectionKey(iC) << endl;
54  }
55  const size_type nO(handle->sizeObjects());
56  cout << "Number of TriggerObjects: " << nO << endl;
57  cout << "The TriggerObjects: #, id, pt, eta, phi, mass" << endl;
58  const TriggerObjectCollection& TOC(handle->getObjects());
59  for (size_type iO=0; iO!=nO; ++iO) {
60  const TriggerObject& TO(TOC[iO]);
61  cout << iO << " " << TO.id() << " " << TO.pt() << " " << TO.eta() << " " << TO.phi() << " " << TO.mass() << endl;
62  }
63  const size_type nF(handle->sizeFilters());
64  cout << "Number of TriggerFilters: " << nF << endl;
65  cout << "The Filters: #, tag, #ids/#keys, the id/key pairs" << endl;
66  for (size_type iF=0; iF!=nF; ++iF) {
67  const Vids& VIDS (handle->filterIds(iF));
68  const Keys& KEYS(handle->filterKeys(iF));
69  const size_type nI(VIDS.size());
70  const size_type nK(KEYS.size());
71  cout << iF << " " << handle->filterTag(iF).encode()
72  << " " << nI << "/" << nK
73  << " the pairs: ";
74  const size_type n(max(nI,nK));
75  for (size_type i=0; i!=n; ++i) {
76  cout << " " << VIDS[i] << "/" << KEYS[i];
77  }
78  cout << endl;
79  assert (nI==nK);
80  }
81  } else {
82  cout << "Handle invalid! Check InputTag provided." << endl;
83  }
84  cout << endl;
85 
86  return;
87 }
int i
Definition: DBlmapReader.cc:9
TriggerSummaryAnalyzerAOD(const edm::ParameterSet &)
int id() const
getters
Definition: TriggerObject.h:57
float phi() const
Definition: TriggerObject.h:60
float eta() const
Definition: TriggerObject.h:59
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:72
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
int iEvent
Definition: GenABIO.cc:243
const T & max(const T &a, const T &b)
tuple handle
Definition: patZpeak.py:22
edm::InputTag inputTag_
InputTag of TriggerEvent to analyze.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< size_type > Keys
tuple cout
Definition: gather_cfg.py:121
float mass() const
Definition: TriggerObject.h:61
std::vector< int > Vids