rivet is hosted by Hepforge, IPPP Durham
Rivet  3.1.0

This is the base class of all analysis classes in Rivet. More...

#include <Analysis.hh>

Inheritance diagram for Rivet::Analysis:
Rivet::ProjectionApplier Rivet::CumulantAnalysis Rivet::MC_JetAnalysis Rivet::MC_JetSplittings Rivet::MC_ParticleAnalysis

Public Member Functions

AnalysisHandlerhandler () const
 Access the controlling AnalysisHandler object.
 
const CentralityProjectiondeclareCentrality (const SingleValueProjection &proj, string calAnaName, string calHistName, const string projName, bool increasing=false)
 Book a CentralityProjection. More...
 
template<class T >
Percentile< T > bookPercentile (string projName, vector< pair< float, float > > centralityBins, vector< tuple< int, int, int > > ref)
 Book a Percentile wrapper around AnalysisObjects. More...
 
double dbl (double x)
 
double dbl (const YODA::Counter &c)
 
double dbl (const YODA::Scatter1D &s)
 
const vector< MultiweightAOPtr > & analysisObjects () const
 List of registered analysis data objects.
 
void markAsOwned () const
 Mark this object as owned by a proj-handler.
 
Standard constructors and destructors.
 Analysis (const std::string &name)
 Constructor.
 
virtual ~Analysis ()
 The destructor.
 
Main analysis methods
virtual void init ()
 
virtual void analyze (const Event &event)=0
 
virtual void finalize ()
 
Metadata

Metadata is used for querying from the command line and also for building web pages and the analysis pages in the Rivet manual.

const AnalysisInfoinfo () const
 Get the actual AnalysisInfo object in which all this metadata is stored.
 
virtual std::string name () const
 Get the name of the analysis. More...
 
virtual std::string getRefDataName () const
 Get name of reference data file, which could be different from plugin name.
 
virtual void setRefDataName (const std::string &ref_data="")
 Set name of reference data file, which could be different from plugin name.
 
virtual std::string inspireId () const
 Get the Inspire ID code for this analysis.
 
virtual std::string spiresId () const
 Get the SPIRES ID code for this analysis (~deprecated).
 
virtual std::vector< std::string > authors () const
 Names & emails of paper/analysis authors. More...
 
virtual std::string summary () const
 Get a short description of the analysis. More...
 
virtual std::string description () const
 Get a full description of the analysis. More...
 
virtual std::string runInfo () const
 Information about the events needed as input for this analysis. More...
 
virtual std::string experiment () const
 Experiment which performed and published this analysis.
 
virtual std::string collider () const
 Collider on which the experiment ran.
 
virtual std::string year () const
 When the original experimental analysis was published.
 
virtual double luminosityfb () const
 The integrated luminosity in inverse femtobarn.
 
virtual double luminosity () const
 The integrated luminosity in inverse picobarn.
 
virtual std::vector< std::string > references () const
 Journal, and preprint references.
 
virtual std::string bibKey () const
 BibTeX citation key for this article.
 
virtual std::string bibTeX () const
 BibTeX citation entry for this article.
 
virtual std::string status () const
 Whether this analysis is trusted (in any way!)
 
virtual std::vector< std::string > todos () const
 Any work to be done on this analysis.
 
virtual std::vector< std::string > validation () const
 make-style commands for validating this analysis.
 
virtual bool reentrant () const
 Does this analysis have a reentrant finalize()?
 
virtual const std::vector< PdgIdPair > & requiredBeams () const
 Return the allowed pairs of incoming beams required by this analysis.
 
virtual AnalysissetRequiredBeams (const std::vector< PdgIdPair > &requiredBeams)
 Declare the allowed pairs of incoming beams required by this analysis.
 
virtual const std::vector< std::pair< double, double > > & requiredEnergies () const
 Sets of valid beam energy pairs, in GeV.
 
virtual const std::vector< std::string > & keywords () const
 Get vector of analysis keywords.
 
virtual AnalysissetRequiredEnergies (const std::vector< std::pair< double, double > > &requiredEnergies)
 Declare the list of valid beam energy pairs, in GeV.
 
Internal metadata modifying methods
AnalysisInfoinfo ()
 Get the actual AnalysisInfo object in which all this metadata is stored (non-const).
 
Run conditions
const ParticlePair & beams () const
 Incoming beams for this run.
 
const PdgIdPair beamIds () const
 Incoming beam IDs for this run.
 
double sqrtS () const
 Centre of mass energy for this run.
 
bool merging () const
 Check if we are running rivet-merge.
 
Analysis / beam compatibility testing
Todo:

Replace with beamsCompatible() with no args (calling beams() function internally)

Add beamsMatch() methods with same (shared-code?) tolerance as in beamsCompatible()

bool isCompatible (const ParticlePair &beams) const
 Check if analysis is compatible with the provided beam particle IDs and energies.
 
bool isCompatible (PdgId beam1, PdgId beam2, double e1, double e2) const
 Check if analysis is compatible with the provided beam particle IDs and energies.
 
bool isCompatible (const PdgIdPair &beams, const std::pair< double, double > &energies) const
 Check if analysis is compatible with the provided beam particle IDs and energies.
 
Accessing options for this Analysis instance.
const std::map< std::string, std::string > & options ()
 Return the map of all options given to this analysis.
 
std::string getOption (std::string optname)
 Get an option for this analysis instance as a string.
 
template<typename T >
getOption (std::string optname, T def)
 
