Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

TCalibration Class Reference

#include <TCalibration.h>

List of all members.


Detailed Description

Calibration base-class.

This class contains a basic map, gain and offset without specifying what they are for. So, you could have a class with instances for ADCS and TDCS to create a complete calibration.

Author:
JEP.
Version:
1.0.
Date:
June 2004.

Definition at line 16 of file TCalibration.h.

Public Member Functions

 TCalibration (UShort_t=1)
 TCalibration (const TCalibration &)
 ~TCalibration ()
TCalibrationoperator= (const TCalibration &)
void Clear (const Char_t *="")
void Print (const Char_t *="") const
void SetChannels (UInt_t)
void SetBitMask ()
void AddToChannel (UInt_t, UShort_t)
void AddToMap (UInt_t, UShort_t)
void AddToOffset (UInt_t, Short_t)
void AddToGain (UInt_t, Float_t)
void AddToHistogramMap (UInt_t, UShort_t)
void Calibrate (const vector< const TDataItem< UShort_t > * > &, vector< const TDataItem< Float_t > * > &) const
UShort_t GetChannels () const
UShort_t GetHistogramMap (UInt_t) const
Bool_t TestChannel (UInt_t) const
Bool_t IsSet () const

Private Attributes

UShort_t fChannels
Bool_t fCalSet
vector< UShort_t > fChannel
vector< UShort_t > fMap
vector< Short_t > fOffset
vector< Float_t > fGain
vector< UShort_t > fMapH
size_t fBits
UInt_t fMaskMax
UInt_t * fBitMask


Constructor & Destructor Documentation

TCalibration UShort_t  channels = 1  ) 
 

Default constructor, setting the calibration test switch to false (indicating no data is being held). The number of channels in the calibration is also set (defaults to 1), the gain vector elements initialized to 1, the offset elements to 0 and the map and histogram-map to index = channel.

Parameters:
[in] channels The number of channels the detector to calibrate has.

Definition at line 24 of file TCalibration.cxx.

References SetChannels().

Here is the call graph for this function:

TCalibration const TCalibration rhs  ) 
 

Copy constructor. Need this because we have a pointer in the member list.

Parameters:
[in] rhs The object being copied.

Definition at line 39 of file TCalibration.cxx.

References fBitMask, fBits, fCalSet, fChannel, fChannels, fGain, fMap, fMapH, fMaskMax, and fOffset.

~TCalibration  ) 
 

Default destructor. Deletes the bit-mask used for testing whether a channel associated with the calibration exists in the data.

Definition at line 59 of file TCalibration.cxx.


Member Function Documentation

TCalibration & operator= const TCalibration rhs  ) 
 

Assignment operator overload. This is needed as some of the DragonRoot classes deal with pointers.

Parameters:
[in] rhs The TCalibration to be copied.
Returns:
The this pointer.

Definition at line 68 of file TCalibration.cxx.

References Clear(), fBitMask, fBits, fCalSet, fChannel, fChannels, fGain, fMap, fMapH, fMaskMax, and fOffset.

Here is the call graph for this function:

void Clear const Char_t *  option = ""  ) 
 

Clears the map, gain, offset and histogram-map arrays and also sets the calibration test switch to false, indicating no data is set in the calibration.

Parameters:
[in] option The option is currently unimplemented.
Note:
Calling this will leave the calibration completely unset; SetChannels() must be called or a calibration supplied from THiCalibration or TGrCalibration, otherwise a crash will occur when sorting data.

Definition at line 93 of file TCalibration.cxx.

References fBitMask, fCalSet, fGain, fMap, fMapH, and fOffset.

void Print const Char_t *  option = ""  )  const
 

Print the data held in the vector members fMap, fGain, fOffset, fMapH and fBitMask. If no data is present or the calibration test switch is false then a "No calibration set" message is printed.

Parameters:
[in] option The option is currently unimplemented.

Definition at line 114 of file TCalibration.cxx.

References fBitMask, fGain, fMap, fMapH, and fOffset.

void SetChannels UInt_t  channels  ) 
 

Sets the size of all the vectors and initializes them to sensible values.

Parameters:
[in] channels The number of detector channels.

Definition at line 152 of file TCalibration.cxx.

References fCalSet, fChannel, fChannels, fGain, fMap, fMapH, fOffset, and SetBitMask().

Here is the call graph for this function:

void SetBitMask  ) 
 

Sets the bit-mask. Each bit in the fBitMask array of integers represents a channel, with 1 indicating the channel is attached to the particular calibration (and hence detector) or zero otherwise. For example, if the calibration is printed and a bit-mask of 00001001 is shown, this indicates that if channels 4 and 7 appear in the data then they belong to the detector that owns this calibration.

Definition at line 177 of file TCalibration.cxx.

