Rivet  3.1.2
TriggerProjection.hh
1 // -*- C++ -*-
2 #ifndef RIVET_TRIGGERPROJECTION_HH
3 #define RIVET_TRIGGERPROJECTION_HH
4 
5 #include "Rivet/Projection.hh"
6 
7 namespace Rivet {
8 
20 
21 public:
22 
24  TriggerProjection() : _passed(true) {
25  setName("TriggerProjection");
26  }
27  virtual ~TriggerProjection() {}
28 
31 
34  bool operator()() const {
35  return _passed;
36  }
37 
38 protected:
39 
40  virtual void project(const Event& e) {
41  pass();
42  }
43 
45  void pass() {
46  _passed = true;
47  }
48 
50  virtual CmpState compare(const Projection&) const {
51  return CmpState::EQ;
52  }
53 
55  void fail() {
56  _passed = false;
57  }
58 
59 private:
60 
61  bool _passed;
62 
63 };
64 
65 }
66 
67 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:142
Definition: MC_Cent_pPb.hh:10
virtual void project(const Event &e)
Definition: TriggerProjection.hh:40
bool operator()() const
Definition: TriggerProjection.hh:34
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
Base class for projections returning a bool corresponding to a trigger.
Definition: TriggerProjection.hh:19
void fail()
Indicate that the event has failed the trigger.
Definition: TriggerProjection.hh:55
TriggerProjection()
The default constructor.
Definition: TriggerProjection.hh:24
DEFAULT_RIVET_PROJ_CLONE(TriggerProjection)
Clone on the heap.
Base class for all Rivet projections.
Definition: Projection.hh:29
virtual CmpState compare(const Projection &) const
Compare projections.
Definition: TriggerProjection.hh:50
void pass()
Indicate that the event has passed the trigger.
Definition: TriggerProjection.hh:45