Ignore:
Timestamp:
12/11/03 17:11:34 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.