ATLAS Offline Software
Classes | Typedefs | Functions
TrigVertex.h File Reference
#include <list>
#include "CLHEP/Geometry/Point3D.h"
#include "TrigInDetEvent/TrigInDetTrack.h"
#include <math.h>
#include <map>
#include <ostream>
#include "GaudiKernel/MsgStream.h"
Include dependency graph for TrigVertex.h:

Go to the source code of this file.

Classes

class  TrigVertex
 

Typedefs

typedef std::list< const TrigInDetTrack * > TrackInVertexList
 

Functions

std::string str (const TrigVertex &v)
 
MsgStream & operator<< (MsgStream &m, const TrigVertex &v)
 
bool operator== (const TrigVertex &a, const TrigVertex &b)
 
bool operator!= (const TrigVertex &a, const TrigVertex &b)
 
void diff (const TrigVertex &a, const TrigVertex &b, std::map< std::string, double > &variableChange)
 comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts More...
 

Typedef Documentation

◆ TrackInVertexList

typedef std::list< const TrigInDetTrack* > TrackInVertexList

Definition at line 26 of file TrigVertex.h.

Function Documentation

◆ diff()

void diff ( const TrigVertex a,
const TrigVertex b,
std::map< std::string, double > &  variableChange 
)

comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts

Parameters
variableChange- map to record the differences In case of collections (or objects when the size may be different) that information can also be returned in variableChange

comparison with feedback Function compares two objects and returns "semi verbose" output in the form of map where there are varaibel names and differences between two obejcts

Parameters
variableChange- map to record the differences In case of collections (or objects when the size may be different) that information can also be returned in variableChange

Definition at line 64 of file TrigVertex.cxx.

65 {
66  int nTracksA=0;
67  int nTracksB=0;
68 
69  if(a.tracks()!=NULL) nTracksA=a.tracks()->size();
70  if(b.tracks()!=NULL) nTracksB=b.tracks()->size();
71  const HepGeom::Point3D<double>& posA = a.position();
72  const HepGeom::Point3D<double>& posB = b.position();
73 
74  variableChange["x"] = posA.x() - posB.x();
75  variableChange["y"] = posA.y() - posB.y();
76  variableChange["z"] = posA.z() - posB.z();
77  variableChange["ntracks"] = (double)(nTracksA - nTracksB);
78  variableChange["chi2"] = a.chi2() - b.chi2();
79  variableChange["ndof"] = (double)(a.ndof() - b.ndof());
80  variableChange["mass"] = a.mass() - b.mass();
81  variableChange["energyFraction"] = a.energyFraction() - b.energyFraction();
82  variableChange["nTwoTracksSecVtx"] = (double)(a.nTwoTracksSecVtx() - b.nTwoTracksSecVtx());
83 }

◆ operator!=()

bool operator!= ( const TrigVertex a,
const TrigVertex b 
)
inline

Definition at line 190 of file TrigVertex.h.

190 { return !(a==b); }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const TrigVertex v 
)

Definition at line 29 of file TrigVertex.cxx.

30 {
31  m << str(v);
32  return m;
33 }

◆ operator==()

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

Definition at line 35 of file TrigVertex.cxx.

36 {
37  const double epsilon=1e-8;
38  int nTracksA=0;
39  int nTracksB=0;
40 
41  if(a.tracks()!=NULL) nTracksA=a.tracks()->size();
42  if(b.tracks()!=NULL) nTracksB=b.tracks()->size();
43  const HepGeom::Point3D<double>& posA = a.position();
44  const HepGeom::Point3D<double>& posB = b.position();
45 
46  if(a.algorithmId() != b.algorithmId()) return false;
47  if(nTracksA != nTracksB) return false;
48  if(a.ndof() != b.ndof()) return false;
49  if(fabs(posA.x()-posB.x())>epsilon) return false;
50  if(fabs(posA.y()-posB.y())>epsilon) return false;
51  if(fabs(posA.z()-posB.z())>epsilon) return false;
52  if(fabs(a.chi2()-b.chi2())>epsilon) return false;
53  if(fabs(a.mass()-b.mass())>epsilon) return false;
54  return true;
55 }

◆ str()

std::string str ( const TrigVertex v)

Definition at line 7 of file TrigVertex.cxx.

8 {
9  std::stringstream ss;
10  const HepGeom::Point3D<double>& pos = v.position();
11  int nTracks=0;
12 
13  if(v.tracks()!=NULL) nTracks=v.tracks()->size();
14 
15  ss << "AlgorithmID: "<<v.algorithmId()
16  << "x: "<<pos.x()
17  <<" y: "<<pos.y()
18  <<" z: "<<pos.z()
19  <<" chi2: "<<v.chi2()
20  <<" ndof: "<<v.ndof()
21  <<" ntracks: "<<nTracks
22  <<" mass: "<<v.mass()
23  <<" energyFraction: "<<v.energyFraction()
24  <<" nTwoTracksSecVtx: "<<v.nTwoTracksSecVtx();
25  return ss.str();
26 
27 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:157
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
str
std::string str(const TrigVertex &v)
Definition: TrigVertex.cxx:7