Analysis object manipulation
Todo:
Should really be protected: only public to keep BinnedHistogram happy for now...
void scale (CounterPtr cnt, CounterAdapter factor)
 Multiplicatively scale the given counter, cnt, by factor factor.
 
void scale (const std::vector< CounterPtr > &cnts, CounterAdapter factor)
 
template<std::size_t array_size>
void scale (const CounterPtr(&cnts)[array_size], CounterAdapter factor)
 
void normalize (Histo1DPtr histo, CounterAdapter norm=1.0, bool includeoverflows=true)
 Normalize the given histogram, histo, to area = norm.
 
void normalize (const std::vector< Histo1DPtr > &histos, CounterAdapter norm=1.0, bool includeoverflows=true)
 
template<std::size_t array_size>
void normalize (const Histo1DPtr(&histos)[array_size], CounterAdapter norm=1.0, bool includeoverflows=true)
 
void scale (Histo1DPtr histo, CounterAdapter factor)
 Multiplicatively scale the given histogram, histo, by factor factor.
 
void scale (const std::vector< Histo1DPtr > &histos, CounterAdapter factor)
 
template<std::size_t array_size>
void scale (const Histo1DPtr(&histos)[array_size], CounterAdapter factor)
 
void normalize (Histo2DPtr histo, CounterAdapter norm=1.0, bool includeoverflows=true)
 Normalize the given histogram, histo, to area = norm.
 
void normalize (const std::vector< Histo2DPtr > &histos, CounterAdapter norm=1.0, bool includeoverflows=true)
 
template<std::size_t array_size>
void normalize (const Histo2DPtr(&histos)[array_size], CounterAdapter norm=1.0, bool includeoverflows=true)
 
void scale (Histo2DPtr histo, CounterAdapter factor)
 Multiplicatively scale the given histogram, histo, by factor factor.
 
void scale (const std::vector< Histo2DPtr > &histos, CounterAdapter factor)
 
template<std::size_t array_size>
void scale (const Histo2DPtr(&histos)[array_size], CounterAdapter factor)
 
void divide (CounterPtr c1, CounterPtr c2, Scatter1DPtr s) const
 
void divide (const YODA::Counter &c1, const YODA::Counter &c2, Scatter1DPtr s) const
 
void divide (Histo1DPtr h1, Histo1DPtr h2, Scatter2DPtr s) const
 
void divide (const YODA::Histo1D &h1, const YODA::Histo1D &h2, Scatter2DPtr s) const
 
void divide (Profile1DPtr p1, Profile1DPtr p2, Scatter2DPtr s) const
 
void divide (const YODA::Profile1D &p1, const YODA::Profile1D &p2, Scatter2DPtr s) const
 
void divide (Histo2DPtr h1, Histo2DPtr h2, Scatter3DPtr s) const
 
void divide (const YODA::Histo2D &h1, const YODA::Histo2D &h2, Scatter3DPtr s) const
 
void divide (Profile2DPtr p1, Profile2DPtr p2, Scatter3DPtr s) const
 
void divide (const YODA::Profile2D &p1, const YODA::Profile2D &p2, Scatter3DPtr s) const
 
void efficiency (Histo1DPtr h1, Histo1DPtr h2, Scatter2DPtr s) const
 
void efficiency (const YODA::Histo1D &h1, const YODA::Histo1D &h2, Scatter2DPtr s) const
 
void asymm (Histo1DPtr h1, Histo1DPtr h2, Scatter2DPtr s) const
 
void asymm (const YODA::Histo1D &h1, const YODA::Histo1D &h2, Scatter2DPtr s) const
 
void integrate (Histo1DPtr h, Scatter2DPtr s) const
 
void integrate (const Histo1D &h, Scatter2DPtr s) const
 
Projection "getting" functions
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 ProjectiongetProjection (const std::string &name) const
 
template<typename PROJ >
const PROJ & get (const std::string &name) const
 
Projection applying functions
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const Projection &proj) const
 Apply the supplied projection on event evt. More...
 
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const PROJ &proj) const
 Apply the supplied projection on event evt. More...
 
template<typename PROJ >
const PROJ & applyProjection (const Event &evt, const std::string &name) const
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const Projection &proj) const
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const PROJ &proj) const
 
template<typename PROJ >
const PROJ & apply (const Event &evt, const std::string &name) const
 
template<typename PROJ >
const PROJ & apply (const std::string &name, const Event &evt) const
 

Protected Member Functions

LoggetLog () const
 Get a Log object based on the name() property of the calling analysis object.
 
double crossSection () const
 Get the process cross-section in pb. Throws if this hasn't been set.
 
double crossSectionPerEvent () const
 
size_t numEvents () const
 Get the number of events seen (via the analysis handler). More...
 
double sumW () const
 Get the sum of event weights seen (via the analysis handler). More...
 
double sumOfWeights () const
 Alias.
 
double sumW2 () const
 Get the sum of squared event weights seen (via the analysis handler). More...
 
ProjectionHandlergetProjHandler () const
 Get a reference to the ProjectionHandler for this thread.
 
Histogram paths
const std::string histoDir () const
 Get the canonical histogram "directory" path for this analysis.
 
const std::string histoPath (const std::string &hname) const
 Get the canonical histogram path for the named histogram in this analysis.
 
const std::string histoPath (unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId) const
 Get the canonical histogram path for the numbered histogram in this analysis.
 
const std::string mkAxisCode (unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId) const
 Get the internal histogram name for given d, x and y (cf. HepData)
 
