CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 >
, twrrefcomp
twrrefset_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:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
void clear()
Clear the vector.
Definition: RefVector.h:133
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64