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 //Local variable state uses 49312 bytes of stack space
29 //coverity[STACK_USE]
30 State state;
31 initState (ctx, state);
32 return VKalGetImpact (InpPerigee, Vertex, Charge, Impact, ImpactError, state);
33 }
34
36 const Amg::Vector3D& Vertex,
37 const long int Charge,
38 std::vector<double>& Impact,
39 std::vector<double>& ImpactError,
40 IVKalState& istate) const
41 {
42 assert(dynamic_cast<State*> (&istate)!=nullptr);
43 State& state = static_cast<State&> (istate);
44
45 //
46 //------ Variables and arrays needed for fitting kernel
47 //
48 double SIGNIF=0.;
49 std::vector<const Trk::Perigee*> InpPerigeeList;
50 InpPerigeeList.push_back(InpPerigee);
51
52 //
53 //------ extract information about selected tracks
54 //
55 int ntrk=0;
56 StatusCode sc = CvtPerigee(InpPerigeeList, ntrk, state);
57 if(sc.isFailure() || ntrk != 1) { //Something is wrong in conversion
58 Impact.assign(5,1.e10);
59 ImpactError.assign(3,1.e20);
60 return 1.e10;
61 }
62 long int vkCharge = state.m_ich[0];
63 if(Charge==0) vkCharge=0;
64
65 //
66 // Target vertex in ref.frame defined by track themself
67 //
68 double VrtInp[3]={Vertex.x()-state.m_refFrameX,
69 Vertex.y()-state.m_refFrameY,
70 Vertex.z()-state.m_refFrameZ};
71 double VrtCov[6]={0.,0.,0.,0.,0.,0.};
72
73 Impact.resize(5);
74 ImpactError.resize(3);
75 Trk::cfimp(0, vkCharge, 0,
76 &state.m_apar[0][0], &state.m_awgt[0][0],
77 &VrtInp[0], &VrtCov[0],
78 Impact.data(), ImpactError.data(),
79 &SIGNIF, &state.m_vkalFitControl);
80
81 return SIGNIF;
82 }
83
84
85 double TrkVKalVrtFitter::VKalGetImpact(const EventContext& ctx,
86 const xAOD::TrackParticle* InpTrk,const Amg::Vector3D& Vertex,const long int Charge,
87 std::vector<double>& Impact, std::vector<double>& ImpactError) const
88 {
89 //Local variable state uses 49312 bytes of stack space
90 //coverity[STACK_USE]
91 State state;
92 initState (ctx, state);
93 return VKalGetImpact (InpTrk, Vertex, Charge, Impact, ImpactError, state);
94 }
95
96
97 double TrkVKalVrtFitter::VKalGetImpact(const xAOD::TrackParticle* InpTrk,const Amg::Vector3D& Vertex,const long int Charge,
98 std::vector<double>& Impact, std::vector<double>& ImpactError,
99 IVKalState& istate) const
100 {
101 assert(dynamic_cast<State*> (&istate)!=nullptr);
102 State& state = static_cast<State&> (istate);
103//
104//------ Variables and arrays needed for fitting kernel
105//
106 double SIGNIF=0.;
107
108 std::vector<const xAOD::TrackParticle*> InpTrkList(1,InpTrk);
109//
110
111//
112//------ extract information about selected tracks
113//
114 int ntrk=0;
115 StatusCode sc = CvtTrackParticle(InpTrkList,ntrk,state);
116 if(sc.isFailure() || ntrk != 1 ) { //Something is wrong in conversion
117 Impact.assign(5,1.e10);
118 ImpactError.assign(3,1.e20);
119 return 1.e10;
120 }
121 double sizeR = state.m_allowUltraDisplaced ? m_MSsizeR : m_IDsizeR;
122 double sizeZ = state.m_allowUltraDisplaced ? m_MSsizeZ : m_IDsizeZ;
123 if (std::abs(Vertex.z()) > sizeZ || Vertex.perp() > sizeR) {
124 Impact.assign(5, 1.e10);
125 ImpactError.assign(3, 1.e20);
126 return 1.e10;
127 }
128 long int vkCharge=state.m_ich[0];
129 if(Charge==0)vkCharge=0;
130//
131// Target vertex in ref.frame defined by track itself
132//
133 double VrtInp[3]={Vertex.x() -state.m_refFrameX, Vertex.y() -state.m_refFrameY, Vertex.z() -state.m_refFrameZ};
134 double VrtCov[6]={0.,0.,0.,0.,0.,0.};
135//
136//
137 Impact.resize(5); ImpactError.resize(3);
138 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);
139
140 return SIGNIF;
141
142 }
143
144
145}
146
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: