20 std::cout <<
" [LASAlignmentTubeAlgorithm::CalculateParameters] -- Starting." << std::endl;
32 int det, beam, disk,
pos;
35 const double phiPositions[8] = { 0.392699, 1.289799, 1.851794, 2.748894, 3.645995, 4.319690, 5.216791, 5.778784 };
36 std::vector<double> beamPhiPositions( 8, 0. );
37 for( beam = 0; beam < 8; ++beam ) beamPhiPositions.at( beam ) = phiPositions[beam];
43 const double radii[6] = { 564., 564., 514., 514., 600., 600. };
44 std::vector<double> beamRadii( 6, 0. );
45 for(
int aHalfbarrel = 0; aHalfbarrel < 6; ++aHalfbarrel ) beamRadii.at( aHalfbarrel ) = radii[aHalfbarrel];
49 std::vector<std::vector<std::vector<double> > > endFaceZPositions( 4, std::vector<std::vector<double> >( 2, std::vector<double>( 2, 0. ) ) );
50 endFaceZPositions.at( 0 ).at( 0 ).at( 0 ) = 1322.5;
51 endFaceZPositions.at( 0 ).at( 0 ).at( 1 ) = 2667.5;
52 endFaceZPositions.at( 1 ).at( 0 ).at( 0 ) = -2667.5;
53 endFaceZPositions.at( 1 ).at( 0 ).at( 1 ) = -1322.5;
54 endFaceZPositions.at( 2 ).at( 1 ).at( 0 ) = -700.;
55 endFaceZPositions.at( 2 ).at( 1 ).at( 1 ) = -300.;
56 endFaceZPositions.at( 2 ).at( 0 ).at( 0 ) = 300.;
57 endFaceZPositions.at( 2 ).at( 0 ).at( 1 ) = 700.;
58 endFaceZPositions.at( 3 ).at( 1 ).at( 0 ) = -1090.;
59 endFaceZPositions.at( 3 ).at( 1 ).at( 1 ) = -300.;
60 endFaceZPositions.at( 3 ).at( 0 ).at( 0 ) = 300.;
61 endFaceZPositions.at( 3 ).at( 0 ).at( 1 ) = 1090.;
64 double detReducedZ[2] = { 0., 0. };
66 double beamReducedZ[2] = { 0., 0. };
69 std::vector<double> disk9EndFaceZPositions( 2, 0. );
70 disk9EndFaceZPositions.at( 0 ) = -2667.5;
71 disk9EndFaceZPositions.at( 1 ) = 2667.5;
77 std::vector<double> sumOverPhiZPrime( 6, 0. );
78 std::vector<double> sumOverPhiZPrimePrime( 6, 0. );
79 std::vector<double> sumOverPhiZPrimeSinTheta( 6, 0. );
80 std::vector<double> sumOverPhiZPrimePrimeSinTheta( 6, 0. );
81 std::vector<double> sumOverPhiZPrimeCosTheta( 6, 0. );
82 std::vector<double> sumOverPhiZPrimePrimeCosTheta( 6, 0. );
85 std::vector<double> sumOverPhiZTPrime( 8, 0. );
86 std::vector<double> sumOverPhiZTPrimePrime( 8, 0. );
92 std::vector<double> sumOverZPrimeSquared( 6, 0. );
93 std::vector<double> sumOverZPrimePrimeSquared( 6, 0. );
94 std::vector<double> sumOverZPrimeZPrimePrime( 6, 0. );
95 std::vector<double> sumOverZPrimeZTPrime( 6, 0. );
96 std::vector<double> sumOverZPrimeZTPrimePrime( 6, 0. );
97 std::vector<double> sumOverZPrimePrimeZTPrime( 6, 0. );
98 std::vector<double> sumOverZPrimePrimeZTPrimePrime( 6, 0. );
101 double sumOverZTPrimeSquared = 0.;
102 double sumOverZTPrimePrimeSquared = 0.;
103 double sumOverZTPrimeZTPrimePrime = 0.;
110 det = 2; beam = 0; pos = 0;
114 const int theSide = pos<3 ? 0 : 1;
117 const int halfbarrel = det==2 ? det+theSide : det+1+theSide;
121 const double radialOffset = det==2 ? 50. : 36.;
124 detReducedZ[0] = measuredCoordinates.
GetTIBTOBEntry( det, beam, pos ).
GetZ() - endFaceZPositions.at( det ).at( theSide ).at( 0 );
125 detReducedZ[0] /= ( endFaceZPositions.at( det ).at( theSide ).at( 1 ) - endFaceZPositions.at( det ).at( theSide ).at( 0 ) );
126 detReducedZ[1] = endFaceZPositions.at( det ).at( theSide ).at( 1 ) - measuredCoordinates.
GetTIBTOBEntry( det, beam, pos ).
GetZ();
127 detReducedZ[1] /= ( endFaceZPositions.at( det ).at( theSide ).at( 1 ) - endFaceZPositions.at( det ).at( theSide ).at( 0 ) );
130 beamReducedZ[0] = ( measuredCoordinates.
GetTIBTOBEntry( det, beam, pos ).
GetZ() - radialOffset ) - disk9EndFaceZPositions.at( 0 );
131 beamReducedZ[0] /= ( disk9EndFaceZPositions.at( 1 ) - disk9EndFaceZPositions.at( 0 ) );
132 beamReducedZ[1] = disk9EndFaceZPositions.at( 1 ) - ( measuredCoordinates.
GetTIBTOBEntry( det, beam, pos ).
GetZ() - radialOffset );
133 beamReducedZ[1] /= ( disk9EndFaceZPositions.at( 1 ) - disk9EndFaceZPositions.at( 0 ) );
139 sumOverPhiZPrime.at( halfbarrel ) += phiResidual * detReducedZ[0];
140 sumOverPhiZPrimePrime.at( halfbarrel ) += phiResidual * detReducedZ[1];
141 sumOverPhiZPrimeSinTheta.at( halfbarrel ) += phiResidual * detReducedZ[0] *
sin( beamPhiPositions.at( beam ) );
142 sumOverPhiZPrimePrimeSinTheta.at( halfbarrel ) += phiResidual * detReducedZ[1] *
sin( beamPhiPositions.at( beam ) );
143 sumOverPhiZPrimeCosTheta.at( halfbarrel ) += phiResidual * detReducedZ[0] *
cos( beamPhiPositions.at( beam ) );
144 sumOverPhiZPrimePrimeCosTheta.at( halfbarrel ) += phiResidual * detReducedZ[1] *
cos( beamPhiPositions.at( beam ) );
146 sumOverPhiZTPrime.at( beam ) += phiResidual * beamReducedZ[0];
147 sumOverPhiZTPrimePrime.at( beam ) += phiResidual * beamReducedZ[1];
150 sumOverZPrimeSquared.at( halfbarrel ) +=
pow( detReducedZ[0], 2 ) / 8.;
151 sumOverZPrimePrimeSquared.at( halfbarrel ) +=
pow( detReducedZ[1], 2 ) / 8.;
152 sumOverZPrimeZPrimePrime.at( halfbarrel ) += detReducedZ[0] * detReducedZ[1] / 8.;
153 sumOverZPrimeZTPrime.at( halfbarrel ) += detReducedZ[0] * beamReducedZ[0] / 8.;
154 sumOverZPrimeZTPrimePrime.at( halfbarrel ) += detReducedZ[0] * beamReducedZ[1] / 8.;
155 sumOverZPrimePrimeZTPrime.at( halfbarrel ) += detReducedZ[1] * beamReducedZ[0] / 8.;
156 sumOverZPrimePrimeZTPrimePrime.at( halfbarrel ) += detReducedZ[1] * beamReducedZ[1] / 8.;
158 sumOverZTPrimeSquared +=
pow( beamReducedZ[0], 2 ) / 8.;
159 sumOverZTPrimePrimeSquared +=
pow( beamReducedZ[1], 2 ) / 8.;
160 sumOverZTPrimeZTPrimePrime += beamReducedZ[0] * beamReducedZ[1] / 8.;
162 }
while( globalLoop.
TIBTOBLoop( det, beam, pos ) );
172 det = 0; beam = 0; disk = 0;
176 const int halfbarrel = det;
179 const int theSide = 0;
182 const double radialOffset = 0.;
185 detReducedZ[0] = measuredCoordinates.
GetTEC2TECEntry( det, beam, disk ).
GetZ() - endFaceZPositions.at( det ).at( theSide ).at( 0 );
186 detReducedZ[0] /= ( endFaceZPositions.at( det ).at( theSide ).at( 1 ) - endFaceZPositions.at( det ).at( theSide ).at( 0 ) );
187 detReducedZ[1] = endFaceZPositions.at( det ).at( theSide ).at( 1 ) - measuredCoordinates.
GetTEC2TECEntry( det, beam, disk ).
GetZ();
188 detReducedZ[1] /= ( endFaceZPositions.at( det ).at( theSide ).at( 1 ) - endFaceZPositions.at( det ).at( theSide ).at( 0 ) );
191 beamReducedZ[0] = ( measuredCoordinates.
GetTEC2TECEntry( det, beam, disk ).
GetZ() - radialOffset ) - disk9EndFaceZPositions.at( 0 );
192 beamReducedZ[0] /= ( disk9EndFaceZPositions.at( 1 ) - disk9EndFaceZPositions.at( 0 ) );
193 beamReducedZ[1] = disk9EndFaceZPositions.at( 1 ) - ( measuredCoordinates.
GetTEC2TECEntry( det, beam, disk ).
GetZ() - radialOffset );
194 beamReducedZ[1] /= ( disk9EndFaceZPositions.at( 1 ) - disk9EndFaceZPositions.at( 0 ) );
200 sumOverPhiZPrime.at( halfbarrel ) += phiResidual * detReducedZ[0];
201 sumOverPhiZPrimePrime.at( halfbarrel ) += phiResidual * detReducedZ[1];
202 sumOverPhiZPrimeSinTheta.at( halfbarrel ) += phiResidual * detReducedZ[0] *
sin( beamPhiPositions.at( beam ) );
203 sumOverPhiZPrimePrimeSinTheta.at( halfbarrel ) += phiResidual * detReducedZ[1] *
sin( beamPhiPositions.at( beam ) );
204 sumOverPhiZPrimeCosTheta.at( halfbarrel ) += phiResidual * detReducedZ[0] *
cos( beamPhiPositions.at( beam ) );
205 sumOverPhiZPrimePrimeCosTheta.at( halfbarrel ) += phiResidual * detReducedZ[1] *
cos( beamPhiPositions.at( beam ) );
207 sumOverPhiZTPrime.at( beam ) += phiResidual * beamReducedZ[0];
208 sumOverPhiZTPrimePrime.at( beam ) += phiResidual * beamReducedZ[1];
211 sumOverZPrimeSquared.at( halfbarrel ) +=
pow( detReducedZ[0], 2 ) / 8.;
212 sumOverZPrimePrimeSquared.at( halfbarrel ) +=
pow( detReducedZ[1], 2 ) / 8.;
213 sumOverZPrimeZPrimePrime.at( halfbarrel ) += detReducedZ[0] * detReducedZ[1] / 8.;
214 sumOverZPrimeZTPrime.at( halfbarrel ) += detReducedZ[0] * beamReducedZ[0] / 8.;
215 sumOverZPrimeZTPrimePrime.at( halfbarrel ) += detReducedZ[0] * beamReducedZ[1] / 8.;
216 sumOverZPrimePrimeZTPrime.at( halfbarrel ) += detReducedZ[1] * beamReducedZ[0] / 8.;
217 sumOverZPrimePrimeZTPrimePrime.at( halfbarrel ) += detReducedZ[1] * beamReducedZ[1] / 8.;
219 sumOverZTPrimeSquared +=
pow( beamReducedZ[0], 2 ) / 8.;
220 sumOverZTPrimePrimeSquared +=
pow( beamReducedZ[1], 2 ) / 8.;
221 sumOverZTPrimeZTPrimePrime += beamReducedZ[0] * beamReducedZ[1] / 8.;
223 }
while( globalLoop.
TEC2TECLoop( det, beam, disk ) );
229 double sumOverSinTheta = 0.;
230 double sumOverCosTheta = 0.;
231 double sumOverSinThetaSquared = 0.;
232 double sumOverCosThetaSquared = 0.;
233 double sumOverCosThetaSinTheta = 0.;
234 double mixedTrigonometricTerm = 0.;
236 for( beam = 0; beam < 8; ++beam ) {
237 sumOverSinTheta +=
sin( beamPhiPositions.at( beam ) );
238 sumOverCosTheta +=
cos( beamPhiPositions.at( beam ) );
239 sumOverSinThetaSquared +=
pow(
sin( beamPhiPositions.at( beam ) ), 2 );
240 sumOverCosThetaSquared +=
pow(
cos( beamPhiPositions.at( beam ) ), 2 );
241 sumOverCosThetaSinTheta +=
cos( beamPhiPositions.at( beam ) ) *
sin( beamPhiPositions.at( beam ) );
244 mixedTrigonometricTerm = 8. * ( sumOverCosThetaSquared * sumOverSinThetaSquared -
pow( sumOverCosThetaSinTheta, 2 ) )
245 -
pow( sumOverCosTheta, 2 ) * sumOverSinThetaSquared
246 -
pow( sumOverSinTheta, 2 ) * sumOverCosThetaSquared
247 + 2. * sumOverCosTheta * sumOverSinTheta * sumOverCosThetaSinTheta;
252 double beamDenominator = (
pow( sumOverZTPrimeZTPrimePrime, 2 ) - sumOverZTPrimeSquared * sumOverZTPrimePrimeSquared ) * beamRadii.at( 0 );
253 std::vector<double> alignmentDenominator( 6, 0. );
254 std::vector<double> termA( 6, 0. ), termB( 6, 0. ), termC( 6, 0. ), termD( 6, 0. );
255 for(
unsigned int aHalfbarrel = 0; aHalfbarrel < 6; ++aHalfbarrel ) {
256 alignmentDenominator.at ( aHalfbarrel ) = (
pow( sumOverZPrimeZPrimePrime.at( aHalfbarrel ), 2 ) - sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) ) * mixedTrigonometricTerm;
257 termA.at( aHalfbarrel ) = sumOverZPrimeZTPrime.at( aHalfbarrel ) * sumOverZTPrimeZTPrimePrime - sumOverZPrimeZTPrimePrime.at( aHalfbarrel ) * sumOverZTPrimeSquared;
258 termB.at( aHalfbarrel ) = sumOverZPrimePrimeZTPrime.at( aHalfbarrel ) * sumOverZTPrimeZTPrimePrime - sumOverZPrimePrimeZTPrimePrime.at( aHalfbarrel ) * sumOverZTPrimeSquared;
259 termC.at( aHalfbarrel ) = sumOverZPrimeZTPrimePrime.at( aHalfbarrel ) * sumOverZTPrimeZTPrimePrime - sumOverZPrimeZTPrime.at( aHalfbarrel ) * sumOverZTPrimePrimeSquared;
260 termD.at( aHalfbarrel ) = sumOverZPrimePrimeZTPrimePrime.at( aHalfbarrel ) * sumOverZTPrimeZTPrimePrime - sumOverZPrimePrimeZTPrime.at( aHalfbarrel ) * sumOverZTPrimePrimeSquared;
265 const int numberOfBeams = 8;
273 for(
int aHalfbarrel = 0; aHalfbarrel < 6; ++aHalfbarrel ) {
279 theResult.
GetParameter( aHalfbarrel, 0, 0 ).first = ( sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinThetaSquared
280 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinThetaSquared
281 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
282 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
283 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
284 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
285 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
286 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
287 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) *
pow( sumOverCosThetaSinTheta, 2 )
288 + sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) *
pow( sumOverCosThetaSinTheta, 2 )
289 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
290 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta )
291 / alignmentDenominator.at ( aHalfbarrel );
294 theResult.
GetParameter( aHalfbarrel, 1, 0 ).first = ( sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinThetaSquared
295 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinThetaSquared
296 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
297 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
298 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
299 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
300 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
301 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
302 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverCosThetaSinTheta
303 + sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverCosThetaSinTheta
304 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
305 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta )
306 / alignmentDenominator.at ( aHalfbarrel );
309 theResult.
GetParameter( aHalfbarrel, 0, 1 ).first = -1. * ( sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
310 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
311 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
312 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
313 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
314 + sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
315 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
316 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
317 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSquared
318 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSquared
319 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosTheta
320 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosTheta )
321 / alignmentDenominator.at ( aHalfbarrel ) * beamRadii.at( aHalfbarrel );
324 theResult.
GetParameter( aHalfbarrel, 1, 1 ).first = -1. * ( sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
325 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSquared * sumOverSinTheta
326 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
327 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
328 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
329 + sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosThetaSinTheta
330 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
331 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
332 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSquared
333 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSquared
334 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosTheta
335 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverCosTheta )
336 / alignmentDenominator.at ( aHalfbarrel ) * beamRadii.at( aHalfbarrel );
339 theResult.
GetParameter( aHalfbarrel, 0, 2 ).first = ( sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
340 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
341 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverSinThetaSquared
342 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverSinThetaSquared
343 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverSinTheta * sumOverSinTheta
344 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverSinTheta * sumOverSinTheta
345 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
346 + sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
347 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
348 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
349 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
350 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta )
351 / alignmentDenominator.at ( aHalfbarrel ) * beamRadii.at( aHalfbarrel );
354 theResult.
GetParameter( aHalfbarrel, 1, 2 ).first = ( sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
355 - sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinThetaSquared
356 - sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverSinThetaSquared
357 + sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverSinThetaSquared
358 + sumOverPhiZPrimePrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverSinTheta * sumOverSinTheta
359 - sumOverPhiZPrimeCosTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverSinTheta * sumOverSinTheta
360 - sumOverPhiZPrimePrime.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
361 + sumOverPhiZPrime.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosThetaSinTheta * sumOverSinTheta
362 - sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
363 + sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * sumOverCosTheta * sumOverSinTheta
364 + sumOverPhiZPrimePrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimeZPrimePrime.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta
365 - sumOverPhiZPrimeSinTheta.at( aHalfbarrel ) * sumOverZPrimePrimeSquared.at( aHalfbarrel ) * numberOfBeams * sumOverCosThetaSinTheta )
366 / alignmentDenominator.at ( aHalfbarrel ) * beamRadii.at( aHalfbarrel );
374 double vsumA = 0., vsumB = 0., vsumC = 0., vsumD = 0., vsumE = 0., vsumF = 0.;
375 for(
unsigned int aHalfbarrel = 0; aHalfbarrel < 6; ++aHalfbarrel ) {
376 vsumA += theResult.
GetParameter( aHalfbarrel, 1, 2 ).first * termA.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 2 ).first * termB.at( aHalfbarrel );
377 vsumB += theResult.
GetParameter( aHalfbarrel, 1, 1 ).first * termA.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 1 ).first * termB.at( aHalfbarrel );
378 vsumC += beamRadii.at( aHalfbarrel ) * ( theResult.
GetParameter( aHalfbarrel, 1, 0 ).first * termA.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 0 ).first * termB.at( aHalfbarrel ) );
379 vsumD += theResult.
GetParameter( aHalfbarrel, 1, 2 ).first * termC.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 2 ).first * termD.at( aHalfbarrel );
380 vsumE += theResult.
GetParameter( aHalfbarrel, 1, 1 ).first * termC.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 1 ).first * termD.at( aHalfbarrel );
381 vsumF += beamRadii.at( aHalfbarrel ) * ( theResult.
GetParameter( aHalfbarrel, 1, 0 ).first * termC.at( aHalfbarrel ) + theResult.
GetParameter( aHalfbarrel, 0, 0 ).first * termD.at( aHalfbarrel ) );
387 for(
unsigned int beam = 0; beam < 8; ++beam ) {
391 -
sin( beamPhiPositions.at( beam ) ) * vsumB
393 + sumOverPhiZTPrime.at( beam ) * sumOverZTPrimeZTPrimePrime - sumOverPhiZTPrimePrime.at( beam ) * sumOverZTPrimeSquared )
397 std::cout <<
"BBBBBBBB: " <<
cos( beamPhiPositions.at( beam ) ) * vsumA <<
" " 398 << -1. *
sin( beamPhiPositions.at( beam ) ) * vsumB <<
" " 399 << -1. * vsumC <<
" " 400 << sumOverPhiZTPrime.at( beam ) * sumOverZTPrimeZTPrimePrime - sumOverPhiZTPrimePrime.at( beam ) * sumOverZTPrimeSquared <<
" " 408 -
sin( beamPhiPositions.at( beam ) ) * vsumE
410 + sumOverPhiZTPrimePrime.at( beam ) * sumOverZTPrimeZTPrimePrime - sumOverPhiZTPrime.at( beam ) * sumOverZTPrimePrimeSquared )
std::pair< double, double > & GetParameter(int aSubdetector, int aDisk, int aParameter)
Sin< T >::type sin(const T &t)
double GetPhi(void) const
bool TEC2TECLoop(int &, int &, int &) const
Cos< T >::type cos(const T &t)
std::pair< double, double > & GetBeamParameter(int aBeam, int aParameter)
T & GetTIBTOBEntry(int subdetector, int beam, int tibTobPosition)
T & GetTEC2TECEntry(int subdetector, int beam, int tecDisk)
bool TIBTOBLoop(int &, int &, int &) const
Power< A, B >::type pow(const A &a, const B &b)