2#ifndef RIVET_CENTRALITYPROJECTION_HH
3#define RIVET_CENTRALITYPROJECTION_HH
5#include "Rivet/Projections/PercentileProjection.hh"
6#include "Rivet/Tools/RivetYODA.hh"
30 using SingleValueProjection::operator=;
40 using Projection::operator =;
49 _projNames.push_back(pname);
56 for (
string pname : _projNames )
57 _values.push_back(apply<SingleValueProjection>(e, pname)());
58 if ( !_values.empty() )
setValue(_values[0]);
63 return _projNames.empty();
76 if (other->_projNames.size() == 0)
return CmpState::NEQ;
80 for (
string pname : _projNames) {
83 for (
string p2name : other->_projNames){
84 if (pname != p2name) hasPname =
false;
86 if (!hasPname)
return CmpState::NEQ;
89 if (proj.compare(oth) != CmpState::EQ)
return CmpState::NEQ;
103 vector<string> _projNames;
106 vector<double> _values;
Used together with the percentile-based analysis objects Percentile and PercentileXaxis.
Definition CentralityProjection.hh:27
CentralityProjection()
Default constructor.
Definition CentralityProjection.hh:33
CmpState compare(const Projection &p) const
Definition CentralityProjection.hh:74
vector< string > projections() const
The list of names of the internal projections.
Definition CentralityProjection.hh:95
double operator[](int i) const
Definition CentralityProjection.hh:69
bool empty() const
Cheek if no internal projections have been added.
Definition CentralityProjection.hh:62
void project(const Event &e)
Perform all internal projections.
Definition CentralityProjection.hh:54
void add(const SingleValueProjection &p, string pname)
Add a new centrality estimate.
Definition CentralityProjection.hh:48
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:62
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
Definition MC_CENT_PPB_Projections.hh:10