Skip to content

Commit 9536fb7

Browse files
authored
Merge pull request #53 from rest-for-physics/jovoy_acceptance
External rotation for acceptance study
2 parents 21e1bf1 + 68b9410 commit 9536fb7

File tree

6 files changed

+225
-15
lines changed

6 files changed

+225
-15
lines changed

Diff for: .github/workflows/validation.yml

+9
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,12 @@ jobs:
243243
restManager --c photonConversion.rml
244244
restRoot -b -q Validate.C'(5.86614e-19, 1.61288)'
245245
python3 validateStreamer.py
246+
- name: Full ray-tracing
247+
run: |
248+
source ${{ env.REST_PATH }}/thisREST.sh
249+
cd ${{ env.AXION_LIB_PATH }}/pipeline/ray-tracing/full-chain/
250+
export REST_LOW_AXION_MASS=1e-2
251+
export REST_HIGH_AXION_MASS=1e-1
252+
export REST_GAS_STEP=2
253+
restManager --c BabyIAXO_Micromegas_XMM.rml --o output.root
254+
restRoot -q ValidateChain.C'("output.root")'

Diff for: inc/TRestAxionEventProcess.h

+16-7
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,23 @@
2929
/// A base class for any axion event process. Defines position, rotation and component displacement.
3030
class TRestAxionEventProcess : public TRestEventProcess {
3131
private:
32-
/// The position respect which the rotation will be applied
33-
TVector3 fCenter = TVector3(0, 0, 0);
32+
/// The position of the component around which the rotation will be applied
33+
TVector3 fPosition = TVector3(0, 0, 0);
3434

35-
/// The rotation angle respect to the Y-axis
36-
Double_t fYaw = 0;
35+
/// The rotation angle with respect to the Y-axis
36+
Double_t fInternalYaw = 0;
3737

3838
/// The rotation angle with respect to X-axis
39-
Double_t fPitch = 0;
39+
Double_t fInternalPitch = 0;
40+
41+
/// The position (different than the center of the object) around which the rotation will be applied
42+
TVector3 fExternalRotationCenter = TVector3(0, 0, 0);
43+
44+
/// The rotation angle around CenterSetup with respect to the Y-axis
45+
Double_t fExternalYaw = 0;
46+
47+
/// The rotation angle around CenterSetup with respect to X-axis
48+
Double_t fExternalPitch = 0;
4049

4150
/// If enabled it will skip the end rotation that recovers the original axion trajectory direction
4251
Bool_t fSkipEndProcessRotation = false; //!
@@ -48,7 +57,7 @@ class TRestAxionEventProcess : public TRestEventProcess {
4857
void BeginPrintProcess();
4958
void EndPrintProcess();
5059

51-
TVector3 GetCenter() const { return fCenter; }
60+
TVector3 GetCenter() const { return fPosition; }
5261

5362
void SkipEndProcessRotation(Bool_t value = true) { fSkipEndProcessRotation = value; }
5463

@@ -67,6 +76,6 @@ class TRestAxionEventProcess : public TRestEventProcess {
6776
TRestAxionEventProcess();
6877
~TRestAxionEventProcess();
6978

70-
ClassDefOverride(TRestAxionEventProcess, 1);
79+
ClassDefOverride(TRestAxionEventProcess, 2);
7180
};
7281
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="2.0" encoding="UTF-8" standalone="no"?>
2+
<TRestManager name="RESTManagerSim" title="Template manager to process a simulation generated by restG4." verboseLevel="info">
3+
<globals>
4+
<parameter name="verboseLevel" value="essential"/>
5+
<constant name="opticsPosition" value="7000"/>
6+
<constant name="focalPosition" value="7538"/>
7+
<variable name="REST_YAW" value="1"/>
8+
<variable name="REST_GAS_STEP" value="1"/>
9+
<variable name="REST_LOW_AXION_MASS" value="1e-3"/>
10+
<variable name="REST_HIGH_AXION_MASS" value="1e-2"/>
11+
<variable name="CONDOR_RUN" value="auto"/>
12+
</globals>
13+
<TRestRun name="axionRun" title="BabyIAXO V1.0" verboseLevel="info">
14+
<parameter name="experimentName" value="BabyIAXO"/>
15+
<parameter name="runType" value="rayTracing"/>
16+
<parameter name="runNumber" value="137"/>
17+
<parameter name="runTag" value="Primakoff_XMM_Micromegas_P${REST_GAS_STEP}"/>
18+
<parameter name="runDescription" value=""/>
19+
<parameter name="user" value="pipeline"/>
20+
<parameter name="verboseLevel" value="2"/>
21+
<parameter name="outputFileName" value="run_[fRunNumber]_[fRunType]_[fRunTag]_V[fVersion].root"/>
22+
<TRestAxionSolarFlux file="fluxes.rml" name="LennertHoofPrimakoff"/>
23+
<TRestAxionMagneticField file="fields.rml" name="babyIAXO"/>
24+
<TRestAxionBufferGas file="bufferGases.rml" name="helium_${REST_GAS_STEP}"/>
25+
<TRestAxionTrueWolterOptics file="xmmTrueWolter.rml" name="xmm"/>
26+
<TRestAxionXrayWindow name="magnetBoreWindow" material="Vacuum">
27+
<TRestPatternMask name="mask" maskRadius="35cm" verboseLevel="info"/>
28+
</TRestAxionXrayWindow>
29+
<TRestAxionXrayWindow file="windows.rml" name="MicromegasAluminumFoil"/>
30+
<TRestAxionXrayWindow file="windows.rml" name="MicromegasStrongBack"/>
31+
<TRestAxionXrayWindow file="windows.rml" name="MicromegasMylar"/>
32+
</TRestRun>
33+
<TRestProcessRunner name="EventProcess" verboseLevel="info">
34+
<parameter name="eventsToProcess" value="100"/>
35+
<!-- By default the generator will place the Z-position at 1 A.U. -->
36+
<addProcess type="TRestAxionGeneratorProcess" name="axionGen">
37+
<parameter name="generatorType" value="solarFlux"/>
38+
<parameter name="targetRadius" value="35cm"/>
39+
<parameter name="axionMassRange" value="(${REST_LOW_AXION_MASS},${REST_HIGH_AXION_MASS})eV"/>
40+
<parameter name="seed" value="314"/>
41+
</addProcess>
42+
<addProcess type="TRestAxionAnalysisProcess" name="initial" observables="all"/>
43+
<!-- We do not need to transport the axion. It is just to evaluate the axion at a given Z-position using the analysis process -->
44+
<addProcess type="TRestAxionTransportProcess" zPosition="-10m" name="tom5m"/>
45+
<addProcess type="TRestAxionAnalysisProcess" name="magnetEntrance">
46+
<observable name="posX"/>
47+
<observable name="posY"/>
48+
<observable name="posZ"/>
49+
<observable name="R"/>
50+
</addProcess>
51+
<addProcess type="TRestAxionFieldPropagationProcess" name="axionPhoton" integrationStep="5cm" position="(0,0,-5)m" bufferGasAdditionalLength="5m" observables="all" verboseLevel="info"/>
52+
<!-- Checking the generator target defined by TRestAxionGeneratorProcess -->
53+
<addProcess type="TRestAxionTransportProcess" zPosition="0" name="origin"/>
54+
<addProcess type="TRestAxionAnalysisProcess" name="magnetExit">
55+
<observable name="posX"/>
56+
<observable name="posY"/>
57+
<observable name="posZ"/>
58+
<observable name="R"/>
59+
</addProcess>
60+
<addProcess type="TRestAxionTransmissionProcess" name="boreExitGate" position="(0,0,0)m">
61+
<window name="magnetBoreWindow"/>
62+
</addProcess>
63+
<addProcess type="TRestAxionOpticsProcess" name="optics" position="(0,0,opticsPosition)mm">
64+
<parameter name="internalYaw" value="${REST_YAW}degrees"/>
65+
<parameter name="opticalAxis" value="false"/>
66+
<observable name="efficiency" value="ON"/>
67+
</addProcess>
68+
<addProcess type="TRestAxionAnalysisProcess" name="afterOptics">
69+
<observable name="posX"/>
70+
<observable name="posY"/>
71+
<observable name="posZ"/>
72+
<observable name="R"/>
73+
</addProcess>
74+
<addProcess type="TRestAxionTransmissionProcess" name="window" position="(0,0,focalPosition + opticsPosition)mm">
75+
<window name="MicromegasMylar"/>
76+
<window name="MicromegasStrongBack"/>
77+
<window name="MicromegasAluminumFoil"/>
78+
</addProcess>
79+
80+
<addProcess type="TRestAxionTransportProcess" zPosition="focalPosition+opticsPosition-500" name="origin"/>
81+
<addProcess type="TRestAxionAnalysisProcess" name="offset">
82+
<observable name="posX"/>
83+
<observable name="posY"/>
84+
<observable name="posZ"/>
85+
<observable name="R"/>
86+
</addProcess>
87+
88+
<addProcess type="TRestAxionTransportProcess" zPosition="focalPosition+opticsPosition" name="origin"/>
89+
<addProcess type="TRestAxionAnalysisProcess" name="final" observables="all"/>
90+
</TRestProcessRunner>
91+
<addTask command="EventProcess-&gt;RunProcess()" value="ON"/>
92+
</TRestManager>

Diff for: pipeline/ray-tracing/full-chain/ValidateChain.C

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#include <TH1D.h>
2+
#include <TRestRun.h>
3+
4+
Int_t ValidateChain(std::string fname) {
5+
std::cout << "Filename : " << fname << std::endl;
6+
TRestRun* run = new TRestRun(fname);
7+
8+
if (run->GetEntries() != 100) {
9+
std::cout << "Error. Number of entries is not 100!" << std::endl;
10+
11+
return 1;
12+
}
13+
14+
run->GetAnalysisTree()->Draw("axionPhoton_probability", "axionPhoton_probability");
15+
16+
run->GetEntry(10);
17+
run->GetAnalysisTree()->PrintObservables();
18+
19+
TH1D* h = (TH1D*)run->GetAnalysisTree()->GetHistogram();
20+
21+
if (h == nullptr) {
22+
std::cout << "Problems generating axionPhoton histogram" << std::endl;
23+
return 2;
24+
}
25+
26+
Double_t integral = h->Integral() / run->GetEntries();
27+
std::cout << "Average axion-photon probability : " << integral << std::endl;
28+
if (integral < 9.71489e-24 || integral > 9.91489e-24) {
29+
std::cout << "Axion-photon probability is not within the expected range!" << std::endl;
30+
return 3;
31+
}
32+
33+
run->GetAnalysisTree()->Draw("window_transmission", "window_transmission");
34+
TH1D* g = (TH1D*)run->GetAnalysisTree()->GetHistogram();
35+
if (g == nullptr) {
36+
std::cout << "Problems generating window_transmission histogram" << std::endl;
37+
return 4;
38+
}
39+
40+
Double_t integral2 = g->Integral() / run->GetEntries();
41+
std::cout << "Average window transmission : " << integral2 << std::endl;
42+
if (integral2 < 0.135 || integral2 > 0.145) {
43+
std::cout << "Axion-photon probability is not within the expected range!" << std::endl;
44+
return 3;
45+
}
46+
47+
run->GetAnalysisTree()->Draw("optics_efficiency", "optics_efficiency");
48+
TH1D* l = (TH1D*)run->GetAnalysisTree()->GetHistogram();
49+
if (l == nullptr) {
50+
std::cout << "Problems generating optics_efficiency histogram" << std::endl;
51+
return 6;
52+
}
53+
54+
Double_t integral3 = l->Integral() / run->GetEntries();
55+
std::cout << "Average optics efficiency : " << integral3 << std::endl;
56+
if (integral3 < 0.045 || integral3 > 0.055) {
57+
std::cout << "Optics efficiency is not within the expected range!" << std::endl;
58+
return 7;
59+
}
60+
61+
delete run;
62+
63+
return 0;
64+
}

Diff for: pipeline/ray-tracing/full-chain/bufferGases.rml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<gas>
3+
<!-- It could be done using variables ${step}. However there are some issues that need to be fixed -->
4+
<TRestAxionBufferGas name="helium_1" verboseLevel="warning">
5+
<gas name="He" density="0.0167mg/cm^3"/>
6+
</TRestAxionBufferGas>
7+
<TRestAxionBufferGas name="helium_2" verboseLevel="warning">
8+
<gas name="He" density="0.0334mg/cm^3"/>
9+
</TRestAxionBufferGas>
10+
<TRestAxionBufferGas name="helium_3" verboseLevel="warning">
11+
<gas name="He" density="0.0501mg/cm^3"/>
12+
</TRestAxionBufferGas>
13+
<TRestAxionBufferGas name="helium_4" verboseLevel="warning">
14+
<gas name="He" density="0.0668mg/cm^3"/>
15+
</TRestAxionBufferGas>
16+
<TRestAxionBufferGas name="helium_5" verboseLevel="warning">
17+
<gas name="He" density="0.0835mg/cm^3"/>
18+
</TRestAxionBufferGas>
19+
<TRestAxionBufferGas name="helium_6" verboseLevel="warning">
20+
<gas name="He" density="0.1002mg/cm^3"/>
21+
</TRestAxionBufferGas>
22+
<TRestAxionBufferGas name="helium_7" verboseLevel="warning">
23+
<gas name="He" density="0.1169mg/cm^3"/>
24+
</TRestAxionBufferGas>
25+
<TRestAxionBufferGas name="helium_8" verboseLevel="warning">
26+
<gas name="He" density="0.1336mg/cm^3"/>
27+
</TRestAxionBufferGas>
28+
<TRestAxionBufferGas name="helium_9" verboseLevel="warning">
29+
<gas name="He" density="0.1503mg/cm^3"/>
30+
</TRestAxionBufferGas>
31+
<TRestAxionBufferGas name="helium_10" verboseLevel="warning">
32+
<gas name="He" density="0.167mg/cm^3"/>
33+
</TRestAxionBufferGas>
34+
</gas>

Diff for: src/TRestAxionEventProcess.cxx

+10-8
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ void TRestAxionEventProcess::BeginOfEventProcess(TRestEvent* inEv) {
7171
RESTDebug << "BoEP: Initial Direction. X: " << fAxionEvent->GetDirection().X()
7272
<< " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
7373
<< RESTendl;
74-
fAxionEvent->RotateYX(fCenter, -fYaw, -fPitch);
75-
fAxionEvent->Translate(TVector3(-fCenter.X(), -fCenter.Y(), -fCenter.Z()));
74+
fAxionEvent->RotateYX(fPosition, -fInternalYaw, -fInternalPitch);
75+
fAxionEvent->RotateYX(fExternalRotationCenter, -fExternalYaw, -fExternalPitch);
76+
fAxionEvent->Translate(TVector3(-fPosition.X(), -fPosition.Y(), -fPosition.Z()));
7677
RESTDebug << " ---- " << RESTendl;
7778
RESTDebug << "BoEP: Final Position. X: " << fAxionEvent->GetPosition().X()
7879
<< " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
@@ -97,8 +98,9 @@ void TRestAxionEventProcess::EndOfEventProcess(TRestEvent* evInput) {
9798
<< " Y: " << fAxionEvent->GetDirection().Y() << " Z: " << fAxionEvent->GetDirection().Z()
9899
<< RESTendl;
99100
RESTDebug << " ---- " << RESTendl;
100-
fAxionEvent->Translate(TVector3(fCenter.X(), fCenter.Y(), fCenter.Z()));
101-
if (!fSkipEndProcessRotation) fAxionEvent->RotateXY(fCenter, fPitch, fYaw);
101+
fAxionEvent->Translate(TVector3(fPosition.X(), fPosition.Y(), fPosition.Z()));
102+
fAxionEvent->RotateYX(fExternalRotationCenter, fExternalYaw, fExternalPitch);
103+
if (!fSkipEndProcessRotation) fAxionEvent->RotateXY(fPosition, fInternalPitch, fInternalYaw);
102104
RESTDebug << "EoEP: Final Position. X: " << fAxionEvent->GetPosition().X()
103105
<< " Y: " << fAxionEvent->GetPosition().Y() << " Z: " << fAxionEvent->GetPosition().Z()
104106
<< RESTendl;
@@ -117,10 +119,10 @@ void TRestAxionEventProcess::EndOfEventProcess(TRestEvent* evInput) {
117119
void TRestAxionEventProcess::BeginPrintProcess() {
118120
TRestEventProcess::BeginPrintProcess();
119121

120-
RESTMetadata << "Center: (" << fCenter.X() << ", " << fCenter.Y() << ", " << fCenter.Z() << ") mm"
121-
<< RESTendl;
122-
RESTMetadata << "Yaw angle (Y-axis): " << fYaw * units("degrees") << " degrees" << RESTendl;
123-
RESTMetadata << "Pitch angle (X-axis): " << fPitch * units("degrees") << " degrees" << RESTendl;
122+
RESTMetadata << "fPosition: (" << fPosition.X() << ", " << fPosition.Y() << ", " << fPosition.Z()
123+
<< ") mm" << RESTendl;
124+
RESTMetadata << "Yaw angle (Y-axis): " << fInternalYaw * units("degrees") << " degrees" << RESTendl;
125+
RESTMetadata << "Pitch angle (X-axis): " << fInternalPitch * units("degrees") << " degrees" << RESTendl;
124126
RESTMetadata << " --------------------------- " << RESTendl;
125127
RESTMetadata << " " << RESTendl;
126128
}

0 commit comments

Comments
 (0)