struct Rivet::Cutflow

Rivet::Cutflow

A tracker of numbers & fractions of events passing sequential cuts.

#include <Cutflow.hh>

Public Functions

Name
Cutflow()
Default constructor.
Cutflow(const string & cfname, const vector< string > & cutnames)
Proper constructor.
voidfillinit(double weight =1.)
Fill the pre-cut counter.
boolfill(size_t icut, bool cutresult =true, double weight =1.)
Fill the {icut}’th post-cut counter, starting at icut=1 for first cut.
boolfill(size_t icut, double weight)
Fill the {icut}’th post-cut counter, starting at icut=1 for first cut (cutvalue=true overload)
boolfill(size_t icut, const vector< bool > & cutresults, double weight =1.)
Fill cut-state counters from an n-element results vector, starting at icut.
boolfillnext(bool cutresult, double weight =1.)
Fill the next post-cut counter.
boolfillnext(double weight =1.)
Fill the next post-cut counter, assuming a true result.
boolfillnext(const vector< bool > & cutresults, double weight =1.)
Fill the next cut-state counters from an n-element results vector.
boolfillall(const vector< bool > & cutresults, double weight =1.)
Fill all cut-state counters from an Ncut-element results vector, starting at icut=1.
boolfilltail(const vector< bool > & cutresults, double weight =1.)
Fill the N trailing post-cut counters, when supplied with an N-element results vector.
voidscale(double factor)
Scale the cutflow weights by the given factor.
voidnormalize(double norm, size_t icut =0)
Scale the cutflow weights so that the weight count after cut icut is norm.
stringstr() const
Create a string representation.
voidprint(std::ostream & os) const
Print string representation to a stream.

Public Attributes

Name
stringname
size_tncuts
vector< string >cuts
vector< double >counts
size_ticurr

Public Functions Documentation

function Cutflow

inline Cutflow()

Default constructor.

Does nothing! Just to allow storage in STL containers and use as a member variable without using the init list

function Cutflow

inline Cutflow(
    const string & cfname,
    const vector< string > & cutnames
)

Proper constructor.

function fillinit

inline void fillinit(
    double weight =1.
)

Fill the pre-cut counter.

function fill

inline bool fill(
    size_t icut,
    bool cutresult =true,
    double weight =1.
)

Fill the {icut}’th post-cut counter, starting at icut=1 for first cut.

Note: Returns the cut result to allow ‘side-effect’ cut-flow filling in an if-statement

function fill

inline bool fill(
    size_t icut,
    double weight
)

Fill the {icut}’th post-cut counter, starting at icut=1 for first cut (cutvalue=true overload)

Note: Returns the cut result to allow ‘side-effect’ cut-flow filling in an if-statement

This version exists to allow calling fill(i, weight) without the weight getting cast to a bool, or having to explicitly add a ’true’ middle arg.

function fill

inline bool fill(
    size_t icut,
    const vector< bool > & cutresults,
    double weight =1.
)

Fill cut-state counters from an n-element results vector, starting at icut.

Note: Returns the overall cut result to allow ‘side-effect’ cut-flow filling in an if-statement

function fillnext

inline bool fillnext(
    bool cutresult,
    double weight =1.
)

Fill the next post-cut counter.

Note: Returns the cut result to allow ‘side-effect’ cut-flow filling in an if-statement

function fillnext

inline bool fillnext(
    double weight =1.
)

Fill the next post-cut counter, assuming a true result.

Note: Returns the cut result to allow ‘side-effect’ cut-flow filling in an if-statement

function fillnext

inline bool fillnext(
    const vector< bool > & cutresults,
    double weight =1.
)

Fill the next cut-state counters from an n-element results vector.

Note: Returns the cut result to allow ‘side-effect’ cut-flow filling in an if-statement

function fillall

inline bool fillall(
    const vector< bool > & cutresults,
    double weight =1.
)

Fill all cut-state counters from an Ncut-element results vector, starting at icut=1.

Deprecated:

Prefer to use vector fillinit() and vector fill()

function filltail

inline bool filltail(
    const vector< bool > & cutresults,
    double weight =1.
)

Fill the N trailing post-cut counters, when supplied with an N-element results vector.

Deprecated:

Now prefer to use vector fillnext()

Note: Returns the overall cut result to allow ‘side-effect’ cut-flow filling in an if-statement

The cutresults vector represents the boolean results of the last N cuts. This function allows mixing of cut-flow filling with higher-level analyze() function escapes such as the vetoEvent directive. The initial state (state 0) is not incremented.

function scale

inline void scale(
    double factor
)

Scale the cutflow weights by the given factor.

function normalize

inline void normalize(
    double norm,
    size_t icut =0
)

Scale the cutflow weights so that the weight count after cut icut is norm.

function str

inline string str() const

Create a string representation.

function print

inline void print(
    std::ostream & os
) const

Print string representation to a stream.

Public Attributes Documentation

variable name

string name;

variable ncuts

size_t ncuts;

variable cuts

vector< string > cuts;

variable counts

vector< double > counts;

variable icurr

size_t icurr;

Updated on 2022-08-07 at 20:17:16 +0100