CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTPhysicsDeclared.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTPhysicsDeclared
4 // Class: HLTPhysicsDeclared
5 //
6 // Original Author: Luca Malgeri
7 // Adapted for HLT by: Andrea Bocci
8 
9 // user include files
15 //
16 // class declaration
17 //
18 
20 public:
21  explicit HLTPhysicsDeclared( const edm::ParameterSet & );
23 
24 private:
25  virtual bool filter( edm::Event &, const edm::EventSetup & );
26 
27  bool m_invert;
29 
30 };
31 
32 // system include files
33 #include <memory>
34 
35 // user include files
39 
40 using namespace edm;
41 
43  m_invert( config.getParameter<bool>("invert") ),
44  m_gtDigis( config.getParameter<edm::InputTag>("L1GtReadoutRecordTag") )
45 {
46 }
47 
49 {
50 }
51 
53 {
54  bool accept = false;
55 
56  if (event.isRealData()) {
57  // for real data, access the "physics enabled" bit in the L1 GT data
59  if (not event.getByLabel(m_gtDigis, h_gtDigis)) {
60  edm::LogWarning(h_gtDigis.whyFailed()->category()) << h_gtDigis.whyFailed()->what();
61  // not enough informations to make a decision - reject the event
62  return false;
63  } else {
64  L1GtFdlWord fdlWord = h_gtDigis->gtFdlWord();
65  if (fdlWord.physicsDeclared() == 1)
66  accept = true;
67  }
68  } else {
69  // for MC, assume the "physics enabled" bit to be always set
70  accept = true;
71  }
72 
73  // if requested, invert the filter decision
74  if (m_invert)
75  accept = not accept;
76 
77  return accept;
78 }
79 
80 // define this as a framework plug-in
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
bool isRealData() const
Definition: EventBase.h:60
HLTPhysicsDeclared(const edm::ParameterSet &)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
boost::shared_ptr< cms::Exception > whyFailed() const
Definition: HandleBase.h:90
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:229
virtual bool filter(edm::Event &, const edm::EventSetup &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")