CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
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.

52  {
53  for(typename std::map<K, V>::const_iterator cit = extract.begin(); cit != extract.end(); ++cit) {
54  output.push_back((*cit).first);
55  }
56 }
int extract(std::vector< int > *output, const std::string &dati)
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.

19  {
20  std::pair<T, T> r(one.first + two.first, one.second + two.second);
21  return r;
22 }
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.

27  {
28  std::pair<T, T> r(one.first - two.first, one.second - two.second);
29  return r;
30 }
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.

35  {
36  s << "(" << aT.first << ", " << aT.second << ")";
37  return s;
38 }
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().

43  {
44  for(typename std::map<K, V>::const_iterator cit = extract.begin(); cit != extract.end(); ++cit) {
45  output.push_back((*cit).second);
46  }
47 }
int extract(std::vector< int > *output, const std::string &dati)