CSC System Integration Test Software
This page provides access to external (non-embedded) software for the
system integration test of the CSC.
Data format
The data files are saved with the .csc extention.
Each file starts with a section
of general information in ASCII format. This part can be displayed with the
type command in DOS. It is followed by binary data,
including the run parameters and the ADC data.
A detailed description can be found in
this pdf file.
However, the C++ class CEvent simplifies reading and accessing the
data. The source code is
event.cpp and
event.h. The class makes use of the files
rod_pc.h and
opcodes.h.
The main program has one instance of the
event class. It is initialized with the
InitialRead(FILE* infile) function, which skips the text
information and allocates memory according to the number of samples.
The loop over the events in the file starts with a call to
Read(FILE* infile), which reads the next event. The ADC
samples can be obtained with a call to
GetData(int dpu, int chn, int sam).
For an example program, see
rms.cpp, a simple program that calculates
pedestal and RMS values for every channel. More programs are listed below.
For test data, taken at BNL, see
- Shape000.csc: No pulses, just readout
noise, 40MHz sampling.
- Shape001.csc: Pulses on several groups of
channels, 40MHz sampling.
sitSim
This program simulates a full CSC chamber with 192 channels in each of
the four layers. A muon track goes through the middle of the chamber
in each event. Background hits are also simulated. Invoke the command
as
sitsim test.csc 10 1500 20
where test.csc is the name of the output file, 10 is the number of
events generated, 1500 is the flux in Hz/cm^2, and 20 is the number of
time slices.
The source code is in
sitsim.zip.
Note that the program reads a
landau distribution from the file
landau.vec (includes in the zip file).
sitView
This is the Microsoft Windows-based event display for data taken at
the system integration
test. It reads the first 1000 events from a data file and displays the
waveforms on all channels event by event. Press the space bar to go to
the next event, backspace to go back. Double-click on a trace to
display a larger graph.
The source code of the entire project is in
SITView.zip. The windows executable is
SITView.exe.
You may also need the
Microsoft debug dlls
in your windows\system directory. Use one of the above data
files for testing. You can associate the csc extention with the event display.
Below is an older screenshot of the program.
pedestal
This program uses
ROOT
to create histograms of the measured ADC value for each
channel. It fits the resulting distribution to a Gaussian. The mean of
the Gaussian is the pedestal and the sigma is the readout noise. The
simulated data has a noise of 2 ADC counts:
The results of the fits are summarized in two histograms for each
layer. One shows the pedestals versus the channel number, and the
other histogram shows the noise versus the channel number. In the
simulation, muon tracks were generated in the center of the chamber,
leading to larger noise figures in that area:
The source code is in
pedestal.cpp.
Compile the program and link with the ROOT libraries. At UCI use
g++ pedestal.cpp -I/u/cern/root/include -L/u/cern/root/lib -lCint -lCore
-lGpad -lGraf -lHist -lMatrix
To run the program, type
pedestal filename.csc
where filename.csc is the data file. The program generates two output
files. A summary of the pedestal and noise for each channel in ASCII
format is written in filename.ped.txt, and the ROOT file with the
histograms is filename.ped.root. An example ROOT file is
run100ev20sam.ped.root.
amplitude
This program searches for clusters of 5 channels and fits a bipolar
response function to each waveform. Data about the amplitude, timing and
channel number is stored in a ROOT tree.
To run the program, type
amplitude filename.csc
where filename.csc is the data file. The program generates an output file
named filename.amp.root. The following figure shows a histogram of the sum
of the amplitudes for each cluster. The input data was simulated according to
a Landau distribution.
The source code is in
amplitude.cpp.
calSim
This program simulates calibration data from a CSC chamber. Data
from each calibration point is saved in a separate file. The filename
for the first file should be in the form of 'calib00.csc' so that the
numerical part can be incremented for each claibration point.
The 'calibration pulse height'
grows linearly from one point to the next.
The waveform data has a timing jitter of 2 ns and the calibration pulse
height varies by 0.2 %. The program also produces a *.cal
file that lists the 'true' calibration constants for each channel. It
can later be compared with the output of the calibration program.
To run the program, type
calSim calib00.csc calib.cal 10 100 10
where the first 10 means 10 calibration points, resulting in 10 data
files, 100 is the number of events per file and the last 10 indicates
the number of samples.
The source code is in
calSim.zip.
Other Programs
-
calibration.cpp
calculates calibration constants, including the
saturation of the pre-amplifiers.
- resolution.cpp
calculates the resolution by using the hit
positions in two layers to predict the hit position in a third layer.
- reconstruction.cpp compares several position reconstruction
methods and can be used to calculate corrections.