CMS 3D CMS Logo

TkTrackingRegionsMargin.h
Go to the documentation of this file.
1 #ifndef TkTrackingRegionsMargin_H
2 #define TkTrackingRegionsMargin_H
3 
6 #include <utility>
7 #include <iostream>
8 
9 template <class T>
10 class TkTrackingRegionsMargin : public std::pair<T, T> {
11 public:
13 
14  TkTrackingRegionsMargin(const T& aLeft, const T& aRight) : std::pair<T, T>(aLeft, aRight) {}
15 
16  TkTrackingRegionsMargin(const std::pair<T, T>& aPair) : std::pair<T, T>(aPair) {}
17 
18  const T& left() const { return this->first; }
19  const T& right() const { return this->second; }
20 
21  void operator+=(const T& v) { add(v, v); }
22  void add(const T& addLeft, const T& addRight) {
23  this->first += addLeft;
24  this->second += addRight;
25  }
26 };
27 
28 template <class T>
29 std::ostream& operator<<(std::ostream& out, const TkTrackingRegionsMargin<T>& m) {
30  return out << "(" << m.left() << "," << m.right() << ")";
31 }
32 #endif
TkTrackingRegionsMargin::TkTrackingRegionsMargin
TkTrackingRegionsMargin()
Definition: TkTrackingRegionsMargin.h:12
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
findQualityFiles.v
v
Definition: findQualityFiles.py:179
dqmdumpme.first
first
Definition: dqmdumpme.py:55
TkTrackingRegionsMargin::add
void add(const T &addLeft, const T &addRight)
Definition: TkTrackingRegionsMargin.h:22
TkTrackingRegionsMargin::left
const T & left() const
Definition: TkTrackingRegionsMargin.h:18
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
operator<<
std::ostream & operator<<(std::ostream &out, const TkTrackingRegionsMargin< T > &m)
Definition: TkTrackingRegionsMargin.h:29
TkTrackingRegionsMargin
Definition: TkTrackingRegionsMargin.h:10
TkTrackingRegionsMargin::right
const T & right() const
Definition: TkTrackingRegionsMargin.h:19
TkTrackingRegionsMargin::TkTrackingRegionsMargin
TkTrackingRegionsMargin(const T &aLeft, const T &aRight)
Definition: TkTrackingRegionsMargin.h:14
TkTrackingRegionsMargin::operator+=
void operator+=(const T &v)
Definition: TkTrackingRegionsMargin.h:21
std
Definition: JetResolutionObject.h:76
TkTrackingRegionsMargin::TkTrackingRegionsMargin
TkTrackingRegionsMargin(const std::pair< T, T > &aPair)
Definition: TkTrackingRegionsMargin.h:16
T
long double T
Definition: Basic3DVectorLD.h:48
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31