ATLAS Offline Software
Loading...
Searching...
No Matches
VKalGetImpact.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Header include
9//-------------------------------------------------
10//
11#include<iostream>
12
13
14//
15//__________________________________________________________________________
16//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
17
18
19namespace Trk{
20
21 double TrkVKalVrtFitter::VKalGetImpact(const EventContext& ctx,
22 const Trk::Perigee* InpPerigee,
23 const Amg::Vector3D& Vertex,
24 const long int Charge,
25 std::vector<double>& Impact,
26 std::vector<double>& ImpactError) const
27 {
28 State state;
29 initState (ctx, state);
30 return VKalGetImpact (InpPerigee, Vertex, Charge, Impact, ImpactError, state);
31 }
32
34 const Amg::Vector3D& Vertex,
35 const long int Charge,
36 std::vector<double>& Impact,
37 std::vector<double>& ImpactError,
38 IVKalState& istate) const
39 {
40 assert(dynamic_cast<State*> (&istate)!=nullptr);
41 State& state = static_cast<State&> (istate);
42
43 //
44 //------ Variables and arrays needed for fitting kernel
45 //
46 double SIGNIF=0.;
47 std::vector<const Trk::Perigee*> InpPerigeeList;
48 InpPerigeeList.push_back(InpPerigee);
49
50 //
51 //------ extract information about selected tracks
52 //
53 int ntrk=0;
54 StatusCode sc = CvtPerigee(InpPerigeeList, ntrk, state);
55 if(sc.isFailure() || ntrk != 1) { //Something is wrong in conversion
56 Impact.assign(5,1.e10);
57 ImpactError.assign(3,1.e20);
58 return 1.e10;
59 }
60 long int vkCharge = state.m_ich[0];
61 if(Charge==0) vkCharge=0;
62
63 //
64 // Target vertex in ref.frame defined by track themself
65 //
66 double VrtInp[3]={Vertex.x()-state.m_refFrameX,
67 Vertex.y()-state.m_refFrameY,
68 Vertex.z()-state.m_refFrameZ};
69 double VrtCov[6]={0.,0.,0.,0.,0.,0.};
70
71 Impact.resize(5);
72 ImpactError.resize(3);
73 Trk::cfimp(0, vkCharge, 0,
74 &state.m_apar[0][0], &state.m_awgt[0][0],
75 &VrtInp[0], &VrtCov[0],
76 Impact.data(), ImpactError.data(),
77 &SIGNIF, &state.m_vkalFitControl);
78
79 return SIGNIF;
80 }
81
82
83 double TrkVKalVrtFitter::VKalGetImpact(const EventContext& ctx,
84 const xAOD::TrackParticle* InpTrk,const Amg::Vector3D& Vertex,const long int Charge,
85 std::vector<double>& Impact, std::vector<double>& ImpactError) const
86 {
87 State state;
88 initState (ctx, state);
89 return VKalGetImpact (InpTrk, Vertex, Charge, Impact, ImpactError, state);
90 }
91
92
93 double TrkVKalVrtFitter::VKalGetImpact(const xAOD::TrackParticle* InpTrk,const Amg::Vector3D& Vertex,const long int Charge,
94 std::vector<double>& Impact, std::vector<double>& ImpactError,
95 IVKalState& istate) const
96 {
97 assert(dynamic_cast<State*> (&istate)!=nullptr);
98 State& state = static_cast<State&> (istate);
99//
100//------ Variables and arrays needed for fitting kernel
101//
102 double SIGNIF=0.;
103
104 std::vector<const xAOD::TrackParticle*> InpTrkList(1,InpTrk);
105//
106
107//
108//------ extract information about selected tracks
109//
110 int ntrk=0;
111 StatusCode sc = CvtTrackParticle(InpTrkList,ntrk,state);
112 if(sc.isFailure() || ntrk != 1 ) { //Something is wrong in conversion
113 Impact.assign(5,1.e10);
114 ImpactError.assign(3,1.e20);
115 return 1.e10;
116 }
117 double sizeR = state.m_allowUltraDisplaced ? m_MSsizeR : m_IDsizeR;
118 double sizeZ = state.m_allowUltraDisplaced ? m_MSsizeZ : m_IDsizeZ;
119 if (std::abs(Vertex.z()) > sizeZ || Vertex.perp() > sizeR) {
120 Impact.assign(5, 1.e10);
121 ImpactError.assign(3, 1.e20);
122 return 1.e10;
123 }
124 long int vkCharge=state.m_ich[0];
125 if(Charge==0)vkCharge=0;
126//
127// Target vertex in ref.frame defined by track itself
128//
129 double VrtInp[3]={Vertex.x() -state.m_refFrameX, Vertex.y() -state.m_refFrameY, Vertex.z() -state.m_refFrameZ};
130 double VrtCov[6]={0.,0.,0.,0.,0.,0.};
131//
132//
133 Impact.resize(5); ImpactError.resize(3);
134 Trk::cfimp( 0, vkCharge, 0, &state.m_apar[0][0], &state.m_awgt[0][0], &VrtInp[0], &VrtCov[0], Impact.data(), ImpactError.data(), &SIGNIF, &state.m_vkalFitControl);
135
136 return SIGNIF;
137
138 }
139
140
141}
142
static Double_t sc
double m_apar[NTrMaxVFit][5]
double m_awgt[NTrMaxVFit][15]
Gaudi::Property< double > m_MSsizeZ
StatusCode CvtPerigee(const std::vector< const Perigee * > &list, int &ntrk, State &state) const
Gaudi::Property< double > m_IDsizeZ
void initState(const EventContext &ctx, State &state) const
virtual double VKalGetImpact(const xAOD::TrackParticle *, const Amg::Vector3D &Vertex, const long int Charge, dvect &Impact, dvect &ImpactError, IVKalState &istate) const override final
StatusCode CvtTrackParticle(std::span< const xAOD::TrackParticle *const > list, int &ntrk, State &state) const
Gaudi::Property< double > m_IDsizeR
Gaudi::Property< double > m_MSsizeR
This class is a simplest representation of a vertex candidate.
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
void cfimp(long int TrkID, long int ich, int IFL, double *par, const double *err, double *vrt, double *vcov, double *rimp, double *rcov, double *sign, VKalVrtControlBase *FitCONTROL)
Definition cfImp.cxx:43
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
TrackParticle_v1 TrackParticle
Reference the current persistent version: