From 3458670eee995b9330613d5dc257268e0dae117b Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:59:21 +0100 Subject: [PATCH 1/8] Make the generator target position changable --- src/TRestAxionGeneratorProcess.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/TRestAxionGeneratorProcess.cxx b/src/TRestAxionGeneratorProcess.cxx index f7ff7a11..76b03c53 100644 --- a/src/TRestAxionGeneratorProcess.cxx +++ b/src/TRestAxionGeneratorProcess.cxx @@ -166,9 +166,10 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) { /// The axion position must be displaced by the target size. /// We always do this. It is independent of generator - /// The target is virtually placed at the (0,0,0). + /// The target is virtually placed at the (0,0,0) + TargetPosition since the + /// experiment is not focussed by the bore but by the whole experiment. /// In my opinion the target should be either the optics, or the magnet end bore. - /// Then one should place the optics or the magnet end bore at the (0,0,0). + /// Then one should place the optics or the magnet end bore at the (0,0,0) + TargetPosition. /// do { x = 2 * (fRandom->Rndm() - 0.5); @@ -178,7 +179,7 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) { r = TMath::Sqrt(r); - axionPosition = axionPosition + TVector3(fTargetRadius * x, fTargetRadius * y, 0); + axionPosition = axionPosition + TVector3(fTargetRadius * x, fTargetRadius * y, 0) + fTargetPosition; Double_t mass = fRandom->Uniform(fAxionMassRange.X(), fAxionMassRange.Y()); From 197f3306dfa2593feaacfe9cc9fdc121f0c45421 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:05:38 +0000 Subject: [PATCH 2/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionGeneratorProcess.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestAxionGeneratorProcess.cxx b/src/TRestAxionGeneratorProcess.cxx index 76b03c53..1d687ed1 100644 --- a/src/TRestAxionGeneratorProcess.cxx +++ b/src/TRestAxionGeneratorProcess.cxx @@ -166,7 +166,7 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) { /// The axion position must be displaced by the target size. /// We always do this. It is independent of generator - /// The target is virtually placed at the (0,0,0) + TargetPosition since the + /// The target is virtually placed at the (0,0,0) + TargetPosition since the /// experiment is not focussed by the bore but by the whole experiment. /// In my opinion the target should be either the optics, or the magnet end bore. /// Then one should place the optics or the magnet end bore at the (0,0,0) + TargetPosition. From f8b25e9f5f24ecfadd6f5bc1d36f4e013dee21d3 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:23:14 +0100 Subject: [PATCH 3/8] Adding target position --- inc/TRestAxionGeneratorProcess.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/TRestAxionGeneratorProcess.h b/inc/TRestAxionGeneratorProcess.h index b29391df..88305404 100644 --- a/inc/TRestAxionGeneratorProcess.h +++ b/inc/TRestAxionGeneratorProcess.h @@ -49,6 +49,9 @@ class TRestAxionGeneratorProcess : public TRestEventProcess { /// The target size in mm (or generator source extension) for the generator. Double_t fTargetRadius = 800; //< + /// The target position in mm with regards to the sun at (0,0,-AU). + TVector3 fTargetPosition = TVector3(0 ,0 ,0 ); //< + /// The generator type (solarFlux/flat) TString fGeneratorType = "solarFlux"; //< From f60908450a62eb7e522771cb98d89b6b1de6ea4b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:23:21 +0000 Subject: [PATCH 4/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- inc/TRestAxionGeneratorProcess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/TRestAxionGeneratorProcess.h b/inc/TRestAxionGeneratorProcess.h index 88305404..d93e308c 100644 --- a/inc/TRestAxionGeneratorProcess.h +++ b/inc/TRestAxionGeneratorProcess.h @@ -50,7 +50,7 @@ class TRestAxionGeneratorProcess : public TRestEventProcess { Double_t fTargetRadius = 800; //< /// The target position in mm with regards to the sun at (0,0,-AU). - TVector3 fTargetPosition = TVector3(0 ,0 ,0 ); //< + TVector3 fTargetPosition = TVector3(0, 0, 0); //< /// The generator type (solarFlux/flat) TString fGeneratorType = "solarFlux"; //< From 464ab9428070bac13bcb05e4607046a245348187 Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:17:02 +0100 Subject: [PATCH 5/8] Adding analysis position --- inc/TRestAxionAnalysisProcess.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/TRestAxionAnalysisProcess.h b/inc/TRestAxionAnalysisProcess.h index 41c70809..8c440983 100644 --- a/inc/TRestAxionAnalysisProcess.h +++ b/inc/TRestAxionAnalysisProcess.h @@ -32,6 +32,9 @@ class TRestAxionAnalysisProcess : public TRestEventProcess { /// A pointer to the specific TRestAxionEvent TRestAxionEvent* fAxionEvent; //! + /// The analysis position in mm with regards to the sun at (0,0,-AU). + TVector3 fAnalysisPosition = TVector3(0, 0, 0); //< + void Initialize() override; void LoadDefaultConfig(); From ef375c672f085575bb1e2c974606cefc231b0e4c Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:18:41 +0100 Subject: [PATCH 6/8] Adding analysis position to posX and posY --- src/TRestAxionAnalysisProcess.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/TRestAxionAnalysisProcess.cxx b/src/TRestAxionAnalysisProcess.cxx index 0d199a90..23c420cf 100644 --- a/src/TRestAxionAnalysisProcess.cxx +++ b/src/TRestAxionAnalysisProcess.cxx @@ -125,13 +125,14 @@ TRestEvent* TRestAxionAnalysisProcess::ProcessEvent(TRestEvent* evInput) { SetObservableValue("energy", fAxionEvent->GetEnergy()); SetObservableValue("mass", fAxionEvent->GetMass() * units("eV")); - - Double_t x = fAxionEvent->GetPosition().X(); - Double_t y = fAxionEvent->GetPosition().Y(); + + Double_t x = fAxionEvent->GetPosition().X() - fAnalysisPosition.X(); + Double_t y = fAxionEvent->GetPosition().Y() - fAnalysisPosition.Y(); SetObservableValue("posX", x); SetObservableValue("posY", y); SetObservableValue("posZ", fAxionEvent->GetPosition().Z()); + /// The following only works if the center of the signal is where the analysis position is. Double_t r = TMath::Sqrt(x * x + y * y); SetObservableValue("R", r); From 05295fabbbfb7aa9ef8bccd4281b7b2e9ab0671b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:18:48 +0000 Subject: [PATCH 7/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestAxionAnalysisProcess.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestAxionAnalysisProcess.cxx b/src/TRestAxionAnalysisProcess.cxx index 23c420cf..d3b88820 100644 --- a/src/TRestAxionAnalysisProcess.cxx +++ b/src/TRestAxionAnalysisProcess.cxx @@ -125,7 +125,7 @@ TRestEvent* TRestAxionAnalysisProcess::ProcessEvent(TRestEvent* evInput) { SetObservableValue("energy", fAxionEvent->GetEnergy()); SetObservableValue("mass", fAxionEvent->GetMass() * units("eV")); - + Double_t x = fAxionEvent->GetPosition().X() - fAnalysisPosition.X(); Double_t y = fAxionEvent->GetPosition().Y() - fAnalysisPosition.Y(); SetObservableValue("posX", x); From 0595ab5a77a67c36f12a5327e49866b6215130eb Mon Sep 17 00:00:00 2001 From: jovoy <50204158+jovoy@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:22:24 +0100 Subject: [PATCH 8/8] Update commentation --- src/TRestAxionGeneratorProcess.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TRestAxionGeneratorProcess.cxx b/src/TRestAxionGeneratorProcess.cxx index 1d687ed1..6d7feb9c 100644 --- a/src/TRestAxionGeneratorProcess.cxx +++ b/src/TRestAxionGeneratorProcess.cxx @@ -170,6 +170,8 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) { /// experiment is not focussed by the bore but by the whole experiment. /// In my opinion the target should be either the optics, or the magnet end bore. /// Then one should place the optics or the magnet end bore at the (0,0,0) + TargetPosition. + /// TODO: The target position and the magnetic field have to be in the same spot in x- and y-direction + /// apparently. /// do { x = 2 * (fRandom->Rndm() - 0.5);