struct Gambit::ColliderBit::Cutflow
A tracker of numbers & fractions of events passing sequential cuts.
#include <Cutflow.hpp>
Public Functions
| Name | |
|---|---|
| Cutflow() Default constructor. | |
| 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. |
| bool | fill(size_t icut, double weight) Fill the {icut}’th post-cut counter, starting at icut=1 for first cut (cutvalue=true overload) |
| 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. |
| bool | fillall(const vector< bool > & cutresults, double weight =1.) Fill all cut-state counters from an Ncut-element results vector, starting at icut=1. |
| bool | fillnext(bool cutresult, double weight =1.) Fill the next post-cut counter. |
| bool | fillnext(double weight =1.) Fill the next post-cut counter, assuming a true result. |
| bool | fillnext(const vector< bool > & cutresults, double weight =1.) Fill the next cut-state counters from an n-element results vector. |
| bool | filltail(const vector< bool > & cutresults, double weight =1.) Fill the N trailing post-cut counters, when supplied with an N-element results vector. |
| 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
| Name | |
|---|---|
| string | name |
| size_t | ncuts |
| vector< string > | cuts |
| vector< double > | counts |
| size_t | icurr |
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 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.
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 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 2025-02-12 at 16:10:32 +0000