Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/TriggerProjection.hh Source File

| Rivet 3.1.9

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