CMS 3D CMS Logo

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, 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.
template<class T>
std::pair< T, T > operator- (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 
) [inline]

Definition at line 52 of file Operators.h.

00052                                                                                               {
00053         for(typename std::map<K, V>::const_iterator cit = extract.begin(); cit != extract.end(); ++cit) {
00054                 output.push_back((*cit).first);
00055         }
00056 }

template<class T>
std::pair<T, T> operator+ ( const std::pair< T, T > &  one,
const std::pair< T, T > &  two 
) [inline]

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 r.

00019                                                                                                {
00020         std::pair<T, T> r(one.first + two.first, one.second + two.second);
00021         return r;
00022 }

template<class T>
std::pair<T, T> operator- ( const std::pair< T, T > &  one,
const std::pair< T, T > &  two 
) [inline]

Definition at line 27 of file Operators.h.

References r.

00027                                                                                                {
00028         std::pair<T, T> r(one.first - two.first, one.second - two.second);
00029         return r;
00030 }

template<class T>
std::ostream& operator<< ( std::ostream &  s,
const std::pair< T, T > &  aT 
) [inline]

Definition at line 35 of file Operators.h.

References s.

00035                                                                                   {
00036         s << "(" << aT.first << ", " << aT.second << ")";
00037         return s;
00038 }

template<class K, class V>
void valueVector ( const std::map< K, V > &  extract,
std::vector< V > &  output 
) [inline]

Definition at line 43 of file Operators.h.

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


Generated on Tue Jun 9 17:55:30 2009 for CMSSW by  doxygen 1.5.4