rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Rivet::Percentile< T > Class Template Reference

The Percentile class for centrality binning. More...

#include <Percentile.hh>

Inheritance diagram for Rivet::Percentile< T >:
Rivet::PercentileTBase< T > Rivet::PercentileBase

Public Types

using TPtr = MultiplexPtr< Multiplexer< T > >
 Convenient typedef.
 

Public Member Functions

 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.
 
void add (TPtr ao, CounterPtr cnt, pair< float, float > cent={0.0, 100.0})
 Add a new percentile bin.
 
bool add (const PercentileBase &other, const vector< TPtr > &tv)
 Copy the information from an other Percentile object.
 
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.
 
void normalizePerEvent ()
 Normalize each AnalysisObject.
 
void scale (float scale)
 Simple scaling of each AnalysisObject.
 
void exec (function< void(T &)> f)
 Execute a function for each AnalysisObject.
 
const vector< pair< TPtr, CounterPtr > > & analysisObjects () const
 Access the underlyng AnalysisObjects.
 
void selectBins (const Event &)
 Initialize the PercentileBase for a new event.
 
void copyFrom (const PercentileBase &other)
 Copy information from other PercentileBase.
 
bool compatible (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.
 

Static Public Member Functions

static bool inRange (double x, pair< float, float > range)
 Helper function to check if x is within range.
 

Detailed Description

template<class T>
class Rivet::Percentile< T >

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.

Constructor & Destructor Documentation

◆ Percentile()

template<class T >
Rivet::Percentile< T >::Percentile ( Analysis ana,
string  projName 
)
inline

Main constructor.

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

Member Function Documentation

◆ add() [1/2]

template<class T >
bool Rivet::PercentileTBase< T >::add ( const PercentileBase other,
const vector< TPtr > &  tv 
)
inlineinherited

Copy the information from an other Percentile object.

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

References Rivet::PercentileBase::copyFrom().

◆ add() [2/2]

template<class T >
void Rivet::PercentileTBase< T >::add ( TPtr  ao,
CounterPtr  cnt,
pair< float, float >  cent = {0.0, 100.0} 
)
inlineinherited

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 CentralityProjection proj. This function is common for Percentile and PecentileXaxis, but for the latter the cent argument should be left to its default.

Referenced by Rivet::Analysis::book().

◆ analysisObjects()

template<class T >
const vector< pair< TPtr, CounterPtr > > & Rivet::PercentileTBase< T >::analysisObjects ( ) const
inlineinherited

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.

◆ centralities()

const vector< pair< float, float > > & Rivet::PercentileBase::centralities ( ) const
inlineinherited

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.

◆ fill()

template<class T >
template<typename... Args>
void Rivet::Percentile< T >::fill ( Args...  args)
inline

Fill each AnalysisObject selected in the last call to PercentileTBase<T>init

◆ normalizePerEvent()

template<class T >
void Rivet::PercentileTBase< T >::normalizePerEvent ( )
inlineinherited

Normalize each AnalysisObject.

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

◆ operator+=()

template<class T >
Percentile< T > & Rivet::Percentile< T >::operator+= ( const Percentile< T > &  rhs)
inline

Add the contents fro another Pecentile.

Todo:
should this also add the Counter?

◆ selectBins()

void Rivet::PercentileBase::selectBins ( const Event )
inherited

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.


The documentation for this class was generated from the following file: