CMS 3D CMS Logo

TriggerSummaryAnalyzerAOD.cc
Go to the documentation of this file.
1 
17 
18 //
19 // class declaration
20 //
22 public:
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26  void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override;
27 
28 private:
32 };
33 
34 //
35 // constructors and destructor
36 //
38  : inputTag_(ps.getParameter<edm::InputTag>("inputTag")), inputToken_(consumes<trigger::TriggerEvent>(inputTag_)) {}
39 
40 //
41 // member functions
42 //
43 
46  desc.add<edm::InputTag>("inputTag", edm::InputTag("hltTriggerSummaryAOD"));
47  descriptions.add("triggerSummaryAnalyzerAOD", desc);
48 }
49 
50 // ------------ method called to produce the data ------------
52  using namespace std;
53  using namespace edm;
54  using namespace reco;
55  using namespace trigger;
56 
57  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
58  LogVerbatim("TriggerSummaryAnalyzerAOD")
59  << "TriggerSummaryAnalyzerAOD: content of TriggerEvent: " << inputTag_.encode() << endl;
60 
62  iEvent.getByToken(inputToken_, handle);
63  if (handle.isValid()) {
64  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Used Processname: " << handle->usedProcessName() << endl;
65  const size_type nC(handle->sizeCollections());
66  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of packed Collections: " << nC << endl;
67  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The Collections: #, tag, 1-past-end index" << endl;
68  for (size_type iC = 0; iC != nC; ++iC) {
69  LogVerbatim("TriggerSummaryAnalyzerAOD")
70  << iC << " " << handle->collectionTag(iC).encode() << " " << handle->collectionKey(iC) << endl;
71  }
72  const size_type nO(handle->sizeObjects());
73  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of TriggerObjects: " << nO << endl;
74  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The TriggerObjects: #, id, pt, eta, phi, mass" << endl;
75  const TriggerObjectCollection& TOC(handle->getObjects());
76  for (size_type iO = 0; iO != nO; ++iO) {
77  const TriggerObject& TO(TOC[iO]);
78  LogVerbatim("TriggerSummaryAnalyzerAOD")
79  << iO << " " << TO.id() << " " << TO.pt() << " " << TO.eta() << " " << TO.phi() << " " << TO.mass() << endl;
80  }
81  const size_type nF(handle->sizeFilters());
82  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Number of TriggerFilters: " << nF << endl;
83  LogVerbatim("TriggerSummaryAnalyzerAOD") << "The Filters: #, tag, #ids/#keys, the id/key pairs" << endl;
84  for (size_type iF = 0; iF != nF; ++iF) {
85  const Vids& VIDS(handle->filterIds(iF));
86  const Keys& KEYS(handle->filterKeys(iF));
87  const size_type nI(VIDS.size());
88  const size_type nK(KEYS.size());
89  LogVerbatim("TriggerSummaryAnalyzerAOD")
90  << iF << " " << handle->filterTag(iF).encode() << " " << nI << "/" << nK << " the pairs: ";
91  const size_type n(max(nI, nK));
92  for (size_type i = 0; i != n; ++i) {
93  LogVerbatim("TriggerSummaryAnalyzerAOD") << " " << VIDS[i] << "/" << KEYS[i];
94  }
95  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
96  assert(nI == nK);
97  }
98  } else {
99  LogVerbatim("TriggerSummaryAnalyzerAOD") << "Handle invalid! Check InputTag provided." << endl;
100  }
101  LogVerbatim("TriggerSummaryAnalyzerAOD") << endl;
102 
103  return;
104 }
105 
ConfigurationDescriptions.h
trigger::TriggerObject::phi
float phi() const
Definition: TriggerObject.h:54
TriggerObject
Definition: TriggerObject.py:1
edm::StreamID
Definition: StreamID.h:30
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
trigger::Vids
std::vector< int > Vids
Definition: TriggerTypeDefs.h:21
patZpeak.handle
handle
Definition: patZpeak.py:23
TriggerEvent.h
edm::EDGetTokenT< trigger::TriggerEvent >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
TriggerSummaryAnalyzerAOD::TriggerSummaryAnalyzerAOD
TriggerSummaryAnalyzerAOD(const edm::ParameterSet &)
Definition: TriggerSummaryAnalyzerAOD.cc:37
TriggerSummaryAnalyzerAOD::inputTag_
const edm::InputTag inputTag_
InputTag of TriggerEvent to analyze.
Definition: TriggerSummaryAnalyzerAOD.cc:30
TriggerSummaryAnalyzerAOD::inputToken_
const edm::EDGetTokenT< trigger::TriggerEvent > inputToken_
Definition: TriggerSummaryAnalyzerAOD.cc:31
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TriggerSummaryAnalyzerAOD::analyze
void analyze(edm::StreamID, const edm::Event &, const edm::EventSetup &) const override
Definition: TriggerSummaryAnalyzerAOD.cc:51
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
trigger::TriggerObject::pt
float pt() const
Definition: TriggerObject.h:52
TriggerSummaryAnalyzerAOD::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TriggerSummaryAnalyzerAOD.cc:44
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
trigger::TriggerObject::id
int id() const
getters
Definition: TriggerObject.h:51
iEvent
int iEvent
Definition: GenABIO.cc:224
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
trigger::TriggerObject::eta
float eta() const
Definition: TriggerObject.h:53
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
edm::EventSetup
Definition: EventSetup.h:58
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
TriggerSummaryAnalyzerAOD
Definition: TriggerSummaryAnalyzerAOD.cc:21
trigger
Definition: HLTPrescaleTableCond.h:8
ParameterSet.h
edm::Event
Definition: Event.h:73
EDAnalyzer.h
trigger::TriggerObject::mass
float mass() const
Definition: TriggerObject.h:55
edm::InputTag
Definition: InputTag.h:15
edm::global::EDAnalyzer
Definition: EDAnalyzer.h:32
ZCounting_cff.TriggerEvent
TriggerEvent
Definition: ZCounting_cff.py:5