CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CategoryCriteria< Collection, Classifier > Class Template Reference

#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 15 of file CategoryCriteria.h.

Member Typedef Documentation

◆ collection

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

Definition at line 18 of file CategoryCriteria.h.

◆ const_iterator

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

Definition at line 27 of file CategoryCriteria.h.

◆ container

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

Definition at line 24 of file CategoryCriteria.h.

◆ type

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

Definition at line 21 of file CategoryCriteria.h.

Constructor & Destructor Documentation

◆ CategoryCriteria()

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.

31  : classifier_(config, std::move(iC)), evaluate_(config.getParameter<std::string>("cut")) {}

Member Function Documentation

◆ begin()

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

Definition at line 53 of file CategoryCriteria.h.

53 { return selected_.begin(); }

References CategoryCriteria< Collection, Classifier >::selected_.

◆ end()

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

Definition at line 56 of file CategoryCriteria.h.

56 { return selected_.end(); }

References CategoryCriteria< Collection, Classifier >::selected_.

◆ select()

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 34 of file CategoryCriteria.h.

34  {
35  selected_.clear();
36 
37  // const collection & collectionPointer = *(collectionHandler.product());
38 
39  classifier_.newEvent(event, setup);
40 
41  for (typename collection::size_type i = 0; i < collectionHandler->size(); ++i) {
42  edm::Ref<Collection> member(collectionHandler, i);
43 
44  classifier_.evaluate(member);
45 
46  // Classifier is evaluated using StringCutObjectSelector
48  selected_.push_back(&(*member));
49  }
50  }

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

◆ size()

template<typename Collection , typename Classifier >
std::size_t CategoryCriteria< Collection, Classifier >::size ( void  ) const
inline

Member Data Documentation

◆ classifier_

template<typename Collection , typename Classifier >
Classifier CategoryCriteria< Collection, Classifier >::classifier_
private

◆ evaluate_

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

◆ selected_

template<typename Collection , typename Classifier >
container CategoryCriteria< Collection, Classifier >::selected_
private
mps_fire.i
i
Definition: mps_fire.py:428
CategoryCriteria::evaluate_
StringCutObjectSelector< typename Classifier::Categories > evaluate_
Definition: CategoryCriteria.h:66
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::Ref
Definition: AssociativeIterator.h:58
config
Definition: config.py:1
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CategoryCriteria::classifier_
Classifier classifier_
Definition: CategoryCriteria.h:64
CategoryCriteria::selected_
container selected_
Definition: CategoryCriteria.h:62
eostools.move
def move(src, dest)
Definition: eostools.py:511
event
Definition: event.py:1