rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
GeneratedPercentileProjection.hh
1// -*- C++ -*-
2#ifndef RIVET_GENERATEDPERCENTILEPROJECTION_HH
3#define RIVET_GENERATEDPERCENTILEPROJECTION_HH
4
5#include "Rivet/Projections/SingleValueProjection.hh"
6#include "Rivet/Projections/HepMCHeavyIon.hh"
7
8namespace Rivet {
9
11 public:
12
13 using SingleValueProjection::operator=;
14
16 setName("GeneratedPercentileProjection");
17 declare(HepMCHeavyIon(), "HepMC");
18 }
19
22
24 using Projection::operator =;
25
26
27 protected:
28
29 void project(const Event& e) {
30 clear();
31 setValue(apply<HepMCHeavyIon>(e, "HepMC").centrality());
32 }
33
34 CmpState compare(const Projection&) const {
35 return CmpState::EQ;
36 }
37
38 };
39
40}
41
42#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Definition GeneratedPercentileProjection.hh:10
CmpState compare(const Projection &) const
Definition GeneratedPercentileProjection.hh:34
RIVET_DEFAULT_PROJ_CLONE(GeneratedPercentileProjection)
Clone on the heap.
void project(const Event &e)
Definition GeneratedPercentileProjection.hh:29
Definition HepMCHeavyIon.hh:12
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:175
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 single floating point value.
Definition SingleValueProjection.hh:17
void setValue(double v)
Set the value.
Definition SingleValueProjection.hh:48
void clear()
Unset the value.
Definition SingleValueProjection.hh:54
Definition MC_CENT_PPB_Projections.hh:10