CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Attributes
ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder > Class Template Reference

#include <ObjectPairCollectionSelector.h>

Public Types

typedef InputCollection collection
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
 ObjectPairCollectionSelector (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
void select (const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
 

Private Types

typedef container::const_iterator const_iterator
 
typedef StoreContainer container
 

Private Attributes

RefAdder addRef_
 
const typedef InputCollection::value_type * reference
 
Selector select_
 
StoreContainer selected_
 

Detailed Description

template<typename InputCollection, typename Selector, typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
class ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >

selects object pairs wose combination satiefies a specific selection for instance, could be based on invariant mass, deltaR , deltaPhi, etc.

Author
Luca Lista, INFN
Version
Revision
1.1
Id
ObjectPairCollectionSelector.h,v 1.1 2009/03/03 13:07:27 llista Exp

Definition at line 31 of file ObjectPairCollectionSelector.h.

Member Typedef Documentation

◆ collection

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef InputCollection ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::collection

Definition at line 33 of file ObjectPairCollectionSelector.h.

◆ const_iterator

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef container::const_iterator ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::const_iterator
private

Definition at line 38 of file ObjectPairCollectionSelector.h.

◆ container

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
typedef StoreContainer ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::container
private

Definition at line 37 of file ObjectPairCollectionSelector.h.

Constructor & Destructor Documentation

◆ ObjectPairCollectionSelector()

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::ObjectPairCollectionSelector ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 41 of file ObjectPairCollectionSelector.h.

42  : select_(reco::modules::make<Selector>(cfg)) {}

Member Function Documentation

◆ begin()

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
const_iterator ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::begin ( void  ) const
inline

◆ end()

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
const_iterator ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::end ( void  ) const
inline

◆ select()

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
void ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::select ( const edm::Handle< InputCollection > &  c,
const edm::Event ,
const edm::EventSetup  
)
inline

Definition at line 45 of file ObjectPairCollectionSelector.h.

45  {
46  unsigned int s = c->size();
47  std::vector<bool> v(s, false);
48  for (unsigned int i = 0; i < s; ++i)
49  for (unsigned int j = i + 1; j < s; ++j) {
50  if (select_((*c)[i], (*c)[j]))
51  v[i] = v[j] = true;
52  }
53  selected_.clear();
54  for (unsigned int i = 0; i < s; ++i)
55  if (v[i])
56  addRef_(selected_, c, i);
57  }

References ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::addRef_, c, mps_fire::i, dqmiolumiharvest::j, alignCSCRings::s, ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::select_, ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::selected_, and findQualityFiles::v.

Member Data Documentation

◆ addRef_

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
RefAdder ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::addRef_
private

◆ reference

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
const typedef InputCollection::value_type* ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::reference
private

Definition at line 36 of file ObjectPairCollectionSelector.h.

◆ select_

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
Selector ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::select_
private

◆ selected_

template<typename InputCollection , typename Selector , typename StoreContainer = std::vector<const typename InputCollection::value_type *>, typename RefAdder = typename helper::SelectionAdderTrait<InputCollection, StoreContainer>::type>
StoreContainer ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >::selected_
private
mps_fire.i
i
Definition: mps_fire.py:428
findQualityFiles.v
v
Definition: findQualityFiles.py:179
ObjectPairCollectionSelector::addRef_
RefAdder addRef_
Definition: ObjectPairCollectionSelector.h:62
alignCSCRings.s
s
Definition: alignCSCRings.py:92
ObjectPairCollectionSelector::select_
Selector select_
Definition: ObjectPairCollectionSelector.h:60
looper.cfg
cfg
Definition: looper.py:296
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
ObjectPairCollectionSelector::selected_
StoreContainer selected_
Definition: ObjectPairCollectionSelector.h:61