class Rivet::Percentile

Rivet::Percentile

The Percentile class for centrality binning. More…

#include <Percentile.hh>

Inherits from Rivet::PercentileTBase< T >, Rivet::PercentileBase

Public Types

Name
typedef rivet_shared_ptr< Wrapper< T > >TPtr
Convenient typedef.

Public Functions

Name
Percentile(Analysis * ana, string projName)
Main constructor.
Percentile()
Default constructor.
~Percentile()
Empty destructor.
template <typename… Args>
void
fill(Args… args)
Percentile< T > &operator-=(const Percentile< T > & rhs)
Subtract the contents fro another Pecentile.
Percentile< T > &operator+=(const Percentile< T > & rhs)
Add the contents fro another Pecentile.
Percentile< T > *operator->()
Make this object look like a pointer.
Percentile< T > &operator->*(function< void(T &)> f)
Pointer to member operator.
voidadd(TPtr ao, CounterPtr cnt, pair< float, float > cent ={0.0, 100.0})
Add a new percentile bin.
booladd(const PercentileBase & other, const vector< TPtr > & tv)
Copy the information from an otherPercentile object.
boolinit(const Event & event)
Initialize for a new event. Select which AnalysisObjects should be filled for this event. Keeps track of the number of events seen for each centrality bin and AnalysisAbject.
voidnormalizePerEvent()
Normalize each AnalysisObject.
voidscale(float scale)
Simple scaling of each AnalysisObject.
voidexec(function< void(T &)> f)
Execute a function for each AnalysisObject.
const vector< pair< TPtr, CounterPtr > > &analysisObjects() const
Access the underlyng AnalysisObjects.
voidselectBins(const Event & )
Initialize the PercentileBase for a new event.
voidcopyFrom(const PercentileBase & other)
Copy information from _other_PercentileBase.
boolcompatible(const PercentileBase & other) const
check if _other_PercentileBase is compatible with this.
const vector< pair< float, float > > &centralities() const
return the list of centrality bins.
boolinRange(double x, pair< float, float > range)
Helper function to check if x is within range.

Additional inherited members

Public Functions inherited from Rivet::PercentileTBase< T >

Name
PercentileTBase(Analysis * ana, string projName)
Main constructor.
PercentileTBase()
Default constructor.
~PercentileTBase()
Empty destructor.

Public Functions inherited from Rivet::PercentileBase

Name
PercentileBase(Analysis * ana, string projName)
Constructor.
PercentileBase()
Default constructor.

Detailed Description

template <class T >
class Rivet::Percentile;

The Percentile class for centrality binning.

The Percentile class automatically handles the selection of which AnalysisObject(s) should be filled depending on the centrality of an event. It cointains a list of AnalysisObjects, one for each centrality bin requested (note that these bins may be overlapping) and each centrality definition is available in the assigned CentralityProjection.

Public Types Documentation

typedef TPtr

typedef rivet_shared_ptr<Wrapper<T> > Rivet::PercentileTBase< T >::TPtr;

Convenient typedef.

Public Functions Documentation

function Percentile

inline Percentile(
    Analysis * ana,
    string projName
)

Main constructor.

Requires a pointer, ana, to the Analysis to which this object belongs and the name of the CentralityProjection, projname, to be used.

function Percentile

inline Percentile()

Default constructor.

function ~Percentile

inline ~Percentile()

Empty destructor.

function fill

template <typename... Args>
inline void fill(
    Args... args
)

Fill each AnalysisObject selected in the last call to PercentileTBaseinit

function operator-=

inline Percentile< T > & operator-=(
    const Percentile< T > & rhs
)

Subtract the contents fro another Pecentile.

function operator+=

inline Percentile< T > & operator+=(
    const Percentile< T > & rhs
)

Add the contents fro another Pecentile.

Todoshould this also add the Counter?

function operator->

inline Percentile< T > * operator->()

Make this object look like a pointer.

function operator->*

inline Percentile< T > & operator->*(
    function< void(T &)> f
)

Pointer to member operator.

function add

inline void add(
    TPtr ao,
    CounterPtr cnt,
    pair< float, float > cent ={0.0, 100.0}
)

Add a new percentile bin.

Add an analysis objects which are clones of temp that should be active for events in the given centrality bin cent. Several analysis objects may be added depending on the number of alternative centrality definitions in the CentralityProjectionproj. This function is common for Percentile and PecentileXaxis, but for the latter the cent argument should be left to its default.

function add

inline bool add(
    const PercentileBase & other,
    const vector< TPtr > & tv
)

Copy the information from an otherPercentile object.

This function differs from a simple assignement as the other analysis objects are not copied, but supplied separately through tv.

function init

inline bool init(
    const Event & event
)

Initialize for a new event. Select which AnalysisObjects should be filled for this event. Keeps track of the number of events seen for each centrality bin and AnalysisAbject.

function normalizePerEvent

inline void normalizePerEvent()

Normalize each AnalysisObject.

Normalize by dividing by the sum of the events seen for each centrality bin.

function scale

inline void scale(
    float scale
)

Simple scaling of each AnalysisObject.

function exec

inline void exec(
    function< void(T &)> f
)

Execute a function for each AnalysisObject.

function analysisObjects

inline const vector< pair< TPtr, CounterPtr > > & analysisObjects() const

Access the underlyng AnalysisObjects.

The returned vector contains a pair, where the first member is the AnalysisObject and the second is a counter keeping track of the sum of event weights for which the AnalysisObject has been active.

function selectBins

void selectBins(
    const Event & 
)

Initialize the PercentileBase for a new event.

This will perform the assigned CentralityProjection and select out the (indices) of the internal AnalysisObjects that are to be active in this event.

function copyFrom

inline void copyFrom(
    const PercentileBase & other
)

Copy information from _other_PercentileBase.

function compatible

inline bool compatible(
    const PercentileBase & other
) const

check if _other_PercentileBase is compatible with this.

function centralities

inline const vector< pair< float, float > > & centralities() const

return the list of centrality bins.

The size of this vector is the same as number of internal analysis objects in the sub class PercentileTBase.

function inRange

static inline bool inRange(
    double x,
    pair< float, float > range
)

Helper function to check if x is within range.


Updated on 2022-08-07 at 20:17:17 +0100