File indexing completed on 2023-03-17 10:38:57
0001
0002
0003
0004
0005
0006
0007 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0008
0009 #include "Alignment/CommonAlignmentParametrization/interface/BowedSurfaceAlignmentDerivatives.h"
0010 #include "Alignment/CommonAlignmentParametrization/interface/KarimakiAlignmentDerivatives.h"
0011 #include <cmath>
0012
0013 AlgebraicMatrix BowedSurfaceAlignmentDerivatives::operator()(
0014 const TrajectoryStateOnSurface &tsos, double uWidth, double vLength, bool doSplit, double ySplit) const {
0015 AlgebraicMatrix result(N_PARAM, 2);
0016
0017
0018 const AlgebraicVector5 tsosPar(tsos.localParameters().mixedFormatVector());
0019
0020
0021
0022
0023 double myY = tsosPar[4];
0024 double myLengthV = vLength;
0025 if (doSplit) {
0026
0027
0028
0029 const double sign = (tsosPar[4] < ySplit ? +1. : -1.);
0030 const double yMiddle = ySplit * 0.5 - sign * vLength * .25;
0031 myY = tsosPar[4] - yMiddle;
0032 myLengthV = vLength * 0.5 + sign * ySplit;
0033 }
0034
0035 const AlgebraicMatrix karimaki(KarimakiAlignmentDerivatives()(tsos));
0036
0037 result[dx][0] = karimaki[0][0];
0038 result[dx][1] = karimaki[0][1];
0039 result[dy][0] = karimaki[1][0];
0040 result[dy][1] = karimaki[1][1];
0041 result[dz][0] = karimaki[2][0];
0042 result[dz][1] = karimaki[2][1];
0043 const double aScale = gammaScale(uWidth, myLengthV);
0044 result[drotZ][0] = myY / aScale;
0045 result[drotZ][1] = karimaki[5][1] / aScale;
0046
0047 double uRel = 2. * tsosPar[3] / uWidth;
0048 double vRel = 2. * myY / myLengthV;
0049
0050 const double cutOff = 1.5;
0051 if (uRel < -cutOff) {
0052 uRel = -cutOff;
0053 } else if (uRel > cutOff) {
0054 uRel = cutOff;
0055 }
0056 if (vRel < -cutOff) {
0057 vRel = -cutOff;
0058 } else if (vRel > cutOff) {
0059 vRel = cutOff;
0060 }
0061
0062
0063 const double uLP0 = 1.0;
0064 const double uLP1 = uRel;
0065 const double uLP2 = uRel * uRel - 1. / 3.;
0066 const double vLP0 = 1.0;
0067 const double vLP1 = vRel;
0068 const double vLP2 = vRel * vRel - 1. / 3.;
0069
0070
0071 result[dslopeX][0] = tsosPar[1] * uLP1 * vLP0;
0072 result[dslopeX][1] = tsosPar[2] * uLP1 * vLP0;
0073 result[dslopeY][0] = tsosPar[1] * uLP0 * vLP1;
0074 result[dslopeY][1] = tsosPar[2] * uLP0 * vLP1;
0075
0076
0077 result[dsagittaX][0] = tsosPar[1] * uLP2 * vLP0;
0078 result[dsagittaX][1] = tsosPar[2] * uLP2 * vLP0;
0079 result[dsagittaXY][0] = tsosPar[1] * uLP1 * vLP1;
0080 result[dsagittaXY][1] = tsosPar[2] * uLP1 * vLP1;
0081 result[dsagittaY][0] = tsosPar[1] * uLP0 * vLP2;
0082 result[dsagittaY][1] = tsosPar[2] * uLP0 * vLP2;
0083
0084 return result;
0085 }
0086
0087
0088 double BowedSurfaceAlignmentDerivatives::gammaScale(double width, double splitLength) {
0089
0090
0091 return 0.5 * (width + splitLength);
0092 }