Histogram reference data
template<typename T = YODA::Scatter2D>
const T & refData (const string &hname) const
 
template<typename T = YODA::Scatter2D>
const T & refData (unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId) const
 
Counter booking
CounterPtr & book (CounterPtr &, const std::string &name)
 Book a counter.
 
CounterPtr & book (CounterPtr &, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId)
 
1D histogram booking
Histo1DPtr & book (Histo1DPtr &, const std::string &name, size_t nbins, double lower, double upper)
 Book a 1D histogram with nbins uniformly distributed across the range lower - upper .
 
Histo1DPtr & book (Histo1DPtr &, const std::string &name, const std::vector< double > &binedges)
 Book a 1D histogram with non-uniform bins defined by the vector of bin edges binedges .
 
Histo1DPtr & book (Histo1DPtr &, const std::string &name, const std::initializer_list< double > &binedges)
 Book a 1D histogram with non-uniform bins defined by the vector of bin edges binedges .
 
Histo1DPtr & book (Histo1DPtr &, const std::string &name, const Scatter2D &refscatter)
 Book a 1D histogram with binning from a reference scatter.
 
Histo1DPtr & book (Histo1DPtr &, const std::string &name)
 Book a 1D histogram, using the binnings in the reference data histogram.
 
Histo1DPtr & book (Histo1DPtr &, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId)
 
2D histogram booking
Histo2DPtr & book (Histo2DPtr &, const std::string &name, size_t nxbins, double xlower, double xupper, size_t nybins, double ylower, double yupper)
 
Histo2DPtr & book (Histo2DPtr &, const std::string &name, const std::vector< double > &xbinedges, const std::vector< double > &ybinedges)
 
Histo2DPtr & book (Histo2DPtr &, const std::string &name, const std::initializer_list< double > &xbinedges, const std::initializer_list< double > &ybinedges)
 
Histo2DPtr & book (Histo2DPtr &, const std::string &name, const Scatter3D &refscatter)
 Book a 2D histogram with binning from a reference scatter.
 
Histo2DPtr & book (Histo2DPtr &, const std::string &name)
 Book a 2D histogram, using the binnings in the reference data histogram.
 
Histo2DPtr & book (Histo2DPtr &, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId)
 
1D profile histogram booking
Profile1DPtr & book (Profile1DPtr &, const std::string &name, size_t nbins, double lower, double upper)
 Book a 1D profile histogram with nbins uniformly distributed across the range lower - upper .
 
Profile1DPtr & book (Profile1DPtr &, const std::string &name, const std::vector< double > &binedges)
 Book a 1D profile histogram with non-uniform bins defined by the vector of bin edges binedges .
 
Profile1DPtr & book (Profile1DPtr &, const std::string &name, const std::initializer_list< double > &binedges)
 Book a 1D profile histogram with non-uniform bins defined by the vector of bin edges binedges .
 
Profile1DPtr & book (Profile1DPtr &, const std::string &name, const Scatter2D &refscatter)
 Book a 1D profile histogram with binning from a reference scatter.
 
Profile1DPtr & book (Profile1DPtr &, const std::string &name)
 Book a 1D profile histogram, using the binnings in the reference data histogram.
 
Profile1DPtr & book (Profile1DPtr &, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId)
 
2D profile histogram booking
Profile2DPtr & book (Profile2DPtr &, const std::string &name, size_t nxbins, double xlower, double xupper, size_t nybins, double ylower, double yupper)
 
Profile2DPtr & book (Profile2DPtr &, const std::string &name, const std::vector< double > &xbinedges, const std::vector< double > &ybinedges)
 
Profile2DPtr & book (Profile2DPtr &, const std::string &name, const std::initializer_list< double > &xbinedges, const std::initializer_list< double > &ybinedges)
 
2D scatter booking
Todo:
REINSTATE
Scatter2DPtr & book (Scatter2DPtr &s2d, const string &hname, bool copy_pts=false)
 Book a 2-dimensional data point set with the given name. More...
 
Scatter2DPtr & book (Scatter2DPtr &s2d, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId, bool copy_pts=false)
 Book a 2-dimensional data point set, using the binnings in the reference data histogram. More...
 
Scatter2DPtr & book (Scatter2DPtr &s2d, const string &hname, size_t npts, double lower, double upper)
 Book a 2-dimensional data point set with equally spaced x-points in a range. More...
 
Scatter2DPtr & book (Scatter2DPtr &s2d, const string &hname, const std::vector< double > &binedges)
 Book a 2-dimensional data point set based on provided contiguous "bin edges". More...
 
Scatter2DPtr & book (Scatter2DPtr &s2d, const string &hname, const Scatter2D &refscatter)
 Book a 2-dimensional data point set with x-points from an existing scatter and a new path.
 
3D scatter booking
Scatter3DPtr & book (Scatter3DPtr &s3d, const std::string &hname, bool copy_pts=false)
 Book a 3-dimensional data point set with the given name. More...
 
Scatter3DPtr & book (Scatter3DPtr &s3d, unsigned int datasetId, unsigned int xAxisId, unsigned int yAxisId, unsigned int zAxisId, bool copy_pts=false)
 Book a 3-dimensional data point set, using the binnings in the reference data histogram. More...
 
Scatter3DPtr & book (Scatter3DPtr &s3d, const std::string &hname, size_t xnpts, double xlower, double xupper, size_t ynpts, double ylower, double yupper)
 Book a 3-dimensional data point set with equally spaced x-points in a range. More...
 
