CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CategoryCriteria< Collection, Classifier > Class Template Reference

Implement a selector given a track or vertex collection and track or vertex classifier. More...

#include <CategoryCriteria.h>

Public Types

typedef Collection collection
 
typedef container::const_iterator const_iterator
 
typedef std::vector< const type * > container
 
typedef Collection::value_type type
 

Public Member Functions

const_iterator begin () const
 
 CategoryCriteria (const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
 
const_iterator end () const
 
void select (const edm::Handle< collection > &collectionHandler, const edm::Event &event, const edm::EventSetup &setup)
 
std::size_t size () const
 

Private Attributes

Classifier classifier_
 
StringCutObjectSelector
< typename
Classifier::Categories > 
evaluate_
 
container selected_
 

Detailed Description

template<typename Collection, typename Classifier>
class CategoryCriteria< Collection, Classifier >

Implement a selector given a track or vertex collection and track or vertex classifier.

Definition at line 12 of file CategoryCriteria.h.

Member Typedef Documentation

template<typename Collection , typename Classifier >
typedef Collection CategoryCriteria< Collection, Classifier >::collection

Definition at line 18 of file CategoryCriteria.h.

template<typename Collection , typename Classifier >
typedef container::const_iterator CategoryCriteria< Collection, Classifier >::const_iterator

Definition at line 27 of file CategoryCriteria.h.

template<typename Collection , typename Classifier >
typedef std::vector<const type *> CategoryCriteria< Collection, Classifier >::container

Definition at line 24 of file CategoryCriteria.h.

template<typename Collection , typename Classifier >
typedef Collection::value_type CategoryCriteria< Collection, Classifier >::type

Definition at line 21 of file CategoryCriteria.h.

Constructor & Destructor Documentation

template<typename Collection , typename Classifier >
CategoryCriteria< Collection, Classifier >::CategoryCriteria ( const edm::ParameterSet config,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 30 of file CategoryCriteria.h.

30  :
31  classifier_(config,std::move(iC)),
32  evaluate_( config.getParameter<std::string>("cut") ) {}
T getParameter(std::string const &) const
Classifier classifier_
def move
Definition: eostools.py:510
StringCutObjectSelector< typename Classifier::Categories > evaluate_

Member Function Documentation

template<typename Collection , typename Classifier >
const_iterator CategoryCriteria< Collection, Classifier >::begin ( void  ) const
inline

Definition at line 57 of file CategoryCriteria.h.

References CategoryCriteria< Collection, Classifier >::selected_.

58  {
59  return selected_.begin();
60  }
template<typename Collection , typename Classifier >
const_iterator CategoryCriteria< Collection, Classifier >::end ( void  ) const
inline

Definition at line 63 of file CategoryCriteria.h.

References CategoryCriteria< Collection, Classifier >::selected_.

64  {
65  return selected_.end();
66  }
template<typename Collection , typename Classifier >
void CategoryCriteria< Collection, Classifier >::select ( const edm::Handle< collection > &  collectionHandler,
const edm::Event event,
const edm::EventSetup setup 
)
inline

Definition at line 35 of file CategoryCriteria.h.

References CategoryCriteria< Collection, Classifier >::classifier_, CategoryCriteria< Collection, Classifier >::evaluate_, i, and CategoryCriteria< Collection, Classifier >::selected_.

36  {
37 
38  selected_.clear();
39 
40  // const collection & collectionPointer = *(collectionHandler.product());
41 
42  classifier_.newEvent(event, setup);
43 
44  for (typename collection::size_type i = 0; i < collectionHandler->size(); ++i)
45  {
46  edm::Ref<Collection> member(collectionHandler, i);
47 
48  classifier_.evaluate(member);
49 
50  // Classifier is evaluated using StringCutObjectSelector
51  if ( evaluate_(classifier_) )
52  selected_.push_back( &(*member) );
53  }
54  }
int i
Definition: DBlmapReader.cc:9
Classifier classifier_
uint16_t size_type
StringCutObjectSelector< typename Classifier::Categories > evaluate_
template<typename Collection , typename Classifier >
std::size_t CategoryCriteria< Collection, Classifier >::size ( void  ) const
inline

Definition at line 69 of file CategoryCriteria.h.

References CategoryCriteria< Collection, Classifier >::selected_.

70  {
71  return selected_.size();
72  }

Member Data Documentation

template<typename Collection , typename Classifier >
Classifier CategoryCriteria< Collection, Classifier >::classifier_
private
template<typename Collection , typename Classifier >
StringCutObjectSelector<typename Classifier::Categories> CategoryCriteria< Collection, Classifier >::evaluate_
private
template<typename Collection , typename Classifier >
container CategoryCriteria< Collection, Classifier >::selected_
private