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

PercentileTBase is the base class of all Percentile classes. More...

#include <Percentile.hh>

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

Public Types

typedef T::Ptr TPtr
 Convenient typedef.
 

Public Member Functions

 PercentileTBase (Analysis *ana, string projName)
 the main constructor More...
 
 PercentileTBase ()
 Default constructor.
 
 ~PercentileTBase ()
 Empty destructor.
 
void add (shared_ptr< T > ao, CounterPtr cnt, pair< float, float > cent={0.0, 100.0})
 add a new percentile bin. More...
 
bool add (const PercentileBase &other, const vector< TPtr > &tv)
 Copy the information from an other Percentile object. More...
 
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. More...
 
void scale (float scale)
 Simple scaling of each AnalysisObject.
 
void exec (function< void(T &)> f)
 Execute a function for each AnalysisObject.
 
const vector< pair< shared_ptr< T >, shared_ptr< Counter > > > & analysisObjects () const
 Access the underlyng AnalysisObjects. More...
 
- Public Member Functions inherited from Rivet::PercentileBase
 PercentileBase (Analysis *ana, string projName)
 the main constructor More...
 
 PercentileBase ()
 Default constructor.
 
void selectBins (const 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Rivet::PercentileBase
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::PercentileTBase< T >

PercentileTBase is the base class of all Percentile classes.

This base class contains all template-dependent variables and infrastructure needed for Percentile and PercentileXaxis.

Constructor & Destructor Documentation

◆ PercentileTBase()

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

the main constructor

requiring 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 >
void Rivet::PercentileTBase< T >::add ( shared_ptr< T >  ao,
CounterPtr  cnt,
pair< float, float >  cent = {0.0, 100.0} 
)
inline

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::bookPercentile(), Rivet::Analysis::bookPercentileXaxis(), and Rivet::PercentileXaxis< T >::operator-> *().

◆ add() [2/2]

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

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().

◆ analysisObjects()

template<class T >
const vector<pair<shared_ptr<T>, shared_ptr<Counter> > >& Rivet::PercentileTBase< T >::analysisObjects ( ) const
inline

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.

Referenced by Rivet::PercentileXaxis< T >::operator-> *().

◆ normalizePerEvent()

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

Normalize each AnalysisObject.

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


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