Scatter3DPtr & book (Scatter3DPtr &s3d, const std::string &hname, const std::vector< double > &xbinedges, const std::vector< double > &ybinedges)
 Book a 3-dimensional data point set based on provided contiguous "bin edges". More...
 
Scatter3DPtr & book (Scatter3DPtr &s3d, const std::string &hname, const Scatter3D &refscatter)
 Book a 3-dimensional data point set with x-points from an existing scatter and a new path.
 
Data object registration, retrieval, and removal
template<typename YODAT >
shared_ptr< YODAT > getPreload (string path) const
 Get a preloaded YODA object.
 
template<typename YODAT >
rivet_shared_ptr< Wrapper< YODAT > > registerAO (const YODAT &yao)
 Register a new data object, optionally read in preloaded data.
 
template<typename AO = MultiweightAOPtr>
AO addAnalysisObject (const AO &aonew)
 Register a data object in the histogram system.
 
void removeAnalysisObject (const std::string &path)
 Unregister a data object from the histogram system (by name)
 
void removeAnalysisObject (const MultiweightAOPtr &ao)
 Unregister a data object from the histogram system (by pointer)
 
template<typename AO = MultiweightAOPtr>
const AO getAnalysisObject (const std::string &aoname) const
 Get a Rivet data object from the histogram system.
 
template<typename AO = MultiweightAOPtr>
AO getAnalysisObject (const std::string &ananame, const std::string &aoname)
 
Projection registration functions
template<typename PROJ >
const PROJ & declareProjection (const PROJ &proj, const std::string &name)
 Register a contained projection. More...
 
template<typename PROJ >
const PROJ & declare (const PROJ &proj, const std::string &name)
 Register a contained projection (user-facing version) More...
 
template<typename PROJ >
const PROJ & declare (const std::string &name, const PROJ &proj)
 Register a contained projection (user-facing, arg-reordered version) More...
 

Friends

class AnalysisHandler
 The AnalysisHandler is a friend.
 

Detailed Description

This is the base class of all analysis classes in Rivet.

There are three virtual functions which should be implemented in base classes:

void init() is called by Rivet before a run is started. Here the analysis class should book necessary histograms. The needed projections should probably rather be constructed in the constructor.

void analyze(const Event&) is called once for each event. Here the analysis class should apply the necessary Projections and fill the histograms.

void finalize() is called after a run is finished. Here the analysis class should do whatever manipulations are necessary on the histograms. Writing the histograms to a file is, however, done by the Rivet class.

Member Function Documentation

◆ analyze()

virtual void Rivet::Analysis::analyze ( const Event event)
pure virtual

Analyze one event. A concrete class should here apply the necessary projections on the event and fill the relevant histograms. An overridden function must make sure it first calls the base class function.

Implemented in Rivet::MC_ParticleAnalysis, Rivet::MC_JetAnalysis, and Rivet::MC_JetSplittings.

Referenced by init().

◆ apply() [1/4]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::apply ( const Event evt,
const Projection proj 
) const
inlineinherited

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

Todo:
Add SFINAE to require that PROJ inherit from Projection

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

◆ apply() [2/4]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::apply ( const Event evt,
const PROJ &  proj 
) const
inlineinherited

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

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ apply() [3/4]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::apply ( const Event evt,
const std::string &  name 
) const
inlineinherited

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

Todo:
Add SFINAE to require that PROJ inherit from Projection

References Rivet::ProjectionApplier::name().

◆ apply() [4/4]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::apply ( const std::string &  name,
const Event evt 
) const
inlineinherited

Apply the supplied projection on event evt (convenience arg-reordering alias).

Todo:
Add SFINAE to require that PROJ inherit from Projection

References Rivet::ProjectionApplier::name().

◆ applyProjection() [1/3]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::applyProjection ( const Event evt,
const Projection proj 
) const
inlineinherited

Apply the supplied projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ applyProjection() [2/3]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::applyProjection ( const Event evt,
const PROJ &  proj 
) const
inlineinherited

Apply the supplied projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ applyProjection() [3/3]

template<typename PROJ >
const PROJ& Rivet::ProjectionApplier::applyProjection ( const Event evt,
const std::string &  name 
) const
inlineinherited

Apply the named projection on event evt.

Todo:
Add SFINAE to require that PROJ inherit from Projection

◆ asymm() [1/2]

void Rivet::Analysis::asymm ( Histo1DPtr  h1,
Histo1DPtr  h2,
Scatter2DPtr  s 
) const

Helper for histogram asymmetry calculation.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

Referenced by scale().

◆ asymm() [2/2]

void Rivet::Analysis::asymm ( const YODA::Histo1D &  h1,
const YODA::Histo1D &  h2,
Scatter2DPtr  s 
) const

Helper for histogram asymmetry calculation.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ authors()

virtual std::vector<std::string> Rivet::Analysis::authors ( ) const
inlinevirtual

Names & emails of paper/analysis authors.

Names and email of authors in 'NAME <EMAIL>' format. The first name in the list should be the primary contact person.

References Rivet::AnalysisInfo::authors(), and info().

◆ book() [1/18]

CounterPtr& Rivet::Analysis::book ( CounterPtr &  ,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId 
)
protected

Book a counter, using a path generated from the dataset and axis ID codes

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

◆ book() [2/18]

Histo1DPtr& Rivet::Analysis::book ( Histo1DPtr &  ,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId 
)
protected

Book a 1D histogram, using the binnings in the reference data histogram.

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

