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

ped.cpp File Reference

Reads one csc data file and calculates pedestal and noise. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "TH1.h"
#include "TFile.h"
#include "TF1.h"
#include "CSCEvent.h"

Defines

#define maxSize   4000*32
#define maxChamber   32

Functions

int main (int argc, char *argv[])
 main program


Detailed Description

Reads one csc data file and calculates pedestal and noise.

This application uses the CSCEvent class to read CSC raw data and to fill histograms of pedestal values. If the peak-to-peak amplitude of a channel is larger than 20 ADC counts, then the program does not use this data. The program can therefore be run on data files that contain hits.

For each channel, the histogram is fitted to a Gaussian and the mean and sigma are saved as pedestal and noise. The results are summarized in the mean and sigma histograms and also written into a text file.

Format

The file starts with the number of chambers in the first line. After that, there are 5 * 192 * (number of chambers) channels, with one line per channel.

Each line starts with the channel ID in hex, followed by 3 characters that identify the chamber, the direction and the layer. This information is contained in the channel ID, but repeated to make the file more readable. Next on the line is the channel number in decimal. This is followed by the pedestal value and its error, and the noise value an its error. The errors are the statistical uncertainties from the gaussian fit. Here are the first few lines of such a file:

      4
00005800 00X0   0 2044.468    0.046    2.870    0.034
00005801 00X0   1 2076.505    0.043    2.671    0.032
00005802 00X0   2 2042.054    0.039    2.435    0.029
00005803 00X0   3 2056.927    0.039    2.438    0.029
00005804 00X0   4 2072.017    0.039    2.411    0.029
...

Generated on Wed Oct 29 10:35:18 2008 for CSCRead by  doxygen 1.3.9.1