- Timestamp:
- 09/21/00 12:35:27 (24 years ago)
- Location:
- trunk/MagicSoft/include-Classes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/include-Classes/MRawEvt.cxx
r374 r434 6 6 #include "MRawEvt.h" 7 7 #include "MRawPixel.h" 8 #include "MRawCrate.h" 8 9 9 10 #include "Mdefine.h" … … 14 15 // (Photomultipliers) from the Camera of MAGIC. So all data (FADC) of the 15 16 // interesting pixels are the modules of an event. To describe pixels the 16 // class MRawPixel is used. To define a single events 17 // some other data members are needed (Time of the events, kind of event..). 18 // 17 // class MRawPixel is used and the class MRawCrate to describe Crates. 18 // To define a single events some other data members are needed 19 // (Time of the events, tirgger pattern of event..) 20 // 19 21 // To describe one event on the level of FADC values the Class MRawEvt is 20 22 // created. It has the following data members: … … 22 24 // ---------- 23 25 // 24 // UInt_t EvtNo26 // UInt_t DAQEvtNumber 25 27 // 26 28 // This it the number of the Event in one … … 37 39 // ---------- 38 40 // 39 // U Long_t fTimeStamp41 // UInt_t AbsTime[2] 40 42 // 41 43 // Time of the event. … … 43 45 // the millenium. From that start point the time is 44 46 // measured in 200ns-count. One day for example 45 // contains 432.e9 counts. An unsigned Longis able to47 // contains 432.e9 counts. An array of two unsigned Int is able to 46 48 // contain 1.8e19 200ns-counts. This corresponds to 41.e6 47 49 // days. This should be more than the livetime of MAGIC. … … 49 51 // ---------- 50 52 // 51 // UChar_t EvtStatus 52 // 53 // Status of Event. 54 // This is a Byte (8 bit) to indicated the status of 55 // the event (Pedestal, Calibration, etc). 56 // 57 // ---------- 58 // 59 // UShort_t Trig1st 53 // UInt_t FstLvlTrigNumber 60 54 // 61 55 // Number of first level trigger … … 70 64 // ---------- 71 65 // 72 // UShort_t MultPixel 73 // 74 // Multiplicity of Pixels 75 // Each event consists of a specific number of 76 // pixels. This is the number of pixels in one event. 77 // The array of ClonesPixels (taClonesArray) is of this 78 // size. 79 // 80 // ---------- 81 // 82 // TClonesArray *Pixels 83 // 84 // Array of Pixels 66 // UInt_t SecLvlTrigNumber 67 // 68 // Number of second level trigger 69 // This member counts the number of Second Level Trigger 70 // between the last and this event. 71 // 72 // ---------- 73 // 74 // UInt_t TriggerPattern[2] 75 // 76 // Trigger Pattern used for this event 77 // Each event triggers for a particular configuration and each 78 // configuration shoul have an ID (which is not fixed yet). 79 // 80 // ---------- 81 // 82 // Byte_t TriggerType 83 // 84 // Type of Trigger. 85 // This is a Byte (8 bit) to indicated the status of 86 // the event (Normal (0), Pedestal (1), Calibration (2), etc). 87 // 88 // ---------- 89 // 90 // Byte_t AllLowGainOn 91 // 92 // Type of Trigger. 93 // This is a Byte (8 bit) to indicated if any of the pixels 94 // have a non-negligible low gain (1) or not (0) 95 // 96 // ---------- 97 // 98 // TClonesArray *Crates 99 // 100 // Array of Crates 101 // The Clones array is a list of the Crates used in one 102 // event with the information about the Crate. 103 // 104 // ---------- 105 // 106 // TClonesArray *PixelsHigh 107 // 108 // Array of Pixels for their high voltage channel 85 109 // The Clones array is a list of the Pixels used in one 86 110 // event with the information about the Pixels. 87 111 // 88 112 // 89 90 // 91 void GetFadcNoise ( UChar_t asF[] ) 113 // ---------- 114 // 115 // TClonesArray *PixelsLow 116 // 117 // Array of Pixels for their low voltage channel 118 // The Clones array is a list of the Pixels used in one 119 // event that have a significant signal in the low gain channel 120 // with the information about the Pixels. 121 // 122 // 123 124 // 125 void GetFadcNoise ( Byte_t asF[] ) 92 126 { 93 127 static TRandom Gen ; … … 95 129 for (Int_t i=0; i<FADC_SLICES; i++ ) { 96 130 Gen.Rannor(z1, z2) ; 97 asF[i] = 10 + ( UChar_t)(z1*4) ;131 asF[i] = 10 + (Byte_t)(z1*4) ; 98 132 // if (asF[i] < 0 ) asF[i] = 0 ; 99 133 } … … 108 142 // set all member to zero, init the pointer to ClonesArray, 109 143 110 EvtNo = 0 ; 111 fTimeStamp = 0 ; 112 EvtStatus = 0 ; 113 Trig1st = 0 ; 114 MultPixel = 0 ; 144 DAQEvtNumber = 0 ; 145 AbsTime[0] = AbsTime [1] = 0 ; 146 FstLvlTrigNumber = 0 ; 147 SecLvlTrigNumber = 0 ; 148 TriggerPattern[0] = TriggerPattern[1] = 0 ; 149 TriggerType = 0 ; 150 AllLowGainOn = 0 ; 115 151 116 152 // … … 120 156 // initialize the list to this global pointer 121 157 122 Pixels = new TClonesArray ("MRawPixel", 2*CAMERA_PIXELS ) ; 158 PixelsHigh = new TClonesArray ("MRawPixel", 5*CAMERA_PIXELS ) ; 159 PixelsLow = new TClonesArray ("MRawPixel", CAMERA_PIXELS ) ; 160 Crates = new TClonesArray ("MRawCrate", 25 ) ; 123 161 124 162 cout << " default constructor " << endl ; … … 130 168 // Implementation of the default destructor 131 169 // 132 delete Pixels ; 170 delete PixelsHigh ; 171 delete PixelsLow ; 172 delete Crates ; 133 173 cout << " default destructor " << endl ; 134 174 } … … 140 180 // Resets all members to zero, clear the list of Pixels 141 181 // 142 EvtNo = 0 ; 143 fTimeStamp = 0 ; 144 EvtStatus = 0 ; 145 Trig1st = 0 ; 146 MultPixel = 0 ; 147 148 Pixels->Clear() ; 182 DAQEvtNumber = 0 ; 183 AbsTime[0] = AbsTime [1] = 0 ; 184 FstLvlTrigNumber = 0 ; 185 SecLvlTrigNumber = 0 ; 186 TriggerPattern[0] = TriggerPattern[1] = 0 ; 187 TriggerType = 0 ; 188 AllLowGainOn = 0 ; 189 190 PixelsHigh->Clear() ; 191 PixelsLow->Clear() ; 192 Crates -> Clear() ; 149 193 } 150 194 … … 156 200 // 157 201 202 Int_t i = 0; 203 158 204 // Prints out the data of one Pixel 159 cout << endl << "EventNumber " << EvtNo ; 160 cout << endl << "Event Time Stamp " << fTimeStamp ; 161 cout << endl << "Event Status " << (int) EvtStatus ; 162 cout << endl << "Trigger 1. Level " << Trig1st ; 163 cout << endl << "Number of Pixels " << MultPixel ; 164 165 for (Int_t i=0 ; i<MultPixel; i++ ) { 166 ((MRawPixel *)Pixels->At(i))->Print() ; 205 cout << endl << "EventNumber " << DAQEvtNumber ; 206 cout << endl << "Event Time Stamp " << (Float_t) AbsTime[0]*4294967296 207 +AbsTime[1] ; 208 cout << endl << "Trigger 1. Level " << FstLvlTrigNumber ; 209 cout << endl << "Trigger 2. Level " << SecLvlTrigNumber ; 210 cout << endl << "Trigger Pattern " << (Float_t) TriggerPattern[0]*4294967296 211 +TriggerPattern[1] ; 212 cout << endl << "Trigger Type "; 213 switch (TriggerType){ 214 case 0: 215 cout<<" Normal Trigger "; 216 break; 217 case 1: 218 cout<<" Pedestal "; 219 break; 220 case 2: 221 cout<<" Calibration "; 222 break; 223 default: 224 cout<<TriggerType; 225 break; 167 226 } 168 } 169 170 171 void MRawEvt::FillRandom ( UInt_t uiN, ULong_t ulT, UShort_t usMuPi ) { 172 // 173 // This is neccessary to fill the MRawEvt Class with randomized FADC 174 // values. The EventNumber, EventTime and the Number of Pixels are given 175 // as parameters. 176 // 177 178 EvtNo = uiN ; 179 fTimeStamp = ulT ; 180 181 UChar_t ucA[FADC_SLICES] ; 182 183 for (UShort_t i = 0 ; i< usMuPi; i++ ) { 184 GetFadcNoise ( ucA ) ; 185 186 TClonesArray &caP = *Pixels ; 187 new ( caP[MultPixel++] ) MRawPixel((MultPixel), 0, ucA) ; 227 228 cout<<"High Voltage channel"<<endl; 229 while (PixelsHigh+i) { 230 ((MRawPixel *)PixelsHigh->At(i))->Print() ; 231 i++; 188 232 } 189 } 190 191 void MRawEvt::FillHeader ( UInt_t uiN, ULong_t ulT, UChar_t ucSta ) { 233 cout<<"Low Voltage channel"<<endl; 234 while (PixelsLow+i) { 235 ((MRawPixel *)PixelsLow->At(i))->Print() ; 236 i++; 237 } 238 } 239 240 void MRawEvt::FillHeader ( UInt_t uiN, Float_t ulT, Float_t ulTP ) { 192 241 193 EvtNo = uiN ; 194 fTimeStamp = ulT ; 195 196 EvtStatus = ucSta ; 197 Trig1st = 0 ; 198 MultPixel = 0 ; 199 200 Pixels->Clear() ; 201 } 202 203 void MRawEvt::FillPixel ( UShort_t uiPix, Float_t *array ) { 242 DAQEvtNumber = uiN ; 243 AbsTime[0] = (UInt_t) (ulT/4294967296) ; 244 AbsTime[1] = (UInt_t) (ulT-AbsTime[0]*4294967296) ; 245 TriggerPattern[0] = (UInt_t) (ulTP/4294967296) ; 246 TriggerPattern[1] = (UInt_t) (ulTP-TriggerPattern[0]*4294967296) ; 247 248 } 249 250 void MRawEvt::FillPixel ( Short_t siPix, UShort_t *MultPixel, Float_t *array ) { 204 251 // 205 252 // This is to fill the data of one pixel to the MRawEvt Class. … … 207 254 // 208 255 209 UChar_t ucA[FADC_SLICES] ; 210 211 for (UShort_t i = 0 ; i< FADC_SLICES ; i++ ) { 212 ucA[i] = (UShort_t) array[i] ; 256 Int_t i = 0; 257 Byte_t ucA[FADC_SLICES] ; 258 259 for(i=0;i<FADC_SLICES;i++){ 260 ucA[i] = (Byte_t) array[i] ; 213 261 } 214 262 215 TClonesArray &caP = *Pixels ; 216 new ( caP[MultPixel++] ) MRawPixel((uiPix), 0, ucA) ; 217 } 218 219 void MRawEvt::FillMontCarl ( UInt_t uiN, ULong_t ulT, Float_t *array ) { 220 // 221 // This is neccessary to fill the MRawEvt Class with randomized FADC 222 // values. The EventNumber, EventTime and the Number of Pixels are given 223 // as parameters. 263 TClonesArray &caP = *PixelsHigh ; 264 new ( caP[(*(MultPixel))++] ) MRawPixel((siPix), ucA) ; 265 } 266 267 void MRawEvt::FillPixelLow ( Short_t siPix, UShort_t *MultPixel, Float_t *array ) { 268 // 269 // This is to fill the data of one pixel to the MRawEvt Class. 270 // The parameters are the pixelnumber and the FADC_SLICES values of ADCs 224 271 // 225 272 226 EvtNo = uiN ; 227 fTimeStamp = ulT ; 228 229 MultPixel = 0 ; 230 231 UChar_t ucA[FADC_SLICES] ; 232 233 for (UShort_t i = 0 ; i< CAMERA_PIXELS; i++ ) { 234 235 if ( array[i] > 0. ) { 236 for ( Int_t ii = 0 ; ii < FADC_SLICES ; ii++ ) { 237 ucA[ii] = 0 ; 238 } 239 ucA[5] = (UShort_t) (array[i]) ; 240 241 TClonesArray &caP = *Pixels ; 242 new ( caP[MultPixel++] ) MRawPixel(i, 0, ucA) ; 243 } 244 } 245 } 246 247 UShort_t MRawEvt::GetMultPixel() { 248 // 249 // returns the pixel multiplicity of the Event 250 // 251 return MultPixel; 252 } 253 273 Int_t i = 0; 274 Byte_t ucA[FADC_SLICES] ; 275 276 for(i=0;i<FADC_SLICES;i++){ 277 ucA[i] = (Byte_t) array[i] ; 278 } 279 280 TClonesArray &caP = *PixelsLow ; 281 new ( caP[(*(MultPixel))++] ) MRawPixel((siPix), ucA) ; 282 } 283 284 UShort_t MRawEvt::GetMultPixel(){ 285 // 286 // returns the number of pixells which are already in the list 287 // 288 289 UShort_t i =0; 290 while(PixelsHigh+i) i++; 291 return (i); 292 } 254 293 255 294 // void MRawEvt::AddPixel ( UShort_t usP ) { … … 261 300 // } 262 301 263 // void MRawEvt::AddPixel ( UShort_t usP, UChar_t ucStat, UChar_t ausAR[] ) {302 // void MRawEvt::AddPixel ( UShort_t usP, UChar_t ucStat, Byte_t ausAR[] ) { 264 303 // cout << " need implementation 2 " << endl ; 265 304 // } 266 267 268 -
trunk/MagicSoft/include-Classes/MRawEvt.h
r422 r434 11 11 12 12 private: 13 UInt_t EvtNo ;// Number of Event13 UInt_t DAQEvtNumber ; // Number of Event 14 14 15 ULong_t fTimeStamp ; // Time of the Event 16 17 UChar_t EvtStatus ; // Status of this event (DAQ, Pedestal, ..) 15 UInt_t AbsTime[2] ; // Time of the Event 18 16 19 U Short_t Trig1st; // Number of 1st level tiggers between 2 events17 UInt_t FstLvlTrigNumber ; // Number of 1st level tiggers between 2 events 20 18 21 U Short_t MultPixel ; // Multiplicity of the Pixels in this event19 UInt_t SecLvlTrigNumber ; // Number of 2nd level tiggers between 2 events 22 20 23 TClonesArray *Pixels ; // list of the events 21 UInt_t TriggerPattern[2] ; // Trigger configuration 22 23 Byte_t TriggerType ; // Normal trigger 0, pedestal 1, calibration 2 24 25 Byte_t AllLowGainOn ; // Flag indicating if any of the pixels have a 26 // non-negligible low gain signal (1) or not (0) 27 28 TClonesArray *Crates ; // list of crates 29 30 TClonesArray *PixelsHigh ; // list of the events for the 31 // high gain channel 32 33 TClonesArray *PixelsLow ; // list of the events for the low gain 34 // channel if it has signifcant signal 24 35 25 36 public: … … 33 44 void Print() ; 34 45 35 void Fill Random( UInt_t, ULong_t, UShort_t) ;46 void FillHeader( UInt_t, Float_t, Float_t = 0 ) ; 36 47 37 void FillHeader( UInt_t, ULong_t, UChar_t = 0 ) ; 38 39 void FillPixel( UShort_t, Float_t * ) ; 48 void FillPixel(Short_t, UShort_t *, Float_t * ) ; 40 49 41 void Fill MontCarl ( UInt_t, ULong_t, Float_t * ) ;50 void FillPixelLow(Short_t, UShort_t *, Float_t * ) ; 42 51 43 52 UShort_t GetMultPixel(); 44 45 UShort_t GetPixelId( Int_t )46 {return 1 ) ;47 53 48 54 TClonesArray *&GetPixelList() { … … 50 56 // returns a Pointer to the pixel list 51 57 // 52 return Pixels ;58 return PixelsHigh ; 53 59 } 54 60 55 61 ULong_t GetTimeStamp() { 56 return fTimeStamp;62 return (ULong_t) AbsTime[0]*4294967296+AbsTime[1]; 57 63 } 58 64 59 65 60 /* void AddPixel( UShort_t ) ; */66 /* void AddPixel( Short_t ) ; */ 61 67 62 /* void AddPixel ( UShort_t, UChar_t, UChar_t * ) ; */68 /* void AddPixel ( Short_t, Byte_t, Byte_t * ) ; */ 63 69 64 70 … … 68 74 69 75 #endif 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 -
trunk/MagicSoft/include-Classes/MRawPixel.cxx
r371 r434 1 1 #include <iostream.h> 2 2 3 #include "TClonesArray.h"4 3 #include "TString.h" 5 4 #include "TRandom.h" … … 26 25 // --------- 27 26 // 28 // UShort_t PixelId ;27 // Short_t PixelId ; 29 28 // 30 29 // This is to identify the Pixel. … … 35 34 // low-gain-branch of the Fadc´s only if there is a signal in. Then the 36 35 // PixelId is: 37 // PixelId = 10000 + PixelId . 36 // PixelId = - PixelId . 37 // if there is an entry in the low gain list. 38 38 // 39 // For the high gainFadc values the rule is:39 // Otherwise Fadc values the rule is: 40 40 // PixelId = PixelId . 41 41 // … … 43 43 // --------- 44 44 // 45 // UChar_t PixelStatus ; 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 PixelStatus. etc 50 // 51 // --------- 52 // 53 // UChar_t Fadc[ FADC_SLICES ] ; 45 // Byte_t FADCSamples[FADC_SLICES] ; 54 46 // 55 47 // The values of FADC_SLICES fadc-slices. This is the information of the 56 48 // measured ADC values for one branch (high gain or low gain). The typ of 57 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 58 51 59 52 ClassImp(MRawPixel) … … 66 59 // 67 60 68 69 PixelStatus = 0 ; 70 71 for (Int_t i = 0; i<FADC_SLICES; i++)72 Fadc[i] = 0 ; 61 PixelId = 0 ; 62 63 for (Int_t i = 0; i<FADC_SLICES; i++) 64 FADCSamples[i] = 0 ; 65 73 66 } 74 67 75 68 76 MRawPixel::MRawPixel( UShort_t PId) {69 MRawPixel::MRawPixel(Short_t PId) { 77 70 // 78 71 // constructor II overloaded … … 81 74 82 75 PixelId = PId ; 83 PixelStatus = 0 ;84 85 76 for (Int_t i = 0; i<FADC_SLICES; i++) 86 Fadc[i] = 0 ; 77 FADCSamples[i] = 0 ; 78 87 79 } 88 80 89 81 90 MRawPixel::MRawPixel( UShort_t usPId, UChar_t ucSt, UChar_t ucF[]) {82 MRawPixel::MRawPixel(Short_t usPId, Byte_t ucF[]) { 91 83 // 92 84 // constructor III overloaded 93 85 // 94 // parameters are PixelId , Status and an array with Fadc numbers.86 // parameters are PixelId and an array with Fadc values. 95 87 96 88 PixelId = usPId ; 97 PixelStatus = ucSt ;98 89 99 for (Int_t i = 0; i<FADC_SLICES; i++)100 F adc[i] = ucF[i] ;90 for (Int_t i = 0; i<FADC_SLICES; i++) 91 FADCSamples[i] = ucF[i] ; 101 92 } 93 102 94 MRawPixel::~MRawPixel(){ 103 95 // … … 111 103 // 112 104 PixelId = 0 ; 113 PixelStatus = 0 ; 114 115 for (Int_t i = 0; i<FADC_SLICES; i++)116 Fadc[i] = 0 ;105 106 for (Int_t i=0;i<FADC_SLICES; i++){ 107 FADCSamples[i] = 0; 108 } 117 109 } 118 119 110 120 111 void MRawPixel::Print() … … 125 116 126 117 cout << endl << "PixId " << PixelId ; 127 cout << " Stat " << (Int_t) PixelStatus << " --> " ;128 118 129 119 for (Int_t i=0 ; i<FADC_SLICES ; i++ ) { 130 cout<<" / " << (int) Fadc[i];120 cout<<" / " << FADCSamples[i]; 131 121 } 132 122 } 133 134 UShort_t MRawPixel::GetPixelId() { 123 124 void 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 137 Short_t MRawPixel::GetPixelId() { 135 138 // 136 139 // returns back the PixelId of the Pixel … … 139 142 } 140 143 141 UChar_t MRawPixel::GetFadcSlice( Int_t iSli ) {144 Byte_t MRawPixel::GetFadcSlice( Int_t iSli ) { 142 145 // 143 146 // returns back the fadc content of the slice iSli 144 147 // 145 return ( Fadc[iSli] ) ; 148 149 return (FADCSamples[iSli]) ; 146 150 } 147 148 149 150 151 152 -
trunk/MagicSoft/include-Classes/MRawPixel.h
r371 r434 13 13 private: 14 14 15 UShort_t PixelId ; // Identification of PixelNumber and gain branch 15 Short_t PixelId ; // Identification of PixelNumber and 16 // flag for existency of low gain branch 16 17 17 UChar_t PixelStatus ; // The Status of the pixel 18 19 UChar_t Fadc[ FADC_SLICES ] ; // The values of fadc-slices. 18 Byte_t FADCSamples[FADC_SLICES] ; // The values of fadc-slices. 20 19 21 20 public: … … 23 22 MRawPixel() ; 24 23 25 MRawPixel( UShort_t ) ;24 MRawPixel(Short_t ) ; 26 25 27 MRawPixel( UShort_t , UChar_t , UChar_t* ) ;26 MRawPixel(Short_t , Byte_t* ) ; 28 27 29 28 ~MRawPixel() ; … … 33 32 void Print() ; 34 33 35 UShort_t GetPixelId() ;34 void FillPixel( Short_t, Byte_t *); 36 35 37 UChar_t GetFadcSlice( Int_t ) ; 36 Short_t GetPixelId() ; 37 38 Byte_t GetFadcSlice( Int_t ) ; 38 39 39 40 ClassDef ( MRawPixel, 1 )
Note:
See TracChangeset
for help on using the changeset viewer.