◆ book() [3/18]

Histo2DPtr& Rivet::Analysis::book ( Histo2DPtr &  ,
const std::string &  name,
size_t  nxbins,
double  xlower,
double  xupper,
size_t  nybins,
double  ylower,
double  yupper 
)
protected

Book a 2D histogram with nxbins and nybins uniformly distributed across the ranges xlower - xupper and ylower - yupper respectively along the x- and y-axis.

◆ book() [4/18]

Histo2DPtr& Rivet::Analysis::book ( Histo2DPtr &  ,
const std::string &  name,
const std::vector< double > &  xbinedges,
const std::vector< double > &  ybinedges 
)
protected

Book a 2D histogram with non-uniform bins defined by the vectors of bin edges xbinedges and ybinedges.

◆ book() [5/18]

Histo2DPtr& Rivet::Analysis::book ( Histo2DPtr &  ,
const std::string &  name,
const std::initializer_list< double > &  xbinedges,
const std::initializer_list< double > &  ybinedges 
)
protected

Book a 2D histogram with non-uniform bins defined by the vectors of bin edges xbinedges and ybinedges.

◆ book() [6/18]

Histo2DPtr& Rivet::Analysis::book ( Histo2DPtr &  ,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId 
)
protected

Book a 2D histogram, using the binnings in the reference data histogram.

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

◆ book() [7/18]

Profile1DPtr& Rivet::Analysis::book ( Profile1DPtr &  ,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId 
)
protected

Book a 1D profile histogram, using the binnings in the reference data histogram.

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

◆ book() [8/18]

Profile2DPtr& Rivet::Analysis::book ( Profile2DPtr &  ,
const std::string &  name,
size_t  nxbins,
double  xlower,
double  xupper,
size_t  nybins,
double  ylower,
double  yupper 
)
protected

Book a 2D profile histogram with nxbins and nybins uniformly distributed across the ranges xlower - xupper and ylower - yupper respectively along the x- and y-axis.

◆ book() [9/18]

Profile2DPtr& Rivet::Analysis::book ( Profile2DPtr &  ,
const std::string &  name,
const std::vector< double > &  xbinedges,
const std::vector< double > &  ybinedges 
)
protected

Book a 2D profile histogram with non-uniform bins defined by the vectorx of bin edges xbinedges and ybinedges.

◆ book() [10/18]

Profile2DPtr& Rivet::Analysis::book ( Profile2DPtr &  ,
const std::string &  name,
const std::initializer_list< double > &  xbinedges,
const std::initializer_list< double > &  ybinedges 
)
protected

Book a 2D profile histogram with non-uniform bins defined by the vectorx of bin edges xbinedges and ybinedges.

◆ book() [11/18]

Scatter2DPtr& Rivet::Analysis::book ( Scatter2DPtr &  s2d,
const string &  hname,
bool  copy_pts = false 
)
protected

Book a 2-dimensional data point set with the given name.

Note
Unlike histogram booking, scatter booking by default makes no attempt to use reference data to pre-fill the data object. If you want this, which is sometimes useful e.g. when the x-position is not really meaningful and can't be extracted from the data, then set the copy_pts parameter to true. This creates points to match the reference data's x values and errors, but with the y values and errors zeroed... assuming that there is a reference histo with the same name: if there isn't, an exception will be thrown.

◆ book() [12/18]

Scatter2DPtr& Rivet::Analysis::book ( Scatter2DPtr &  s2d,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId,
bool  copy_pts = false 
)
protected

Book a 2-dimensional data point set, using the binnings in the reference data histogram.

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

Note
Unlike histogram booking, scatter booking by default makes no attempt to use reference data to pre-fill the data object. If you want this, which is sometimes useful e.g. when the x-position is not really meaningful and can't be extracted from the data, then set the copy_pts parameter to true. This creates points to match the reference data's x values and errors, but with the y values and errors zeroed.

◆ book() [13/18]

Scatter2DPtr& Rivet::Analysis::book ( Scatter2DPtr &  s2d,
const string &  hname,
size_t  npts,
double  lower,
double  upper 
)
protected

Book a 2-dimensional data point set with equally spaced x-points in a range.

The y values and errors will be set to 0.

◆ book() [14/18]

Scatter2DPtr& Rivet::Analysis::book ( Scatter2DPtr &  s2d,
const string &  hname,
const std::vector< double > &  binedges 
)
protected

Book a 2-dimensional data point set based on provided contiguous "bin edges".

The y values and errors will be set to 0.

◆ book() [15/18]

Scatter3DPtr& Rivet::Analysis::book ( Scatter3DPtr &  s3d,
const std::string &  hname,
bool  copy_pts = false 
)
protected

Book a 3-dimensional data point set with the given name.

Note
Unlike histogram booking, scatter booking by default makes no attempt to use reference data to pre-fill the data object. If you want this, which is sometimes useful e.g. when the x-position is not really meaningful and can't be extracted from the data, then set the copy_pts parameter to true. This creates points to match the reference data's x values and errors, but with the y values and errors zeroed... assuming that there is a reference histo with the same name: if there isn't, an exception will be thrown.

◆ book() [16/18]

Scatter3DPtr& Rivet::Analysis::book ( Scatter3DPtr &  s3d,
unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId,
unsigned int  zAxisId,
bool  copy_pts = false 
)
protected

Book a 3-dimensional data point set, using the binnings in the reference data histogram.

The paper, dataset and x/y-axis IDs will be used to build the histo name in the HepData standard way.

