#include <TVirtualSpectrometer.h>
Public Member Functions | |
TVirtualSpectrometer (Int_t nOrbitBPMs, Int_t nChicaneBPMs) | |
Int_t | alignSystem (Long64_t iEv1, Long64_t iEv2, Int_t mode) |
void | setMagnetLocations (Double_t z1, Double_t z2) |
void | setMagnetFields (Double_t Bdl1, Double_t Bdl2) |
Int_t | getChicaneResiduals (void) |
Double_t | getEnergy (Long64_t iev) |
virtual Int_t | setTree (TTree *t)=0 |
virtual Int_t | getEvent (Long64_t iev)=0 |
void | showAlignment (void) |
Protected Attributes | |
TTree * | _dataTree |
Int_t | _nOrbitBPMs |
Double_t * | _xOrbitPos |
Double_t * | _zOrbitPos |
Int_t | _nChicaneBPMs |
Double_t * | _xChicanePos |
Double_t * | _zChicanePos |
The class implements methods to align the spectrometer either using a linear or parabolic fit or using SVD constants. When "aligning" the spectrometer using SVD the correlation coefficients are calculated and applied when getting the energy for each pulse.
Data quality should be implemented in the getEvent method by the user, when this routine returns 1, the pulse will not be considered in the calculations.
Note that this class works in SI units ( and GeV ). So the orbit positions it expects should be in meters !!! Please make sure that you set the correct unit scale when copying the values from the Tree, which probably usually is in mm !!
Int_t TVirtualSpectrometer::alignSystem | ( | Long64_t | iEv1, | |
Long64_t | iEv2, | |||
Int_t | mode | |||
) |
This routine should get the alignment constants for the pulse range given It fills the alignmen offset arrays
iEv1 | The first event of the tree to consider for this | |
iEv2 | The last event of the tree to consider | |
mode | The alignment mode |
void TVirtualSpectrometer::setMagnetLocations | ( | Double_t | z1, | |
Double_t | z2 | |||
) | [inline] |
Sets the z locations of the first two magnets in the chicane
z1 | Location of the first magnet | |
z2 | Location of the second magnet |
void TVirtualSpectrometer::setMagnetFields | ( | Double_t | Bdl1, | |
Double_t | Bdl2 | |||
) | [inline] |
Sets the values of the integrated fiels for the first two magnets in the chicane
Bdl1 | Integrated field for first magnet [Tm] | |
Bdl2 | Integrated field for second magnet [Tm] |
Int_t TVirtualSpectrometer::getChicaneResiduals | ( | void | ) |
Computes the chicane residuals, values are stored internally
Double_t TVirtualSpectrometer::getEnergy | ( | Long64_t | iev | ) |
Calculates the energy for the pulse
virtual Int_t TVirtualSpectrometer::setTree | ( | TTree * | t | ) | [pure virtual] |
Pure virtual method that the user has to implement. It should map some variable addresses in the derived class to the variables from the tree that have the beam data.
*t | Pointer to a data tree |
virtual Int_t TVirtualSpectrometer::getEvent | ( | Long64_t | iev | ) | [pure virtual] |
Gets the event information into the local buffers. This method should be implemented by the user and should copy the local variables in the derived class into the _xChicanePos and _xOrbitPos variables of the base class...
iev | The event number in the tree |
void TVirtualSpectrometer::showAlignment | ( | void | ) |
Prints the system alignment to the screen
TTree* TVirtualSpectrometer::_dataTree [protected] |
A pointer to the ROOT tree containing the data
Int_t TVirtualSpectrometer::_nOrbitBPMs [protected] |
The number of Orbit BPMs in the system
Double_t* TVirtualSpectrometer::_xOrbitPos [protected] |
Array of x positions of the orbit BPMs
Double_t* TVirtualSpectrometer::_zOrbitPos [protected] |
Array of z positions of the orbit BPMs
Int_t TVirtualSpectrometer::_nChicaneBPMs [protected] |
The number of Chicane BPMs in the system
Double_t* TVirtualSpectrometer::_xChicanePos [protected] |
Array of x positions of the chicane BPMs
Double_t* TVirtualSpectrometer::_zChicanePos [protected] |
Array of z positions of the chicane BPMs