References fBitMask, fBits, fCalSet, fChannels, fMap, and fMaskMax.

void AddToChannel UInt_t  map,
UShort_t  channel
 

Set the calibration channels, adding one element at a time to the fChannel vector. This vector enables the location of a detector channel to be mapped given a particular channel in the data.

Parameters:
[in] map The channel expected in the data.
[in] channel The detector channel.

Definition at line 202 of file TCalibration.cxx.

References fChannel.

void AddToMap UInt_t  channel,
UShort_t  map
 

Set the calibration map, adding one element at a time to the fMap vector. This vector enables the location of a data channel to be mapped given a particular channel in the detector.

Parameters:
[in] channel The detector channel.
[in] map The channel expected in the data.

Definition at line 216 of file TCalibration.cxx.

References fMap.

void AddToOffset UInt_t  channel,
Short_t  offset
 

Set the calibration offset, adding one element at a time to the fOffset vector.

Parameters:
[in] channel The detector channel.
[in] offset The channel offset.

Definition at line 227 of file TCalibration.cxx.

References fOffset.

void AddToGain UInt_t  channel,
Float_t  gain
 

Set the calibration gain, adding one element at a time to the fGain vector.

Parameters:
[in] channel The detector channel.
[in] gain The channel gain.

Definition at line 237 of file TCalibration.cxx.

References fGain.

void AddToHistogramMap UInt_t  channel,
UShort_t  map
 

Set the histogram map, adding one element at a time to the fMapH vector.

Parameters:
[in] channel The detector channel.
[in] map The channel to use when histogramming.

Definition at line 247 of file TCalibration.cxx.

References fMapH.

void Calibrate const vector< const TDataItem< UShort_t > * > &  rawSignals,
vector< const TDataItem< Float_t > * > &  calSignals
const
 

For the vector of data held in a detector, it can be calibrated by passing it to this method, along with another vector which can accept the calibrated data.

Parameters:
[in] rawSignals The vector containing raw data-signals.
[in] calSignals The vector in which calibrated items are placed.

Definition at line 258 of file TCalibration.cxx.

References fChannel, fGain, and fOffset.

UShort_t GetChannels  )  const [inline]
 

Get the number of channels associated with the calibration.

Returns:
The number of channels the calibration is for.

Definition at line 75 of file TCalibration.h.

UShort_t GetHistogramMap UInt_t  channel  )  const [inline]
 

Get the histogram-map for detector-channel chan from vector fMapH. Use this to plot a detector channel 0..n in another channel. This is useful if you have more than one type of the same detector.

Parameters:
[in] channel The channel for which to get the histogram map.
Returns:
fMapH[chan].

Definition at line 83 of file TCalibration.h.

References fMapH.

Bool_t TestChannel UInt_t  dataChannel  )  const [inline]
 

Test to see if data-channel dataChannel is present in the calibration i.e. is associated with a particular detector.

Parameters:
[in] dataChannel The channel to test.
Returns:
True (1) if the channel is present in the calibration; false (0) otherwise.

Definition at line 96 of file TCalibration.h.

References fBitMask, fBits, and fMaskMax.

Bool_t IsSet  )  const [inline]
 

Test to check whether a calibration has been set and data written into fMap, fGain and fOffset.

Returns:
True (1) if the calibration has been set; false (0) if no.

Definition at line 108 of file TCalibration.h.


Member Data Documentation

UShort_t fChannels [private]
 

The number of channels to set in the calibration. This defaults to 1.

Definition at line 42 of file TCalibration.h.

Bool_t fCalSet [private]
 

Switch set to true (1) when data is held in fMap, gain and offset. Otherwise false (0).

Definition at line 46 of file TCalibration.h.

vector<UShort_t> fChannel [private]
 

Vector holding the calibration map values.

Definition at line 49 of file TCalibration.h.

vector<UShort_t> fMap [private]
 

Vector holding the calibration map values.

Definition at line 52 of file TCalibration.h.

vector<Short_t> fOffset [private]
 

Vector holding the calibration map values.

Definition at line 55 of file TCalibration.h.

vector<Float_t> fGain [private]
 

Vector holding the calibration map values.

Definition at line 58 of file TCalibration.h.

vector<UShort_t> fMapH [private]
 

Histogram map for the channels of each detector.

Definition at line 61 of file TCalibration.h.

size_t fBits [private]
 

The number of bits in the architecture short integer. This is used to find the correct number of elements to dynamically add to the bit-mask array.

Definition at line 66 of file TCalibration.h.

UInt_t fMaskMax [private]
 

The maximum number of elements to the bit-mask array.

Definition at line 69 of file TCalibration.h.

UInt_t* fBitMask [private]
 

Array holding the channel bit-mask.

Definition at line 72 of file TCalibration.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 8 11:54:33 2007 for DragonRoot by  doxygen 1.3.9.1