CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types
JoinCaloTowerRefVectorsWithoutDuplicates Class Reference

#include <HcalNoiseAlgo.h>

Classes

struct  twrrefcomp
 

Public Member Functions

 JoinCaloTowerRefVectorsWithoutDuplicates ()
 
void operator() (edm::RefVector< CaloTowerCollection > &v1, const edm::RefVector< CaloTowerCollection > &v2) const
 
 ~JoinCaloTowerRefVectorsWithoutDuplicates ()
 

Private Types

typedef std::set< edm::Ref< CaloTowerCollection >, twrrefcomptwrrefset_t
 

Detailed Description

Definition at line 177 of file HcalNoiseAlgo.h.

Member Typedef Documentation

Definition at line 193 of file HcalNoiseAlgo.h.

Constructor & Destructor Documentation

JoinCaloTowerRefVectorsWithoutDuplicates::JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 180 of file HcalNoiseAlgo.h.

180 {}
JoinCaloTowerRefVectorsWithoutDuplicates::~JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 181 of file HcalNoiseAlgo.h.

181 {}

Member Function Documentation

void JoinCaloTowerRefVectorsWithoutDuplicates::operator() ( edm::RefVector< CaloTowerCollection > &  v1,
const edm::RefVector< CaloTowerCollection > &  v2 
) const

Definition at line 343 of file HcalNoiseAlgo.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::clear(), edm::RefVector< C, T, F >::end(), and edm::RefVector< C, T, F >::push_back().

344 {
345  // combines them first into a set to get rid of duplicates and then puts them into the first vector
346 
347  // sorts them first to get rid of duplicates, then puts them into another RefVector
348  twrrefset_t twrrefset;
350  twrrefset.insert(*it);
352  twrrefset.insert(*it);
353 
354  // clear the original refvector and put them back in
355  v1.clear();
356  for(twrrefset_t::const_iterator it=twrrefset.begin(); it!=twrrefset.end(); ++it) {
357  v1.push_back(*it);
358  }
359  return;
360 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
void clear()
Clear the vector.
Definition: RefVector.h:147
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69