2#ifndef RIVET_CENTRALITYPROJECTION_HH
3#define RIVET_CENTRALITYPROJECTION_HH
5#include "Rivet/Projections/PercentileProjection.hh"
6#include "Rivet/Tools/RivetYODA.hh"
38 using Projection::operator =;
47 _projNames.push_back(pname);
54 for (
string pname : _projNames )
55 _values.push_back(apply<SingleValueProjection>(e, pname)());
56 if ( !_values.empty() )
set(_values[0]);
61 return _projNames.empty();
74 if (other->_projNames.size() == 0)
return CmpState::NEQ;
78 for (
string pname : _projNames) {
81 for (
string p2name : other->_projNames){
82 if (pname != p2name) hasPname =
false;
84 if (!hasPname)
return CmpState::NEQ;
87 if (proj.compare(oth) != CmpState::EQ)
return CmpState::NEQ;
101 vector<string> _projNames;
104 vector<double> _values;
Used together with the percentile-based analysis objects Percentile and PercentileXaxis.
Definition CentralityProjection.hh:27
CentralityProjection()
Default constructor.
Definition CentralityProjection.hh:31
CmpState compare(const Projection &p) const
Definition CentralityProjection.hh:72
vector< string > projections() const
The list of names of the internal projections.
Definition CentralityProjection.hh:93
double operator[](int i) const
Definition CentralityProjection.hh:67
bool empty() const
Cheek if no internal projections have been added.
Definition CentralityProjection.hh:60
void project(const Event &e)
Perform all internal projections.
Definition CentralityProjection.hh:52
void add(const SingleValueProjection &p, string pname)
Add a new centrality estimate.
Definition CentralityProjection.hh:46
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:55
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Definition MC_Cent_pPb.hh:10