Ignore:
Timestamp:
09/09/04 16:55:42 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc

    r4766 r4896  
    9999
    100100  const Byte_t windowhi = hilast-hifirst+1;
    101   const Byte_t windowlo = lolast-lofirst+1;
    102  
    103101  const Byte_t whieven = windowhi & ~1;
    104   const Byte_t wloeven = windowlo & ~1;
    105102
    106103  if (whieven != windowhi)
     
    112109    }
    113110 
    114   if (wloeven != windowlo)
    115     {
    116       *fLog << warn << GetDescriptor()
    117             << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from "
    118                     ,(int)lolast," to ",(int)(lolast-1)) << endl;
    119       lolast -= 1;
    120     }
    121  
    122111  if (whieven<2)
    123112    {
     
    128117    }
    129118 
    130   if (wloeven<2)
    131     {
    132       *fLog << warn << GetDescriptor()
     119
     120  if (lolast != 0)
     121    {
     122      const Byte_t windowlo = lolast-lofirst+1;
     123      const Byte_t wloeven = windowlo & ~1;
     124
     125      if (wloeven != windowlo)
     126        {
     127          *fLog << warn << GetDescriptor()
     128                << Form("%s%2i%s%2i",": Lo Gain window size has to be even, set last slice from "
     129                        ,(int)lolast," to ",(int)(lolast-1)) << endl;
     130          lolast -= 1;
     131        }
     132     
     133      if (wloeven<2)
     134        {
     135          *fLog << warn << GetDescriptor()
    133136            << Form("%s%2i%s%2i",": Lo Gain window is smaller than 2 FADC sampes, set last slice from"
    134137                    ,(int)lolast," to ",(int)(lofirst+1)) << endl;
    135       lolast = lofirst+1;       
    136     }
    137 
     138          lolast = lofirst+1;       
     139        }
     140    }
    138141
    139142  MExtractor::SetRange(hifirst,hilast,lofirst,lolast);
    140143
    141144  fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1);
    142   fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 
     145  if (fLoGainLast != 0)
     146    fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 
     147  else
     148    fNumLoGainSamples = 0.;
    143149
    144150  fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
     
    166172  *fLog << inf << GetDescriptor() << ": Taking " << fNumHiGainSamples
    167173        << " HiGain samples from slice " << (Int_t)fHiGainFirst
    168         << " to " << (Int_t)(fHiGainLast+fHiLoLast) << "incl" << endl;
     174        << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl;
    169175  *fLog << inf << GetDescriptor() << ": Taking " << fNumLoGainSamples
    170176        << " LoGain samples from slice " << (Int_t)fLoGainFirst
    171         << " to " << (Int_t)fLoGainLast << "incl" << endl;
     177        << " to " << (Int_t)fLoGainLast << " incl" << endl;
    172178  return kTRUE;
    173179 
Note: See TracChangeset for help on using the changeset viewer.