npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::NtRectangularCut< Numeric > Class Template Reference

#include <NtRectangularCut.hh>

Public Member Functions

 NtRectangularCut ()
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4, unsigned long c5, const T &min5, const T &max5)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4, unsigned long c5, const T &min5, const T &max5, unsigned long c6, const T &min6, const T &max6)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4, unsigned long c5, const T &min5, const T &max5, unsigned long c6, const T &min6, const T &max6, unsigned long c7, const T &min7, const T &max7)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4, unsigned long c5, const T &min5, const T &max5, unsigned long c6, const T &min6, const T &max6, unsigned long c7, const T &min7, const T &max7, unsigned long c8, const T &min8, const T &max8)
 
template<typename T >
 NtRectangularCut (unsigned long c0, const T &min0, const T &max0, unsigned long c1, const T &min1, const T &max1, unsigned long c2, const T &min2, const T &max2, unsigned long c3, const T &min3, const T &max3, unsigned long c4, const T &min4, const T &max4, unsigned long c5, const T &min5, const T &max5, unsigned long c6, const T &min6, const T &max6, unsigned long c7, const T &min7, const T &max7, unsigned long c8, const T &min8, const T &max8, unsigned long c9, const T &min9, const T &max9)
 
template<typename T >
 NtRectangularCut (const std::vector< unsigned long > &ntupleColumns, const BoxND< T > &acceptedBox)
 
template<typename T >
NtRectangularCutaddCut (unsigned long cutColumn, const T &min, const T &max, bool inverted=false)
 
template<typename T >
NtRectangularCutaddCut (const NtRectangularCut< T > &another)
 
void invert ()
 
unsigned long dim () const
 
unsigned long cutColumn (const unsigned long cutNumber) const
 
void cutInterval (unsigned long cutNumber, Numeric *minValue, Numeric *maxValue) const
 
bool isInverted (unsigned long cutNumber) const
 
unsigned long nUniqueColumns () const
 
std::vector< unsigned long > ntupleColumns () const
 
BoxND< Numeric > acceptedBox () const
 
bool operator() (unsigned long rowNumber, const Numeric *row, unsigned long nCols) const
 
bool operator== (const NtRectangularCut< Numeric > &r) const
 
bool operator!= (const NtRectangularCut< Numeric > &r) const
 
gs::ClassId classId () const
 
bool write (std::ostream &of) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static void restore (const gs::ClassId &id, std::istream &in, NtRectangularCut *cut)
 

Detailed Description

template<typename Numeric>
class npstat::NtRectangularCut< Numeric >

This convenience class implements simple rectangular cuts on ntuple contents. Cut lower bound is included and cut upper bound is excluded from the passing sample. It is possible to specify min >= max for any rectangle dimension. In this case no ntuple rows will be accepted by the cut.

The template parameter should coincide with the ntuple value_type.

For use inside "conditionalCycleOverRows", and other similar methods of AbsNtuple.

Constructor & Destructor Documentation

◆ NtRectangularCut() [1/3]

template<typename Numeric >
npstat::NtRectangularCut< Numeric >::NtRectangularCut ( )
inline

Default constructor creates an "all pass" cut

◆ NtRectangularCut() [2/3]

template<typename Numeric >
template<typename T >
npstat::NtRectangularCut< Numeric >::NtRectangularCut ( unsigned long  c0,
const T &  min0,
const T &  max0 
)

For this convenience constructor, there must be an automatic conversion from type T to Numeric.

It is assumed that correctness of the ntuple column numbers has already been verified. Use "validColumn()" ntuple method or other similar checks to ensure this correctness and do not reuse cut objects with ntuples that might have different column structure.

◆ NtRectangularCut() [3/3]

template<typename Numeric >
template<typename T >
npstat::NtRectangularCut< Numeric >::NtRectangularCut ( const std::vector< unsigned long > &  ntupleColumns,
const BoxND< T > &  acceptedBox 
)

Constructor for a cut of arbitrary dimensionality. Note that it is impossible to specify a box with negative side length.

Member Function Documentation

◆ addCut() [1/2]

template<typename Numeric >
template<typename T >
NtRectangularCut& npstat::NtRectangularCut< Numeric >::addCut ( const NtRectangularCut< T > &  another)

Add all cuts from another object of similar kind

◆ addCut() [2/2]

template<typename Numeric >
template<typename T >
NtRectangularCut& npstat::NtRectangularCut< Numeric >::addCut ( unsigned long  cutColumn,
const T &  min,
const T &  max,
bool  inverted = false 
)

Add a cut on column contents to the set. Returns *this, so that a bunch of calls of this method can be stacked.

◆ classId()

template<typename Numeric >
gs::ClassId npstat::NtRectangularCut< Numeric >::classId ( ) const
inline

Method related to "geners" I/O

◆ cutColumn()

template<typename Numeric >
unsigned long npstat::NtRectangularCut< Numeric >::cutColumn ( const unsigned long  cutNumber) const
inline

In this method, cutNumber parameter should be less than dim()

◆ cutInterval()

template<typename Numeric >
void npstat::NtRectangularCut< Numeric >::cutInterval ( unsigned long  cutNumber,
Numeric *  minValue,
Numeric *  maxValue 
) const

In principle, min can be larger than max. Because of this, we can't just return Interval<Numeric> when inspecting cut values.

◆ dim()

template<typename Numeric >
unsigned long npstat::NtRectangularCut< Numeric >::dim ( ) const
inline

The number of cuts defined so far

◆ invert()

template<typename Numeric >
void npstat::NtRectangularCut< Numeric >::invert ( )

Invert the meaning of all cuts added so far to this object

◆ isInverted()

template<typename Numeric >
bool npstat::NtRectangularCut< Numeric >::isInverted ( unsigned long  cutNumber) const

Was the cut meaning inverted?

◆ ntupleColumns()

template<typename Numeric >
std::vector<unsigned long> npstat::NtRectangularCut< Numeric >::ntupleColumns ( ) const

Convert to column vector / cut box. Intervals in which min >= max are converted into [min, min]. "acceptedBox" method will throw std::invalid_argument if any of the cuts have been inverted.

◆ nUniqueColumns()

template<typename Numeric >
unsigned long npstat::NtRectangularCut< Numeric >::nUniqueColumns ( ) const

The following method returns the number of unique columns. It may be useful to check that nUniqueColumns() == dim() after the cut is fully constructed (unless you intentionally include more than one cut for some column).

◆ operator!=()

template<typename Numeric >
bool npstat::NtRectangularCut< Numeric >::operator!= ( const NtRectangularCut< Numeric > &  r) const
inline

Logical negation of operator==

◆ operator()()

template<typename Numeric >
bool npstat::NtRectangularCut< Numeric >::operator() ( unsigned long  rowNumber,
const Numeric *  row,
unsigned long  nCols 
) const

Operator which returns "true" if an ntuple row passes the cut

◆ operator==()

template<typename Numeric >
bool npstat::NtRectangularCut< Numeric >::operator== ( const NtRectangularCut< Numeric > &  r) const

Comparison for equality


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