Changeset 7844 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
08/04/06 10:16:57 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7842 r7844  
    4141     - allow to setup different password for differend users and different
    4242       users for different databases in sql.rc
     43
     44   * mcalib/MCalibrateRelTimes.cc:
     45     - implemented a workaround to mark pixels bad for extraction of
     46       hi- and lo-gain failed. (Before MCalibrateData just assigned
     47       a weird value)
     48
     49   * msignal/MArrivalTimePix.h:
     50     - added some member functions
     51
     52   * msignal/MExtractTimeAndCharge.cc:
     53     - added some comments which contain future code
     54     - invalidate hi- and lo-gain if both could not be extracted properly
     55       (FIXME: We need a cut on the number of unsuitable pixels per event)
     56     - changed handling of sathi to make the detection of hi-gain
     57       saturation work properly
     58
     59   * msignal/MExtractTimeAndChargeDigitalFilter.cc:
     60     - changed fgLoGainOffset from 1.05 to 0.95 (comming out of the
     61       latest plots)
     62     - fixed assignment of sat in hi-gain extraction to make sure
     63       the the satuartion information can be returned properly
     64
     65   * msignal/MExtractTimeAndChargeSpline.cc:
     66     - changed fgLoGainStartShift according to BCN cvs to -2.4 (FIXME
     67       this should be checked!)
     68     - adapted handling of sat in hi-gain extraction to changes
     69       above
    4370
    4471
  • 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;
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r7832 r7844  
    2424!
    2525\* ======================================================================== */
     26
    2627//////////////////////////////////////////////////////////////////////////////
    2728//
     
    8889const Int_t  MExtractTimeAndChargeDigitalFilter::fgSignalStartBinHiGain    =  4;
    8990const Int_t  MExtractTimeAndChargeDigitalFilter::fgSignalStartBinLoGain    =  4;
    90 const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain           =  1.05;
     91const Float_t MExtractTimeAndChargeDigitalFilter::fgOffsetLoGain           =  0.95;
    9192const Float_t MExtractTimeAndChargeDigitalFilter::fgLoGainStartShift       = -1.8;
    9293
     
    329330  const Byte_t *end = ptr + range;
    330331  Byte_t *p     = ptr;
    331   Byte_t maxpos = 0;
    332332
    333333  //
     
    352352      if (*p > fMaxBinContent)
    353353        {
    354           maxpos = p-ptr;
     354          Byte_t maxpos = p-ptr;
     355
     356          // range-fWindowSizeHiGain+1 == fHiLoLast isn't it?
    355357          if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1))
    356358            fMaxBinContent = *p;
     
    359361      if (*p++ >= fSaturationLimit)
    360362        if (!sat)
    361           sat = ids-3;
     363          sat = ids-fHiGainFirst;
    362364    }
    363365
     
    391393          if (*logain++ >= fSaturationLimit)
    392394            if (!sat)
    393               sat = ids-3;
     395              sat = ids-fHiGainFirst;
    394396        }
    395397    }
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r7188 r7844  
    160160const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch    = 1.5;
    161161const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain     = 1.39;  // 5 ns
    162 const Float_t MExtractTimeAndChargeSpline::fgLoGainStartShift = -1.8; 
     162const Float_t MExtractTimeAndChargeSpline::fgLoGainStartShift = -2.4;
    163163
    164164// --------------------------------------------------------------------------
     
    404404      if (*p++ >= fSaturationLimit)
    405405        if (!sat)
    406           sat = ids-3;
     406          sat = ids-fHiGainFirst;
    407407     
    408408    }
     
    426426          if (*logain++ >= fSaturationLimit)
    427427            if (!sat)
    428               sat = ids-3;
     428              sat = ids-fHiGainFirst;
    429429
    430430          range++;
Note: See TracChangeset for help on using the changeset viewer.