test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
BPHMultiSelect< T > Class Template Reference

#include <BPHMultiSelect.h>

Inheritance diagram for BPHMultiSelect< T >:

Classes

struct  SelectElement
 

Public Member Functions

template<>
bool accept (const reco::Candidate &cand, const BPHRecoBuilder *build) const
 
template<>
bool accept (const reco::Candidate &cand) const
 
template<>
bool accept (const BPHDecayMomentum &cand) const
 
template<>
bool accept (const BPHDecayVertex &cand) const
 
virtual bool accept (const reco::Candidate &cand, const BPHRecoBuilder *build) const
 accept function More...
 
virtual bool accept (const reco::Candidate &cand) const
 
virtual bool accept (const BPHDecayMomentum &cand) const
 
virtual bool accept (const BPHDecayVertex &cand) const
 
template<>
bool accept (const reco::Candidate &cand, const BPHRecoBuilder *build) const
 
template<>
bool accept (const reco::Candidate &cand) const
 
template<>
bool accept (const BPHDecayMomentum &cand) const
 
template<>
bool accept (const BPHDecayVertex &cand) const
 
 BPHMultiSelect (BPHSelectOperation::mode op)
 
void include (T &s, bool m=true)
 include selection More...
 
virtual ~BPHMultiSelect ()
 

Private Member Functions

 BPHMultiSelect (const BPHMultiSelect< T > &x)
 
BPHMultiSelectoperator= (const BPHMultiSelect< T > &x)
 
template<class Obj >
bool select (const Obj &cand) const
 
template<class Obj >
bool select (const Obj &cand, const BPHRecoBuilder *build) const
 

Private Attributes

bool breakValue
 
bool finalValue
 
std::vector< SelectElementselectList
 

Detailed Description

template<class T>
class BPHMultiSelect< T >

Description: Class to combine multiple selection (OR mode)

Author
Paolo Ronchese INFN Padova

Definition at line 46 of file BPHMultiSelect.h.

Constructor & Destructor Documentation

template<class T>
BPHMultiSelect< T >::BPHMultiSelect ( BPHSelectOperation::mode  op)
inline

Constructor

Definition at line 52 of file BPHMultiSelect.h.

References BPHSelectOperation::and_mode, BPHMultiSelect< T >::breakValue, BPHMultiSelect< T >::finalValue, and BPHSelectOperation::or_mode.

52  {
53  switch ( op ) {
55  breakValue = true;
56  finalValue = false;
57  break;
59  breakValue = false;
60  finalValue = true;
61  break;
62  }
63  }
template<class T>
virtual BPHMultiSelect< T >::~BPHMultiSelect ( )
inlinevirtual

Destructor

Definition at line 67 of file BPHMultiSelect.h.

67 {}
template<class T>
BPHMultiSelect< T >::BPHMultiSelect ( const BPHMultiSelect< T > &  x)
private

Member Function Documentation

template<>
bool BPHMultiSelect< BPHRecoSelect >::accept ( const reco::Candidate cand,
const BPHRecoBuilder build 
) const
template<>
bool BPHMultiSelect< BPHRecoSelect >::accept ( const reco::Candidate cand) const
template<>
bool BPHMultiSelect< BPHMomentumSelect >::accept ( const BPHDecayMomentum cand) const
template<>
bool BPHMultiSelect< BPHVertexSelect >::accept ( const BPHDecayVertex cand) const
template<class T>
virtual bool BPHMultiSelect< T >::accept ( const reco::Candidate cand,
const BPHRecoBuilder build 
) const
inlinevirtual
template<class T>
virtual bool BPHMultiSelect< T >::accept ( const reco::Candidate cand) const
inlinevirtual
template<class T>
virtual bool BPHMultiSelect< T >::accept ( const BPHDecayMomentum cand) const
inlinevirtual
template<class T>
virtual bool BPHMultiSelect< T >::accept ( const BPHDecayVertex cand) const
inlinevirtual
template<>
bool BPHMultiSelect< BPHRecoSelect >::accept ( const reco::Candidate cand,
const BPHRecoBuilder build 
) const
template<>
bool BPHMultiSelect< BPHRecoSelect >::accept ( const reco::Candidate cand) const
template<>
bool BPHMultiSelect< BPHMomentumSelect >::accept ( const BPHDecayMomentum cand) const
template<>
bool BPHMultiSelect< BPHVertexSelect >::accept ( const BPHDecayVertex cand) const
template<class T>
void BPHMultiSelect< T >::include ( T s,
bool  m = true 
)
inline

include selection

Operations

Definition at line 72 of file BPHMultiSelect.h.

Referenced by BPHOniaToMuMuBuilder::build().

72  {
73  SelectElement e;
74  e.selector = &s;
75  e.mode = m;
76  selectList.push_back( e );
77  return;
78  }
std::vector< SelectElement > selectList
template<class T>
BPHMultiSelect& BPHMultiSelect< T >::operator= ( const BPHMultiSelect< T > &  x)
private
template<class T>
template<class Obj >
bool BPHMultiSelect< T >::select ( const Obj &  cand) const
inlineprivate

Definition at line 102 of file BPHMultiSelect.h.

References BPHMultiSelect< T >::breakValue, BPHMultiSelect< T >::finalValue, i, BPHMultiSelect< T >::SelectElement::mode, gen::n, BPHMultiSelect< T >::selectList, and BPHMultiSelect< T >::SelectElement::selector.

102  {
103  int i;
104  int n = selectList.size();
105  for ( i = 0; i < n; ++i ) {
106  const SelectElement& e = selectList[i];
107  if ( ( e.selector->accept( cand ) == e.mode ) == breakValue )
108  return breakValue;
109  }
110  return finalValue;
111  }
int i
Definition: DBlmapReader.cc:9
std::vector< SelectElement > selectList
template<class T>
template<class Obj >
bool BPHMultiSelect< T >::select ( const Obj &  cand,
const BPHRecoBuilder build 
) const
inlineprivate

Definition at line 112 of file BPHMultiSelect.h.

References BPHMultiSelect< T >::breakValue, BPHMultiSelect< T >::finalValue, i, BPHMultiSelect< T >::SelectElement::mode, gen::n, BPHMultiSelect< T >::selectList, and BPHMultiSelect< T >::SelectElement::selector.

113  {
114  int i;
115  int n = selectList.size();
116  for ( i = 0; i < n; ++i ) {
117  const SelectElement& e = selectList[i];
118  if ( ( e.selector->accept( cand, build ) == e.mode ) == breakValue )
119  return breakValue;
120  }
121  return finalValue;
122  }
int i
Definition: DBlmapReader.cc:9
std::vector< SelectElement > selectList

Member Data Documentation

template<class T>
bool BPHMultiSelect< T >::breakValue
private
template<class T>
bool BPHMultiSelect< T >::finalValue
private
template<class T>
std::vector<SelectElement> BPHMultiSelect< T >::selectList
private

Definition at line 100 of file BPHMultiSelect.h.

Referenced by BPHMultiSelect< T >::select().