ATLAS Offline Software
Loading...
Searching...
No Matches
SVInfoPlus.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace Analysis
8{
9
12 m_recsvx(Trk::RecVertex()),
13 m_NGTinJet(-1),
14 m_NGTinSvx(-1),
15 m_N2Tpair(-1),
16 m_masssvx(-1.),
17 m_efracsvx(-1.),
18 m_normdist(-1.),
20
22SVInfoPlus::SVInfoPlus(const TagInfoType& tagJetInfoType) : BaseTagInfo(tagJetInfoType),
23 m_recsvx(Trk::RecVertex()),
24 m_NGTinJet(-1),
25 m_NGTinSvx(-1),
26 m_N2Tpair(-1),
27 m_masssvx(-1.),
28 m_efracsvx(-1.),
29 m_normdist(-1.),
31{
32 m_tagLikelihood.clear();
33}
34
48
51{
52 if (this!=&rhs)
53 {
55 m_recsvx = rhs.m_recsvx;
58 m_N2Tpair = rhs.m_N2Tpair;
59 m_masssvx = rhs.m_masssvx;
64 }
65 return *this;
66}
67
71
72 float SVInfoPlus::getChi2Compatibility(const Trk::RecVertex priVertex, const Trk::RecVertex secVertex, const Amg::Vector3D jetDirection) const {
73 // calculates the chi2 compatibility between the primary and secondary vertex.
74 // this used to be the default tag weight until January 2010.
75
76 Eigen::Vector3d Diff;
77 Diff[0]=secVertex.position().x()-priVertex.position().x();
78 Diff[1]=secVertex.position().y()-priVertex.position().y();
79 Diff[2]=secVertex.position().z()-priVertex.position().z();
80
81 AmgSymMatrix(3) covariance = secVertex.covariancePosition() + priVertex.covariancePosition();
82
83 Eigen::Matrix3d weight;
84 bool invertible;
85 covariance.computeInverseWithCheck(weight, invertible);
86 if (not invertible) {
87 return 0;
88 }
89
90 Amg::Vector3D differenceNorm(Diff);
91 differenceNorm.normalize();
92 Amg::Vector3D jetDirectionNorm(jetDirection);
93 jetDirectionNorm.normalize();
94
95 double weight_similarity = Diff.transpose()*weight*Diff;
96
97 return std::sqrt(weight_similarity)*differenceNorm.dot(jetDirectionNorm);
98
99
100 }
101
102}
103
#define AmgSymMatrix(dim)
virtual double weight() const
get the weight of one tagger
TagInfoType m_tagJetInfoType
string to hold the info type (specified by the tag tool)
Definition BaseTagInfo.h:69
std::vector< double > m_tagLikelihood
vector to hold the taglikelihood (signal plus N background)
Definition BaseTagInfo.h:67
BaseTagInfo()
default constructor
float getChi2Compatibility(const Trk::RecVertex priVertex, const Trk::RecVertex secVertex, const Amg::Vector3D jetDirection) const
SVInfoPlus & operator=(const SVInfoPlus &rhs)
assigenment operator
virtual ~SVInfoPlus()
default destructor
SVInfoPlus()
default constructor
std::vector< SVTrackInfo > m_trackinfo
Definition SVInfoPlus.h:64
Trk::RecVertex m_recsvx
Definition SVInfoPlus.h:57
Trk::RecVertex inherits from Trk::Vertex.
Definition RecVertex.h:44
const Amg::Vector3D & position() const
return position of vertex
Definition Vertex.cxx:63
Eigen::Matrix< double, 3, 1 > Vector3D
The namespace of all packages in PhysicsAnalysis/JetTagging.
std::string TagInfoType
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.