rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
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 int compare(const Projection&) const {
51  return 0;
52  }
53 
55  void fail() {
56  _passed = false;
57  }
58 
59 private:
60 
61  bool _passed;
62 
63 };
64 
65 }
66 
67 #endif
68 
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
virtual void project(const Event &e)
Definition: TriggerProjection.hh:40
bool operator()() const
Definition: TriggerProjection.hh:34
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
virtual int compare(const Projection &) const
Compare projections.
Definition: TriggerProjection.hh:50
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
void pass()
Indicate that the event has passed the trigger.
Definition: TriggerProjection.hh:45