rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
Rivet::Cutflow Struct Reference

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

#include <Cutflow.hh>

Public Member Functions

 Cutflow ()
 Default constructor. More...
 
 Cutflow (const string &cfname, const vector< string > &cutnames)
 Proper constructor.
 
void fillinit (double weight=1.)
 Fill the pre-cut counter.
 
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. More...
 
bool fill (size_t icut, double weight)
 Fill the {icut}'th post-cut counter, starting at icut=1 for first cut (cutvalue=true overload) More...
 
bool fill (const vector< bool > &cutresults, double weight=1.)
 Fill all cut-state counters from an Ncut-element results vector. More...
 
bool filltail (const vector< bool > &cutresults, double weight=1.)
 Fill the N trailing post-cut counters, when supplied with an N-element results vector. More...
 
void scale (double factor)
 Scale the cutflow weights by the given factor.
 
void normalize (double norm, size_t icut=0)
 Scale the cutflow weights so that the weight count after cut icut is norm.
 
string str () const
 Create a string representation.
 
void print (ostream &os) const
 Print string representation to a stream.
 

Public Attributes

string name
 
size_t ncuts
 
vector< string > cuts
 
vector< double > counts
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Cutflow()

Rivet::Cutflow::Cutflow ( )
inline

Default constructor.

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

Referenced by Rivet::Cutflows::addCutflow().

Member Function Documentation

◆ fill() [1/3]

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

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

Referenced by fill(), and Rivet::Cutflows::fill().

◆ fill() [2/3]

bool Rivet::Cutflow::fill ( size_t  icut,
double  weight 
)
inline

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

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.

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

References fill().

◆ fill() [3/3]

bool Rivet::Cutflow::fill ( const vector< bool > &  cutresults,
double  weight = 1. 
)
inline

Fill all cut-state counters from an Ncut-element results vector.

This function is to be used to fill all of an event's pre- and post-cut state counters at once, including the incoming event counter. It must not be mixed with calls to the fill(size_t, bool) and fillinit() methods, or double-counting will occur.

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

References Rivet::all().

◆ filltail()

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

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

Todo:
Add a fillnext(), keeping track of current ifill
Todo:
Add a fillhead() (or vector fillnext()?)

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.

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

References Rivet::all().


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