ATLAS Offline Software
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 
7 namespace 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.),
19  m_trackinfo(std::vector<SVTrackInfo>()) {}
20 
22 SVInfoPlus::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.),
30  m_trackinfo(std::vector<SVTrackInfo>())
31 {
32  m_tagLikelihood.clear();
33 }
34 
39  m_recsvx(rhs.m_recsvx),
40  m_NGTinJet(rhs.m_NGTinJet),
41  m_NGTinSvx(rhs.m_NGTinSvx),
42  m_N2Tpair(rhs.m_N2Tpair),
43  m_masssvx(rhs.m_masssvx),
44  m_efracsvx(rhs.m_efracsvx),
45  m_normdist(rhs.m_normdist),
46  m_trackinfo(rhs.m_trackinfo)
47 {}
48 
51 {
52  if (this!=&rhs)
53  {
55  m_recsvx = rhs.m_recsvx;
56  m_NGTinJet = rhs.m_NGTinJet;
57  m_NGTinSvx = rhs.m_NGTinSvx;
58  m_N2Tpair = rhs.m_N2Tpair;
59  m_masssvx = rhs.m_masssvx;
60  m_efracsvx = rhs.m_efracsvx;
61  m_normdist = rhs.m_normdist;
64  }
65  return *this;
66 }
67 
70 {}
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 
Analysis::BaseTagInfo::m_tagLikelihood
std::vector< double > m_tagLikelihood
vector to hold the taglikelihood (signal plus N background)
Definition: BaseTagInfo.h:75
Analysis::SVInfoPlus::operator=
SVInfoPlus & operator=(const SVInfoPlus &rhs)
assigenment operator
Definition: SVInfoPlus.cxx:50
Analysis::SVInfoPlus::getChi2Compatibility
float getChi2Compatibility(const Trk::RecVertex priVertex, const Trk::RecVertex secVertex, const Amg::Vector3D jetDirection) const
Definition: SVInfoPlus.cxx:72
Analysis::SVTrackInfo
Definition: SVTrackInfo.h:17
Analysis::BaseTagInfo::weight
virtual double weight() const
get the weight of one tagger
Definition: BaseTagInfo.h:117
Analysis::SVInfoPlus::~SVInfoPlus
virtual ~SVInfoPlus()
default destructor
Definition: SVInfoPlus.cxx:69
Analysis::SVInfoPlus::m_trackinfo
std::vector< SVTrackInfo > m_trackinfo
Definition: SVInfoPlus.h:64
Analysis::SVInfoPlus::m_masssvx
float m_masssvx
Definition: SVInfoPlus.h:61
Analysis::SVInfoPlus::m_recsvx
Trk::RecVertex m_recsvx
Definition: SVInfoPlus.h:57
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
Analysis::SVInfoPlus::SVInfoPlus
SVInfoPlus()
default constructor
Definition: SVInfoPlus.cxx:11
vector
Definition: MultiHisto.h:13
Analysis::BaseTagInfo
Class BasetagInfo: Implements methods defined in ITagInfo.
Definition: BaseTagInfo.h:40
SVInfoPlus.h
Analysis::TagInfoType
std::string TagInfoType
Definition: JetTagInfoBase.h:19
Trk::Vertex::position
const Amg::Vector3D & position() const
return position of vertex
Definition: Vertex.cxx:72
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::SVInfoPlus::m_normdist
float m_normdist
Definition: SVInfoPlus.h:63
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Analysis::SVInfoPlus
Definition: SVInfoPlus.h:17
Analysis::SVInfoPlus::m_NGTinJet
long int m_NGTinJet
Definition: SVInfoPlus.h:58
Analysis::BaseTagInfo::m_tagJetInfoType
TagInfoType m_tagJetInfoType
string to hold the info type (specified by the tag tool)
Definition: BaseTagInfo.h:77
Analysis::SVInfoPlus::m_efracsvx
float m_efracsvx
Definition: SVInfoPlus.h:62
Analysis::SVInfoPlus::m_NGTinSvx
long int m_NGTinSvx
Definition: SVInfoPlus.h:59
Analysis::SVInfoPlus::m_N2Tpair
long int m_N2Tpair
Definition: SVInfoPlus.h:60