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 164 of file HcalNoiseAlgo.h.

Member Typedef Documentation

Definition at line 180 of file HcalNoiseAlgo.h.

Constructor & Destructor Documentation

JoinCaloTowerRefVectorsWithoutDuplicates::JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 167 of file HcalNoiseAlgo.h.

167 {}
JoinCaloTowerRefVectorsWithoutDuplicates::~JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 168 of file HcalNoiseAlgo.h.

168 {}

Member Function Documentation

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

Definition at line 261 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().

262 {
263  // combines them first into a set to get rid of duplicates and then puts them into the first vector
264 
265  // sorts them first to get rid of duplicates, then puts them into another RefVector
266  twrrefset_t twrrefset;
268  twrrefset.insert(*it);
270  twrrefset.insert(*it);
271 
272  // clear the original refvector and put them back in
273  v1.clear();
274  for(twrrefset_t::const_iterator it=twrrefset.begin(); it!=twrrefset.end(); ++it) {
275  v1.push_back(*it);
276  }
277  return;
278 }
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