rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.2
Rivet::CentralityBinner< T, MDist > Class Template Reference

#include <CentralityBinner.hh>

Inheritance diagram for Rivet::CentralityBinner< T, MDist >:
Rivet::ProjectionApplier

Public Member Functions

 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)
 
select (const Event &event, double weight=1.0)
 
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 ()
 
void markAsOwned () const
 Mark this object as owned by a proj-handler.
 
Projection "getting" functions
std::set< ConstProjectionPtr > getProjections () const
 Get the contained projections, including recursion.
 
std::set< ConstProjectionPtr > getImmediateChildProjections () const
 Get the contained projections, excluding 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 ProjectiongetProjection (const std::string &name) const
 
template<typename PROJ >
const PROJ & get (const std::string &name) const
 
template<typename PROJ >
const PROJ & getProjectionFromDeclQueue (const std::string name) const
 
Projection applying functions
template<typename PROJ = Projection>
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.
 
template<typename PROJ = Projection>
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<typename PROJ = Projection>
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<typename PROJ = Projection>
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).
 

Protected Types

typedef set< FlexiBin > FlexiBinSet
 Convenient typedefs.
 

Protected Member Functions

LoggetLog () const
 
ProjectionHandlergetProjHandler () const
 Get a reference to the ProjectionHandler for this thread.
 
void setProjectionHandler (ProjectionHandler &projectionHandler) const
 
Projection registration functions
template<typename PROJ >
const PROJ & declare (const PROJ &proj, const std::string &name) const
 Register a contained projection (user-facing version)
 
template<typename PROJ >
const PROJ & declare (const std::string &name, const PROJ &proj) const
 Register a contained projection (user-facing, arg-reordered version)
 

Detailed Description

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
class Rivet::CentralityBinner< T, MDist >

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.

Constructor & Destructor Documentation

◆ CentralityBinner()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
Rivet::CentralityBinner< T, MDist >::CentralityBinner ( int  maxbins = 200,
double  wlim = 0.02 
)
inline

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.

Member Function Documentation

◆ add()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
void Rivet::CentralityBinner< T, MDist >::add ( t,
double  cmin,
double  cmax,
double  cestmin = -1.0,
double  cestmax = -1.0 
)
inline

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.

References Rivet::max(), and Rivet::min().

◆ apply()

template<typename PROJ = Projection>
std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > Rivet::ProjectionApplier::apply ( const Event evt,
const Projection proj 
) const
inlineinherited

Apply the supplied projection on event evt.

Apply the supplied projection on event evt (user-facing alias).

Referenced by Rivet::ALICE::V0Trigger< MODE >::project().

◆ declare() [1/2]

template<typename PROJ >
const PROJ & Rivet::ProjectionApplier::declare ( const PROJ &  proj,
const std::string &  name 
) const
inlineprotectedinherited

Register a contained projection (user-facing version)

Todo:
Add SFINAE to require that PROJ inherit from Projection

Referenced by Rivet::CentralEtHCM::CentralEtHCM(), Rivet::CentralityEstimator::CentralityEstimator(), Rivet::ChargedLeptons::ChargedLeptons(), Rivet::ALICE::CLMultiplicity< INNER >::CLMultiplicity(), Rivet::DISDiffHadron::DISDiffHadron(), Rivet::DISFinalState::DISFinalState(), Rivet::DISKinematics::DISKinematics(), Rivet::DISLepton::DISLepton(), Rivet::EventMixingBase::EventMixingBase(), Rivet::GammaGammaKinematics::GammaGammaKinematics(), Rivet::GammaGammaLeptons::GammaGammaLeptons(), Rivet::GammaGammaLeptons::GammaGammaLeptons(), Rivet::GeneratedCentrality::GeneratedCentrality(), Rivet::HadronicFinalState::HadronicFinalState(), Rivet::HeavyHadrons::HeavyHadrons(), Rivet::Hemispheres::Hemispheres(), Rivet::InvisibleFinalState::InvisibleFinalState(), Rivet::LeadingParticlesFinalState::LeadingParticlesFinalState(), Rivet::LossyFinalState< FILTER >::LossyFinalState(), Rivet::LossyFinalState< FILTER >::LossyFinalState(), Rivet::MC_pPbMinBiasTrigger::MC_pPbMinBiasTrigger(), Rivet::MC_SumETFwdPbCentrality::MC_SumETFwdPbCentrality(), Rivet::ATLAS::MinBiasTrigger::MinBiasTrigger(), Rivet::MissingMomentum::MissingMomentum(), Rivet::NeutralFinalState::NeutralFinalState(), Rivet::NeutralFinalState::NeutralFinalState(), Rivet::NonHadronicFinalState::NonHadronicFinalState(), Rivet::ParisiTensor::ParisiTensor(), Rivet::PercentileProjection::PercentileProjection(), Rivet::PrimaryHadrons::PrimaryHadrons(), Rivet::PrimaryHadrons::PrimaryHadrons(), Rivet::SmearedMET::SmearedMET(), Rivet::SmearedMET::SmearedMET(), Rivet::Spherocity::Spherocity(), Rivet::ATLAS::SumET_PB_Centrality::SumET_PB_Centrality(), Rivet::ATLAS::SumET_PBPB_Centrality::SumET_PBPB_Centrality(), Rivet::TauFinder::TauFinder(), Rivet::TriggerCDFRun0Run1::TriggerCDFRun0Run1(), Rivet::TriggerCDFRun2::TriggerCDFRun2(), Rivet::UndressBeamLeptons::UndressBeamLeptons(), Rivet::ALICE::V0AndTrigger::V0AndTrigger(), Rivet::ALICE::V0Trigger< MODE >::V0Trigger(), Rivet::VetoedFinalState::VetoedFinalState(), Rivet::VisibleFinalState::VisibleFinalState(), Rivet::VisibleFinalState::VisibleFinalState(), Rivet::CentralityProjection::add(), Rivet::CentralityBinner< T, MDist >::setProjection(), and Rivet::VetoedFinalState::vetoFinalState().

