CMS 3D CMS Logo

HLTInspect.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: BeamSplash
4 // Class: BeamSPlash
5 //
6 //
7 // Original Author: Luca Malgeri
8 
9 #include <memory>
10 #include <vector>
11 #include <map>
12 #include <set>
13 
14 // user include files
16 
29 
30 using namespace edm;
31 using namespace std;
32 
34  hlTriggerResults_ = iConfig.getParameter<edm::InputTag>("HLTriggerResults");
35  init_ = false;
36 }
37 
40  int ievt = iEvent.id().event();
41  int irun = iEvent.id().run();
42  int ils = iEvent.luminosityBlock();
43  int bx = iEvent.bunchCrossing();
44  //
45  // trigger type
46  //
47  int trigger_type = -1;
48  if (iEvent.isRealData())
49  trigger_type = iEvent.experimentType();
50 
51  //hlt info
53  iEvent.getByLabel(hlTriggerResults_, HLTR);
54 
55  if (HLTR.isValid() == false) {
56  std::cout << " HLTInspect Error - Could not access Results with name " << hlTriggerResults_ << std::endl;
57  }
58  if (HLTR.isValid()) {
59  if (!init_) {
60  init_ = true;
61  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*HLTR);
62  hlNames_ = triggerNames.triggerNames();
63  }
64  std::cout << "HLTInspect: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Type "
65  << trigger_type << " Acc: ";
66  const unsigned int n(hlNames_.size());
67  for (unsigned int i = 0; i != n; ++i) {
68  if (HLTR->accept(i)) {
69  std::cout << hlNames_[i] << ",";
70  }
71  }
72  std::cout << std::endl;
73  }
74 }
75 //define this as a plug-in
bool accept() const
Has at least one path accepted the event?
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
~HLTInspect() override
Definition: HLTInspect.cc:38
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int iEvent
Definition: GenABIO.cc:224
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: HLTInspect.cc:39
bool isValid() const
Definition: HandleBase.h:70
HLTInspect(const edm::ParameterSet &)
Definition: HLTInspect.cc:33
HLT enums.