dwvisser.analysis
Class ArrayCalibration

java.lang.Object
  |
  +--dwvisser.analysis.ArrayCalibration
All Implemented Interfaces:
java.io.Serializable

public class ArrayCalibration
extends java.lang.Object
implements java.io.Serializable

This class is a database class for containing all the calibration info for the YLSA array. YLSA is an array of 5 16-strip detectors. This class will eventually be a repository for linear time and energy calibration data and will be able to service a sort routine with appropriate gain coefficients which compress gains of all channels to match the lowest gain channel.

Version:
1.0
Author:
Dale W. Visser
See Also:
Serialized Form

Field Summary
static int NUM_DETECTORS
          Number of detectors in YLSA array.
static int NUM_STRIPS
          Number of strips per detector in YLSA array.
 
Constructor Summary
ArrayCalibration()
           
 
Method Summary
 int getCalibratedEnergyChannel(int det, int strip, int channel)
           
 int getCalibratedTimeChannel(int det, int strip, int channel)
          Returns the uncompressed channel number recommended for displaying calibrated time.
 double getChannelsPerMeV()
           
 double getChannelsPerNsec()
           
 double getDistance(int strip)
           
 double getEnergyDeposited(int det, int strip, int channel)
          Returns energy deposited in MeV.
 double getEnergyGain(int det, int strip)
           
 double getEnergyOffset(int det, int strip)
          Gets zero offset for channel in the electronics.
 double getIncidence(int strip)
          Returns 1/cos(inc.
 void getOffsets(java.io.File offsetsText)
          Format of the file is
 double getPhi(int det)
           
 double getTheta(int strip)
          Returns theta of strip in radians.
static void main(java.lang.String[] args)
          Just for debugging.
 void setEnergyGain(int det, int strip, double gain)
          Sets the number of channels per MeV for this channel of electronics.
 void setEnergyGainFactors()
          Processes energy gains to produce a factor <= 1.0 to multiply.
 void setEnergyOffset(int det, int strip, double offset)
          Sets the zero-offset for the particular channel of electronics.
 void setTimeGain(int det, int strip, double gain)
          Sets gain for this channel of electronics.
 void setTimeGainFactors()
          Processes time gains to produce a factor <= 1.0 to multiply.
 void setTimeOffset(int det, int strip, double offset)
           
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUM_DETECTORS

public static int NUM_DETECTORS
Number of detectors in YLSA array.


NUM_STRIPS

public static int NUM_STRIPS
Number of strips per detector in YLSA array.

Constructor Detail

ArrayCalibration

public ArrayCalibration()
Method Detail

getOffsets

public void getOffsets(java.io.File offsetsText)
Format of the file is
det strip offset delOffset

Parameters:
offsetsText - file containing offsets information

setEnergyOffset

public void setEnergyOffset(int det,
                            int strip,
                            double offset)
Sets the zero-offset for the particular channel of electronics.

Parameters:
det - which detector
strip - which strip in the detector
offset - channel corresponding to zero energy

setTimeOffset

public void setTimeOffset(int det,
                          int strip,
                          double offset)

getEnergyOffset

public double getEnergyOffset(int det,
                              int strip)
Gets zero offset for channel in the electronics.

Parameters:
det - which detector
strip - which strip
Returns:
channel corresponding to zero energy

setEnergyGain

public void setEnergyGain(int det,
                          int strip,
                          double gain)
Sets the number of channels per MeV for this channel of electronics.

Parameters:
det - which detector
strip - which strip
gain - channels per MeV

getEnergyGain

public double getEnergyGain(int det,
                            int strip)

setTimeGain

public void setTimeGain(int det,
                        int strip,
                        double gain)
Sets gain for this channel of electronics.

Parameters:
det - which detector
strip - which strip in the detector
gain - channels per nsec

setEnergyGainFactors

public void setEnergyGainFactors()
Processes energy gains to produce a factor <= 1.0 to multiply. The proper way to use this is to subtract the zero offset from the channel, then multiply by the gain factor.


setTimeGainFactors

public void setTimeGainFactors()
Processes time gains to produce a factor <= 1.0 to multiply. The proper way to use this is to subtract the zero offset from the channel, then multiply by the gain factor.


getChannelsPerMeV

public double getChannelsPerMeV()

getChannelsPerNsec

public double getChannelsPerNsec()

getCalibratedEnergyChannel

public int getCalibratedEnergyChannel(int det,
                                      int strip,
                                      int channel)

getEnergyDeposited

public double getEnergyDeposited(int det,
                                 int strip,
                                 int channel)
Returns energy deposited in MeV.


getCalibratedTimeChannel

public int getCalibratedTimeChannel(int det,
                                    int strip,
                                    int channel)
Returns the uncompressed channel number recommended for displaying calibrated time.

Parameters:
det - detector number
strip - strip number
channel - raw channel number from TDC
Returns:
zero if uncalibrated, value matched to max gain channel otherwise

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
string representation of the gains for writing out to screen or text file

getIncidence

public double getIncidence(int strip)
Returns 1/cos(inc. angle) for a ray from the target to a particular strip. What it actually returns is the average value taken from a ~1 million event monte carlo.

Parameters:
strip - strip number in detector (0 further back, 15 further forward)
Returns:
1/cos(incidence angle)

getDistance

public double getDistance(int strip)

getTheta

public double getTheta(int strip)
Returns theta of strip in radians.


getPhi

public double getPhi(int det)

main

public static void main(java.lang.String[] args)
Just for debugging.

Parameters:
args - command-line arguments