CMS 3D CMS Logo

CaloDigiCollectionSorter Class Reference

For test purposes, users might want to sort a collection of digis to find the highest energies. More...

#include <SimCalorimetry/CaloSimAlgos/interface/CaloDigiCollectionSorter.h>

List of all members.

Public Member Functions

 CaloDigiCollectionSorter (int bin)
template<class T>
std::vector< T > sortedVector (const edm::SortedCollection< T > &input) const
 takes a digi collection and returns a vector of digis, sorted by the peak bin

Private Attributes

int theMaxBin

Classes

class  CaloDigiSortByMaxBin
 embedded class to be used as a sort predicate More...


Detailed Description

For test purposes, users might want to sort a collection of digis to find the highest energies.

This class does that, and should work for all ECAL and HCAL digi types

Rick Wilkinson

Definition at line 17 of file CaloDigiCollectionSorter.h.


Constructor & Destructor Documentation

CaloDigiCollectionSorter::CaloDigiCollectionSorter ( int  bin  )  [inline]

Definition at line 19 of file CaloDigiCollectionSorter.h.

00019 : theMaxBin(bin) {}


Member Function Documentation

template<class T>
std::vector<T> CaloDigiCollectionSorter::sortedVector ( const edm::SortedCollection< T > &  input  )  const [inline]

takes a digi collection and returns a vector of digis, sorted by the peak bin

Definition at line 40 of file CaloDigiCollectionSorter.h.

References i, HLT_VtxMuL3::result, edm::SortedCollection< T, SORT >::size(), python::multivaluedict::sort(), and theMaxBin.

00040                                                                         {
00041      std::vector<T> result;
00042      result.reserve(input.size());
00043      for(unsigned int i = 0; i < input.size() ; ++i) 
00044      {
00045        result.push_back(input[i]);
00046      }
00047      // now sort
00048      std::sort(result.begin(), result.end(), CaloDigiSortByMaxBin<T>(theMaxBin));
00049      return result;
00050   }


Member Data Documentation

int CaloDigiCollectionSorter::theMaxBin [private]

Definition at line 53 of file CaloDigiCollectionSorter.h.

Referenced by sortedVector().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:15:44 2009 for CMSSW by  doxygen 1.5.4