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 337 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().

338 {
339  // combines them first into a set to get rid of duplicates and then puts them into the first vector
340 
341  // sorts them first to get rid of duplicates, then puts them into another RefVector
342  twrrefset_t twrrefset;
344  twrrefset.insert(*it);
346  twrrefset.insert(*it);
347 
348  // clear the original refvector and put them back in
349  v1.clear();
350  for(twrrefset_t::const_iterator it=twrrefset.begin(); it!=twrrefset.end(); ++it) {
351  v1.push_back(*it);
352  }
353  return;
354 }
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