32 AmgVector(5) VectPerig; VectPerig.setZero();
34 double CovVertTrk[15];
std::fill(CovVertTrk,CovVertTrk+15,0.);
35 double tmp_refFrameX=0, tmp_refFrameY=0, tmp_refFrameZ=0;
36 double fx,fy,BMAG_FIXED;
49 for (
auto i_ntrk = InpTrk.begin(); i_ntrk != InpTrk.end(); ++i_ntrk) {
51 mPer = &(*i_ntrk)->perigeeParameters();
52 if( mPer==
nullptr )
continue;
53 perGlobalPos = mPer->position();
54 if(fabs(perGlobalPos.z()) >
m_IDsizeZ)
return StatusCode::FAILURE;
55 if( perGlobalPos.perp() >
m_IDsizeR)
return StatusCode::FAILURE;
56 tmp_refFrameX += perGlobalPos.x() ;
57 tmp_refFrameY += perGlobalPos.y() ;
58 tmp_refFrameZ += perGlobalPos.z() ;
69 if(
counter == 0)
return StatusCode::FAILURE;
73 Amg::Vector3D refGVertex (tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ);
83 for (
auto i_ntrk = InpTrk.begin(); i_ntrk != InpTrk.end(); ++i_ntrk) {
87 mPer = &(*i_ntrk)->perigeeParameters();
88 if( mPer==
nullptr )
continue;
89 perGlobalPos = mPer->position();
90 if( !
convertAmg5SymMtx(mPer->covariance(), CovVertTrk) )
return StatusCode::FAILURE;
93 if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
98 const Perigee tmpPer(mPer->position(),mPer->momentum(),mPer->charge(),surfGRefPoint,std::move(tmpCov));
99 VectPerig = tmpPer.parameters();
101 VKalTransform( BMAG_FIXED, (
double)VectPerig[0], (
double)VectPerig[1],
102 (
double)VectPerig[2], (
double)VectPerig[3], (
double)VectPerig[4], CovVertTrk,
107 return StatusCode::FAILURE;
116 return StatusCode::SUCCESS;
128 std::vector<const xAOD::NeutralParticle*>::const_iterator i_ntrk;
129 AmgVector(5) VectPerig; VectPerig.setZero();
131 double CovVertTrk[15];
std::fill(CovVertTrk,CovVertTrk+15,0.);
132 double tmp_refFrameX=0, tmp_refFrameY=0, tmp_refFrameZ=0;
133 double fx,fy,BMAG_FIXED;
146 for (i_ntrk = InpTrk.begin(); i_ntrk != InpTrk.end(); ++i_ntrk) {
148 mPer = &(*i_ntrk)->perigeeParameters();
149 if( mPer==
nullptr )
continue;
150 perGlobalPos = mPer->position();
151 if(fabs(perGlobalPos.z()) >
m_IDsizeZ)
return StatusCode::FAILURE;
152 if( perGlobalPos.perp() >
m_IDsizeR)
return StatusCode::FAILURE;
153 tmp_refFrameX += perGlobalPos.x() ;
154 tmp_refFrameY += perGlobalPos.y() ;
155 tmp_refFrameZ += perGlobalPos.z() ;
166 if(
counter == 0)
return StatusCode::FAILURE;
170 Amg::Vector3D refGVertex (tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ);
181 for (i_ntrk = InpTrk.begin(); i_ntrk != InpTrk.end(); ++i_ntrk) {
185 mPer = &(*i_ntrk)->perigeeParameters();
186 if( mPer==
nullptr )
continue;
187 perGlobalPos = mPer->position();
188 if( !
convertAmg5SymMtx(mPer->covariance(), CovVertTrk) )
return StatusCode::FAILURE;
191 if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
198 const Perigee tmpPer(mPer->position(),mPer->momentum(),mPer->charge(),surfGRefPoint,std::move(tmpCov));
199 VectPerig = tmpPer.parameters();
201 VKalTransform( BMAG_FIXED, (
double)VectPerig[0], (
double)VectPerig[1],
202 (
double)VectPerig[2], (
double)VectPerig[3], (
double)VectPerig[4], CovVertTrk,
213 return StatusCode::FAILURE;
221 return StatusCode::SUCCESS;
230 mPer =
dynamic_cast<const Perigee*
> (i_ntrk);