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 
13 
14 //
15 // constructors and destructor
16 //
18  inputTag_(ps.getParameter<edm::InputTag>("inputTag")),
19  inputToken_(consumes<trigger::TriggerEvent>(inputTag_))
20 { }
21 
23 {
24 }
25 
26 //
27 // member functions
28 //
29 
32  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltTriggerSummaryAOD"));
33  descriptions.add("triggerSummaryAnalyzerAOD", 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 trigger;
44 
45 
46  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
47  LogVerbatim("TriggerSummaryAnalyzerAOD") << "TriggerSummaryAnalyzerAOD: content of TriggerEvent: " << inputTag_.encode() << endl;
48 
51  if (handle.isValid()) {
52  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Used Processname: " << handle->usedProcessName() << endl;
53  const size_type nC(handle->sizeCollections());
54  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of packed Collections: " << nC << endl;
55  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The Collections: #, tag, 1-past-end index" << endl;
56  for (size_type iC=0; iC!=nC; ++iC) {
57  LogVerbatim("TriggerSummaryAnalyzerAOD") << iC << " "
58  << handle->collectionTag(iC).encode() << " "
59  << handle->collectionKey(iC) << endl;
60  }
61  const size_type nO(handle->sizeObjects());
62  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of TriggerObjects: " << nO << endl;
63  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The TriggerObjects: #, id, pt, eta, phi, mass" << endl;
64  const TriggerObjectCollection& TOC(handle->getObjects());
65  for (size_type iO=0; iO!=nO; ++iO) {
66  const TriggerObject& TO(TOC[iO]);
67  LogVerbatim("TriggerSummaryAnalyzerAOD") << iO << " " << TO.id() << " " << TO.pt() << " " << TO.eta() << " " << TO.phi() << " " << TO.mass() << endl;
68  }
69  const size_type nF(handle->sizeFilters());
70  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of TriggerFilters: " << nF << endl;
71  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The Filters: #, tag, #ids/#keys, the id/key pairs" << endl;
72  for (size_type iF=0; iF!=nF; ++iF) {
73  const Vids& VIDS (handle->filterIds(iF));
74  const Keys& KEYS(handle->filterKeys(iF));
75  const size_type nI(VIDS.size());
76  const size_type nK(KEYS.size());
77  LogVerbatim("TriggerSummaryAnalyzerAOD") << iF << " " << handle->filterTag(iF).encode()
78  << " " << nI << "/" << nK
79  << " the pairs: ";
80  const size_type n(max(nI,nK));
81  for (size_type i=0; i!=n; ++i) {
82  LogVerbatim("TriggerSummaryAnalyzerAOD") << " " << VIDS[i] << "/" << KEYS[i];
83  }
84  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
85  assert (nI==nK);
86  }
87  } else {
88  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Handle invalid! Check InputTag provided." << endl;
89  }
90  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
91 
92  return;
93 }
int i
Definition: DBlmapReader.cc:9
TriggerSummaryAnalyzerAOD(const edm::ParameterSet &)
int id() const
getters
Definition: TriggerObject.h:55
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
float phi() const
Definition: TriggerObject.h:58
const edm::EDGetTokenT< trigger::TriggerEvent > inputToken_
assert(m_qm.get())
float eta() const
Definition: TriggerObject.h:57
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
uint16_t size_type
std::string encode() const
Definition: InputTag.cc:164
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
int iEvent
Definition: GenABIO.cc:230
const edm::InputTag inputTag_
InputTag of TriggerEvent to analyze.
tuple handle
Definition: patZpeak.py:22
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
float mass() const
Definition: TriggerObject.h:59
std::vector< int > Vids