rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
TriggerProjection.hh
1// -*- C++ -*-
2#ifndef RIVET_TRIGGERPROJECTION_HH
3#define RIVET_TRIGGERPROJECTION_HH
4
5#include "Rivet/Projection.hh"
6
7namespace Rivet {
8
9
19 public:
20
22 TriggerProjection() : _passed(true) {
23 setName("TriggerProjection");
24 }
25
26 virtual ~TriggerProjection() {}
27
30
32 using Projection::operator =;
33
35 bool operator()() const {
36 return _passed;
37 }
38
39
40 protected:
41
42 virtual void project(const Event&) {
43 pass();
44 }
45
47 void pass() {
48 _passed = true;
49 }
50
52 virtual CmpState compare(const Projection&) const {
53 return CmpState::EQ;
54 }
55
57 void fail() {
58 _passed = false;
59 }
60
61 protected:
62
63 bool _passed;
64
65 };
66
67
68}
69
70#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Base class for all Rivet projections.
Definition Projection.hh:29
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:148
Base class for projections returning a bool corresponding to a trigger.
Definition TriggerProjection.hh:18
virtual CmpState compare(const Projection &) const
Compare projections.
Definition TriggerProjection.hh:52
void fail()
Indicate that the event has failed the trigger.
Definition TriggerProjection.hh:57
bool operator()() const
Return true if the event has passed some trigger or selection criteria.
Definition TriggerProjection.hh:35
TriggerProjection()
The default constructor.
Definition TriggerProjection.hh:22
virtual void project(const Event &)
Definition TriggerProjection.hh:42
RIVET_DEFAULT_PROJ_CLONE(TriggerProjection)
Clone on the heap.
void pass()
Indicate that the event has passed the trigger.
Definition TriggerProjection.hh:47
Definition MC_CENT_PPB_Projections.hh:10