I am puzzled by local residuals for our DUT, which is an ATLAS Strip detector. We put it in the beam “the wrong way round” … its internal coordinate system has x along global negative x; y along y. I apply a rotation of Pi radians about its y-axis to align it with the telescope. I include the DUT in the Gsl tracking in Tracking4D, where I print out local residuals, the intercept, and global residuals with:
ROOT::Math::XYZPoint globalRes = track->getGlobalResidual(detectorID);
ROOT::Math::XYPoint localRes = track->getLocalResidual(detectorID);
ROOT::Math::XYZPoint intercept = track->getState(detectorID);
if (track->getChi2ndof() < 3.) {
cout << detectorID << ": " << localRes << intercept << globalRes << endl;
}
Resulting in (for the first track found):
mimosa26_0: (-7.81404e-05, -0.00062894)(-0.653122, 0.902229, 0)(-7.81404e-05, -0.00062894, 0)
mimosa26_5: (0.000604319, 1.7071e-05)(-0.17685, 1.00407, 850)(0.000604401, 1.38756e-05, 0)
mimosa26_1: (0.000287192, 0.00119619)(-0.569866, 0.955627, 153)(0.000296676, 0.00119388, 0)
mimosa26_2: (-0.000591934, -0.000583202)(-0.487681, 1.00444, 305)(-0.000594077, -0.000581019, 0)
abc_29: (-10.1802, -0.0190987)(-0.405911, 1.03012, 425)(0.0185752, -10.1802, -8.86416e-10)
mimosa26_3: (-0.000307841, -2.21878e-06)(-0.342598, 1.03449, 559)(-0.000307848, -8.80011e-07, 0)
mimosa26_4: (0.000605309, 0.000273789)(-0.266852, 1.01954, 704)(0.000605372, 0.000273648, 0)
USBPIXI4B_10: (-0.0896679, 0.00730516)(-0.230156, 1.01197, 774)(-0.0076825, -0.0896364, 0)
What I see is that for Mimosas, the global residuals are more or less the same as the locals; xGlob → xLoc and yGlob → yLoc, as expected: they only have minor rotations for alignment.
For our USBPix, xGlob → -yLoc and yGlob → xLoc. That’s what I expect: in the geometry file, USBPix is rotated 90 deg about the z-axis, so I expect to swap x and y coords, with a sign change on one of them.
Our strip DUT abc_29 has the same: xGlob → -yLoc and yGlob → xLoc. Not what I would expect. I have a rotation of the DUT by 180 deg about the y-axis. This should map xGlob → -xLoc and yGlob → yGlob.
(I see in GblTrack.cpp, line 345 or thereabouts,
residual_local_[plane.getName()] = ROOT::Math::XYPoint(gblResiduals(0), gblResiduals(1));
hence I say it is Gbl that is swapping them)
Any ideas?