Belle II Software development
Filter< Belle2::OperatorNot, someFilter, templateObserverType > Class Template Reference

Realization of a NOT operator for the Filter classes. More...

#include <Filter.h>

Public Types

typedef someFilter::argumentType argumentType
 Handy typedef for arguments.
 
typedef someFilter::functionType functionType
 Handy typedef for function.
 

Public Member Functions

 Filter (const someFilter &filter)
 Constructor creating a NOT filter from a filter.
 
 Filter ()
 Empty constructor.
 
template<typename ... argsType>
std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept (const argsType &... args) const
 The accept method of the filter with NOT Operator: This will return the inverse of the result of the accept method.
 
std::string getNameAndReference (std::vector< std::pair< char, void * > > *pointers=nullptr)
 Getter for name of and reference to the range of the filters.
 
template<class otherObserver >
Filter< Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())), otherObserver > observeLeaf (const otherObserver &) const
 Will set the observer for the combination of NOT operator + filter.
 
void persist (TTree *t, const std::string &branchName)
 Persist the filter on a TTree.
 
void setBranchAddress (TTree *t, const std::string &branchName)
 Set the Branches addresses to this filter.
 

Private Attributes

const char * c_notSuffix = "_not"
 Char suffix to be used in the filter name for ROOT to indicate that NOT operator is attached.
 
someFilter m_filter
 Member variable containing the filter.
 

Detailed Description

template<class someFilter, class templateObserverType>
class Belle2::Filter< Belle2::OperatorNot, someFilter, templateObserverType >

Realization of a NOT operator for the Filter classes.

Template Parameters
someFilter: filter type to which the not operator shall be applied
templateObserverType: observer type of the filter to pass it along

Definition at line 488 of file Filter.h.

Member Typedef Documentation

◆ argumentType

typedef someFilter::argumentType argumentType

Handy typedef for arguments.

Definition at line 493 of file Filter.h.

◆ functionType

typedef someFilter::functionType functionType

Handy typedef for function.

Definition at line 495 of file Filter.h.

Constructor & Destructor Documentation

◆ Filter() [1/2]

Filter ( const someFilter< Belle2::OperatorNot, someFilter, templateObserverType > &  filter)
inlineexplicit

Constructor creating a NOT filter from a filter.

Parameters
filter: filter to be copied

Definition at line 501 of file Filter.h.

501 :
502 m_filter(filter) { };
someFilter m_filter
Member variable containing the filter.
Definition: Filter.h:572
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38

◆ Filter() [2/2]

Filter ( )
inline

Empty constructor.

Definition at line 506 of file Filter.h.

506{ };

Member Function Documentation

◆ accept()

std::enable_if< all_same< argumentType, argsType... >::value, bool >::type accept ( const argsType &...  args) const
inline

The accept method of the filter with NOT Operator: This will return the inverse of the result of the accept method.

Template Parameters
argsTypetemplate arguments depending on the filter
Parameters
argsvalues to be tested by the filters
Returns
boolean indicating if filter is NOT passed

Definition at line 517 of file Filter.h.

518 {
519 return ! m_filter.accept(args ...);
520 }

◆ getNameAndReference()

std::string getNameAndReference ( std::vector< std::pair< char, void * > > *  pointers = nullptr)
inline

Getter for name of and reference to the range of the filters.

Calls getNameAndReference of RangeType.

Parameters
pointerspointer to vector of pairs of names of and pointers to the filters
Returns
string containing name of the variable and the bounds of the range (see RangeTypes)

Definition at line 528 of file Filter.h.

529 {
530 return "!" + m_filter.getNameAndReference(pointers);
531 }

◆ observeLeaf()

Filter< Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())), otherObserver > observeLeaf ( const otherObserver &  ) const
inline

Will set the observer for the combination of NOT operator + filter.

Template Parameters
otherObserver: the new observer
Returns
the filter with the new observer

Definition at line 540 of file Filter.h.

541 {
542 return Filter<Belle2::OperatorNot, decltype(someFilter().observeLeaf(otherObserver())),
543 otherObserver>(m_filter.observeLeaf(otherObserver()));
544 }

◆ persist()

void persist ( TTree *  t,
const std::string &  branchName 
)
inline

Persist the filter on a TTree.

Parameters
tis the TTree under which the TBranch will be created
branchNameis the name of the TBranch holding m_range

Definition at line 551 of file Filter.h.

552 {
553 std::string nameOfFilter(branchName);
554 nameOfFilter += c_notSuffix;
555 m_filter.persist(t, nameOfFilter);
556 }
const char * c_notSuffix
Char suffix to be used in the filter name for ROOT to indicate that NOT operator is attached.
Definition: Filter.h:490

◆ setBranchAddress()

void setBranchAddress ( TTree *  t,
const std::string &  branchName 
)
inline

Set the Branches addresses to this filter.

Parameters
tis the TTree containing the TBranch
branchNameis the name of the TBranch holding the m_range

Definition at line 563 of file Filter.h.

564 {
565 std::string nameOfFilter(branchName);
566 nameOfFilter += c_notSuffix;
567 m_filter.setBranchAddress(t, nameOfFilter);
568 }

Member Data Documentation

◆ c_notSuffix

const char* c_notSuffix = "_not"
private

Char suffix to be used in the filter name for ROOT to indicate that NOT operator is attached.

Definition at line 490 of file Filter.h.

◆ m_filter

someFilter m_filter
private

Member variable containing the filter.

Definition at line 572 of file Filter.h.


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