◆ declare() [2/2]

template<typename PROJ >
const PROJ & Rivet::ProjectionApplier::declare ( const std::string &  name,
const PROJ &  proj 
) const
inlineprotectedinherited

Register a contained projection (user-facing, arg-reordered version)

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ edges()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
map< double, double > Rivet::CentralityBinner< T, MDist >::edges ( ) const
inline

Return a map bin edges of the centrality extimator indexed by the corresponing percentile.

◆ estimator()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
double Rivet::CentralityBinner< T, MDist >::estimator ( ) const
inline

Return the value of the centrality estimator set in the latest call to select().

◆ finalize()

template<typename T , typename MDist >
void Rivet::CentralityBinner< T, MDist >::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.

References Rivet::max(), Rivet::min(), and MSG_WARNING.

◆ get()

template<typename PROJ >
const PROJ & Rivet::ProjectionApplier::get ( const std::string &  name) const
inlineinherited

Get the named projection, specifying return type via a template argument (user-facing alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ getProjection() [1/2]

template<typename PROJ >
const PROJ & Rivet::ProjectionApplier::getProjection ( const std::string &  name) const
inlineinherited

Get the named projection, specifying return type via a template argument.

Todo:
Add SFINAE to require that PROJ inherit from Projection

References Rivet::ProjectionHandler::getProjection(), and Rivet::ProjectionApplier::getProjHandler().

Referenced by Rivet::CentralityProjection::compare(), Rivet::pcmp(), Rivet::pcmp(), Rivet::pcmp(), and Rivet::pcmp().

◆ getProjection() [2/2]

const Projection & Rivet::ProjectionApplier::getProjection ( const std::string &  name) const
inlineinherited

Get the named projection (non-templated, so returns as a reference to a Projection base class).

References Rivet::ProjectionHandler::getProjection(), and Rivet::ProjectionApplier::getProjHandler().

◆ getProjectionFromDeclQueue()

template<typename PROJ >
const PROJ & Rivet::ProjectionApplier::getProjectionFromDeclQueue ( const std::string  name) const
inlineinherited

Get a named projection from this projection appliers declqueue TODO for TP: Recursion?

References MSG_ERROR.

◆ name()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
virtual std::string Rivet::CentralityBinner< T, MDist >::name ( ) const
inlinevirtual

Return the class name.

Implements Rivet::ProjectionApplier.

◆ normalizePerEvent()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
void Rivet::CentralityBinner< T, MDist >::normalizePerEvent ( )
inline

Normalize each AnalysisObjects to the sum of event weights in the corresponding centrality bin.

◆ select() [1/2]

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
T Rivet::CentralityBinner< T, MDist >::select ( const Event event,
double  weight = 1.0 
)
inline

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.

References Rivet::CentralityBinner< T, MDist >::select().

Referenced by Rivet::CentralityBinner< T, MDist >::select().

◆ select() [2/2]

template<typename T , typename MDist >
T Rivet::CentralityBinner< T, MDist >::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.

◆ setProjection()

template<typename T = Histo1DPtr, typename MDist = MergeDistance>
void Rivet::CentralityBinner< T, MDist >::setProjection ( const CentralityEstimator p,
string  pname 
)
inline

Set the centrality projection to be used. Note that this projection must have already been declared to Rivet.

References Rivet::ProjectionApplier::declare().

◆ setProjectionHandler()

void Rivet::ProjectionApplier::setProjectionHandler ( ProjectionHandler projectionHandler) const
protectedinherited
Todo:
AB: Add Doxygen comment, follow surrounding coding style

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