Ignore:
Timestamp:
08/04/06 10:16:57 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7832 r7844  
    179179
    180180  while (pixel.Next())
    181     {
     181  {
     182      // COPY HERE PRODUCING ARRAY WITH SAMPLES
     183
     184      /*
     185       const MPedestalPix  &ped = (*fPedestals)[pixidx];
     186
     187       const Float_t pedes  = ped.GetPedestal();
     188       const Float_t ABoffs = ped.GetPedestalABoffset();
     189
     190       const Float_t pedmean[2] = { pedes + ABoffs, pedes - ABoffs };
     191
     192       const Int_t num = pixel.GetNumHiGainSamples()+pixel.GetNumLoGainSamples();
     193
     194       MArrayF sample(num);
     195
     196       const Int_t abflag = pixel.HasABFlag() ? 1 : 0;
     197       const Int_t ids0 = fHiGainFirst + abflag;
     198
     199       Int_t ids  = ids0;
     200
     201       Float_t  null   = 0;      // Starting value for maxpos
     202       Float_t *maxpos = &null;  // Position of maximum
     203       Float_t *sat1   = 0;      // First saturating slice
     204       Float_t *sat2   = 0;      // Last saturating slice
     205
     206       const Float_t *beg = sample.GetArray();
     207       const Float_t *end = beg + num;
     208
     209       Float_t *ptr = beg;
     210       while (ptr<end)
     211       {
     212          *sample++ = (Float_t)*ptr - pedmean[ids++&0x1];
     213
     214          // This extraction must be done independant for lo- and hi-gain
     215          // if (*ptr > *maxpos)
     216          //     maxpos = ptr;
     217          //
     218          // if (*ptr >= fSaturationLimit)
     219          // {
     220          //    sat2 = ptr;
     221          //    if (!sat1)
     222          //       sat1 = ptr;
     223          // }
     224          //
     225          // ptr++;
     226        }
     227       */
     228
    182229      //
    183230      // Find signal in hi- and lo-gain
     
    210257      // Adapt the low-gain extraction range from the obtained high-gain time
    211258      //
    212       if (pixel.HasLoGain() && (fMaxBinContent > fLoGainSwitch) )
     259
     260      // IN THIS CASE THE PIXEL SHOULD BE MARKED BAD!!!!
     261      // MEANS: Hi gain has saturated, but it is too early to extract
     262      // the lo-gain properly
     263      // THIS produces pulse positions ~= -1
     264      // The signal might be handled in MCalibrateData, but hwat's about
     265      // the arrival times in MCalibrateRelTime
     266      if (sathi && fMaxBinContent<=fLoGainSwitch)
     267          deltasumlo=deltasumhi=deltatimelo=deltatimehi=-1;
     268
     269      // FIXME: What to do with the pixel if it saturates too early???
     270      if (pixel.HasLoGain() && (fMaxBinContent > fLoGainSwitch /*|| sathi>0*/) )
    213271      {
    214272          deltasumlo  = 0; // make logain of MExtractedSignalPix valid
     
    217275          fLoGainFirstSave = fLoGainFirst;
    218276
    219           const Float_t pos = sathi==0 ? timehi : sathi;
     277          // sathi is the number (not index!) of the first saturating slice
     278          // 0 indicates that no saturation was found
     279          // FIMXME: Is 3 an accurate value?
     280
     281          const Float_t pos = sathi==0 ? timehi : (int)(sathi)-3;
    220282
    221283          if (pos>-fLoGainStartShift)
     
    225287              fLoGainFirst = fLoGainFirstSave;
    226288
    227           if ( fLoGainFirst <= fLoGainLast-fWindowSizeLoGain)
     289          if (fLoGainFirst <= fLoGainLast-fWindowSizeLoGain)
    228290          {
    229291              const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1;
Note: See TracChangeset for help on using the changeset viewer.