Changeset 637 for trunk/MagicSoft/Simulation/Detector/include-MFadc
- Timestamp:
- 02/23/01 10:43:46 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
r579 r637 74 74 75 75 // 76 // set all pedestals to 0 77 // 78 79 for ( i =0 ; i <CAMERA_PIXELS ; i++ ) { 80 pedestal[i] = 0 ; 81 } 82 83 // 76 84 // set tha values of FADC slices that would be read after trigger to zero 77 85 // … … 105 113 } 106 114 } 107 108 115 109 116 void MFadc::Fill( Int_t iPix, Float_t time, Float_t amplitude ) { … … 171 178 } 172 179 180 void MFadc::Set( Int_t iPix, Float_t resp[(Int_t) SLICES_MFADC]) { 181 182 // 183 // Sets the information about fadc reponse from a given array 184 // 185 // parameter is the number of the pixel and the values to be set 186 // 187 // 188 189 Int_t i ; 190 191 // 192 // first we have to check if the pixel iPix is used or not until now 193 // if this is the first use, reset all signal for that pixels 194 // 195 if ( iPix > CAMERA_PIXELS ) { 196 cout << " WARNING: MFadc::Fill() : iPix greater than CAMERA_PIXELS" 197 << endl ; 198 exit(987) ; 199 } 200 201 if ( used[iPix] == FALSE ) { 202 used [iPix] = TRUE ; 203 204 for (i=0; i < SLICES_MFADC; i++ ) { 205 sig[iPix][i] = 0. ; 206 } 207 } 208 for ( i = 0 ; i<SLICES_MFADC; i++ ) { 209 sig[iPix][i] = resp[i] ; 210 } 211 212 } 213 214 void MFadc::SetPedestals( Int_t ped) { 215 // It sets pedestal for each pixel flat randomly dstributed between 0 and ped 216 // It uses the instance of TRandom GenElec. 217 218 Int_t i; 219 220 for(i=0;i<CAMERA_PIXELS;i++){ 221 pedestal[i]= (UChar_t)(ped* GenElec->Rndm()); 222 } 223 } 224 225 void MFadc::SetPedestals( UChar_t ped[CAMERA_PIXELS]) { 226 // It sets pedestal for each pixel from ped array 227 228 Int_t i; 229 230 for(i=0;i<CAMERA_PIXELS;i++){ 231 pedestal[i]= ped[i]; 232 } 233 } 234 235 173 236 void MFadc::Baseline(){ 174 237 // … … 188 251 } 189 252 } 253 } 254 255 void MFadc::Pedestals(){ 256 // 257 // It shifts the FADC contents their pedestal values 258 // It shifts the values in the analog signal, 259 // therefore it has to be done before getting FADC output 260 // 261 262 Int_t i, j; 263 264 for(i=0;i<CAMERA_PIXELS;i++) 265 for(j=0;j<SLICES_MFADC;j++) 266 sig[i][j]+=pedestal[i]; 190 267 } 191 268 … … 368 445 i=0; 369 446 for ( Int_t is=iFirstSlice ; is < (iFirstSlice+FADC_SLICES) ; is++ ) { 370 if (is< SLICES_MFADC )447 if (is< SLICES_MFADC && sig[ip][is]>0.0) 371 448 output[ip][i++]=(UChar_t) sig[ip][is]; 372 449 else … … 451 528 } 452 529 453 Float_t MFadc::GetFadcSignal(Int_t pixel, Int_t slice){530 UChar_t MFadc::GetFadcSignal(Int_t pixel, Int_t slice){ 454 531 455 532 // It returns the analog signal for a given pixel and a given FADC
Note:
See TracChangeset
for help on using the changeset viewer.