CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoParticleFlow/PFClusterTools/interface/Operators.h File Reference

#include "TH1F.h"
#include <iostream>
#include <vector>
#include <map>

Go to the source code of this file.

Functions

template<class K , class V >
void keyVector (const std::map< K, V > &extract, std::vector< K > &output)
template<class T >
std::pair< T, Toperator+ (const std::pair< T, T > &one, const std::pair< T, T > &two)
template<class T >
std::pair< T, Toperator- (const std::pair< T, T > &one, const std::pair< T, T > &two)
template<class T >
std::ostream & operator<< (std::ostream &s, const std::pair< T, T > &aT)
template<class K , class V >
void valueVector (const std::map< K, V > &extract, std::vector< V > &output)

Function Documentation

template<class K , class V >
void keyVector ( const std::map< K, V > &  extract,
std::vector< K > &  output 
)

Definition at line 52 of file Operators.h.

                                                                                              {
        for(typename std::map<K, V>::const_iterator cit = extract.begin(); cit != extract.end(); ++cit) {
                output.push_back((*cit).first);
        }
}
template<class T >
std::pair<T, T> operator+ ( const std::pair< T, T > &  one,
const std::pair< T, T > &  two 
)

Operators.h Various operators and handy methods for std::pairs and std::maps

Author:
Jamie Ballin
Date:
May 2008

Definition at line 19 of file Operators.h.

References alignCSCRings::r.

                                                                                               {
        std::pair<T, T> r(one.first + two.first, one.second + two.second);
        return r;
}
template<class T >
std::pair<T, T> operator- ( const std::pair< T, T > &  one,
const std::pair< T, T > &  two 
)

Definition at line 27 of file Operators.h.

References alignCSCRings::r.

                                                                                               {
        std::pair<T, T> r(one.first - two.first, one.second - two.second);
        return r;
}
template<class T >
std::ostream& operator<< ( std::ostream &  s,
const std::pair< T, T > &  aT 
)

Definition at line 35 of file Operators.h.

References alignCSCRings::s.

                                                                                  {
        s << "(" << aT.first << ", " << aT.second << ")";
        return s;
}
template<class K , class V >
void valueVector ( const std::map< K, V > &  extract,
std::vector< V > &  output 
)

Definition at line 43 of file Operators.h.

Referenced by editVectorParameter().

                                                                                                {
        for(typename std::map<K, V>::const_iterator cit = extract.begin(); cit != extract.end(); ++cit) {
                output.push_back((*cit).second);
        }
}