source: trunk/MagicSoft/include-Classes/MRawPixel.cxx@ 479

Last change on this file since 479 was 434, checked in by harald, 24 years ago
Changed the format for root to store the raw data from the pixels. This is the version that was discussed on the software meeting in Goettingen.
File size: 3.2 KB
Line 
1#include <iostream.h>
2
3#include "TString.h"
4#include "TRandom.h"
5
6#include "MRawPixel.h"
7
8#include "Mdefine.h"
9
10//==========
11// MRawPixel
12//
13// One Event in the Camera of MAGIC consists of measurements of different
14// Photomultiplier. The measurements are taken with FADCs. So the raw
15// informations of one pixel are the ADC values of the FADCs. MAGIC will
16// measure the amplitude of one Photomulitplier in different branches
17// - one high and one low gain branch. The first is for small signals, the
18// other for big signals. With this method it is possible to increase the
19// dynamic range.
20//
21// The Class MRawPixel is used to manage this raw information.
22//
23// The data members are described in detail here:
24//
25// ---------
26//
27// Short_t PixelId ;
28//
29// This is to identify the Pixel.
30// The Camera consists of CAMERA_PIXELS Pixels. Each one has a specific Id.
31// The center of the camera is zero and a spiral numbering is chosen.
32//
33// To reduce the amount of data, we store the information of the
34// low-gain-branch of the Fadc´s only if there is a signal in. Then the
35// PixelId is:
36// PixelId = - PixelId .
37// if there is an entry in the low gain list.
38//
39// Otherwise Fadc values the rule is:
40// PixelId = PixelId .
41//
42//
43// ---------
44//
45// Byte_t FADCSamples[FADC_SLICES] ;
46//
47// The values of FADC_SLICES fadc-slices. This is the information of the
48// measured ADC values for one branch (high gain or low gain). The typ of
49// branch is indicated in the usPixelNumber and in the PixelStatus.
50// In this first version the number of FADC_SLICES is going to be fixed
51
52ClassImp(MRawPixel)
53
54
55
56MRawPixel::MRawPixel() {
57 //
58 // The default constructor sets all members to zero.
59 //
60
61 PixelId = 0 ;
62
63 for (Int_t i = 0; i<FADC_SLICES; i++)
64 FADCSamples[i] = 0 ;
65
66}
67
68
69MRawPixel::MRawPixel(Short_t PId) {
70 //
71 // constructor II overloaded
72 //
73 // Parameter is the PixelId. All other data member are set to zero
74
75 PixelId = PId ;
76 for (Int_t i = 0; i<FADC_SLICES; i++)
77 FADCSamples[i] = 0 ;
78
79}
80
81
82MRawPixel::MRawPixel(Short_t usPId, Byte_t ucF[]) {
83 //
84 // constructor III overloaded
85 //
86 // parameters are PixelId and an array with Fadc values.
87
88 PixelId = usPId ;
89
90 for (Int_t i = 0; i<FADC_SLICES; i++)
91 FADCSamples[i] = ucF[i] ;
92}
93
94MRawPixel::~MRawPixel(){
95 //
96 // default destructor
97 //
98}
99
100void MRawPixel::Clear() {
101 //
102 // Sets the data member back to zero
103 //
104 PixelId = 0 ;
105
106 for (Int_t i=0;i<FADC_SLICES; i++){
107 FADCSamples[i] = 0;
108 }
109}
110
111void MRawPixel::Print()
112{
113 //
114 // This member function prints all Data of one Pixel on screen.
115 //
116
117 cout << endl << "PixId " << PixelId ;
118
119 for (Int_t i=0 ; i<FADC_SLICES ; i++ ) {
120 cout<<" / " << FADCSamples[i];
121 }
122}
123
124void MRawPixel::FillPixel (Short_t usPId, Byte_t ucF[]){
125 //
126 // Fills the event information
127 //
128
129 PixelId= usPId;
130
131 for (Int_t i = 0; i<FADC_SLICES; i++){
132 FADCSamples[i]= ucF[i];
133 }
134
135}
136
137Short_t MRawPixel::GetPixelId() {
138 //
139 // returns back the PixelId of the Pixel
140 //
141 return PixelId;
142}
143
144Byte_t MRawPixel::GetFadcSlice( Int_t iSli ) {
145 //
146 // returns back the fadc content of the slice iSli
147 //
148
149 return (FADCSamples[iSli]) ;
150}
Note: See TracBrowser for help on using the repository browser.