- Timestamp:
- 03/05/01 10:52:18 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
r637 r677 93 93 } 94 94 95 MFadc::MFadc(Float_t ampl, Float_t fwhm) { 96 // 97 // Constructor overloaded II 98 // 99 // The procedure is the following: 100 // 1. some parameters of the trigger are set to default. 101 // this parameters of the trigger may be changed 102 // 3. Then the all signals are set to zero 103 104 fwhm_resp = fwhm ; 105 ampl_resp = ampl ; 106 107 // 108 // set up the response shape 109 // 110 Int_t i,j ; 111 112 Float_t sigma ; 113 Float_t x, x0 ; 114 115 sigma = fwhm_resp / 2.35 ; 116 x0 = 3*sigma ; 117 118 Float_t dX, dX2 ; 119 120 dX = WIDTH_FADC_TIMESLICE / SUBBINS ; 121 dX2 = dX/2. ; 122 123 for (i=0; i< RESPONSE_SLICES_MFADC ; i++ ) { 124 125 x = i * dX + dX2 ; 126 127 // 128 // the value 0.125 was introduced to normalize the things 129 // 130 sing_resp[i] = 0.125 * 131 ampl_resp * expf(-0.5 * (x-x0)*(x-x0) / (sigma*sigma) ) ; 132 133 } 134 135 // 136 // init the Random Generator for Electonic Noise 137 // 138 139 GenElec = new TRandom () ; 140 141 // 142 // set all the booleans used to FALSE, indicating that the pixel is not 143 // used in this event. 144 // 145 146 for ( i =0 ; i <CAMERA_PIXELS ; i++ ) { 147 used [i] = FALSE ; 148 } 149 150 // 151 // set all pedestals to 0 152 // 153 154 for ( i =0 ; i <CAMERA_PIXELS ; i++ ) { 155 pedestal[i] = 0 ; 156 } 157 158 // 159 // set tha values of FADC slices that would be read after trigger to zero 160 // 161 162 for (i=0; i <CAMERA_PIXELS; i++){ 163 for (j=0; j<FADC_SLICES;j++){ 164 output[i][j]=0; 165 } 166 } 167 168 } 95 169 96 170 void MFadc::Reset() { … … 208 282 for ( i = 0 ; i<SLICES_MFADC; i++ ) { 209 283 sig[iPix][i] = resp[i] ; 284 } 285 286 } 287 288 void MFadc::AddSignal( Int_t iPix, Float_t resp[(Int_t) SLICES_MFADC]) { 289 290 // 291 // Adds signals to the fadc reponse from a given array 292 // 293 // parameter is the number of the pixel and the values to be added 294 // 295 // 296 297 Int_t i ; 298 299 // 300 // first we have to check if the pixel iPix is used or not until now 301 // if this is the first use, reset all signal for that pixels 302 // 303 if ( iPix > CAMERA_PIXELS ) { 304 cout << " WARNING: MFadc::Fill() : iPix greater than CAMERA_PIXELS" 305 << endl ; 306 exit(987) ; 307 } 308 309 if ( used[iPix] == FALSE ) { 310 used [iPix] = TRUE ; 311 312 for (i=0; i < SLICES_MFADC; i++ ) { 313 sig[iPix][i] = 0. ; 314 } 315 } 316 for ( i = 0 ; i<SLICES_MFADC; i++ ) { 317 sig[iPix][i] += resp[i] ; 210 318 } 211 319 … … 405 513 } 406 514 } 515 407 516 void MFadc::GetResponse( Float_t *resp ) { 408 517 // ============================================================ … … 415 524 } 416 525 } 417 526 527 void MFadc::GetPedestals( UChar_t *offset) { 528 // ============================================================ 529 // 530 // puts the standard response function into the array resp 531 532 for ( Int_t i=0; i< CAMERA_PIXELS; i++ ) { 533 534 offset[i] = pedestal[i] ; 535 } 536 } 537 418 538 void MFadc::TriggeredFadc(Float_t time) { 419 539
Note:
See TracChangeset
for help on using the changeset viewer.