- [ ] Use the Single_crystal component as it is used in the glitches project.
# The ROCK beamline
[ROCK](https://www.synchrotron-soleil.fr/en/beamlines/rock) is a quick-EXAFS beamline dedicated to the study of rapid kinetic processes on nanomaterials used mainly in the field of catalysis and batteries. Its energy range goes from 4 to 40 keV, the wavelength selection is done with a two Hertz oscillating channel-cut.
From the source to the sample the beamline is composed of the elements listed in **table** I with their characteristics :
| **Element characteristics** | Field=1.72T Ec=8.65keV | - | - | Coating:Ir(50nm) Big radius:9.02km Small radius:0.0317m Incidence:2.5mrad Width:0.015m Length:1.1m| - | Coatings:Pt(50nm) or Pd(50nm) or B4C(5nm) Width:47mm Length:1.1m Incidence:1.75mrad to 5.2 mrad| - | Channelcut CC1 Crystal:Si(111) d:3.13582Ang Width:25mm Length(C1,C2):70mm Spacing:10mm ----------------- Channelcut CC2 Cristal:Si(220) d:1.92038Ang Width:25mm Length(C1,C2):70mm Spacing:10mm ----------------- Channelcut CC3 Crystal:Si(111) d:3.13582Ang Width:25mm Length(C1):50mm Length(C2):70mm Spacing:10mm| - | - | Coatings:Pt(50nm) or Pd(50nm) or B4C(5nm) Width:47mm Length:1.1m Incidence:1.75mrad to 5.2 mrad |
**Angular attitudes** of ROCK's beamline optics. The total angular deviation is of 2.5 mrad (toroidal mirror). The angular deviations due to M2a/M2b on one end and those due to the channel-cut on the other cancel each other out.
The vertical offset of the centre of the second crystal is also of interest because we place the optic that follows the second crystal of the CC relative to it's centre.
Further on the simulation of a simple case with the CC (channel-cut) only is presented. The optic that follows the second crystal of the CC will be placed relative to the centre of the second crystal of the CC.
For the simulation of the ROCK beamline, the ray is what is followed. Indeed the ray needs to hit the same place of the sample. Therefore we position the optic that follows the second crystal of the CC relative to it's centre modulo `h`.
((explain also the projection for the horizontal offset))
### Energy ranges
Three different types of channel-cuts are used: a long CC Si 220, a long CC Si 111 and a short CC Si 111.
The long CC have their crystals equal to a length of 0.07 m.
The short CC has it's first crystal equal to a length of 0.05m, and it's second crystal of length 0.07m.
All have their crystals separated vertically by 0.01m.
The long CCs turn from 4 to 35 degrees. The short CC turns from 6 to 35 degrees.
The simple case with the CC and monitors placed after it is simulated.
Here the centre of the energy monitor is placed relative to the centre of the CC's second crystal.
Let's take as an example three energies of the CC Si 220, E_min = 11752 eV, E_max = 34055 eV and an intermediate energy of 23keV.
### Energy monitors
The bell shaped curve of the energy is cut for the energies 11.752 and 34.055 keV. For 11.752 keV, the lowest energies of the bell are cut. For the second, the highest energies of the bell are cut.
And for 23 keV, the bell stays symmetrical, there is no longer any cut from one side or the other.
The signal's spot moves vertically as explained before. For a small energy (big attack angle) the spot is towards the bottom because `H1-H2 < 0`. To be exact, in the case of the long CC, `H1-H2>0` from 4 to 8 degrees approximately (exact values to be done), and `H1-H2<0` from 8 to 35 degrees.
The signal's spot is smaller vertically for a bigger energy.
This is explained by the fact that the divergence cone is smaller for a smaller attack angle, and inversely, bigger for a bigger attack angle of the beam (explain in more detail, show a diagram).
### Top and bottom energy monitors
An energy monitor is cut in half horizontally at mid-height. This is done to observe the energy repartition of the signal.
The energy is again cut in half, the part with the highest energies is on the top monitor, and the part with the lower energies is on the bottom monitor.
(maybe insert images here if it's not clear)
The rays that hit the top monitor are of higher energies than those hitting the bottom monitor.
The rays forming the beam hit the crystal at different angles, it's the angular divergence, but there is also a divergence in energy with `dE = 1% *E`.
As explained in page 152 of the book "An Introduction to Synchrotron Radiation" by Willmott, Philip, John Wiley & Sons, 2019:
> We allow, however, the incoming polychromatic beam to have a divergence of 𝛿𝜃 in the plane containing both it and the cristal normal. According to Equation (5.25), the cristal will select longer wavelengths from that part of the beam that impinges more steeply (larger 𝜃) on it
than that part of the beam that strikes the cristal at a shallower angle.
where the equation 5.25 is Bragg's law: `2*d*sin(β)=n*λ`
## Simulation of the ROCK beamline
The whole beamline is simulated (without the sample).
Here the centre of the energy monitor is positionned relative to the centre of the CC's second crystal modulo `h`. The ray is followed.
Let's take as an example three energies of the CC Si 220, E_min = 11752 eV, E_max = 34055 eV and an intermediate energy of 23keV.
### Energy monitors
The energy monitors show the same results as previously.
The presence of the M2b mirror has for main purpose to focus the beam towards the detector's entrance, a ionisation chamber of aperture 10mm. Furthermore, it attenuates the vertical movement of the beam caused by the channel-cut's rotation. Another effect of this mirror is to inverse the beam's spot due to it's concavity.
The presence of the M2b mirror attenuates the beam's vertical movement although it is a minimal movement.
This inversion is also seen in the following part.
### Top and bottom energy monitors
The energy is once more cut in half but this time the part with the higher energies is on the bottom monitor, and the part with the lower energies is on the top monitor.
The M2b mirror is the cause of the inversion.
(...)
## Simulation of the ROCK beamline with a sample
The sample is positioned at the end of the beamline.
### Energy scan copper
Here is the XANES/EXAFS graph for an energy scan from 8.5 to 9.5 keV with the copper sample.
The oscillations due to backscattering in the EXAFS part can't be seen because McXtrace does not simulate that effect.

### Energy scan Mn and Cr
Here is the XANES/EXAFS for an energy scan of 5.7 to 7.2 keV with a sample composed of Manganese and Chrome.