You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TPC: improving simulation of distortions in MC (#13345)
* TPC: improving simulation of distortions in MC
- adding option to recalculate (merging) the distortions in case of large scaling
- accessing the distortions of the derivative map at the distorted
position for better consistency with corrections
* TPC: Renaming variables
(cherry picked from commit 91dd4df)
LOGP(info, "Inst. lumi {} is same as mean lumi {}. Skip recalculation of distortions", CorrMapParam::Instance().lumiInst, mSpaceCharge->getMeanLumi());
Copy file name to clipboardExpand all lines: Detectors/TPC/spacecharge/include/TPCSpaceCharge/SpaceCharge.h
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -354,7 +354,20 @@ class SpaceCharge
354
354
/// \param approachR when the difference between the desired r coordinate and the position of the global correction is deltaR, approach the desired r coordinate by deltaR * \p approachR.
355
355
/// \param approachPhi when the difference between the desired phi coordinate and the position of the global correction is deltaPhi, approach the desired phi coordinate by deltaPhi * \p approachPhi.
356
356
/// \param diffCorr if the absolute differences from the interpolated values for the global corrections from the last iteration compared to the current iteration is smaller than this value, set converged to true for current global distortion
// set global distortions if algorithm converged or iterations exceed max numbers of iterations
786
-
mGlobalDistdR[side](iZ, iR, iPhi) = -corrdR;
787
-
mGlobalDistdRPhi[side](iZ, iR, iPhi) = -corrdRPhi;
788
-
mGlobalDistdZ[side](iZ, iR, iPhi) = -corrdZ;
845
+
if (type == Type::Distortions) {
846
+
mGlobalDistdR[side](iZ, iR, iPhi) = -corrdR;
847
+
mGlobalDistdRPhi[side](iZ, iR, iPhi) = -corrdRPhi;
848
+
mGlobalDistdZ[side](iZ, iR, iPhi) = -corrdZ;
849
+
} else {
850
+
mGlobalCorrdR[side](iZ, iR, iPhi) = -corrdR;
851
+
mGlobalCorrdRPhi[side](iZ, iR, iPhi) = -corrdRPhi;
852
+
mGlobalCorrdZ[side](iZ, iR, iPhi) = -corrdZ;
853
+
}
789
854
}
790
855
}
791
856
for (unsignedint iR = 0; iR < mParamGrid.NRVertices; ++iR) {
792
-
mGlobalDistdR[side](0, iR, iPhi) = 3 * (mGlobalDistdR[side](1, iR, iPhi) - mGlobalDistdR[side](2, iR, iPhi)) + mGlobalDistdR[side](3, iR, iPhi);
793
-
mGlobalDistdRPhi[side](0, iR, iPhi) = 3 * (mGlobalDistdRPhi[side](1, iR, iPhi) - mGlobalDistdRPhi[side](2, iR, iPhi)) + mGlobalDistdRPhi[side](3, iR, iPhi);
794
-
mGlobalDistdZ[side](0, iR, iPhi) = 3 * (mGlobalDistdZ[side](1, iR, iPhi) - mGlobalDistdZ[side](2, iR, iPhi)) + mGlobalDistdZ[side](3, iR, iPhi);
857
+
if (type == Type::Distortions) {
858
+
mGlobalDistdR[side](0, iR, iPhi) = 3 * (mGlobalDistdR[side](1, iR, iPhi) - mGlobalDistdR[side](2, iR, iPhi)) + mGlobalDistdR[side](3, iR, iPhi);
859
+
mGlobalDistdRPhi[side](0, iR, iPhi) = 3 * (mGlobalDistdRPhi[side](1, iR, iPhi) - mGlobalDistdRPhi[side](2, iR, iPhi)) + mGlobalDistdRPhi[side](3, iR, iPhi);
860
+
mGlobalDistdZ[side](0, iR, iPhi) = 3 * (mGlobalDistdZ[side](1, iR, iPhi) - mGlobalDistdZ[side](2, iR, iPhi)) + mGlobalDistdZ[side](3, iR, iPhi);
861
+
} else {
862
+
mGlobalCorrdR[side](0, iR, iPhi) = 3 * (mGlobalCorrdR[side](1, iR, iPhi) - mGlobalCorrdR[side](2, iR, iPhi)) + mGlobalCorrdR[side](3, iR, iPhi);
863
+
mGlobalCorrdRPhi[side](0, iR, iPhi) = 3 * (mGlobalCorrdRPhi[side](1, iR, iPhi) - mGlobalCorrdRPhi[side](2, iR, iPhi)) + mGlobalCorrdRPhi[side](3, iR, iPhi);
864
+
mGlobalCorrdZ[side](0, iR, iPhi) = 3 * (mGlobalCorrdZ[side](1, iR, iPhi) - mGlobalCorrdZ[side](2, iR, iPhi)) + mGlobalCorrdZ[side](3, iR, iPhi);
865
+
}
795
866
}
796
867
}
797
868
}
@@ -1535,7 +1606,7 @@ void SpaceCharge<DataT>::distortElectron(GlobalPosition3D& point, const SpaceCha
0 commit comments