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 
28 
29 using namespace edm;
30 using namespace std;
31 
33  hlTriggerResults_ = iConfig.getParameter<edm::InputTag>("HLTriggerResults");
34  init_ = false;
35 }
36 
39  int ievt = iEvent.id().event();
40  int irun = iEvent.id().run();
41  int ils = iEvent.luminosityBlock();
42  int bx = iEvent.bunchCrossing();
43  //
44  // trigger type
45  //
46  int trigger_type = -1;
47  if (iEvent.isRealData())
48  trigger_type = iEvent.experimentType();
49 
50  //hlt info
52  iEvent.getByLabel(hlTriggerResults_, HLTR);
53 
54  if (HLTR.isValid() == false) {
55  std::cout << " HLTInspect Error - Could not access Results with name " << hlTriggerResults_ << std::endl;
56  }
57  if (HLTR.isValid()) {
58  if (!init_) {
59  init_ = true;
60  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*HLTR);
61  hlNames_ = triggerNames.triggerNames();
62  }
63  std::cout << "HLTInspect: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Type "
64  << trigger_type << " Acc: ";
65  const unsigned int n(hlNames_.size());
66  for (unsigned int i = 0; i != n; ++i) {
67  if (HLTR->accept(i)) {
68  std::cout << hlNames_[i] << ",";
69  }
70  }
71  std::cout << std::endl;
72  }
73 }
74 //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:37
int iEvent
Definition: GenABIO.cc:224
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: HLTInspect.cc:38
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool isValid() const
Definition: HandleBase.h:70
HLTInspect(const edm::ParameterSet &)
Definition: HLTInspect.cc:32
HLT enums.