Changeset 2767 for trunk/MagicSoft


Ignore:
Timestamp:
01/12/04 10:37:11 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2766 r2767  
    99    - replace logainshift by two independent variables:
    1010      logainfirst, logainlast
     11    - because in most data, maximum occurs in slice 4, shift default
     12      from slices 4-9 to slices 3-8.
    1113
    1214
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2728 r2767  
    5656// Default constructor.
    5757//
    58 MExtractSignal::MExtractSignal(/*const Byte_t first, const Byte_t last, const Byte_t logainshift,*/
    59                     const char *name, const char *title)
    60   : /*fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1),*/
    61     fSaturationLimit(254)
     58MExtractSignal::MExtractSignal(const char *name, const char *title)
     59  : fSaturationLimit(254)
    6260{
    6361
     
    6866
    6967    SetRange();
    70     /*
    71      fFirst       = first;
    72      fLoGainFirst = first+logainshift;
    73 
    74      fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
    75      fSqrtLoGainSamples = TMath::Sqrt((Float_t)fNumLoGainSamples);
    76      */
    77 }
    78 
    79 void MExtractSignal::SetRange(Byte_t first, Byte_t last, Byte_t logainshift)
    80 {
    81     fNumHiGainSamples = last-first+1;
    82     fNumLoGainSamples = last-first+1;
    83 
    84     fFirst       = first;
    85     fLoGainFirst = first+logainshift;
     68}
     69
     70void MExtractSignal::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast)
     71{
     72
     73    fNumHiGainSamples = hilast-hifirst+1;
     74    fNumLoGainSamples = lolast-lofirst+1;
     75
     76    fHiGainFirst = hifirst;
     77    fLoGainFirst = lofirst;
    8678
    8779    fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
     
    144136    fSignals->InitSize(cam->GetNumPixels());   
    145137
    146     fSignals->SetNumUsedFADCSlices(fNumHiGainSamples, fFirst, fFirst+fNumHiGainSamples-1,
    147                                    fNumLoGainSamples, fFirst, fFirst+fNumLoGainSamples-1);
     138    fSignals->SetNumUsedFADCSlices(fNumHiGainSamples, fHiGainFirst, fHiGainFirst+fNumHiGainSamples-1,
     139                                   fNumLoGainSamples, fLoGainFirst, fLoGainFirst+fNumLoGainSamples-1);
    148140
    149141    return kTRUE;
     
    167159
    168160        Byte_t *ptr   = pixel.GetHiGainSamples();
    169         Byte_t *first = ptr + fFirst;
    170         Byte_t *last  = ptr + fFirst + fNumHiGainSamples;
     161        Byte_t *first = ptr + fHiGainFirst;
     162        Byte_t *last  = ptr + fHiGainFirst + fNumHiGainSamples;
    171163
    172164        UInt_t  sumHi   = 0;
     
    200192
    201193        ptr   = pixel.GetLoGainSamples();
    202         first = ptr + fLoGainFirst + 1;
    203         last  = ptr + fLoGainFirst + fNumLoGainSamples +1;
     194        first = ptr + fLoGainFirst;
     195        last  = ptr + fLoGainFirst + fNumLoGainSamples;
    204196        Byte_t maxlo  = 0;
    205197        Byte_t midlo  = 0;
     
    228220                               pedrms*fSqrtHiGainSamples,
    229221                               ((Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples),
    230                                pedrms*fSqrtLoGainSamples
    231                                );
     222                               pedrms*fSqrtLoGainSamples);
    232223
    233224        pix.SetGainSaturation(satHi, satHi, satLo);
     
    235226        // FIXME: Arrival time has to be stored in MArrivalTime!
    236227        if (satHi)
    237           pix.SetArrivalTimes((Float_t)(midlo+fFirst),0.,0.);
     228          pix.SetArrivalTimes((Float_t)(midlo+fLoGainFirst),0.,0.);
    238229        else
    239           pix.SetArrivalTimes((Float_t)(midhi+fLoGainFirst),0.,0.);
     230          pix.SetArrivalTimes((Float_t)(midhi+fHiGainFirst),0.,0.);
    240231
    241232      } /* while (pixel.Next()) */
Note: See TracChangeset for help on using the changeset viewer.