Nymph  v1.5.2
Flow-Based Data Processing Framework
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
KTCutStatus Class Reference

Provides easy access to cut information. More...

#include <KTCutStatus.hh>

Classes

class  KTCutResultHandle
 

Public Types

typedef boost::dynamic_bitset< > bitset_type
 

Public Member Functions

 KTCutStatus ()
 
 KTCutStatus (const KTCutStatus &orig)
 
 ~KTCutStatus ()
 
KTCutStatusoperator= (const KTCutStatus &rhs)
 
const KTCutResultCutResults () const
 
void UpdateStatus ()
 
template<typename XCutType >
bool AddCutResult (bool state, bool doUpdateStatus=true)
 
bool AddCutResult (const std::string &cutName, bool state, bool doUpdateStatus=true)
 
bool AddCutResult (const char *cutName, bool state, bool doUpdateStatus=true)
 
template<typename XCutType >
bool AddCutResult (const XCutType &cut, bool doUpdateStatus=true)
 
template<typename XCutType >
bool HasCutResult () const
 
bool HasCutResult (const std::string &cutName) const
 
template<typename XCutType >
bool GetCutState () const
 
bool GetCutState (const std::string &cutName) const
 
template<typename XCutType >
const KTCutResultGetCutResult () const
 
const KTCutResultGetCutResult (const std::string &cutName) const
 
template<typename XCutType >
KTCutResultGetCutResult ()
 
KTCutResultGetCutResult (const std::string &cutName)
 
template<typename XCutType >
bool SetCutState (bool state, bool doUpdateStatus=true)
 
bool SetCutState (const std::string &cutName, bool state, bool doUpdateStatus=true)
 
template<typename XCutType >
void RemoveCutResult (bool doUpdateStatus=true)
 
std::string CutResultsPresent () const
 Returns a string with the names of the cuts that are present in bitset order. More...
 
size_t size () const
 
bool IsCut () const
 
bool IsCut (const bitset_type &mask) const
 
bool IsCut (unsigned long long mask) const
 
bool IsCut (const std::string &mask) const
 
bitset_type ToBitset (unsigned long long mask) const
 
bitset_type ToBitset (const std::string &mask) const
 

Private Attributes

boost::scoped_ptr< KTCutResultHandlefCutResults
 
bitset_type fSummary
 

Friends

std::ostream & operator<< (std::ostream &out, const KTCutStatus &status)
 

Detailed Description

Provides easy access to cut information.

Author
N. S. Oblath

KTCutStatus is typically used as a member variable of KTData, the top-level data object.

KTCutStatus owns the set of cut results that have been added to a data object. It also owns a summary of those cuts (implemented with boost::dynamic_bitset).

You can check if the data has been cut with the IsCut functions.

When specifying a cut mask, bits set to true specify cuts that should be used:

With KTCutStatus you can interact with individual cut results in the following ways:

For all except KTCutStatus::RemoveCutResult, the cut result can be identified by type or string name.

Definition at line 54 of file KTCutStatus.hh.

Member Typedef Documentation

◆ bitset_type

typedef boost::dynamic_bitset< > bitset_type

Definition at line 57 of file KTCutStatus.hh.

Constructor & Destructor Documentation

◆ KTCutStatus() [1/2]

Definition at line 17 of file KTCutStatus.cc.

◆ KTCutStatus() [2/2]

KTCutStatus ( const KTCutStatus orig)

Definition at line 23 of file KTCutStatus.cc.

◆ ~KTCutStatus()

Definition at line 30 of file KTCutStatus.cc.

Member Function Documentation

◆ AddCutResult() [1/4]

bool AddCutResult ( bool  state,
bool  doUpdateStatus = true 
)

Definition at line 146 of file KTCutStatus.hh.

◆ AddCutResult() [2/4]

bool AddCutResult ( const std::string &  cutName,
bool  state,
bool  doUpdateStatus = true 
)

Definition at line 71 of file KTCutStatus.cc.

◆ AddCutResult() [3/4]

