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] 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());