2#ifndef RIVET_CENTRALITYPROJECTION_HH
3#define RIVET_CENTRALITYPROJECTION_HH
5#include "Rivet/Projections/PercentileProjection.hh"
6#include "Rivet/Tools/RivetYODA.hh"
42 _projNames.push_back(pname);
49 for (
string pname : _projNames )
50 _values.push_back(apply<SingleValueProjection>(e, pname)());
51 if ( !_values.empty() )
set(_values[0]);
56 return _projNames.empty();
69 if (other->_projNames.size() == 0)
return CmpState::NEQ;
73 for (
string pname : _projNames) {
76 for (
string p2name : other->_projNames){
77 if (pname != p2name) hasPname =
false;
79 if (!hasPname)
return CmpState::NEQ;
82 if (proj.compare(oth) != CmpState::EQ)
return CmpState::NEQ;
95 vector<string> _projNames;
98 vector<double> _values;
Used together with the percentile-based analysis objects Percentile and PercentileXaxis.
Definition: CentralityProjection.hh:26
CentralityProjection()
Default constructor.
Definition: CentralityProjection.hh:30
CmpState compare(const Projection &p) const
Definition: CentralityProjection.hh:67
vector< string > projections() const
The list of names of the internal projections.
Definition: CentralityProjection.hh:88
double operator[](int i) const
Definition: CentralityProjection.hh:62
bool empty() const
Cheek if no internal projections have been added.
Definition: CentralityProjection.hh:55
void project(const Event &e)
Perform all internal projections.
Definition: CentralityProjection.hh:47
void add(const SingleValueProjection &p, string pname)
Add a new centrality estimate.
Definition: CentralityProjection.hh:41
Representation of a HepMC event, and enabler of Projection caching.
Definition: Event.hh:22
const PROJ & getProjection(const std::string &name) const
Definition: ProjectionApplier.hh:56
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
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:142
Base class for projections returning a single floating point value.
Definition: SingleValueProjection.hh:17
void set(double v)
Definition: SingleValueProjection.hh:51
double p(const ParticleBase &p)
Unbound function access to p.
Definition: ParticleBaseUtils.hh:653
Definition: MC_Cent_pPb.hh:10