ATLAS Offline Software
JacobianCartesianToPolar.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // JacobianCartesianToPolar.cxx, (c) ATLAS Detector Software
8 
10 #include <cmath>
11 
13  AmgMatrix(5,5)()
14 {
15  // initialize to identify matrix
16  this->setIdentity();
17 
18  if (std::fabs(lx)>10e-6 || std::fabs(ly)>10e-6){
19 
20  double r = std::sqrt(lx*lx+ly*ly);
21 
22  (*this)(Trk::locR,Trk::locX) = lx/r;
23  (*this)(Trk::locR,Trk::locY) = ly/r;
24  (*this)(Trk::locPhi,Trk::locX) = -ly/(r*r);
25  (*this)(Trk::locPhi,Trk::locY) = lx/(r*r);
26  }
27 }
28 
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::JacobianCartesianToPolar::JacobianCartesianToPolar
JacobianCartesianToPolar(const double lx, const double ly)
Definition: JacobianCartesianToPolar.cxx:12
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Trk::locR
@ locR
Definition: ParamDefs.h:44
AmgMatrix
#define AmgMatrix(rows, cols)
Definition: EventPrimitives.h:49
Trk::locPhi
@ locPhi
local polar
Definition: ParamDefs.h:45
JacobianCartesianToPolar.h