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

◆ twrrefset_t

Definition at line 191 of file HcalNoiseAlgo.h.

Constructor & Destructor Documentation

◆ JoinCaloTowerRefVectorsWithoutDuplicates()

JoinCaloTowerRefVectorsWithoutDuplicates::JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 179 of file HcalNoiseAlgo.h.

179 {}

◆ ~JoinCaloTowerRefVectorsWithoutDuplicates()

JoinCaloTowerRefVectorsWithoutDuplicates::~JoinCaloTowerRefVectorsWithoutDuplicates ( )
inline

Definition at line 180 of file HcalNoiseAlgo.h.

180 {}

Member Function Documentation

◆ operator()()

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

Definition at line 364 of file HcalNoiseAlgo.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

365  {
366  // combines them first into a set to get rid of duplicates and then puts them into the first vector
367 
368  // sorts them first to get rid of duplicates, then puts them into another RefVector
369  twrrefset_t twrrefset;
370  for (edm::RefVector<CaloTowerCollection>::const_iterator it = v1.begin(); it != v1.end(); ++it)
371  twrrefset.insert(*it);
373  twrrefset.insert(*it);
374 
375  // clear the original refvector and put them back in
376  v1.clear();
377  for (twrrefset_t::const_iterator it = twrrefset.begin(); it != twrrefset.end(); ++it) {
378  v1.push_back(*it);
379  }
380  return;
381 }
std::set< edm::Ref< CaloTowerCollection >, twrrefcomp > twrrefset_t
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223