spectrometerFunctions.h File Reference

Function definitions for the spectrometer macros. More...

#include <TF1.h>

Go to the source code of this file.

Functions

Double_t spectrometerSBendSynchEnergyLossEB (Double_t Energy, Double_t BField, Double_t sLength)
Double_t spectrometerSBendSynchEnergyLossERho (Double_t Energy, Double_t Rho, Double_t sLength)
Double_t spectrometer4MagChicaneEnergy (Double_t Offset, Double_t Lm, Double_t Lb, Double_t Bdl1, Double_t Bdl2)
Double_t spectrometer4MagChicaneEnergyErr (Double_t Offset, Double_t OffsetErr, Double_t Lm, Double_t LmErr, Double_t Lb, Double_t LbErr, Double_t Bdl1, Double_t Bdl1Err, Double_t Bdl2, Double_t Bdl2Err)
Double_t spectrometer4MagChicaneOffset (Double_t Energy, Double_t Lm, Double_t Lb, Double_t Bdl1, Double_t Bdl2)
Double_t spectrometerGetOrbit (Double_t *pos, Double_t *zpos, Int_t n, Double_t z, TF1 *f)
Double_t spectrometerGetLinearOrbit (Double_t *pos, Double_t *zpos, Int_t n, Double_t z)
Double_t spectrometerGetParabolicOrbit (Double_t *pos, Double_t *zpos, Int_t n, Double_t z)


Detailed Description

Function definitions for the spectrometer macros.


Function Documentation

Double_t spectrometer4MagChicaneEnergy ( Double_t  Offset,
Double_t  Lm,
Double_t  Lb,
Double_t  Bdl1,
Double_t  Bdl2 
)

Calculates the beam energy in a 4 magnet chicane The formula used is as follows :

\[ E_{beam} = \frac{ec}{ \Delta x} \left( ( L_{m} + L_{b} ) \int B_{1}dl + L_{b} \int B_{2}dl \right) \]

Where $ \Delta x $ represents the Offset at center of the chicane. A sketch is shown here

energy_calc.gif

Sketch showing the energy calculation in a 4 magnet chicane.

Note that the sign of the field has to be taken into account !

Parameters:
Offset The offset at center of the chicane [m]
Lm The distance between the centers of the two first magnets [m]
Lb The distance between the center of the second magnet and the center BPM [m]
Bdl1 The integrated field in the first magnet [T.m]
Bdl2 The integrated field in the second magnet [T.m]
Returns:
The energy value in GeV

Double_t spectrometer4MagChicaneEnergyErr ( Double_t  Offset,
Double_t  OffsetErr,
Double_t  Lm,
Double_t  LmErr,
Double_t  Lb,
Double_t  LbErr,
Double_t  Bdl1,
Double_t  Bdl1Err,
Double_t  Bdl2,
Double_t  Bdl2Err 
)

Calculates the uncertainty on the energy from error propagation

Parameters:
Offset The offset at center of the chicane [m]
OffsetErr ... error on that
Lm The distance between the centers of the two first magnets [m]
LmErr ... error on that
Lb The distance between the center of the second magnet and the center BPM [m]
LbErr ... error on that
Bdl1 The integrated field in the first magnet [T.m]
Bdl1Err ... error on that
Bdl2 The integrated field in the second magnet [T.m]
Bdl2Err ... error on that
Returns:
The error on the energy value in GeV

Double_t spectrometer4MagChicaneOffset ( Double_t  Energy,
Double_t  Lm,
Double_t  Lb,
Double_t  Bdl1,
Double_t  Bdl2 
)

Calculates the beam offset in a 4 magnet chicane

Parameters:
Energy The electron beam energy in [GeV]
Lm The distance between the centers of the two first magnets [m]
Lb The distance between the center of the second magnet and the center BPM [m]
Bdl1 The integrated field in the first magnet [T.m]
Bdl2 The integrated field in the second magnet [T.m]
Returns:
The beam offset at center of the chicane in meter

Double_t spectrometerGetLinearOrbit ( Double_t *  pos,
Double_t *  zpos,
Int_t  n,
Double_t  z 
)

Extrapolates the orbit using a straight line for a series of given positions and z positions at z.

Parameters:
pos Array of n measured positions
zpos Array of n z positions corresponding to the measured ones
n The number of measured positions
z The z coordinate at which to evaluate the function
Returns:
The orbit position at z

Double_t spectrometerGetOrbit ( Double_t *  pos,
Double_t *  zpos,
Int_t  n,
Double_t  z,
TF1 *  f 
)

Extrapolates the orbit for a series of given positions and z positions at z. The extrapolation function is given by a general TF1 f

Parameters:
pos Array of n measured positions
zpos Array of n z positions corresponding to the measured ones
n The number of measured positions
z The z coordinate at which to evaluate the function
f The function to fit the orbit
Returns:
The orbit position at z

Double_t spectrometerGetParabolicOrbit ( Double_t *  pos,
Double_t *  zpos,
Int_t  n,
Double_t  z 
)

Extrapolates the orbit using a parabola for a series of given positions and z positions at z.

Parameters:
pos Array of n measured positions
zpos Array of n z positions corresponding to the measured ones
n The number of measured positions
z The z coordinate at which to evaluate the function
Returns:
The orbit position at z

Double_t spectrometerSBendSynchEnergyLossEB ( Double_t  Energy,
Double_t  BField,
Double_t  sLength 
)

Calculates the energy loss due to synchrotron radiation in a sector bending magnet from the beam energy and the magnetic field.

The formula is given by :

\[ \int P_\gamma dt = \frac{ e^2c^2 C_\gamma}{2\pi}E^2B^2L = \frac{C_\gamma}{2\pi}\frac{E^4}{\rho}L \]

where $ P_\gamma $ is the power radiated by an electron in a magnetic field $B$ and $L$ the pathlength through the field. $E$ is it's energy and $C_\gamma$ is the synchrotron radiation constant. Just for reference, $P_\gamma$ is given by

\[ P_\gamma = \frac{ e^2c^3 C_\gamma}{2\pi}E^2B^2 = \frac{cC_\gamma}{2\pi}\frac{E^4}{\rho} \]

Parameters:
Energy The energy of the electron beam in GeV
BField The magnetic field of the magnet in Tesla
sLength The sector length through the magnet
Returns:
The energy loss in GeV

Double_t spectrometerSBendSynchEnergyLossERho ( Double_t  Energy,
Double_t  Rho,
Double_t  sLength 
)

Calculates the energy loss due to synchrotron radiation in a sector bending magnet from the beam energy and the magnet bending radius. For the formulat see the EB version of this routine...

Parameters:
Energy The energy of the electron beam in GeV
Rho The magnet bending radius in meter
sLength The sector length through the magnet
Returns:
The energy loss in GeV


Generated on Fri Dec 14 15:55:25 2007 for spectrometer by  doxygen 1.5.1