Ignore:
Timestamp:
01/18/02 18:00:54 (23 years ago)
Author:
blanch
Message:
ElecNoise routine has been change, now the noise is added to all the
pixels and therefore all are set to used.
The digititzation has been changed. A 0.5 has been added to make a more
reasonable aproximation to the closest integer from the actual analogic
value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx

    r1066 r1200  
    328328}
    329329
    330 void MFadc::ElecNoise() {
    331   //
    332   // 
    333   //
    334  
    335   for ( Int_t i = 0 ; i < CAMERA_PIXELS; i++) {
    336     if ( used [i] == TRUE ) {
    337       for ( Int_t is=0 ; is< (Int_t)SLICES_MFADC ; is++ ) {
    338 
    339         sig[i][is] += GenElec->Gaus(0., 2.) ;
    340 
    341       }
    342     }
    343   }
     330void MFadc::ElecNoise(Float_t value) {
     331  // ============================================================
     332  //
     333  //    adds the noise due to optronic and electronic
     334  //    to the signal
     335  //
     336
     337    for ( Int_t i = 0 ; i < CAMERA_PIXELS; i++) {
     338        //
     339        //  but at the beginning we must check if this pixel is
     340        //  hitted the first time
     341        //
     342        if ( used[i] == FALSE ) {
     343            used [i] = TRUE ;
     344           
     345            for (Int_t ii=0; ii < (Int_t)SLICES_MFADC; ii++ ) {
     346                sig[i][ii] = 0. ;
     347            }
     348        }
     349        //     
     350        //  Then the noise is introduced for each time slice
     351        //
     352        for ( Int_t is=0 ; is< (Int_t)SLICES_MFADC ; is++ ) {
     353           
     354            sig[i][is] += GenElec->Gaus(0., value) ;
     355           
     356        }
     357       
     358    }
    344359}
    345360
     
    463478      for ( Int_t is=iFirstSlice ; is < (iFirstSlice+FADC_SLICES) ; is++ ) {
    464479        if (is< (Int_t)SLICES_MFADC && sig[ip][is]>0.0)
    465           output[ip][i++]=(UChar_t) sig[ip][is];
     480          output[ip][i++]=(UChar_t) (sig[ip][is]+0.5);
    466481        else
    467482          output[ip][i++]= 0;
Note: See TracChangeset for help on using the changeset viewer.