Note
Unlike histogram booking, scatter booking by default makes no attempt to use reference data to pre-fill the data object. If you want this, which is sometimes useful e.g. when the x-position is not really meaningful and can't be extracted from the data, then set the copy_pts parameter to true. This creates points to match the reference data's x values and errors, but with the y values and errors zeroed.

◆ book() [17/18]

Scatter3DPtr& Rivet::Analysis::book ( Scatter3DPtr &  s3d,
const std::string &  hname,
size_t  xnpts,
double  xlower,
double  xupper,
size_t  ynpts,
double  ylower,
double  yupper 
)
protected

Book a 3-dimensional data point set with equally spaced x-points in a range.

The y values and errors will be set to 0.

◆ book() [18/18]

Scatter3DPtr& Rivet::Analysis::book ( Scatter3DPtr &  s3d,
const std::string &  hname,
const std::vector< double > &  xbinedges,
const std::vector< double > &  ybinedges 
)
protected

Book a 3-dimensional data point set based on provided contiguous "bin edges".

The y values and errors will be set to 0.

◆ bookPercentile()

template<class T >
Percentile<T> Rivet::Analysis::bookPercentile ( string  projName,
vector< pair< float, float > >  centralityBins,
vector< tuple< int, int, int > >  ref 
)
inline

Book a Percentile wrapper around AnalysisObjects.

Based on a previously registered CentralityProjection named projName book one AnalysisObject for each centralityBin and name them according to the corresponding code in the ref vector.

Todo:
Convert to just be called book() cf. others

References Rivet::PercentileTBase< T >::add(), addAnalysisObject(), histoPath(), mkAxisCode(), and scale().

◆ crossSectionPerEvent()

double Rivet::Analysis::crossSectionPerEvent ( ) const
protected

Get the process cross-section per generated event in pb. Throws if this hasn't been set.

Referenced by handler().

◆ declare() [1/2]

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

Register a contained projection (user-facing version)

Todo:
Add SFINAE to require that PROJ inherit from Projection

References Rivet::ProjectionApplier::declareProjection().

Referenced by Rivet::CentralityProjection::add(), Rivet::VetoedFinalState::addVetoOnThisFinalState(), Rivet::BeamThrust::BeamThrust(), 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::GammaGammaKinematics::GammaGammaKinematics(), Rivet::GammaGammaLeptons::GammaGammaLeptons(), Rivet::GeneratedCentrality::GeneratedCentrality(), Rivet::HadronicFinalState::HadronicFinalState(), Rivet::HeavyHadrons::HeavyHadrons(), Rivet::Hemispheres::Hemispheres(), Rivet::LeadingParticlesFinalState::LeadingParticlesFinalState(), Rivet::LossyFinalState< ConstRandomFilter >::LossyFinalState(), Rivet::MC_pPbMinBiasTrigger::MC_pPbMinBiasTrigger(), Rivet::MC_SumETFwdPbCentrality::MC_SumETFwdPbCentrality(), Rivet::ATLAS::MinBiasTrigger::MinBiasTrigger(), Rivet::MissingMomentum::MissingMomentum(), Rivet::NeutralFinalState::NeutralFinalState(), Rivet::NonHadronicFinalState::NonHadronicFinalState(), Rivet::ParisiTensor::ParisiTensor(), Rivet::PercentileProjection::PercentileProjection(), Rivet::PrimaryHadrons::PrimaryHadrons(), Rivet::CentralityBinner< T, MDist >::setProjection(), Rivet::SmearedJets::SmearedJets(), Rivet::SmearedMET::SmearedMET(), Rivet::SmearedParticles::SmearedParticles(), Rivet::Spherocity::Spherocity(), Rivet::ATLAS::SumET_PB_Centrality::SumET_PB_Centrality(), Rivet::ATLAS::SumET_PBPB_Centrality::SumET_PBPB_Centrality(), Rivet::TauFinder::TauFinder(), Rivet::Thrust::Thrust(), Rivet::TriggerCDFRun0Run1::TriggerCDFRun0Run1(), Rivet::TriggerCDFRun2::TriggerCDFRun2(), Rivet::UndressBeamLeptons::UndressBeamLeptons(), Rivet::ALICE::V0AndTrigger::V0AndTrigger(), Rivet::ALICE::V0Trigger< MODE >::V0Trigger(), Rivet::VetoedFinalState::VetoedFinalState(), and Rivet::VisibleFinalState::VisibleFinalState().

◆ declare() [2/2]

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

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

Todo:
Add SFINAE to require that PROJ inherit from Projection

References Rivet::ProjectionApplier::declareProjection(), and Rivet::ProjectionApplier::name().

◆ declareCentrality()

const CentralityProjection& Rivet::Analysis::declareCentrality ( const SingleValueProjection proj,
string  calAnaName,
string  calHistName,
const string  projName,
bool  increasing = false 
)

Book a CentralityProjection.

