Go to the documentation of this file.00001
00007 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00008
00009 #include "Alignment/CommonAlignmentParametrization/interface/KarimakiAlignmentDerivatives.h"
00010 #include "Alignment/CommonAlignmentParametrization/interface/BowedSurfaceAlignmentDerivatives.h"
00011 #include <math.h>
00012
00013 AlgebraicMatrix
00014 BowedSurfaceAlignmentDerivatives::operator()(const TrajectoryStateOnSurface &tsos,
00015 double uWidth, double vLength,
00016 bool doSplit, double ySplit) const
00017 {
00018
00019 AlgebraicMatrix result(N_PARAM, 2);
00020
00021
00022 const AlgebraicVector5 tsosPar(tsos.localParameters().mixedFormatVector());
00023
00024
00025
00026
00027 double myY = tsosPar[4];
00028 double myLengthV = vLength;
00029 if (doSplit) {
00030
00031 const double sign = (tsosPar[4] < ySplit ? +1. : -1.);
00032 const double yMiddle = ySplit * 0.5 - sign * vLength * .25;
00033 myY = tsosPar[4] - yMiddle;
00034 myLengthV = vLength * 0.5 + sign * ySplit;
00035 }
00036
00037 const AlgebraicMatrix karimaki(KarimakiAlignmentDerivatives()(tsos));
00038
00039 result[dx][0] = karimaki[0][0];
00040 result[dx][1] = karimaki[0][1];
00041 result[dy][0] = karimaki[1][0];
00042 result[dy][1] = karimaki[1][1];
00043 result[dz][0] = karimaki[2][0];
00044 result[dz][1] = karimaki[2][1];
00045 const double aScale = gammaScale(uWidth, myLengthV);
00046 result[drotZ][0] = myY / aScale;
00047 result[drotZ][1] = karimaki[5][1] / aScale;
00048
00049 double uRel = 2. * tsosPar[3] / uWidth;
00050 double vRel = 2. * myY / myLengthV;
00051
00052 const double cutOff = 1.5;
00053 if (uRel < -cutOff) { uRel = -cutOff; } else if (uRel > cutOff) { uRel = cutOff; }
00054 if (vRel < -cutOff) { vRel = -cutOff; } else if (vRel > cutOff) { vRel = cutOff; }
00055
00056
00057 const double uLP0 = 1.0;
00058 const double uLP1 = uRel;
00059 const double uLP2 = uRel * uRel - 1./3.;
00060 const double vLP0 = 1.0;
00061 const double vLP1 = vRel;
00062 const double vLP2 = vRel * vRel - 1./3.;
00063
00064
00065 result[dslopeX][0] = tsosPar[1] * uLP1 * vLP0;
00066 result[dslopeX][1] = tsosPar[2] * uLP1 * vLP0;
00067 result[dslopeY][0] = tsosPar[1] * uLP0 * vLP1;
00068 result[dslopeY][1] = tsosPar[2] * uLP0 * vLP1;
00069
00070
00071 result[dsagittaX ][0] = tsosPar[1] * uLP2 * vLP0;
00072 result[dsagittaX ][1] = tsosPar[2] * uLP2 * vLP0;
00073 result[dsagittaXY][0] = tsosPar[1] * uLP1 * vLP1;
00074 result[dsagittaXY][1] = tsosPar[2] * uLP1 * vLP1;
00075 result[dsagittaY ][0] = tsosPar[1] * uLP0 * vLP2;
00076 result[dsagittaY ][1] = tsosPar[2] * uLP0 * vLP2;
00077
00078 return result;
00079 }
00080
00081
00082 double BowedSurfaceAlignmentDerivatives::gammaScale(double width, double splitLength)
00083 {
00084
00085
00086 return 0.5 * (width + splitLength);
00087 }