Ignore:
Timestamp:
05/11/00 16:31:20 (24 years ago)
Author:
blanch
Message:
I introduced a member function that selects the 15 slices after Trigger.
This class still needs a big improvement.
File:
1 edited

Legend:

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

    r378 r396  
    3333  //    set up the response shape
    3434  //
    35   Int_t  i ;
     35  Int_t  i,j ;
    3636 
    3737  Float_t   sigma ;
     
    7272    used [i] = FALSE ;
    7373  }
     74
     75  //
     76  //  set tha values of FADC slices that would be read after trigger to zero
     77  //
     78 
     79  for (i=0; i <CAMERA_PIXELS; i++){
     80    for (j=0; j<FADC_SLICES;j++){
     81       output[i][j]=0;
     82    }
     83  }
     84
    7485}
    7586
     
    7990  //  set all values of the signals to zero
    8091  //
    81   Int_t  i ;
     92  Int_t  i,j ;
    8293 
    8394  for ( i =0 ; i <CAMERA_PIXELS ; i++ ) {
    8495    used [i] = FALSE ;
    8596  }
     97  //
     98  //  set tha values of FADC slices that would be read after trigger to zero
     99  //
     100 
     101  for (i=0; i <CAMERA_PIXELS; i++){
     102    for (j=0; j<FADC_SLICES;j++){
     103       output[i][j]=0;
     104    }
     105  }
    86106}
    87107
     
    158178  for ( Int_t i = 0 ; i < CAMERA_PIXELS; i++) {
    159179    if ( used [i] == TRUE ) {
    160      
    161180      for ( Int_t is=0 ; is< SLICES_MFADC ; is++ ) {
    162181
    163182        sig[i][is] += GenElec->Gaus(0., 2.) ;
     183
    164184      }
    165185    }
     
    203223  Float_t t ;
    204224
    205   t = time - 10. ; // to show also the start of the pulse before the
    206                    // the trigger time
     225  (0 > time - TIME_BEFORE_TRIGGER)? t=0: t=(time-TIME_BEFORE_TRIGGER) ; // to show also the start of the pulse before the trigger time
    207226
    208227  if ( t < 0. ) {
     
    235254}
    236255
    237 
     256void MFadc::TriggeredFadc(Float_t time) {
     257 
     258  //
     259  //    first of all we subtract from the time a offset (8 ns)
     260  //
     261 
     262  Float_t t ;
     263
     264  (0>time-TIME_BEFORE_TRIGGER)? t=0: t=(time-TIME_BEFORE_TRIGGER) ; // to show also the start of the pulse before the trigger time
     265
     266  if ( t < 0. ) {
     267    cout << " WARNING!! FROM MFADC::SCAN(t) " << endl ;
     268    exit (776) ; 
     269  }
     270
     271  //
     272  //  calculate the first slice to write out
     273  //
     274 
     275  Int_t iFirstSlice ;
     276  Int_t i;
     277
     278  iFirstSlice = (Int_t) ( t /  WIDTH_FADC_TIMESLICE ) ;
     279
     280  for ( Int_t ip=0; ip<CAMERA_PIXELS; ip++ ) {
     281   
     282    if ( used[ip] == kTRUE ) {
     283      i=0;
     284      for ( Int_t is=iFirstSlice ; is < (iFirstSlice+FADC_SLICES); is++ ) {
     285        output[ip][i++]=(UChar_t) sig[ip][is];
     286      }
     287
     288    }
     289  } 
     290}
    238291
    239292void MFadc::ShowSignal (MMcEvt *McEvt, Float_t trigTime) {
     
    310363}
    311364
    312 
    313 
     365Float_t MFadc::GetFadcSignal(Int_t pixel, Int_t slice){
     366
     367  //  It returns the analog signal for a given pixel and a given FADC
     368  //  time slice which would be read.
     369
     370  return (output[pixel][slice]);
     371}
     372
     373
Note: See TracChangeset for help on using the changeset viewer.