CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
const edm::EventSetup & c
~HLTInspect() override
Definition: HLTInspect.cc:38
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
bool isRealData() const
Definition: EventBase.h:62
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTInspect(const edm::ParameterSet &)
Definition: HLTInspect.cc:33
edm::EventID id() const
Definition: EventBase.h:59
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:63
tuple cout
Definition: gather_cfg.py:144