11 #include <alignment/reconstruction/AlignableSVDRecoHit.h>
13 #include <alignment/dbobjects/VXDAlignment.h>
14 #include <alignment/GlobalDerivatives.h>
15 #include <alignment/Hierarchy.h>
16 #include <alignment/Manager.h>
17 #include <framework/geometry/BFieldManager.h>
18 #include <svd/geometry/SensorInfo.h>
19 #include <vxd/geometry/GeoCache.h>
23 using namespace alignment;
25 bool AlignableSVDRecoHit::s_enableLorentzGlobalDerivatives =
false;
27 std::pair<std::vector<int>, TMatrixD> AlignableSVDRecoHit::globalDerivatives(
const genfit::StateOnPlane* sop)
29 auto alignment = GlobalCalibrationManager::getInstance().getAlignmentHierarchy().getGlobalDerivatives<
VXDAlignment>(getPlaneId(),
32 auto globals = GlobalDerivatives(alignment);
34 if (s_enableLorentzGlobalDerivatives) {
35 auto lorentz = GlobalCalibrationManager::getInstance().getLorentzShiftHierarchy().getGlobalDerivatives<
VXDAlignment>(getPlaneId(),
36 sop, BFieldManager::getInstance().getField(sop->getPos()));
43 auto L1 = [](
double x) {
return x;};
44 auto L2 = [](
double x) {
return (3 * x * x - 1) / 2;};
45 auto L3 = [](
double x) {
return (5 * x * x * x - 3 * x) / 2;};
46 auto L4 = [](
double x) {
return (35 * x * x * x * x - 30 * x * x + 3) / 8;};
48 double du_dw = sop->getState()[1];
49 double dv_dw = sop->getState()[2];
55 v = sop->getState()[4];
58 u = sop->getState()[3];
61 double width = geometry.getWidth(v);
62 double length = geometry.getLength();
73 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 31), std::vector<double> {L2(u)*du_dw, L2(u)*dv_dw});
74 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 32), std::vector<double> {L1(u)*L1(v)*du_dw, L1(u)*L1(v)*dv_dw});
75 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 33), std::vector<double> {L2(v)*du_dw, L2(v)*dv_dw});
77 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 41), std::vector<double> {L3(u)*du_dw, L3(u)*dv_dw});
78 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 42), std::vector<double> {L2(u)*L1(v)*du_dw, L2(u)*L1(v)*dv_dw});
79 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 43), std::vector<double> {L1(u)*L2(v)*du_dw, L1(u)*L2(v)*dv_dw});
80 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 44), std::vector<double> {L3(v)*du_dw, L3(v)*dv_dw});
82 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 51), std::vector<double> {L4(u)*du_dw, L4(u)*dv_dw});
83 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 52), std::vector<double> {L3(u)*L1(v)*du_dw, L3(u)*L1(v)*dv_dw});
84 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 53), std::vector<double> {L2(u)*L2(v)*du_dw, L2(u)*L2(v)*dv_dw});
85 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 54), std::vector<double> {L1(u)*L3(v)*du_dw, L1(u)*L3(v)*dv_dw});
86 globals.
add(GlobalLabel::construct<VXDAlignment>(getSensorID(), 55), std::vector<double> {L4(v)*du_dw, L4(v)*dv_dw});