bool AddCutResult ( const char *  cutName,
bool  state,
bool  doUpdateStatus = true 
)
inline

Definition at line 157 of file KTCutStatus.hh.

◆ AddCutResult() [4/4]

bool AddCutResult ( const XCutType &  cut,
bool  doUpdateStatus = true 
)

Definition at line 163 of file KTCutStatus.hh.

◆ CutResults()

const KTCutResult * CutResults ( ) const
inline

Definition at line 140 of file KTCutStatus.hh.

◆ CutResultsPresent()

std::string CutResultsPresent ( ) const

Returns a string with the names of the cuts that are present in bitset order.

Definition at line 158 of file KTCutStatus.cc.

◆ GetCutResult() [1/4]

const KTCutResult * GetCutResult ( ) const

Definition at line 191 of file KTCutStatus.hh.

◆ GetCutResult() [2/4]

const KTCutResult * GetCutResult ( const std::string &  cutName) const

Definition at line 105 of file KTCutStatus.cc.

◆ GetCutResult() [3/4]

KTCutResult * GetCutResult ( )

Definition at line 201 of file KTCutStatus.hh.

◆ GetCutResult() [4/4]

KTCutResult * GetCutResult ( const std::string &  cutName)

Definition at line 116 of file KTCutStatus.cc.

◆ GetCutState() [1/2]

bool GetCutState ( ) const

Definition at line 181 of file KTCutStatus.hh.

◆ GetCutState() [2/2]

bool GetCutState ( const std::string &  cutName) const

Definition at line 98 of file KTCutStatus.cc.

◆ HasCutResult() [1/2]

bool HasCutResult ( ) const
inline

Definition at line 175 of file KTCutStatus.hh.

◆ HasCutResult() [2/2]

bool HasCutResult ( const std::string &  cutName) const

Definition at line 91 of file KTCutStatus.cc.

◆ IsCut() [1/4]

bool IsCut ( ) const
inline

Definition at line 223 of file KTCutStatus.hh.

◆ IsCut() [2/4]

bool IsCut ( const bitset_type mask) const
inline

Definition at line 228 of file KTCutStatus.hh.

◆ IsCut() [3/4]

bool IsCut ( unsigned long long  mask) const
inline

Definition at line 233 of file KTCutStatus.hh.

◆ IsCut() [4/4]

bool IsCut ( const std::string &  mask) const
inline

Definition at line 238 of file KTCutStatus.hh.

◆ operator=()

KTCutStatus & operator= ( const KTCutStatus rhs)

Definition at line 33 of file KTCutStatus.cc.

◆ RemoveCutResult()

void RemoveCutResult ( bool  doUpdateStatus = true)
inline

Definition at line 211 of file KTCutStatus.hh.

◆ SetCutState() [1/2]

bool SetCutState ( bool  state,
bool  doUpdateStatus = true 
)

◆ SetCutState() [2/2]

bool SetCutState ( const std::string &  cutName,
bool  state,
bool  doUpdateStatus = true 
)

Definition at line 127 of file KTCutStatus.cc.

◆ size()

size_t size ( ) const
inline

Definition at line 218 of file KTCutStatus.hh.

◆ ToBitset() [1/2]

KTCutStatus::bitset_type ToBitset ( unsigned long long  mask) const
inline

Definition at line 243 of file KTCutStatus.hh.

◆ ToBitset() [2/2]

KTCutStatus::bitset_type ToBitset ( const std::string &  mask) const
inline

Definition at line 248 of file KTCutStatus.hh.

◆ UpdateStatus()

void UpdateStatus ( )

Definition at line 40 of file KTCutStatus.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const KTCutStatus status 
)
friend

Definition at line 187 of file KTCutStatus.cc.

Member Data Documentation

◆ fCutResults

boost::scoped_ptr< KTCutResultHandle > fCutResults
private

Definition at line 122 of file KTCutStatus.hh.

◆ fSummary

bitset_type fSummary
private

Definition at line 124 of file KTCutStatus.hh.


The documentation for this class was generated from the following files: