Rivet API documentation

Rivet 4.1.3
UserCentEstimate.hh
1// -*- C++ -*-
2#ifndef RIVET_USERCENTESTIMATE_HH
3#define RIVET_USERCENTESTIMATE_HH
4
5#include "Rivet/Projections/SingleValueProjection.hh"
6#include "Rivet/Projections/HepMCHeavyIon.hh"
7
8namespace Rivet {
9
10
11 class UserCentEstimate: public SingleValueProjection {
12 public:
13
14 using SingleValueProjection::operator=;
15
16 UserCentEstimate() {
17 setName("UserCentEstimate");
18 declare(HepMCHeavyIon(), "HepMC");
19 }
20
22 RIVET_DEFAULT_PROJ_CLONE(UserCentEstimate);
23
25 using Projection::operator =;
26
27
28 protected:
29
30 void project(const Event& e) {
31 clear();
32 setValue(apply<HepMCHeavyIon>(e, "HepMC").user_cent_estimate());
33 }
34
35 CmpState compare(const Projection&) const {
36 return CmpState::EQ;
37 }
38
39 };
40
41
42}
43
44#endif
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Definition HepMCHeavyIon.hh:12
std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(const Event &evt, const Projection &proj) const
Apply the supplied projection on event evt.
Definition ProjectionApplier.hh:119
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version).
Definition ProjectionApplier.hh:184
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
void setValue(double v)
Set the value.
Definition SingleValueProjection.hh:48
SingleValueProjection()
The default constructor.
Definition SingleValueProjection.hh:21
void clear()
Unset the value.
Definition SingleValueProjection.hh:54
void project(const Event &e)
Definition UserCentEstimate.hh:30
RIVET_DEFAULT_PROJ_CLONE(UserCentEstimate)
Clone on the heap.
CmpState compare(const Projection &) const
Definition UserCentEstimate.hh:35
Definition MC_CENT_PPB_Projections.hh:10