Skip to content

Commit 2f77db4

Browse files
authored
Merge pull request #87 from rest-for-physics/jovoy-target-position
Change Axion generator Target Position
2 parents 068fb45 + 0595ab5 commit 2f77db4

4 files changed

+15
-5
lines changed

inc/TRestAxionAnalysisProcess.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class TRestAxionAnalysisProcess : public TRestEventProcess {
3232
/// A pointer to the specific TRestAxionEvent
3333
TRestAxionEvent* fAxionEvent; //!
3434

35+
/// The analysis position in mm with regards to the sun at (0,0,-AU).
36+
TVector3 fAnalysisPosition = TVector3(0, 0, 0); //<
37+
3538
void Initialize() override;
3639

3740
void LoadDefaultConfig();

inc/TRestAxionGeneratorProcess.h

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class TRestAxionGeneratorProcess : public TRestEventProcess {
4949
/// The target size in mm (or generator source extension) for the generator.
5050
Double_t fTargetRadius = 800; //<
5151

52+
/// The target position in mm with regards to the sun at (0,0,-AU).
53+
TVector3 fTargetPosition = TVector3(0, 0, 0); //<
54+
5255
/// The generator type (solarFlux/flat)
5356
TString fGeneratorType = "solarFlux"; //<
5457

src/TRestAxionAnalysisProcess.cxx

+3-2
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,13 @@ TRestEvent* TRestAxionAnalysisProcess::ProcessEvent(TRestEvent* evInput) {
126126
SetObservableValue("energy", fAxionEvent->GetEnergy());
127127
SetObservableValue("mass", fAxionEvent->GetMass() * units("eV"));
128128

129-
Double_t x = fAxionEvent->GetPosition().X();
130-
Double_t y = fAxionEvent->GetPosition().Y();
129+
Double_t x = fAxionEvent->GetPosition().X() - fAnalysisPosition.X();
130+
Double_t y = fAxionEvent->GetPosition().Y() - fAnalysisPosition.Y();
131131
SetObservableValue("posX", x);
132132
SetObservableValue("posY", y);
133133
SetObservableValue("posZ", fAxionEvent->GetPosition().Z());
134134

135+
/// The following only works if the center of the signal is where the analysis position is.
135136
Double_t r = TMath::Sqrt(x * x + y * y);
136137
SetObservableValue("R", r);
137138

src/TRestAxionGeneratorProcess.cxx

+6-3
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,12 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) {
166166

167167
/// The axion position must be displaced by the target size.
168168
/// We always do this. It is independent of generator
169-
/// The target is virtually placed at the (0,0,0).
169+
/// The target is virtually placed at the (0,0,0) + TargetPosition since the
170+
/// experiment is not focussed by the bore but by the whole experiment.
170171
/// In my opinion the target should be either the optics, or the magnet end bore.
171-
/// Then one should place the optics or the magnet end bore at the (0,0,0).
172+
/// Then one should place the optics or the magnet end bore at the (0,0,0) + TargetPosition.
173+
/// TODO: The target position and the magnetic field have to be in the same spot in x- and y-direction
174+
/// apparently.
172175
///
173176
do {
174177
x = 2 * (fRandom->Rndm() - 0.5);
@@ -178,7 +181,7 @@ TRestEvent* TRestAxionGeneratorProcess::ProcessEvent(TRestEvent* evInput) {
178181

179182
r = TMath::Sqrt(r);
180183

181-
axionPosition = axionPosition + TVector3(fTargetRadius * x, fTargetRadius * y, 0);
184+
axionPosition = axionPosition + TVector3(fTargetRadius * x, fTargetRadius * y, 0) + fTargetPosition;
182185

183186
Double_t mass = fRandom->Uniform(fAxionMassRange.X(), fAxionMassRange.Y());
184187

0 commit comments

Comments
 (0)