class Rivet::CentralityBinner
Rivet::CentralityBinner
#include <CentralityBinner.hh>
Inherits from Rivet::ProjectionApplier
Protected Types
Name | |
---|---|
typedef set< FlexiBin > | FlexiBinSet Convenient typedefs. |
Public Functions
Name | |
---|---|
std::set< ConstProjectionPtr > | getProjections() const Get the contained projections, including recursion. |
bool | hasProjection(const std::string & name) const Does this applier have a projection registered under the name name? |
template <typename PROJ > const PROJ & | getProjection(const std::string & name) const |
const Projection & | getProjection(const std::string & name) const |
template <typename PROJ > const PROJ & | get(const std::string & name) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const Projection & proj) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const PROJ & proj) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | applyProjection(const Event & evt, const std::string & name) const |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const Projection & proj) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const PROJ & proj) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const Event & evt, const std::string & name) const Apply the supplied projection on event evt (user-facing alias). |
template std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > | apply(const std::string & name, const Event & evt) const Apply the supplied projection on event evt (convenience arg-reordering alias). |
void | markAsOwned() const Mark this object as owned by a proj-handler. |
CentralityBinner(int maxbins =200, double wlim =0.02) | |
void | setProjection(const CentralityEstimator & p, string pname) |
virtual std::string | name() const Return the class name. |
void | add(T t, double cmin, double cmax, double cestmin =-1.0, double cestmax =-1.0) |
T | select(const Event & event, double weight =1.0) |
T | select(double cest, double weight =1.0) |
void | finalize() |
void | normalizePerEvent() |
map< double, double > | edges() const |
const T & | current() const Return the current AnalysisObject from the latest call to select(). |
double | estimator() const |
vector< T > | allObjects() |
void | debug() Print out the _flexiBins to cerr. |
void | fulldebug() |
Protected Functions
Name | |
---|---|
Log & | getLog() const |
ProjectionHandler & | getProjHandler() const Get a reference to the ProjectionHandler for this thread. |
template <typename PROJ > const PROJ & | declareProjection(const PROJ & proj, const std::string & name) Register a contained projection. |
template <typename PROJ > const PROJ & | declare(const PROJ & proj, const std::string & name) Register a contained projection (user-facing version) |
template <typename PROJ > const PROJ & | declare(const std::string & name, const PROJ & proj) Register a contained projection (user-facing, arg-reordered version) |
Additional inherited members
Public Functions inherited from Rivet::ProjectionApplier
Name | |
---|---|
ProjectionApplier() Constructor. | |
virtual | ~ProjectionApplier() |
Detailed Description
template <typename T =Histo1DPtr,
typename MDist =MergeDistance>
class Rivet::CentralityBinner;
CentralityBinner contains a series of AnalysisObject of the same quantity each in a different percentiles of another quantity. For example, a CentralityBinner may e.g. contain histograms of the cross section differential in ( p_T ) in different centrality regions for heavy ion collisions based on forward energy flow.
Protected Types Documentation
typedef FlexiBinSet
typedef set<FlexiBin> Rivet::CentralityBinner< T, MDist >::FlexiBinSet;
Convenient typedefs.
Public Functions Documentation
function getProjections
inline std::set< ConstProjectionPtr > getProjections() const
Get the contained projections, including recursion.
function hasProjection
inline bool hasProjection(
const std::string & name
) const
Does this applier have a projection registered under the name name?
function getProjection
template <typename PROJ >
inline const PROJ & getProjection(
const std::string & name
) const
Todo: Add SFINAE to require that PROJ inherit from Projection
Get the named projection, specifying return type via a template argument.
function getProjection
inline const Projection & getProjection(
const std::string & name
) const
Get the named projection (non-templated, so returns as a reference to a Projection base class).
function get
template <typename PROJ >
inline const PROJ & get(
const std::string & name
) const
Todo: Add SFINAE to require that PROJ inherit from Projection
Get the named projection, specifying return type via a template argument (user-facing alias).
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const Projection & proj
) const
Deprecated:
Prefer the simpler apply<> form
Apply the supplied projection on event evt.
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const PROJ & proj
) const
Deprecated:
Prefer the simpler apply<> form
Apply the supplied projection on event evt.
function applyProjection
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > applyProjection(
const Event & evt,
const std::string & name
) const
Deprecated:
Prefer the simpler apply<> form
Apply the named projection on event evt.
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const Projection & proj
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const PROJ & proj
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const Event & evt,
const std::string & name
) const
Apply the supplied projection on event evt (user-facing alias).
function apply
template <typename PROJ =Projection>
inline std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(
const std::string & name,
const Event & evt
) const
Apply the supplied projection on event evt (convenience arg-reordering alias).
function markAsOwned
inline void markAsOwned() const
Mark this object as owned by a proj-handler.
function CentralityBinner
inline CentralityBinner(
int maxbins =200,
double wlim =0.02
)
Create a new empty CentralityBinner. maxbins is the maximum number of bins used by the binner. Default is 1000, which is typically enough. wlim is the mximum allowed error allowed for the centrality limits before a warning is emitted.
function setProjection
inline void setProjection(
const CentralityEstimator & p,
string pname
)
Set the centrality projection to be used. Note that this projection must have already been declared to Rivet.
function name
inline virtual std::string name() const
Return the class name.
Reimplements: Rivet::ProjectionApplier::name
function add
inline void add(
T t,
double cmin,
double cmax,
double cestmin =-1.0,
double cestmax =-1.0
)
Add an AnalysisObject in the region between cmin and cmax to this set of CentralityBinners. The range represent percentiles and must be between 0 and 100. No overlaping bins are allowed. Note that (cmin=0, cmax=5), means the five percent MOST central events although the internal notation is reversed for convenience. Optionally supply corresponding limits cestmin and cestmax of the centrality extimator.
function select
inline T select(
const Event & event,
double weight =1.0
)
Return one of the AnalysisObjects in the CentralityBinner for the given event. This version requires that a CentralityEstimator object has been assigned that can compute the value of the centrality estimator from the event. Optionally the weight of the event is given. This should be the weight that will be used to fill the AnalysisObject. If the centrality estimate is less than zero, the _devnull object will be returned.
function select
T select(
double cest,
double weight =1.0
)
Return one of the AnalysisObjecsts in the Setup the CentralityBinner depending on the value of the centrality estimator, cest. Optionally the weight of the event is given. This should be the weight that will be used to fill the AnalysisObject. If the centrality estimate is less than zero, the _devnull object will be returned.
function finalize
void finalize()
At the end of the run, calculate the percentiles and fill the AnalysisObjectss provided with the add() function. This is typically called from the finalize method in an Analysis, but can also be called earlier in which case the the select functions can be continued to run as before with the edges between the centrality regions now fixed.
function normalizePerEvent
inline void normalizePerEvent()
Normalize each AnalysisObjects to the sum of event weights in the corresponding centrality bin.
function edges
inline map< double, double > edges() const
Return a map bin edges of the centrality extimator indexed by the corresponing percentile.
function current
inline const T & current() const
Return the current AnalysisObject from the latest call to select().
function estimator
inline double estimator() const
Return the value of the centrality estimator set in the latest call to select().
function allObjects
inline vector< T > allObjects()
function debug
void debug()
Print out the _flexiBins to cerr.
function fulldebug
void fulldebug()
Protected Functions Documentation
function getLog
inline Log & getLog() const
function getProjHandler
inline ProjectionHandler & getProjHandler() const
Get a reference to the ProjectionHandler for this thread.
function declareProjection
template <typename PROJ >
inline const PROJ & declareProjection(
const PROJ & proj,
const std::string & name
)
Register a contained projection.
Todo: Add SFINAE to require that PROJ inherit from Projection
The type of the argument is used to instantiate a new projection internally: this new object is applied to events rather than the argument object. Hence you are advised to only use locally-scoped Projection objects in your Projection and Analysis constructors, and to avoid polymorphism (e.g. handling ConcreteProjection
via a pointer or reference to type Projection
) since this will screw up the internal type management.
function declare
template <typename PROJ >
inline const PROJ & declare(
const PROJ & proj,
const std::string & name
)
Register a contained projection (user-facing version)
Todo: Add SFINAE to require that PROJ inherit from Projection
function declare
template <typename PROJ >
inline const PROJ & declare(
const std::string & name,
const PROJ & proj
)
Register a contained projection (user-facing, arg-reordered version)
Todo: Add SFINAE to require that PROJ inherit from Projection
Updated on 2022-08-07 at 20:17:16 +0100