Changeset 2655 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/11/03 17:11:34 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r2652 r2655  
    549549    case 5:
    550550        val = Next.GetIdxMaxHiLoGainSample();
    551         break;
     551        return val >= 0;
    552552    }
    553553
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc

    r2654 r2655  
    221221// --------------------------------------------------------------------------
    222222//
    223 // Returns the index of the FADC slice the maximum signal in
     223// Returns the index of the FADC slice the maximum signal in. If the highest
     224// slices have the same value the last one is returned.
    224225//
    225226Byte_t MRawEvtPixelIter::GetIdxMaxHiGainSample() const
     
    240241// --------------------------------------------------------------------------
    241242//
    242 // Returns the index of the FADC slice the maximum signal in
    243 //
    244 Byte_t MRawEvtPixelIter::GetIdxMaxLoGainSample() const
    245 {
     243// Returns the index of the FADC slice the maximum signal in. If no lo-gains
     244// are available -1 is returned. If the highest slices have the same value the
     245// last one is returned.
     246//
     247Short_t MRawEvtPixelIter::GetIdxMaxLoGainSample() const
     248{
     249    if (!HasLoGain())
     250        return -1; // means: not found
     251
    246252    Byte_t max  = 0;
    247253    Byte_t maxi = 0;
     
    260266//
    261267// Returns the index of the maximum FADC slice from high gain at first. If
    262 // high gain is saturated it returns the low gain one. 
    263 // Att! Here the index range is from 1 to 15.
    264 // 0 means that an error occured (hi-gain saturated and no lo-gain available).
     268// high gain is saturated it returns the low gain one.
     269// If no lo-gains are existing and the hi-gains have saturating values
     270// a negative value (-1) is returned.
    265271//
    266 
    267 Byte_t MRawEvtPixelIter::GetIdxMaxHiLoGainSample() const
    268 {
    269     Byte_t maxi = 0;
    270 
    271     if (this->GetMaxHiGainSample() == 255)
    272     {
    273          if (this->HasLoGain())
    274             maxi = this->GetIdxMaxLoGainSample();
    275     }
    276     else
    277          maxi = this->GetIdxMaxHiGainSample();
    278 
    279     return maxi+1;
     272Short_t MRawEvtPixelIter::GetIdxMaxHiLoGainSample() const
     273{
     274    Byte_t max  = 0;
     275    Char_t maxi = 0;
     276
     277    for (int i=fNumHiGainSamples-1; i>=0; i--)
     278        if (fHiGainPos[i]>max)
     279        {
     280            max  = fHiGainPos[i];
     281            maxi = i;
     282        }
     283
     284    return max<0xff ? maxi : GetIdxMaxLoGainSample();
    280285}
    281286
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h

    r2649 r2655  
    8383    Float_t GetVarHiGainSamples() const;
    8484
    85     Byte_t GetIdxMaxHiGainSample() const;
    86     Byte_t GetIdxMaxLoGainSample() const;
    87     Byte_t GetMaxHiGainSample() const;
    88     Byte_t GetMaxLoGainSample() const;
    89     Byte_t GetIdxMaxHiLoGainSample() const;
     85    Byte_t  GetMaxHiGainSample() const;
     86    Byte_t  GetMaxLoGainSample() const;
     87    Byte_t  GetIdxMaxHiGainSample() const;
     88    Short_t GetIdxMaxLoGainSample() const;
     89    Short_t GetIdxMaxHiLoGainSample() const;
    9090
    9191    Bool_t HasLoGain() const
Note: See TracChangeset for help on using the changeset viewer.