source: branches/start/MagicSoft/include-Classes/MRawPixel.cxx@ 10083

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