Using a SingleValueProjection, proj, giving the value of an experimental observable to be used as a centrality estimator, book a CentralityProjection based on the experimentally measured pecentiles of this observable (as given by the reference data for the calHistName histogram in the calAnaName analysis. If a preloaded file with the output of a run using the calAnaName analysis contains a valid generated calHistName histogram, it will be used as an optional percentile binning. Also if this preloaded file contains a histogram with the name calHistName with an appended "_IMP" This histogram will be used to add an optional centrality percentile based on the generated impact parameter. If increasing is true, a low (high) value of proj is assumed to correspond to a more peripheral (central) event.

Referenced by getOption().

◆ declareProjection()

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

Register a contained 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.

Todo:
Add SFINAE to require that PROJ inherit from Projection

Referenced by Rivet::ProjectionApplier::declare().

◆ description()

virtual std::string Rivet::Analysis::description ( ) const
inlinevirtual

Get a full description of the analysis.

Full textual description of this analysis, what it is useful for, what experimental techniques are applied, etc. Should be treated as a chunk of restructuredText (http://docutils.sourceforge.net/rst.html), with equations to be rendered as LaTeX with amsmath operators.

References Rivet::AnalysisInfo::description(), and info().

◆ divide() [1/10]

void Rivet::Analysis::divide ( CounterPtr  c1,
CounterPtr  c2,
Scatter1DPtr  s 
) const

Helper for counter division.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

Referenced by scale().

◆ divide() [2/10]

void Rivet::Analysis::divide ( const YODA::Counter &  c1,
const YODA::Counter &  c2,
Scatter1DPtr  s 
) const

Helper for histogram division with raw YODA objects.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [3/10]

void Rivet::Analysis::divide ( Histo1DPtr  h1,
Histo1DPtr  h2,
Scatter2DPtr  s 
) const

Helper for histogram division.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [4/10]

void Rivet::Analysis::divide ( const YODA::Histo1D &  h1,
const YODA::Histo1D &  h2,
Scatter2DPtr  s 
) const

Helper for histogram division with raw YODA objects.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [5/10]

void Rivet::Analysis::divide ( Profile1DPtr  p1,
Profile1DPtr  p2,
Scatter2DPtr  s 
) const

Helper for profile histogram division.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [6/10]

void Rivet::Analysis::divide ( const YODA::Profile1D &  p1,
const YODA::Profile1D &  p2,
Scatter2DPtr  s 
) const

Helper for profile histogram division with raw YODA objects.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [7/10]

void Rivet::Analysis::divide ( Histo2DPtr  h1,
Histo2DPtr  h2,
Scatter3DPtr  s 
) const

Helper for 2D histogram division.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [8/10]

void Rivet::Analysis::divide ( const YODA::Histo2D &  h1,
const YODA::Histo2D &  h2,
Scatter3DPtr  s 
) const

Helper for 2D histogram division with raw YODA objects.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [9/10]

void Rivet::Analysis::divide ( Profile2DPtr  p1,
Profile2DPtr  p2,
Scatter3DPtr  s 
) const

Helper for 2D profile histogram division.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ divide() [10/10]

void Rivet::Analysis::divide ( const YODA::Profile2D &  p1,
const YODA::Profile2D &  p2,
Scatter3DPtr  s 
) const

Helper for 2D profile histogram division with raw YODA objects

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ efficiency() [1/2]

void Rivet::Analysis::efficiency ( Histo1DPtr  h1,
Histo1DPtr  h2,
Scatter2DPtr  s 
) const

Helper for histogram efficiency calculation.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

Referenced by scale().

◆ efficiency() [2/2]

void Rivet::Analysis::efficiency ( const YODA::Histo1D &  h1,
const YODA::Histo1D &  h2,
Scatter2DPtr  s 
) const

Helper for histogram efficiency calculation.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ finalize()

virtual void Rivet::Analysis::finalize ( )
inlinevirtual

Finalize this analysis object. A concrete class should here make all necessary operations on the histograms. Writing the histograms to a file is, however, done by the Rivet class. An overridden function must make sure it first calls the base class function.

Reimplemented in Rivet::MC_ParticleAnalysis, Rivet::MC_JetAnalysis, and Rivet::MC_JetSplittings.

◆ 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

References Rivet::ProjectionApplier::name().

◆ getAnalysisObject()

template<typename AO = MultiweightAOPtr>
AO Rivet::Analysis::getAnalysisObject ( const std::string &  ananame,
const std::string &  aoname 
)
inlineprotected

Get a data object from another analysis (e.g. preloaded calibration histogram).

◆ getOption()

template<typename T >
T Rivet::Analysis::getOption ( std::string  optname,
def 
)
inline

Get an option for this analysis instance converted to a specific type (given by the specified def value).

References declareCentrality().

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

◆ init()

virtual void Rivet::Analysis::init ( )
inlinevirtual

Initialize this analysis object. A concrete class should here book all necessary histograms. An overridden function must make sure it first calls the base class function.

Reimplemented in Rivet::MC_JetAnalysis, Rivet::MC_ParticleAnalysis, and Rivet::MC_JetSplittings.

References analyze().

◆ integrate() [1/2]

void Rivet::Analysis::integrate ( Histo1DPtr  h,
Scatter2DPtr  s 
) const

Helper for converting a differential histo to an integral one.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

Referenced by scale().

◆ integrate() [2/2]

void Rivet::Analysis::integrate ( const Histo1D &  h,
Scatter2DPtr  s 
) const

Helper for converting a differential histo to an integral one.

Note
Assigns to the (already registered) output scatter, s. Preserves the path information of the target.

◆ name()

virtual std::string Rivet::Analysis::name ( ) const
inlinevirtual

Get the name of the analysis.

By default this is computed by combining the results of the experiment, year and Spires ID metadata methods and you should only override it if there's a good reason why those won't work. If options has been set for this instance, a corresponding string is appended at the end.

Implements Rivet::ProjectionApplier.

References info().

Referenced by addAnalysisObject(), refData(), registerAO(), and setRefDataName().

◆ normalize() [1/4]

void Rivet::Analysis::normalize ( const std::vector< Histo1DPtr > &  histos,
CounterAdapter  norm = 1.0,
bool  includeoverflows = true 
)
inline

Normalize the given histograms, histos, to area = norm.

Note
Constness intentional, if weird, to allow passing rvalue refs of smart ptrs (argh)
Todo:
Use SFINAE for a generic iterable of Histo1DPtrs

References normalize().

◆ normalize() [2/4]

template<std::size_t array_size>
void Rivet::Analysis::normalize ( const Histo1DPtr(&)  histos[array_size],
CounterAdapter  norm = 1.0,
bool  includeoverflows = true 
)
inline
Todo:
YUCK!

References normalize(), and scale().

◆ normalize() [3/4]

void Rivet::Analysis::normalize ( const std::vector< Histo2DPtr > &  histos,
CounterAdapter  norm = 1.0,
bool  includeoverflows = true 
)
inline

Normalize the given histograms, histos, to area = norm.

Note
Constness intentional, if weird, to allow passing rvalue refs of smart ptrs (argh)
Todo:
Use SFINAE for a generic iterable of Histo2DPtrs

References normalize().

◆ normalize() [4/4]

template<std::size_t array_size>
void Rivet::Analysis::normalize ( const Histo2DPtr(&)  histos[array_size],
CounterAdapter  norm = 1.0,
bool  includeoverflows = true 
)
inline
Todo:
YUCK!

References normalize(), and scale().

◆ numEvents()

size_t Rivet::Analysis::numEvents ( ) const
protected

Get the number of events seen (via the analysis handler).

Note
Use in the finalize phase only.

Referenced by handler().

◆ refData() [1/2]

template<typename T = YODA::Scatter2D>
const T& Rivet::Analysis::refData ( const string &  hname) const
inlineprotected

Get reference data for a named histo

Todo:
SFINAE to ensure that the type inherits from YODA::AnalysisObject?

References name().

Referenced by refData().

◆ refData() [2/2]

template<typename T = YODA::Scatter2D>
const T& Rivet::Analysis::refData ( unsigned int  datasetId,
unsigned int  xAxisId,
unsigned int  yAxisId 
) const
inlineprotected

Get reference data for a numbered histo

Todo:
SFINAE to ensure that the type inherits from YODA::AnalysisObject?

References book(), mkAxisCode(), name(), and refData().

◆ runInfo()

virtual std::string Rivet::Analysis::runInfo ( ) const
inlinevirtual

Information about the events needed as input for this analysis.

Event types, energies, kinematic cuts, particles to be considered stable, etc. etc. Should be treated as a restructuredText bullet list (http://docutils.sourceforge.net/rst.html)

References info(), and Rivet::AnalysisInfo::runInfo().

◆ scale() [1/6]

void Rivet::Analysis::scale ( const std::vector< CounterPtr > &  cnts,
CounterAdapter  factor 
)
inline

Multiplicatively scale the given counters, cnts, by factor factor.

Note
Constness intentional, if weird, to allow passing rvalue refs of smart ptrs (argh)
Todo:
Use SFINAE for a generic iterable of CounterPtrs

References scale().

◆ scale() [2/6]

template<std::size_t array_size>
void Rivet::Analysis::scale ( const CounterPtr(&)  cnts[array_size],
CounterAdapter  factor 
)
inline
Todo:
YUCK!

References normalize(), and scale().

◆ scale() [3/6]

void Rivet::Analysis::scale ( const std::vector< Histo1DPtr > &  histos,
CounterAdapter  factor 
)
inline

Multiplicatively scale the given histograms, histos, by factor factor.

Note
Constness intentional, if weird, to allow passing rvalue refs of smart ptrs (argh)
Todo:
Use SFINAE for a generic iterable of Histo1DPtrs

References scale().

◆ scale() [4/6]

template<std::size_t array_size>
void Rivet::Analysis::scale ( const Histo1DPtr(&)  histos[array_size],
CounterAdapter  factor 
)
inline
Todo:
YUCK!

References normalize(), and scale().

◆ scale() [5/6]

void Rivet::Analysis::scale ( const std::vector< Histo2DPtr > &  histos,
CounterAdapter  factor 
)
inline

Multiplicatively scale the given histograms, histos, by factor factor.

Note
Constness intentional, if weird, to allow passing rvalue refs of smart ptrs (argh)
Todo:
Use SFINAE for a generic iterable of Histo2DPtrs

References scale().

◆ scale() [6/6]

template<std::size_t array_size>
void Rivet::Analysis::scale ( const Histo2DPtr(&)  histos[array_size],
CounterAdapter  factor 
)
inline

◆ summary()

virtual std::string Rivet::Analysis::summary ( ) const
inlinevirtual

Get a short description of the analysis.

Short (one sentence) description used as an index entry. Use description() to provide full descriptive paragraphs of analysis details.

References info(), and Rivet::AnalysisInfo::summary().

◆ sumW()

double Rivet::Analysis::sumW ( ) const
protected

Get the sum of event weights seen (via the analysis handler).

Note
Use in the finalize phase only.

Referenced by handler(), and sumOfWeights().

◆ sumW2()

double Rivet::Analysis::sumW2 ( ) const
protected

Get the sum of squared event weights seen (via the analysis handler).

Note
Use in the finalize phase only.

Referenced by sumOfWeights().


The documentation for this class was generated from the following file:
  • /home/andy/proj/hep/rivet-31x/include/Rivet/Analysis.hh