CMS 3D CMS Logo

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

#include <ContainerMask.h>

Public Member Functions

void applyOrTo (std::vector< bool > &) const
 
 ContainerMask ()
 
 ContainerMask (const edm::RefProd< T > &iProd, const std::vector< bool > &iMask)
 
void copyMaskTo (std::vector< bool > &) const
 
bool mask (unsigned int iIndex) const
 
bool mask (const typename ContainerMaskTraits< T >::value_type *)
 
const edm::RefProd< T > & refProd () const
 
size_t size () const
 
void swap (ContainerMask< T > &iOther)
 

Static Public Member Functions

static short Class_Version ()
 

Private Attributes

std::vector< bool > m_mask
 
edm::RefProd< Tm_prod
 

Detailed Description

template<typename T>
class edm::ContainerMask< T >

Definition at line 35 of file ContainerMask.h.

Constructor & Destructor Documentation

template<typename T>
edm::ContainerMask< T >::ContainerMask ( )
inline

Definition at line 38 of file ContainerMask.h.

38 {}
template<typename T>
ContainerMask::ContainerMask ( const edm::RefProd< T > &  iProd,
const std::vector< bool > &  iMask 
)

Definition at line 76 of file ContainerMask.h.

References assert(), and edm::ContainerMaskTraits< T >::size().

76  :
77  m_prod(iProd), m_mask(iMask) {
78  assert(iMask.size() <= ContainerMaskTraits<T>::size(m_prod.product()));
79  }
std::vector< bool > m_mask
Definition: ContainerMask.h:72
edm::RefProd< T > m_prod
Definition: ContainerMask.h:71
assert(m_qm.get())
static size_t size(const T *iContainer)

Member Function Documentation

template<typename T >
void ContainerMask::applyOrTo ( std::vector< bool > &  iTo) const

Definition at line 95 of file ContainerMask.h.

References assert(), edm::ContainerMask< T >::m_mask, and create_public_lumi_plots::transform.

95  {
96  assert(iTo.size()==m_mask.size());
97  std::transform(m_mask.begin(),m_mask.end(),iTo.begin(), iTo.begin(),std::logical_or<bool>());
98  }
std::vector< bool > m_mask
Definition: ContainerMask.h:72
assert(m_qm.get())
template<typename T>
static short edm::ContainerMask< T >::Class_Version ( )
inlinestatic

Definition at line 63 of file ContainerMask.h.

65 :
66  //ContainerMask(const ContainerMask&); // stop default
template<typename T >
void ContainerMask::copyMaskTo ( std::vector< bool > &  iTo) const

Definition at line 90 of file ContainerMask.h.

References edm::ContainerMask< T >::m_mask.

90  {
91  iTo.assign(m_mask.begin(),m_mask.end());
92  }
std::vector< bool > m_mask
Definition: ContainerMask.h:72
template<typename T>
bool edm::ContainerMask< T >::mask ( unsigned int  iIndex) const
inline

Definition at line 43 of file ContainerMask.h.

Referenced by edm::ContainerMask< T >::mask().

43  {
44  if(iIndex<m_mask.size()) {
45  return m_mask[iIndex];
46  }
47  return false;
48  }
std::vector< bool > m_mask
Definition: ContainerMask.h:72
template<typename T>
bool ContainerMask::mask ( const typename ContainerMaskTraits< T >::value_type *  iElement)

Definition at line 83 of file ContainerMask.h.

References cmsHarvester::index, edm::ContainerMaskTraits< T >::indexFor(), edm::ContainerMask< T >::m_prod, and edm::ContainerMask< T >::mask().

84  {
85  unsigned int index = ContainerMaskTraits<T>::indexFor(iElement,m_prod.product());
86  return this->mask(index);
87  }
edm::RefProd< T > m_prod
Definition: ContainerMask.h:71
bool mask(unsigned int iIndex) const
Definition: ContainerMask.h:43
static unsigned int indexFor(const value_type *iElement, const T *iContainer)
template<typename T>
const edm::RefProd<T>& edm::ContainerMask< T >::refProd ( ) const
inline

Definition at line 56 of file ContainerMask.h.

56 {return m_prod;}
edm::RefProd< T > m_prod
Definition: ContainerMask.h:71
template<typename T>
size_t edm::ContainerMask< T >::size ( void  ) const
inline

Definition at line 54 of file ContainerMask.h.

Referenced by ntuple._Collection::__iter__(), and ntuple._Collection::__len__().

54 { return m_mask.size();}
std::vector< bool > m_mask
Definition: ContainerMask.h:72
template<typename T>
void ContainerMask::swap ( ContainerMask< T > &  iOther)

Definition at line 101 of file ContainerMask.h.

References edm::ContainerMask< T >::m_mask, edm::ContainerMask< T >::m_prod, and std::swap().

101  {
102  m_prod.swap(iOther.m_prod);
103  std::swap(m_mask,iOther.m_mask);
104  }
std::vector< bool > m_mask
Definition: ContainerMask.h:72
edm::RefProd< T > m_prod
Definition: ContainerMask.h:71
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

template<typename T>
std::vector<bool> edm::ContainerMask< T >::m_mask
private
template<typename T>
edm::RefProd<T> edm::ContainerMask< T >::m_prod
private