rivet is hosted by Hepforge, IPPP Durham
Rivet 3.1.6
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 (size_t icut, const vector< bool > &cutresults, double weight=1.)
 Fill cut-state counters from an n-element results vector, starting at icut. More...
 
bool fillnext (bool cutresult, double weight=1.)
 Fill the next post-cut counter. More...
 
bool fillnext (double weight=1.)
 Fill the next post-cut counter, assuming a true result. More...
 
bool fillnext (const vector< bool > &cutresults, double weight=1.)
 Fill the next cut-state counters from an n-element results vector. More...
 
bool fillall (const vector< bool > &cutresults, double weight=1.)
 Fill all cut-state counters from an Ncut-element results vector, starting at icut=1. 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 (std::ostream &os) const
 Print string representation to a stream.
 

Public Attributes

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

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

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(), fillall(), fillnext(), and filltail().

◆ fill() [2/3]

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

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

References fill().

◆ fill() [3/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().

◆ fillall()

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

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

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

References fill().

◆ fillnext() [1/3]

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

Fill the next post-cut counter.

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

References fill().

◆ fillnext() [2/3]

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

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

References fill().

◆ fillnext() [3/3]

bool Rivet::Cutflow::fillnext ( double  weight = 1.)
inline

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

References fill().

◆ 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.

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.

Deprecated:
Now prefer to use vector fillnext()
Note
Returns the overall cut result to allow 'side-effect' cut-flow filling in an if-statement

References fill().


The documentation for this struct was generated from the following file:
  • /Users/chrisg/software/rivet/include/Rivet/Tools/Cutflow.hh