CMS 3D CMS Logo

PhysDecl.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  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter", true);
35  debugOn = iConfig.getUntrackedParameter<bool>("debugOn", false);
36  hlTriggerResults_ = consumes<TriggerResults>(iConfig.getParameter<edm::InputTag>("HLTriggerResults"));
37  gtDigis_ = consumes<L1GlobalTriggerReadoutRecord>(
38  iConfig.getUntrackedParameter<edm::InputTag>("gtDigis", edm::InputTag("gtDigis")));
39  init_ = false;
40 }
41 
43 
45  bool accepted = false;
46 
47  int ievt = iEvent.id().event();
48  int irun = iEvent.id().run();
49  int ils = iEvent.luminosityBlock();
50  int bx = iEvent.bunchCrossing();
51 
52  //hlt info
54  iEvent.getByToken(hlTriggerResults_, HLTR);
55 
56  if (HLTR.isValid()) {
57  if (!init_) {
58  init_ = true;
59  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*HLTR);
60  hlNames_ = triggerNames.triggerNames();
61  }
62  if (debugOn) {
63  std::cout << "HLT_debug: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Acc: ";
64  const unsigned int n(hlNames_.size());
65  for (unsigned int i = 0; i != n; ++i) {
66  if (HLTR->accept(i)) {
67  std::cout << hlNames_[i] << ",";
68  }
69  }
70  std::cout << std::endl;
71  }
72  }
73 
74  // trigger info
75 
77  iEvent.getByToken(gtDigis_, gtrr_handle);
78  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
79 
80  L1GtFdlWord fdlWord = gtrr->gtFdlWord();
81  // std::cout << "phys decl. bit=" << fdlWord.physicsDeclared() << std::endl;
82  if (fdlWord.physicsDeclared() == 1)
83  accepted = true;
84 
85  if (debugOn) {
86  std::cout << "PhysDecl_debug: Run " << irun << " Event " << ievt << " Lumi Block " << ils << " Bunch Crossing "
87  << bx << " Accepted " << accepted << std::endl;
88  }
89 
90  if (applyfilter)
91  return accepted;
92  else
93  return true;
94 }
95 
96 //define this as a plug-in
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
PhysDecl::PhysDecl
PhysDecl(const edm::ParameterSet &)
Definition: PhysDecl.cc:33
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ESHandle.h
TriggerResults.h
L1GtFdlWord::physicsDeclared
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
PhysDecl.h
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
EDFilter.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
PhysDecl
Definition: PhysDecl.h:34
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GOODCOLL_filter_cfg.debugOn
debugOn
Definition: GOODCOLL_filter_cfg.py:72
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
L1GtFdlWord.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
L1GtFdlWord
Definition: L1GtFdlWord.h:29
TriggerNames.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
bsc_activity_cfg.applyfilter
applyfilter
Definition: bsc_activity_cfg.py:23
std
Definition: JetResolutionObject.h:76
PhysDecl::filter
bool filter(edm::Event &, const edm::EventSetup &) override
Definition: PhysDecl.cc:44
PhysDecl::~PhysDecl
~PhysDecl() override
Definition: PhysDecl.cc:42
Frameworkfwd.h
edm::TriggerNames
Definition: TriggerNames.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
L1GlobalTriggerReadoutRecord::gtFdlWord
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
Definition: L1GlobalTriggerReadoutRecord.cc:372
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h