13 if (pt==0.)
throw cms::Exception(
"PerigeeConversions",
"Track with pt=0");
20 double positiveMomentumPhi = ( (phi>0) ? phi : (2*
M_PI+phi) );
21 double positionPhi = impactDistance.
phi();
22 double positivePositionPhi =
23 ( (positionPhi>0) ? positionPhi : (2*
M_PI+positionPhi) );
24 double phiDiff = positiveMomentumPhi - positivePositionPhi;
25 if (phiDiff<0.0) phiDiff+= (2*
M_PI);
26 double signEpsilon = ( (phiDiff >
M_PI) ? -1.0 : 1.0);
29 sqrt ( impactDistance.
x()*impactDistance.
x() +
30 impactDistance.
y()*impactDistance.
y() );
35 double signTC = - originalFTS.
charge();
36 bool isCharged = (signTC!=0) && (fabs(field)>1.e-10);
38 theTrackParameters[0] = field / pt*signTC;
40 theTrackParameters[0] = 1 /
pt;
42 theTrackParameters[1] =
theta;
43 theTrackParameters[2] =
phi;
44 theTrackParameters[3] =
epsilon;
45 theTrackParameters[4] = impactDistance.
z();
63 (
const FTS& originalFTS)
const
113 -theVector[3]*
cos(theVector[2])+referencePoint.
y(),
114 theVector[4]+referencePoint.
z());
122 sin(parameters.
phi()) * pt,
129 return momentumFromPerigee(asSVector<3>(momentum), charge, referencePoint, field);
137 if (momentum[0]==0.)
throw cms::Exception(
"PerigeeConversions",
"Track with rho=0");
140 if ( charge!=0 && bz>1.
e-10 ) {
144 pt = 1 / momentum[0];
148 sin(momentum[2]) * pt,
149 pt/
tan(momentum[1]));
155 return parameters.
charge();
163 return trajectoryStateClosestToPoint(asSVector<3>(momentum), referencePoint,
164 charge, asSMatrix<6>(sym), field);
175 (momentum, referencePoint, charge, field);
179 momentumFromPerigee(momentum, charge, referencePoint, field), charge,
180 field), cartesianTrajErr);
197 if (momentum[0]==0.)
throw cms::Exception(
"PerigeeConversions",
"Track with rho=0");
200 if (charge!=0 && fabs(bField)>1.
e-10) {
205 frameTransJ(0,0) = 1;
206 frameTransJ(1,1) = 1;
207 frameTransJ(2,2) = 1;
208 frameTransJ(3,3) = - factor *
cos(momentum[2]) / (momentum[0]*momentum[0]);
209 frameTransJ(4,3) = - factor *
sin(momentum[2]) / (momentum[0]*momentum[0]);
210 frameTransJ(5,3) = - factor /
tan(momentum[1]) / (momentum[0]*momentum[0]);
212 frameTransJ(3,5) = - factor *
sin(momentum[2]) / (momentum[0]);
213 frameTransJ(4,5) = factor *
cos(momentum[2]) / (momentum[0]);
214 frameTransJ(5,4) = - factor / (momentum[0]*
sin(momentum[1])*
sin(momentum[1]));
246 double Q = -B.
mag() * qbp;
247 double alphaQ = alpha * Q;
250 double coslambda =
cos(lambda), tanlambda =
tan(lambda);
252 double TI = T.
dot(I);
253 double NU = N.
dot(U);
254 double NV = N.
dot(V);
255 double UI = U.
dot(I);
256 double VI = V.
dot(I);
257 double UJ = U.
dot(J);
258 double VJ = V.
dot(J);
259 double UK = U.
dot(K);
260 double VK = V.
dot(K);
265 jac(0,0) = 1/coslambda;
269 jac(0,0) = -Bz/coslambda;
270 jac(0,1) = -Bz * tanlambda/coslambda*qbp;
271 jac(1,3) = alphaQ * NV * UI/TI;
272 jac(1,4) = alphaQ * NV * VI/TI;
273 jac(0,3) = -jac(0,1) * jac(1,3);
274 jac(0,4) = -jac(0,1) * jac(1,4);
275 jac(2,3) = -alphaQ/coslambda * NU * UI/TI;
276 jac(2,4) = -alphaQ/coslambda * NU * VI/TI;
316 double Q = -B.
mag() * qbp;
317 double alphaQ = alpha * Q;
320 double coslambda =
cos(lambda), sinlambda =
sin(lambda);
321 double mqbpt = -1./coslambda * qbp;
323 double TJ = T.
dot(J);
324 double TK = T.
dot(K);
325 double NU = N.
dot(U);
326 double NV = N.
dot(V);
327 double UJ = U.
dot(J);
328 double VJ = V.
dot(J);
329 double UK = U.
dot(K);
330 double VK = V.
dot(K);
335 jac(0,0) = coslambda;
336 jac(0,1) = sinlambda/coslambda/gtp.
momentum().
mag();
338 jac(0,0) = -coslambda/B.
z();
339 jac(0,1) = -sinlambda * mqbpt;
340 jac(1,3) = -alphaQ * NV * TJ;
341 jac(1,4) = -alphaQ * NV * TK;
342 jac(2,3) = -alphaQ/coslambda * NU * TJ;
343 jac(2,4) = -alphaQ/coslambda * NU * TK;
const double Z[kNumberCalorimeter]
const AlgebraicVector5 & vector() const
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
double transverseCurvature() const
const GlobalTrajectoryParameters & parameters() const
TrackCharge chargeFromPerigee(const PerigeeTrajectoryParameters &perigee) const
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
TrackCharge charge() const
Sin< T >::type sin(const T &t)
PerigeeTrajectoryParameters ftsToPerigeeParameters(const FTS &originalFTS, const GlobalPoint &referencePoint, double &pt) const
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
double signedInverseMomentum() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Geom::Theta< T > theta() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrackCharge charge() const
CurvilinearTrajectoryError curvilinearError(const PerigeeTrajectoryError &perigeeError, const GlobalTrajectoryParameters >p) const
const CurvilinearTrajectoryError & curvilinearError() const
static int position[TOTALCHAMBERS][3]
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const AlgebraicVector &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const AlgebraicMatrix &theCovarianceMatrix, const MagneticField *field) const
Geom::Theta< T > theta() const
virtual GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
AlgebraicMatrix66 jacobianParameters2Cartesian(const AlgebraicVector3 &momentum, const GlobalPoint &position, const TrackCharge &charge, const MagneticField *field) const
CLHEP::HepMatrix AlgebraicMatrix
GlobalVector momentumFromPerigee(const AlgebraicVector &momentum, const TrackCharge &charge, const GlobalPoint &referencePoint, const MagneticField *field) const
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
GlobalVector momentum() const
Cos< T >::type cos(const T &t)
GlobalPoint positionFromPerigee(const PerigeeTrajectoryParameters ¶meters, const GlobalPoint &referencePoint) const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Tan< T >::type tan(const T &t)
const std::complex< double > I
AlgebraicMatrix55 jacobianPerigee2Curvilinear(const GlobalTrajectoryParameters >p) const
AlgebraicMatrix55 jacobianCurvilinear2Perigee(const FreeTrajectoryState &fts) const
GlobalVector momentum() const
const AlgebraicSymMatrix55 & covarianceMatrix() const
GlobalPoint position() const
Vector3DBase unit() const
GlobalPoint position() const
CLHEP::HepVector AlgebraicVector
ROOT::Math::SVector< double, 5 > AlgebraicVector5
AlgebraicMatrix jacobianPerigee2Curvilinear_old(const GlobalTrajectoryParameters >p) const
double transverseCurvature() const
AlgebraicMatrix jacobianParameters2Cartesian_old(const AlgebraicVector &momentum, const GlobalPoint &position, const TrackCharge &charge, const MagneticField *field) const
const AlgebraicSymMatrix55 & matrix() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
PerigeeTrajectoryError ftsToPerigeeError(const FTS &originalFTS) const
const MagneticField & magneticField() const
double signedInverseMomentum() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
AlgebraicMatrix jacobianCurvilinear2Perigee_old(const FreeTrajectoryState &fts) const
Global3DVector GlobalVector