TVirtualSpectrometer Class Reference

#include <TVirtualSpectrometer.h>

List of all members.

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


Detailed Description

Abstract spectrometer class which needs to be adjusted by the user to fit the ROOT file layout of the data considered. This is done by deriving a daughter spectrometer class and implementing the setTree and getEvent methods. In the setTree method the user should set the branch addresses to some private variables and in the getEvent method get them using the default ROOT TTree::GetEntry() method and copy them into the internal variables as these are the ones that the implemented methods of this class work with.

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 !!


Member Function Documentation

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

Parameters:
iEv1 The first event of the tree to consider for this
iEv2 The last event of the tree to consider
mode The alignment mode
Returns:
0 upon success, 1 upon failure

void TVirtualSpectrometer::setMagnetLocations ( Double_t  z1,
Double_t  z2 
) [inline]

Sets the z locations of the first two magnets in the chicane

Parameters:
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

Parameters:
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

Returns:
0 upon success, 1 upon failure

Double_t TVirtualSpectrometer::getEnergy ( Long64_t  iev  ) 

Calculates the energy for the pulse

Returns:
The pulse energy in GeV

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.

Parameters:
*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...

Parameters:
iev The event number in the tree

void TVirtualSpectrometer::showAlignment ( void   ) 

Prints the system alignment to the screen


Member Data Documentation

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


The documentation for this class was generated from the following files:
Generated on Fri Dec 14 15:55:25 2007 for spectrometer by  doxygen 1.5.1