ATLAS Offline Software
Functions
MSVertex.cxx File Reference
#include "MSVertexUtils/MSVertex.h"
#include <cmath>
#include <sstream>
Include dependency graph for MSVertex.cxx:

Go to the source code of this file.

Functions

std::string str (const MSVertex &a)
 
MsgStream & operator<< (MsgStream &m, const MSVertex &a)
 
bool operator== (const MSVertex &a, const MSVertex &b)
 

Function Documentation

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const MSVertex a 
)

Definition at line 114 of file MSVertex.cxx.

114 { return (m << str(a)); }

◆ operator==()

bool operator== ( const MSVertex a,
const MSVertex b 
)

Definition at line 116 of file MSVertex.cxx.

116  {
117  //* distance used to compare floats *//
118  const double DELTA = 1e-3;
119 
120  if (std::abs(a.getPosition().x() - b.getPosition().x()) > DELTA) return false;
121  if (std::abs(a.getPosition().y() - b.getPosition().y()) > DELTA) return false;
122  if (std::abs(a.getPosition().z() - b.getPosition().z()) > DELTA) return false;
123  if (std::abs(a.getPosition().eta() - b.getPosition().eta()) > DELTA) return false;
124  if (std::abs(a.getPosition().phi() - b.getPosition().phi()) > DELTA) return false;
125  if (std::abs(a.getChi2Probability() - b.getChi2Probability()) > DELTA) return false;
126 
127  if (a.getAuthor() - b.getAuthor() != 0) return false;
128  if (a.getNTracks() - b.getNTracks() != 0) return false;
129  if (a.getNMDT() - b.getNMDT() != 0) return false;
130  if (a.getNRPC() - b.getNRPC() != 0) return false;
131  if (a.getNTGC() - b.getNTGC() != 0) return false;
132 
133  return true;
134 }

◆ str()

std::string str ( const MSVertex a)

Definition at line 103 of file MSVertex.cxx.

103  {
104  std::stringstream ss;
105 
106  ss << "author = " << a.getAuthor() << "; x = " << a.getPosition().x() << "; y = " << a.getPosition().y()
107  << "; z = " << a.getPosition().z() << "; phi = " << a.getPosition().phi() << "; eta = " << a.getPosition().eta()
108  << "; chi2 prob. = " << a.getChi2Probability() << "; # tracks = " << a.getNTracks() << "; # MDT hits = " << a.getNMDT()
109  << "; # RPC hits = " << a.getNRPC() << "; # TGC hits = " << a.getNTGC();
110 
111  return ss.str();
112 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
str
std::string str(const MSVertex &a)
Definition: MSVertex.cxx:103
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10