Skip to content

Commit

Permalink
Merge pull request #31 from rest-for-physics/jgalan_axion_field
Browse files Browse the repository at this point in the history
Axion field integration
  • Loading branch information
jgalan authored Nov 17, 2022
2 parents 3726652 + cf6d496 commit 6d86d96
Show file tree
Hide file tree
Showing 47 changed files with 1,139 additions and 436 deletions.
67 changes: 64 additions & 3 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Build and install
uses: rest-for-physics/framework/.github/actions/build@master
with:
cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_AXION=ON"
cmake-flags: "-DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DRESTLIB_AXION=ON -DREST_MPFR=ON"
branch: ${{ env.BRANCH_NAME }}
- name: Cache framework installation
id: axionlib-install-cache
Expand All @@ -50,6 +50,55 @@ jobs:
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
path: ${{ env.REST_PATH }}

macros-health:
name: "Macros with clean error output"
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
needs: [ build-axionlib ]
steps:
- uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
id: axionlib-install-cache
with:
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
path: ${{ env.REST_PATH }}
- name: Load restRootMacros in axiolib standalone
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd pipeline
export DISPLAY=localhost:0.0
echo "Running validation script"
python3 validateMacros.py
Physics:
name: Check physics
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
needs: [ build-axionlib ]
steps:
- uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
id: axionlib-install-cache
with:
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
path: ${{ env.REST_PATH }}
- name: Basic physics tests
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd pipeline/physics/
wget https://sultan.unizar.es/axionlib-data/bufferGas/He.abs
wget https://sultan.unizar.es/axionlib-data/bufferGas/He.nff
wget https://sultan.unizar.es/axionlib-data/bufferGas/Ne.abs
wget https://sultan.unizar.es/axionlib-data/bufferGas/Ne.nff
wget https://sultan.unizar.es/axionlib-data/bufferGas/bufferGases.rml
wget https://sultan.unizar.es/axionlib-data/magneticField/fields.rml
wget https://sultan.unizar.es/axionlib-data/magneticField/Bykovskiy_201906.dat
restRoot -b -q AxionPhysicsValidation.C
Metadata:
name: Check metadata
runs-on: ubuntu-latest
Expand Down Expand Up @@ -134,12 +183,13 @@ jobs:
source ${{ env.REST_PATH }}/thisREST.sh
export REST_NEVENTS=1000
export REST_RUN=100
cd pipeline/ray-tracing/optics/
wget https://rest-for-physics.github.io/axionlib-data/optics/xmm.rml
wget https://rest-for-physics.github.io/axionlib-data/optics/XMM.Wolter
wget https://rest-for-physics.github.io/axionlib-data/opticsMirror/Reflectivity_Single_Au_250_Ni_0.4.N901f
wget https://rest-for-physics.github.io/axionlib-data/opticsMirror/Transmission_Single_Au_250_Ni_0.4.N901f
restManager --c opticsBench.rml
restRoot ValidateXMM.C'("OpticsBench_Yaw_0.02_Dev_0.005_BabyIAXO_Run00100.root")'
restRoot -b -q ValidateXMM.C'("OpticsBench_Yaw_0.05_Dev_0.005_BabyIAXO_Run00100.root")'
- name: Window transmission
run: |
source ${{ env.REST_PATH }}/thisREST.sh
Expand All @@ -150,4 +200,15 @@ jobs:
restManager --c shiftedWindow.rml
restRoot ValidateTransmission.C'("ShiftedVacuumWindow", 0.3, 0.5)'
restManager --c siWindow.rml
restRoot ValidateTransmission.C'("SiWindow.root", 0.9, 1)'
restRoot -b -q ValidateTransmission.C'("SiWindow.root", 0.9, 1)'
- name: Axion-field integration
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd pipeline/ray-tracing/axion-field/
wget https://rest-for-physics.github.io/axionlib-data/magneticField/fields.rml
wget https://rest-for-physics.github.io/axionlib-data/magneticField/Bykovskiy_201906.dat
wget https://sultan.unizar.es/axionlib-data/bufferGas/He.abs
wget https://sultan.unizar.es/axionlib-data/bufferGas/He.nff
wget https://rest-for-physics.github.io/axionlib-data/bufferGas/bufferGases.rml
restManager --c photonConversion.rml
restRoot -b -q Validate.C
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build:
- cd ../../../
- mkdir build
- cd build
- cmake ../ -DREST_SOLAXFLUX=OFF -DREST_WELCOME=ON -DRESTLIB_AXION=ON -DREST_GARFIELD=OFF -DREST_G4=OFF -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install -DMPFR_PATH=${CI_PROJECT_DIR}/mpfr-4.0.2/install
- cmake ../ -DREST_SOLAXFLUX=OFF -DREST_WELCOME=ON -DRESTLIB_AXION=ON -DREST_GARFIELD=OFF -DREST_G4=OFF -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install -DMPFR_PATH=${CI_PROJECT_DIR}/mpfr-4.0.2/install -DREST_MPFR=ON
- make install -j2
# - . ${CI_PROJECT_DIR}/framework/source/libraries/axion/external/solarAxionFlux/bin/thisSolarAxionFluxLib.sh
- . ${CI_PROJECT_DIR}/install/thisREST.sh
Expand Down
2 changes: 1 addition & 1 deletion data
85 changes: 85 additions & 0 deletions examples/full-ray-tracing/helioscope.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<TRestManager name="RESTManagerSim" title="Template manager to process a simulation generated by restG4." verboseLevel="info">
<globals>
<parameter name="verboseLevel" value="essential"/>
<constant name="opticsPosition" value="7000"/>
<constant name="focalPosition" value="7538"/>
<variable name="REST_YAW" value="0"/>
</globals>
<TRestRun name="axionRun" title="BabyIAXO V1.0" verboseLevel="info">
<parameter name="experimentName" value="BabyIAXO"/>
<parameter name="runType" value="AxionPhotonProbability"/>
<parameter name="runNumber" value="103"/>
<parameter name="runTag" value="FirstTest"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="verboseLevel" value="2"/>
<parameter name="outputFileName" value="AxionPhotonProbabilityWindowOffset.root"/>
<TRestAxionSolarFlux file="fluxes.rml" name="LennertHoofPrimakoff"/>
<TRestAxionMagneticField file="fields.rml" name="babyIAXO"/>
<TRestAxionBufferGas file="bufferGases.rml" name="helium"/>
<TRestAxionWolterOptics file="xmm.rml" name="xmm"/>
<TRestAxionXrayWindow name="magnetBore" material="Vacuum">
<TRestPatternMask name="mask" maskRadius="35cm" verboseLevel="info"/>
</TRestAxionXrayWindow>
<TRestAxionXrayWindow file="windows.rml" name="cathode"/>
<TRestAxionXrayWindow file="windows.rml" name="strongBack"/>
<TRestAxionXrayWindow file="windows.rml" name="siliconFoil"/>
</TRestRun>
<TRestProcessRunner name="EventProcess" verboseLevel="info">
<parameter name="eventsToProcess" value="100000"/>
<!-- By default the generator will place the Z-position at 1 A.U. -->
<addProcess type="TRestAxionGeneratorProcess" name="axionGen">
<parameter name="generatorType" value="solarFlux"/>
<parameter name="targetRadius" value="35cm"/>
<parameter name="seed" value="314"/>
</addProcess>
<addProcess type="TRestAxionAnalysisProcess" name="initial" observables="all"/>
<!-- We do not need to transport the axion. It is just to evaluate the axion at a given Z-position using the analysis process -->
<addProcess type="TRestAxionTransportProcess" zPosition="-10m" name="tom5m"/>
<addProcess type="TRestAxionAnalysisProcess" name="magnetEntrance">
<observable name="posX"/>
<observable name="posY"/>
<observable name="posZ"/>
<observable name="R"/>
</addProcess>
<addProcess type="TRestAxionFieldPropagationProcess" name="axionPhoton" integrationStep="5cm" center="(0,0,-5)m" bufferGasAdditionalLength="5m" observables="all" verboseLevel="info"/>
<!-- Checking the generator target defined by TRestAxionGeneratorProcess -->
<addProcess type="TRestAxionTransportProcess" zPosition="0" name="origin"/>
<addProcess type="TRestAxionAnalysisProcess" name="magnetExit">
<observable name="posX"/>
<observable name="posY"/>
<observable name="posZ"/>
<observable name="R"/>
</addProcess>
<addProcess type="TRestAxionTransmissionProcess" name="boreExitGate" center="(0,0,0)m">
<window name="magnetBore"/>
</addProcess>
<addProcess type="TRestAxionOpticsProcess" name="optics" center="(0,0,opticsPosition)mm">
<parameter name="yaw" value="${REST_YAW}degrees"/>
<parameter name="opticalAxis" value="false"/>
<observable name="efficiency" value="ON"/>
</addProcess>
<addProcess type="TRestAxionAnalysisProcess" name="afterOptics">
<observable name="posX"/>
<observable name="posY"/>
<observable name="posZ"/>
<observable name="R"/>
</addProcess>
<addProcess type="TRestAxionTransmissionProcess" name="window" center="(1,1,focalPosition + opticsPosition)mm">
<window name="cathode"/>
<window name="strongBack"/>
<window name="siliconFoil"/>
</addProcess>
<addProcess type="TRestAxionTransportProcess" zPosition="focalPosition+opticsPosition-500" name="origin"/>
<addProcess type="TRestAxionAnalysisProcess" name="offset">
<observable name="posX"/>
<observable name="posY"/>
<observable name="posZ"/>
<observable name="R"/>
</addProcess>
<addProcess type="TRestAxionTransportProcess" zPosition="focalPosition+opticsPosition" name="origin"/>
<addProcess type="TRestAxionAnalysisProcess" name="final" observables="all"/>
</TRestProcessRunner>
<addTask command="EventProcess-&gt;RunProcess()" value="ON"/>
</TRestManager>
114 changes: 114 additions & 0 deletions examples/full-ray-tracing/summary.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<TRestManager name="SpecPlot" title="Example" verboseLevel="info">
<TRestRun name="DummyRun"/>
<TRestAnalysisPlot name="restplot" title="Optics Plots" verboseLevel="warning">
<parameter name="previewPlot" value="false"/>
<canvas size="(4800,4000)" divide="(4,5)" save="axionFieldPlots_[fRunNumber].png"/>
<!--- -->
<plot name="Probability" title="Axion-photon probability" xlabel="Axion-photon probability" ylabel="" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="axionPhoton_probability" nbins="500" range="(1.e-22,2.e-18)"/>
</plot>
<plot name="FieldAverage" title="Average field" xlabel="Average magnetic field [T]" ylabel="" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="axionPhoton_fieldAverage" nbins="500" range="(0,2.5)"/>
</plot>
<plot name="Lcoh" title="Coherence length" xlabel="Coherence length [m]" ylabel="" value="ON" stats="OFF" option="colz" marginTop="0.1" logscale="true">
<variable name="axionPhoton_coherenceLength/1000" nbins="100" range="(0,10.01)"/>
</plot>
<plot name="ProbVsB" title="Axion-photon probability versus average field" xlabel="Average magnetic field [T]" ylabel="Axion-photon probability" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="axionPhoton_fieldAverage" nbins="500" range="(0,2.5)"/>
<variable name="axionPhoton_probability" nbins="500" range="(1.e-22,2.e-18)"/>
</plot>
<!--- -->
<plot name="ProbVsL" title="Axion-photon probability versus coherence length" xlabel="Coherence length [m]" ylabel="Axion-photon probability" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="axionPhoton_coherenceLength/1000" nbins="100" range="(0,10.01)"/>
<variable name="axionPhoton_probability" nbins="100" range="(1.e-22,2.e-18)"/>
</plot>
<plot name="BufferGasTransmission" title="Additional buffer gas transmission" xlabel="Energy [keV]" ylabel="Transmission" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="initial_energy" nbins="100" range="(0,10.01)"/>
<variable name="axionPhoton_transmission" nbins="100" range="(0,1)"/>
</plot>
<plot name="BvsAngle" title="Average field versus theta angle" xlabel="Incident angle [rads]" ylabel="Average magnetic field" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="initial_thetaAngle" nbins="100" range="(0,0.0035)"/>
<variable name="axionPhoton_fieldAverage" nbins="100" range="(0,2.5)"/>
</plot>
<plot name="InitialVsFinalAngle" title="Incident versus outcoming optics angle" xlabel="Incident angle [rads]" ylabel="Output optics angle [rads]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="initial_thetaAngle" nbins="100" range="(0,0.0035)"/>
<variable name="final_thetaAngle" nbins="100" range="(0,0.07)"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="EnergySpectrum" title="Energy Spectrum" xlabel="Energy [keV]" ylabel="Counts per bin" value="ON" stats="OFF" option="colz" marginTop="0.1" legend="ON">
<histo name="noCuts" lineColor="1">
<variable name="initial_energy" nbins="500" range="(0,10.0)"/>
<parameter name="lineColor" value="1"/>
</histo>
<histo name="optics" lineColor="2">
<variable name="initial_energy" nbins="500" range="(0,10.0)"/>
<parameter name="lineColor" value="1"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</histo>
<histo name="opticsWeigth" lineColor="4" weight="optics_efficiency">
<variable name="initial_energy" nbins="500" range="(0,10.0)"/>
<parameter name="lineColor" value="1"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</histo>
<histo name="opticsAndWindow" lineColor="12" weight="optics_efficiency*window_transmission*boreExitGate_transmission">
<variable name="initial_energy" nbins="500" range="(0,10.0)"/>
<parameter name="lineColor" value="1"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</histo>
</plot>
<plot name="MagnetEntranceDist" title="Magnet entrance distribution" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="magnetEntrance_posX" nbins="100"/>
<variable name="magnetEntrance_posY" nbins="100"/>
</plot>
<plot name="MagnetExitDist" title="Magnet exit distribution" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="magnetExit_posX" nbins="100"/>
<variable name="magnetExit_posY" nbins="100"/>
<cut variable="boreExitGate_transmission" condition="&gt;0" value="ON"/>
</plot>
<plot name="MagnetEntranceDistOptics" title="Magnet entrance distribution (Optics acceptance)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="magnetEntrance_posX" nbins="100"/>
<variable name="magnetEntrance_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="SolarDist" title="Solar disk distribution" xlabel="X [m]" ylabel="Y [m]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="initial_posX" nbins="100"/>
<variable name="initial_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="OffsetDist" title="Spot at 0.5m focal-offset (only reflected rays)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="offset_posX" nbins="100"/>
<variable name="offset_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="OffsetDistWindow" title="Spot at 0.5m focal-offset (reflected rays + window transmission)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1" weight="window_transmission">
<variable name="offset_posX" nbins="100"/>
<variable name="offset_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="FocalAllEvents" title="Spot at focal (all events)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="final_posX" nbins="100"/>
<variable name="final_posY" nbins="100"/>
</plot>
<plot name="FocalOptics" title="Spot at focal (only reflected rays)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1">
<variable name="final_posX" nbins="100"/>
<variable name="final_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
<plot name="FocalOpticsWindow" title="Spot at focal (only reflected rays. Zoom)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1" weight="optics_efficiency">
<variable name="final_posX" nbins="100" range="(-20,20)"/>
<variable name="final_posY" nbins="100" range="(-20,20)"/>
<cut variable="optics_efficiency" condition="<1" value="ON"/>
</plot>
<plot name="SolarDiskWindow" title="Solar Disk (window_transmission weighted)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1" weight="window_transmission">
<variable name="initial_posX" nbins="100"/>
<variable name="initial_posY" nbins="100"/>
</plot>
<plot name="FocalSpot" title="Spot at focal (all efficiencies)" xlabel="X [mm]" ylabel="Y [mm]" value="ON" stats="OFF" option="colz" marginTop="0.1" weight="optics_efficiency*window_transmission*boreExitGate_transmission*axionPhoton_transmission*axionPhoton_probability">
<variable name="final_posX" nbins="100"/>
<variable name="final_posY" nbins="100"/>
<cut variable="optics_efficiency" condition="&gt;0" value="ON"/>
</plot>
</TRestAnalysisPlot>
<addTask command="restplot-&gt;PlotCombinedCanvas()" value="ON"/>
</TRestManager>
28 changes: 0 additions & 28 deletions examples/likelihood_BabyIAXO.rml

This file was deleted.

Loading

0 comments on commit 6d86d96

Please sign in to comment.