Changeset 443 for trunk/MagicSoft/Simulation/Detector/include-MFadc
- Timestamp:
- 10/25/00 11:09:12 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
r396 r443 171 171 } 172 172 173 void MFadc::Baseline(){ 174 // 175 // It simulates the AC behaviour 176 177 int i,j; 178 Float_t baseline; 179 180 for(j=0;j<CAMERA_PIXELS;j++){ 181 baseline=0.0; 182 for(i=0;i<(Int_t) SLICES_MFADC;i++){ 183 baseline=+sig[j][i]; 184 } 185 baseline=baseline/SLICES_MFADC; 186 for(i=0;i<(Int_t) SLICES_MFADC;i++){ 187 sig[j][i]=-baseline; 188 } 189 } 190 } 191 192 void MFadc::Offset(Float_t offset, Int_t pixel){ 193 // 194 // It puts an offset in the FADC signal 195 // 196 197 int i,j; 198 float fdum; 199 TRandom *GenOff = new TRandom () ; 200 201 if (offset<0) { 202 // It cannot be, so the program assumes that 203 // it should generate random values for the offset. 204 205 if (pixel<0) { 206 // It does not exist, so all pixels will have the same offset 207 208 for(i=0;i<CAMERA_PIXELS;i++){ 209 if (used[i]){ 210 fdum=(10*GenOff->Rndm()); 211 for(j=0;j<(Int_t) SLICES_MFADC;j++) 212 sig[i][j]=+fdum; 213 } 214 } 215 } else { 216 // The program will put the specifies offset to the pixel "pixel". 217 218 if (used[pixel]){ 219 fdum=(10*GenOff->Rndm()); 220 for(j=0;j<(Int_t) SLICES_MFADC;j++) 221 sig[pixel][j]=+fdum; 222 } 223 224 } 225 }else { 226 // The "offset" will be the offset for the FADC 227 228 if (pixel<0) { 229 // It does not exist, so all pixels will have the same offset 230 231 for(i=0;i<CAMERA_PIXELS;i++){ 232 if (used[i]){ 233 for(j=0;j<(Int_t) SLICES_MFADC;j++) 234 sig[i][j]=+offset; 235 } 236 } 237 } else { 238 // The program will put the specifies offset to the pixel "pixel". 239 240 if (used[pixel]){ 241 for(j=0;j<(Int_t) SLICES_MFADC;j++) 242 sig[i][j]=+offset; 243 } 244 } 245 } 246 } 247 173 248 void MFadc::ElecNoise() { 174 249 // … … 282 357 if ( used[ip] == kTRUE ) { 283 358 i=0; 284 for ( Int_t is=iFirstSlice ; is < (iFirstSlice+FADC_SLICES); is++ ) { 285 output[ip][i++]=(UChar_t) sig[ip][is]; 359 for ( Int_t is=iFirstSlice ; is < (iFirstSlice+FADC_SLICES) ; is++ ) { 360 if (is< SLICES_MFADC) 361 output[ip][i++]=(UChar_t) sig[ip][is]; 362 else 363 output[ip][i++]= 0; 286 364 } 287 365
Note:
See TracChangeset
for help on using the changeset viewer.