From 98151179d0b04769b3a9de17742c8a48041429e7 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:19:32 +0200 Subject: [PATCH 01/23] Adding x_sep in TRestAxionTrueWolterOptics.h --- inc/TRestAxionTrueWolterOptics.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/TRestAxionTrueWolterOptics.h b/inc/TRestAxionTrueWolterOptics.h index b8ba4ba0..f1c7c1c0 100644 --- a/inc/TRestAxionTrueWolterOptics.h +++ b/inc/TRestAxionTrueWolterOptics.h @@ -47,6 +47,9 @@ class TRestAxionTrueWolterOptics : public TRestAxionOptics { /// Mirror thickness in mm. See schematic figure. std::vector fThickness; //! + /// Distance between mirror stacks in mm. See schematic figure. + std::vector fxSep; //! + /// The spider structure to be used as an optical opaque mask (common to all planes) TRestSpiderMask* fSpiderMask = nullptr; //< From dbcc47ce366c3736802b0f459fa175bf275d354a Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:22:27 +0200 Subject: [PATCH 02/23] Adding x_sep to TRestAxionWolterOptics.h --- inc/TRestAxionWolterOptics.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/TRestAxionWolterOptics.h b/inc/TRestAxionWolterOptics.h index eb1e837a..4bd30811 100644 --- a/inc/TRestAxionWolterOptics.h +++ b/inc/TRestAxionWolterOptics.h @@ -47,6 +47,9 @@ class TRestAxionWolterOptics : public TRestAxionOptics { /// Mirror thickness in mm. See schematic figure. std::vector fThickness; //! + /// Distance between mirror stacks in mm. See schematic figure. + std::vector fxSep; //! + /// The spider structure to be used as an optical opaque mask (common to all planes) TRestSpiderMask* fSpiderMask = nullptr; //< From 92fda9d679c13744196a5e5d06d2bd8fb436f80c Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:37:54 +0200 Subject: [PATCH 03/23] Adding x_sep to TRestAxionTrueWolterOptics.cxx --- src/TRestAxionTrueWolterOptics.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 592c5ba0..4e04edf7 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -173,6 +173,7 @@ void TRestAxionTrueWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); + fXSep = 2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(fAlpha)) / TMath::Tan(fAlpha); if (fAlpha.size() == 0) return; @@ -181,7 +182,7 @@ void TRestAxionTrueWolterOptics::Initialize() { fCosAlpha_3.clear(); for (const auto& a : fAlpha) fCosAlpha_3.push_back(TMath::Cos(3 * a)); - + fFrontVertex.clear(); for (unsigned int n = 0; n < fAlpha.size(); n++) fFrontVertex.push_back(fR3[n] / TMath::Tan(fAlpha[n])); From 350dd668eb6c430229d8c7c7ab2650f09422765b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:38:03 +0000 Subject: [PATCH 04/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionTrueWolterOptics.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 4e04edf7..6e454e71 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -182,7 +182,7 @@ void TRestAxionTrueWolterOptics::Initialize() { fCosAlpha_3.clear(); for (const auto& a : fAlpha) fCosAlpha_3.push_back(TMath::Cos(3 * a)); - + fFrontVertex.clear(); for (unsigned int n = 0; n < fAlpha.size(); n++) fFrontVertex.push_back(fR3[n] / TMath::Tan(fAlpha[n])); From 2aefce70a92399f826f73aef1978e1fe9dbca087 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:39:13 +0200 Subject: [PATCH 05/23] Adding x_sep to TRestAxionWolterOptics.cxx --- src/TRestAxionWolterOptics.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index faac2445..bdeeb34d 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -173,6 +173,7 @@ void TRestAxionWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); + fXSep = 2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(fAlpha)) / TMath::Tan(fAlpha); if (fAlpha.size() == 0) return; From 941945da904bc910c19ddba94e6c5642cd94946c Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:40:43 +0200 Subject: [PATCH 06/23] Correct variable spelling --- inc/TRestAxionTrueWolterOptics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/TRestAxionTrueWolterOptics.h b/inc/TRestAxionTrueWolterOptics.h index f1c7c1c0..550faaf7 100644 --- a/inc/TRestAxionTrueWolterOptics.h +++ b/inc/TRestAxionTrueWolterOptics.h @@ -48,7 +48,7 @@ class TRestAxionTrueWolterOptics : public TRestAxionOptics { std::vector fThickness; //! /// Distance between mirror stacks in mm. See schematic figure. - std::vector fxSep; //! + std::vector fXSep; //! /// The spider structure to be used as an optical opaque mask (common to all planes) TRestSpiderMask* fSpiderMask = nullptr; //< From 7deb7d964677ac3d42eba52b4f6719eb7065ad01 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:41:36 +0200 Subject: [PATCH 07/23] Correcting variable spelling --- inc/TRestAxionWolterOptics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/TRestAxionWolterOptics.h b/inc/TRestAxionWolterOptics.h index 4bd30811..67498e58 100644 --- a/inc/TRestAxionWolterOptics.h +++ b/inc/TRestAxionWolterOptics.h @@ -48,7 +48,7 @@ class TRestAxionWolterOptics : public TRestAxionOptics { std::vector fThickness; //! /// Distance between mirror stacks in mm. See schematic figure. - std::vector fxSep; //! + std::vector fXSep; //! /// The spider structure to be used as an optical opaque mask (common to all planes) TRestSpiderMask* fSpiderMask = nullptr; //< From e6ed715ec3808536859fb25eb9ad7939de54fad8 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:53:55 +0200 Subject: [PATCH 08/23] Adding x_sep for hyperbolic and parabolic mirror interaction --- src/TRestAxionTrueWolterOptics.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 6e454e71..8664b044 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -277,9 +277,9 @@ Int_t TRestAxionTrueWolterOptics::FirstMirrorReflection(const TVector3& pos, con //// Reflection on first mirror fFirstInteractionPosition = REST_Physics::GetParabolicVectorIntersection( - pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength); // should add this: TVector3(0, 0, -1), vertex + pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex - if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > 0) { + if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -322,12 +322,12 @@ Int_t TRestAxionTrueWolterOptics::SecondMirrorReflection(const TVector3& pos, co TVector3 vertex(0, 0, fBackVertex[mirror]); Double_t focal = fR3[mirror] / TMath::Tan(4 * fAlpha[mirror]); - //// Reflection on first mirror + //// Reflection on second mirror fSecondInteractionPosition = REST_Physics::GetHyperbolicVectorIntersection(pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, - focal); // should add this: TVector3(0, 0, -1), vertex, + focal, fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex, - if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < 0) { + if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From 5077ff580c2cf76021f84ca2c321dabe8cd559e1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:56:46 +0000 Subject: [PATCH 09/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionTrueWolterOptics.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 8664b044..4aa947b6 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -277,9 +277,11 @@ Int_t TRestAxionTrueWolterOptics::FirstMirrorReflection(const TVector3& pos, con //// Reflection on first mirror fFirstInteractionPosition = REST_Physics::GetParabolicVectorIntersection( - pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex + pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, + fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex - if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { + if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || + fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -323,11 +325,12 @@ Int_t TRestAxionTrueWolterOptics::SecondMirrorReflection(const TVector3& pos, co Double_t focal = fR3[mirror] / TMath::Tan(4 * fAlpha[mirror]); //// Reflection on second mirror - fSecondInteractionPosition = - REST_Physics::GetHyperbolicVectorIntersection(pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, - focal, fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex, + fSecondInteractionPosition = REST_Physics::GetHyperbolicVectorIntersection( + pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, focal, + fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex, - if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { + if (fSecondInteractionPosition.Z() > GetExitPositionZ() || + fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From dc5541fc29bbf5d133410c6069c52a5486592a40 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:59:10 +0200 Subject: [PATCH 10/23] Adding x_sep to entrance and exit position in TRestAxionTrueWolterOptics.h --- inc/TRestAxionTrueWolterOptics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/TRestAxionTrueWolterOptics.h b/inc/TRestAxionTrueWolterOptics.h index 550faaf7..1677f348 100644 --- a/inc/TRestAxionTrueWolterOptics.h +++ b/inc/TRestAxionTrueWolterOptics.h @@ -113,13 +113,13 @@ class TRestAxionTrueWolterOptics : public TRestAxionOptics { /// It returns the entrance Z-position defined by the optical axis. Double_t GetEntrancePositionZ() override { - if (fCosAlpha.size() > 0) return -fMirrorLength * fCosAlpha[0]; + if (fCosAlpha.size() > 0) return -fMirrorLength * fCosAlpha[0] - 0.5 * fXSep[0]; return 0; } /// It returns the exit Z-position defined by the optical axis Double_t GetExitPositionZ() override { - if (fCosAlpha_3.size() > 0) return fMirrorLength * fCosAlpha_3[0]; + if (fCosAlpha_3.size() > 0) return fMirrorLength * fCosAlpha_3[0] + 0.5 * fXSep[0]; return 0; } From ad5b10d8d4e5c9b988374d71c94e186a77f3e9dd Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:02:49 +0200 Subject: [PATCH 11/23] Fixed x_sep into a vector in TRestAxionTrueWolterOptics.cxx --- src/TRestAxionTrueWolterOptics.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 4aa947b6..5237270e 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -173,7 +173,9 @@ void TRestAxionTrueWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); - fXSep = 2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(fAlpha)) / TMath::Tan(fAlpha); + + fXSep.clear(); + for (const auto& a : fAlpha) fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); if (fAlpha.size() == 0) return; From a4dc1617089a1a7dd98469eac36891be7f8e26bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:02:59 +0000 Subject: [PATCH 12/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionTrueWolterOptics.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 5237270e..e8a1a951 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -173,9 +173,10 @@ void TRestAxionTrueWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); - + fXSep.clear(); - for (const auto& a : fAlpha) fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); + for (const auto& a : fAlpha) + fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); if (fAlpha.size() == 0) return; From c69bc30eb8171bce4c43e397722607db3c173e32 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:05:59 +0200 Subject: [PATCH 13/23] Adding x_sep to entrance and exit position in TRestAxionWolterOptics.h --- inc/TRestAxionWolterOptics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/TRestAxionWolterOptics.h b/inc/TRestAxionWolterOptics.h index 67498e58..eaf00243 100644 --- a/inc/TRestAxionWolterOptics.h +++ b/inc/TRestAxionWolterOptics.h @@ -113,13 +113,13 @@ class TRestAxionWolterOptics : public TRestAxionOptics { /// It returns the entrance Z-position defined by the optical axis. Double_t GetEntrancePositionZ() override { - if (fCosAlpha.size() > 0) return -fMirrorLength * fCosAlpha[0]; + if (fCosAlpha.size() > 0) return -fMirrorLength * fCosAlpha[0] - 0.5 * fXSep[0]; return 0; } /// It returns the exit Z-position defined by the optical axis Double_t GetExitPositionZ() override { - if (fCosAlpha_3.size() > 0) return fMirrorLength * fCosAlpha_3[0]; + if (fCosAlpha_3.size() > 0) return fMirrorLength * fCosAlpha_3[0] + 0.5 * fXSep[0]; return 0; } From b967ccb0f1884685a21e0f1c27f3f4c27119a3cf Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:07:53 +0200 Subject: [PATCH 14/23] Correcting x_sep into a vector in TRestAxionWolterOptics.cxx --- src/TRestAxionWolterOptics.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index bdeeb34d..e933e1e7 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -173,7 +173,10 @@ void TRestAxionWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); - fXSep = 2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(fAlpha)) / TMath::Tan(fAlpha); + + fXSep.clear(); + for (const auto& a : fAlpha) + fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); if (fAlpha.size() == 0) return; From f44569db935046a001fcbf49a64d902b140dacec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:08:02 +0000 Subject: [PATCH 15/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionWolterOptics.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index e933e1e7..13eca0a2 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -173,7 +173,7 @@ void TRestAxionWolterOptics::Initialize() { fR5 = GetR5(); fAlpha = GetAlpha(); fThickness = GetThickness(); - + fXSep.clear(); for (const auto& a : fAlpha) fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); From 4540f6c2c67bf42f99ada63127c1930bf3c0031a Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:11:49 +0200 Subject: [PATCH 16/23] Added x_sep in first and second mirror interaction in TRestAxionWolterOptics.cxx --- src/TRestAxionWolterOptics.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index 13eca0a2..4214eee2 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -282,7 +282,7 @@ Int_t TRestAxionWolterOptics::FirstMirrorReflection(const TVector3& pos, const T fFirstInteractionPosition = pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); - if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > 0) { + if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -327,7 +327,7 @@ Int_t TRestAxionWolterOptics::SecondMirrorReflection(const TVector3& pos, const fSecondInteractionPosition = pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); - if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < 0) { + if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From 40ca3be347dd5d421890f2dd9ba6874492d76a43 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:12:10 +0000 Subject: [PATCH 17/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionWolterOptics.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index 4214eee2..03c69fa7 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -282,7 +282,8 @@ Int_t TRestAxionWolterOptics::FirstMirrorReflection(const TVector3& pos, const T fFirstInteractionPosition = pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); - if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { + if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || + fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -327,7 +328,8 @@ Int_t TRestAxionWolterOptics::SecondMirrorReflection(const TVector3& pos, const fSecondInteractionPosition = pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); - if (fSecondInteractionPosition.Z() > GetExitPositionZ() || fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { + if (fSecondInteractionPosition.Z() > GetExitPositionZ() || + fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From c9b4362c42a0096cc235d4c7eab3d0dba28a0b57 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:15:40 +0200 Subject: [PATCH 18/23] Removed variables from TRestPhysics --- src/TRestAxionTrueWolterOptics.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index e8a1a951..6f6120f8 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -280,11 +280,10 @@ Int_t TRestAxionTrueWolterOptics::FirstMirrorReflection(const TVector3& pos, con //// Reflection on first mirror fFirstInteractionPosition = REST_Physics::GetParabolicVectorIntersection( - pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, - fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex + pos, dir, fAlpha[mirror], fR3[mirror]); // should add this: TVector3(0, 0, -1), vertex if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || - fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { + fFirstInteractionPosition.Z() > -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -329,11 +328,10 @@ Int_t TRestAxionTrueWolterOptics::SecondMirrorReflection(const TVector3& pos, co //// Reflection on second mirror fSecondInteractionPosition = REST_Physics::GetHyperbolicVectorIntersection( - pos, dir, fAlpha[mirror], fR3[mirror], fMirrorLength, focal, - fXSep[mirror]); // should add this: TVector3(0, 0, -1), vertex, + pos, dir, fAlpha[mirror], fR3[mirror], focal); // should add this: TVector3(0, 0, -1), vertex, if (fSecondInteractionPosition.Z() > GetExitPositionZ() || - fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { + fSecondInteractionPosition.Z() < (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionTrueWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From 923a11fd3deefe5b5c706cc6d37c2cd6b788dfcd Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:18:12 +0200 Subject: [PATCH 19/23] Corrected a sign switch --- src/TRestAxionWolterOptics.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index 03c69fa7..ad45d2c9 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -283,7 +283,7 @@ Int_t TRestAxionWolterOptics::FirstMirrorReflection(const TVector3& pos, const T pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); if (fFirstInteractionPosition.Z() < GetEntrancePositionZ() || - fFirstInteractionPosition.Z() > (0.5 * fXSep[mirror])) { + fFirstInteractionPosition.Z() > -(0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::FirstMirrorReflection. No interaction!" << RESTendl; fFirstInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fMiddleDirection = fEntranceDirection; @@ -329,7 +329,7 @@ Int_t TRestAxionWolterOptics::SecondMirrorReflection(const TVector3& pos, const pos + dir * REST_Physics::GetConeVectorIntersection(pos, dir, TVector3(0, 0, -1), vertex, cosA); if (fSecondInteractionPosition.Z() > GetExitPositionZ() || - fSecondInteractionPosition.Z() < -(0.5 * fXSep[mirror])) { + fSecondInteractionPosition.Z() < (0.5 * fXSep[mirror])) { RESTDebug << "TRestAxionWolterOptics::SecondMirrorReflection. No interaction!" << RESTendl; fSecondInteractionPosition = REST_Physics::MoveByDistance(pos, dir, fMirrorLength / 2.); fExitDirection = fMiddleDirection; From 04f2ceeb24b0f4c439c6793121230c8ff7d5e76e Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:14:08 +0200 Subject: [PATCH 20/23] Correction of vectors in definition of x_sep --- src/TRestAxionTrueWolterOptics.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 6f6120f8..7891ada8 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -175,8 +175,8 @@ void TRestAxionTrueWolterOptics::Initialize() { fThickness = GetThickness(); fXSep.clear(); - for (const auto& a : fAlpha) - fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); + for (unsigned int n = 0; n < fAlpha.size(); n++) + fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / TMath::Tan(fAlpha[n])); if (fAlpha.size() == 0) return; From 6adc34254ef5c164da9ea960e9ed03ad616634c9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:15:15 +0000 Subject: [PATCH 21/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionTrueWolterOptics.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TRestAxionTrueWolterOptics.cxx b/src/TRestAxionTrueWolterOptics.cxx index 7891ada8..c4e23898 100644 --- a/src/TRestAxionTrueWolterOptics.cxx +++ b/src/TRestAxionTrueWolterOptics.cxx @@ -176,7 +176,8 @@ void TRestAxionTrueWolterOptics::Initialize() { fXSep.clear(); for (unsigned int n = 0; n < fAlpha.size(); n++) - fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / TMath::Tan(fAlpha[n])); + fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / + TMath::Tan(fAlpha[n])); if (fAlpha.size() == 0) return; From 30aff7feeac3dfa9595fb2d0dceec5846901fe63 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:15:31 +0200 Subject: [PATCH 22/23] X-sep vector correction --- src/TRestAxionWolterOptics.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index ad45d2c9..dbd5d211 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -175,8 +175,8 @@ void TRestAxionWolterOptics::Initialize() { fThickness = GetThickness(); fXSep.clear(); - for (const auto& a : fAlpha) - fXSep.push_back(2 * (fR1 - fR3 - fMirrorLength * TMath::Sin(a)) / TMath::Tan(a)); + for (unsigned int n = 0; n < fAlpha.size(); n++) + fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / TMath::Tan(fAlpha[n])); if (fAlpha.size() == 0) return; From 8b00dea857f7d716197992709395851f38d2cf84 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:18:12 +0000 Subject: [PATCH 23/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionWolterOptics.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TRestAxionWolterOptics.cxx b/src/TRestAxionWolterOptics.cxx index dbd5d211..14ce777b 100644 --- a/src/TRestAxionWolterOptics.cxx +++ b/src/TRestAxionWolterOptics.cxx @@ -176,7 +176,8 @@ void TRestAxionWolterOptics::Initialize() { fXSep.clear(); for (unsigned int n = 0; n < fAlpha.size(); n++) - fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / TMath::Tan(fAlpha[n])); + fXSep.push_back(2 * (fR1[n] - fR3[n] - fMirrorLength * TMath::Sin(fAlpha[n])) / + TMath::Tan(fAlpha[n])); if (fAlpha.size() == 0) return;