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