CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 {
35  hlTriggerResults_ = iConfig.getParameter<edm::InputTag> ("HLTriggerResults");
36  init_ = false;
37 }
38 
40 {
41 }
43 {
44 
45 
46  int ievt = iEvent.id().event();
47  int irun = iEvent.id().run();
48  int ils = iEvent.luminosityBlock();
49  int bx = iEvent.bunchCrossing();
50 //
51 // trigger type
52 //
53  int trigger_type=-1;
54  if (iEvent.isRealData()) trigger_type = iEvent.experimentType();
55 
56 
57  //hlt info
59  iEvent.getByLabel(hlTriggerResults_,HLTR);
60 
61 
62  if(HLTR.isValid() == false) {
63  std::cout<< " HLTInspect Error - Could not access Results with name "<<hlTriggerResults_<<std::endl;
64  }
65  if(HLTR.isValid())
66  {
67  if (!init_) {
68  init_=true;
69  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*HLTR);
70  hlNames_=triggerNames.triggerNames();
71  }
72  std::cout << "HLTInspect: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Type "<<trigger_type<< " Acc: " ;
73  const unsigned int n(hlNames_.size());
74  for (unsigned int i=0; i!=n; ++i)
75  {
76  if (HLTR->accept(i))
77  {
78  std::cout << hlNames_[i] << ",";
79  }
80  }
81  std::cout << std::endl;
82  }
83 
84 
85 }
86 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:204
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
DEFINE_FWK_MODULE(HiMixingModule)
bool isRealData() const
Definition: EventBase.h:60
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
int iEvent
Definition: GenABIO.cc:230
virtual void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: HLTInspect.cc:42
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
HLTInspect(const edm::ParameterSet &)
Definition: HLTInspect.cc:33
string bx
Definition: rpc-layouts.py:13
edm::EventID id() const
Definition: EventBase.h:56
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:61
tuple cout
Definition: gather_cfg.py:121