ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigT2BeamSpot
src
T2Vertex.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//
6
// $Id: T2Vertex.cxx 793162 2017-01-20 03:48:25Z ssnyder $
7
//
8
9
// This class
10
#include "
T2Vertex.h
"
11
12
// Externals
13
#include "
TrkTrack/TrackCollection.h
"
14
#include "
TrkTrack/Track.h
"
15
#include "GaudiKernel/SystemOfUnits.h"
16
#include "TMath.h"
17
18
#include <functional>
19
#include <numeric>
20
#include <cmath>
21
using
Gaudi::Units::GeV;
22
using
std::accumulate;
23
24
25
namespace
PESA
26
{
27
double
vertexChi2Prob
(
const
T2Vertex
& vertex )
28
{
29
// FIXME: unify with trackChi2Prob()
30
double
chi2Prob = 0.;
31
const
int
ndf = vertex.NDF();
32
const
double
chi2
= vertex.Qual() * vertex.NDF();
33
if
( ndf > 0 &&
chi2
> 0. && ! std::isinf(
chi2
) )
34
{
35
chi2Prob = TMath::Prob(
chi2
,ndf);
36
}
37
return
chi2Prob;
38
}
39
40
41
double
tiltedBeamPositionAtZPoint
(
double
Zref,
double
nominalZPosition,
42
double
nominalTransversePosition,
double
tilt )
43
{
45
return
nominalTransversePosition + tan(tilt) * (Zref-nominalZPosition);
46
}
47
48
template
<
class
T>
49
struct
TrkSumOf
50
{
51
double
operator()
(
double
x
,
const
Trk::Track
* track ) {
return
x
+ T()( track ); }
52
};
53
54
55
struct
TrkTrackPt
56
{
57
double
operator()
(
const
Trk::Track
* track ) {
58
const
Trk::TrackParameters
* params = track->perigeeParameters();
59
return
std::abs(sin(params->parameters()[
Trk::theta
])/params->parameters()[
Trk::qOverP
])/
GeV
;
60
}
61
};
62
63
64
struct
TrkTrackPt2
65
{
66
double
operator()
(
const
Trk::Track
* track ) {
const
double
pT =
TrkTrackPt
()( track );
return
pT*pT; }
67
};
68
69
70
71
double
vertexSumPt
(
const
TrackCollection
& tracks )
72
{
73
return
accumulate
( tracks.
begin
(), tracks.
end
(), 0.,
TrkSumOf< TrkTrackPt >
() );
74
}
75
76
77
double
vertexSumPt2
(
const
TrackCollection
& tracks )
78
{
79
return
sqrt(
accumulate
( tracks.
begin
(), tracks.
end
(), 0.,
TrkSumOf< TrkTrackPt2 >
() ) );
80
}
81
82
std::ostream&
operator<<
( std::ostream& os,
const
T2Vertex
& vertex )
83
{
84
os
85
<<
"Vertex x +/- dx = "
<< vertex.X() <<
" +/- "
<< vertex.Xerr() <<
'\n'
86
<<
"Vertex y +/- dy = "
<< vertex.Y() <<
" +/- "
<< vertex.Yerr() <<
'\n'
87
<<
"Vertex z +/- dz = "
<< vertex.Z() <<
" +/- "
<< vertex.Zerr() <<
'\n'
88
<<
"Vertex N tracks = "
<< vertex.NTrks() <<
'\n'
89
<<
"Vertex fit mass = "
<< vertex.Mass() <<
'\n'
90
<<
"Vertex fit qual = "
<< vertex.Qual() <<
'\n'
91
<<
"Vertex fit prob = "
<< vertex.Chi2Prob() <<
'\n'
92
;
93
return
os;
94
}
95
96
}
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition
FPGATrackSimMatrixAccumulator.cxx:22
GeV
#define GeV
Definition
PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
T2Vertex.h
TrackCollection.h
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition
TrackCollection.h:19
Track.h
x
#define x
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
PESA::T2Vertex
Definition
T2Vertex.h:87
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition
comparitor.cxx:525
PESA
Local tools.
Definition
idx.h:9
PESA::tiltedBeamPositionAtZPoint
double tiltedBeamPositionAtZPoint(double Zref, double nominalZPosition, double nominalTransversePosition, double tilt)
Definition
T2Vertex.cxx:41
PESA::vertexChi2Prob
double vertexChi2Prob(const T2Vertex &vertex)
Definition
T2Vertex.cxx:27
PESA::vertexSumPt2
double vertexSumPt2(const TrackCollection &tracks)
Definition
T2Vertex.cxx:77
PESA::vertexSumPt
double vertexSumPt(const TrackCollection &tracks)
Definition
T2Vertex.cxx:71
PESA::operator<<
std::ostream & operator<<(std::ostream &os, const T2BeamSpot &beamSpot)
Definition
T2BeamSpot.cxx:15
Trk::theta
@ theta
Definition
ParamDefs.h:66
Trk::qOverP
@ qOverP
perigee
Definition
ParamDefs.h:67
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
PESA::TrkSumOf
Definition
T2Vertex.cxx:50
PESA::TrkSumOf::operator()
double operator()(double x, const Trk::Track *track)
Definition
T2Vertex.cxx:51
PESA::TrkTrackPt2
Definition
T2Vertex.cxx:65
PESA::TrkTrackPt2::operator()
double operator()(const Trk::Track *track)
Definition
T2Vertex.cxx:66
PESA::TrkTrackPt
Definition
T2Vertex.cxx:56
PESA::TrkTrackPt::operator()
double operator()(const Trk::Track *track)
Definition
T2Vertex.cxx:57
Generated on
for ATLAS Offline Software by
1.17.0