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

Legend:

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

    r7842 r7876  
    128128        idx++;
    129129
    130         if (!pix->IsValid())
     130        if (!pix->IsArrivalTimeValid())
    131131            continue;
    132132
     
    147147    case 0:
    148148        val = pix.GetArrivalTimeHiGain();
    149         return pix.IsHiGainValid();
     149        return pix.IsHiGainValid() && !pix.IsHiGainSaturated();
    150150
    151151    case 1:
     
    155155    case 2:
    156156        val = pix.GetArrivalTimeLoGain();
    157         return pix.IsLoGainValid();
     157        return pix.IsLoGainValid() && !pix.IsLoGainSaturated();
    158158
    159159    case 3:
     
    164164    case 6:
    165165        val = pix.GetArrivalTime();
    166         return pix.IsValid();
     166        return pix.IsArrivalTimeValid();
    167167
    168168        // This is for the case the signal has been
    169169        // extracted from lo- and hi-gain
    170170    case 7:
     171        // Lo- and hi-gain must be successfully extracted
    171172        if (!pix.IsLoGainValid() || !pix.IsHiGainValid())
     173            return kFALSE;
     174
     175        // Lo- and hi-gain must not be saturated
     176        if (pix.IsLoGainSaturated() || pix.IsHiGainSaturated())
    172177            return kFALSE;
    173178
    174179        val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain();
    175180
    176         if (pix.GetArrivalTimeHiGain()<3 || pix.GetArrivalTimeHiGain()>12 ||
    177             pix.GetArrivalTimeLoGain()<3 || pix.GetArrivalTimeLoGain()>12)
    178             return kFALSE;
     181//        if (pix.GetArrivalTimeHiGain()<3 || pix.GetArrivalTimeHiGain()>12 ||
     182//            pix.GetArrivalTimeLoGain()<3 || pix.GetArrivalTimeLoGain()>12)
     183//            return kFALSE;
    179184
    180185        val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain();
  • trunk/MagicSoft/Mars/msignal/MArrivalTimePix.cc

    r7810 r7876  
    9090}
    9191
    92 Bool_t MArrivalTimePix::IsValid() const
     92Float_t MArrivalTimePix::GetArrivalTime() const
    9393{
    94     return (!IsLoGainUsed() && fArrivalTimeHiGainError >= 0) || (IsLoGainUsed() && fArrivalTimeLoGainError >= 0);
     94    // If hi-gain is not saturated and has successfully been
     95    // extracted use the hi-gain arrival time
     96    if (!IsHiGainSaturated() && IsHiGainValid())
     97        return GetArrivalTimeHiGain();
     98
     99    // If hi-gain could not be used ans the lo-gain could
     100    // not be extracted return
     101    if (!IsLoGainValid())
     102        return 0;
     103
     104    // in all other cases use the lo-gain arrival time
     105    return GetArrivalTimeLoGain();
     106}
     107
     108Bool_t MArrivalTimePix::IsArrivalTimeValid() const
     109{
     110    // If hi-gain is not saturated and has successfully been
     111    // extracted use the hi-gain arrival time
     112    if (!IsHiGainSaturated() && IsHiGainValid())
     113        return kTRUE;
     114
     115    // If hi-gain could not be used ans the lo-gain could
     116    // not be extracted return kFALSE (no valid arrival time)
     117    if (!IsLoGainValid())
     118        return kFALSE;
     119
     120    // in all other cases use the lo-gain arrival time
     121    return kTRUE;
    95122}
    96123
  • trunk/MagicSoft/Mars/msignal/MArrivalTimePix.h

    r7843 r7876  
    4747    Float_t GetArrivalTimeLoGainError() const { return fArrivalTimeLoGainError; }
    4848
    49     Float_t GetArrivalTime()            const { return IsLoGainUsed() ? fArrivalTimeLoGain : fArrivalTimeHiGain; }
     49    Float_t GetArrivalTime()            const;
     50    Bool_t  IsArrivalTimeValid()        const;
    5051
    5152    Byte_t GetNumHiGainSaturated()      const { return fNumHiGainSaturated; }
    5253    Byte_t GetNumLoGainSaturated()      const { return fNumLoGainSaturated; }
    5354
    54     Bool_t IsLoGainUsed()               const { return fNumHiGainSaturated > 0; }
    55     Bool_t IsLoGainValid()              const { return fArrivalTimeLoGainError>=0 && fNumLoGainSaturated==0; }
    56     Bool_t IsHiGainValid()              const { return fArrivalTimeHiGainError>=0 && fNumHiGainSaturated==0; }
    57     Bool_t IsValid()                    const;   
     55    Bool_t IsHiGainSaturated()          const { return fNumHiGainSaturated>0; }
     56    Bool_t IsLoGainSaturated()          const { return fNumLoGainSaturated>0; }
     57
     58    Bool_t IsLoGainValid()              const { return fArrivalTimeLoGainError>=0; }
     59    Bool_t IsHiGainValid()              const { return fArrivalTimeHiGainError>=0; }
    5860
    5961    ClassDef(MArrivalTimePix, 1)        // Storage Container for ArrivalTime information of one pixel
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r7844 r7876  
    399399        {
    400400          maxpos = ids-fHiGainFirst-1;
    401           fMaxBinContent = *p;
     401          // range-fWindowSizeHiGain+1 == fHiLoLast isn't it?
     402          if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1))
     403              fMaxBinContent = *p;
    402404        }
    403405
     
    420422          if (*logain > fMaxBinContent)
    421423            {
    422               maxpos = ids-fHiGainFirst-1;
    423               fMaxBinContent = *logain;
     424                maxpos = ids-fHiGainFirst-1;
     425                // range-fWindowSizeHiGain+1 == fHiLoLast isn't it?
     426                //if (maxpos > 1 && maxpos < (range - fWindowSizeHiGain + 1))
     427                //    fMaxBinContent = *logain;
    424428            }
    425429         
     
    10881092        // between every two FADC slices, instead of numerically
    10891093    }
     1094
    10901095    sum *= step; // Transform sum in integral
    10911096    return sum;
     
    11051110
    11061111    // The order is important. In some cases (limlo-/limup-check) it can
    1107     // happen than max<0. In this case we start at 0
     1112    // happen that max<0. In this case we start at 0
    11081113    if (start > max)
    11091114        start = max;
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc

    r7864 r7876  
    144144        idx++;
    145145
    146         if (!pix->IsValid())
     146        if (!pix->IsLoGainValid() && ! pix->IsHiGainValid())
    147147            continue;
    148148
     
    163163    case 0:
    164164        val = pix.GetExtractedSignalHiGain();
    165         return pix.IsHiGainValid();
     165        return pix.IsHiGainValid() && !pix.IsHiGainSaturated();
    166166
    167167    case 1:
     
    171171    case 2:
    172172        val = pix.GetExtractedSignalLoGain();
    173         return pix.IsLoGainValid();
     173        return pix.IsLoGainValid() && !pix.IsLoGainSaturated();
    174174
    175175    case 3:
     
    180180        // extracted from lo- and hi-gain
    181181    case 4:
     182        // Lo- and hi-gain must be successfully extracted
    182183        if (!pix.IsLoGainValid() || !pix.IsHiGainValid())
    183184            return kFALSE;
    184185
     186        // Lo- and hi-gain must not be saturated
     187        if (pix.IsLoGainSaturated() || pix.IsHiGainSaturated())
     188            return kFALSE;
     189
     190        // Both signals must have a positive value
    185191        if (pix.GetExtractedSignalLoGain()<=0 || pix.GetExtractedSignalHiGain()<=0)
    186192            return kFALSE;
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc

    r7829 r7876  
    4747
    4848static const Float_t gkSignalInitializer = -99999.9;
     49
    4950// ------------------------------------------------------------------------
    5051//
     
    9596}
    9697
    97 Bool_t MExtractedSignalPix::IsValid() const
    98 {
    99     return (!IsLoGainUsed() && fExtractedSignalHiGainError >= 0) || (IsLoGainUsed() && fExtractedSignalLoGainError >= 0);
    100 }
    101 
    10298void MExtractedSignalPix::SetGainSaturation(Byte_t higain, Byte_t logain)
    10399{
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.h

    r7842 r7876  
    3939  Byte_t GetNumLoGainSaturated()          const { return fNumLoGainSaturated;          }
    4040
    41   Bool_t IsLoGainUsed()                   const { return fNumHiGainSaturated>0;        }
    42   Bool_t IsLoGainValid()                  const { return fExtractedSignalLoGainError>=0 && fNumLoGainSaturated==0; }
    43   Bool_t IsHiGainValid()                  const { return fExtractedSignalHiGainError>=0 && fNumHiGainSaturated==0; }
    44   Bool_t IsValid()                        const;   
     41  Bool_t IsHiGainSaturated()              const { return fNumHiGainSaturated>0;        }
     42  Bool_t IsLoGainSaturated()              const { return fNumLoGainSaturated>0;        }
     43
     44  Bool_t IsLoGainValid()                  const { return fExtractedSignalLoGainError>=0; }
     45  Bool_t IsHiGainValid()                  const { return fExtractedSignalHiGainError>=0; }
    4546
    4647  ClassDef(MExtractedSignalPix, 3) // Storage Container for Extracted Signal information of one pixel
  • trunk/MagicSoft/Mars/msignal/MSignalCam.cc

    r7832 r7876  
    656656        break;
    657657
     658        /*
    658659    case 10: // lo gain time
    659660        if (pix->IsPixelUnmapped() || !pix->IsLoGainUsed() ||
     
    672673        val = pix->GetArrivalTime();
    673674        return kTRUE;
     675        */
    674676
    675677    default:
  • trunk/MagicSoft/Mars/msignal/MSignalPix.cc

    r7829 r7876  
    9393    fPhot       =  0;
    9494    fErrPhot    =  0;
    95     fLoGainUsed = kFALSE;
    9695}
    9796
  • trunk/MagicSoft/Mars/msignal/MSignalPix.h

    r7829 r7876  
    2020    Float_t  fArrivalTime;   // Calibrated Arrival Time
    2121
    22     Bool_t   fLoGainUsed;      //! Is lo gain used
    23 
    2422public:
    2523    MSignalPix(Float_t phot=0, Float_t errphot=0);
     
    3432        pix.fPhot       = fPhot;
    3533        pix.fErrPhot    = fErrPhot;
    36         pix.fLoGainUsed = fLoGainUsed;
    3734    }
    3835
     
    6057    void    SetArrivalTime(Float_t tm)    { MMath::ReducePrecision(tm); fArrivalTime = tm; }
    6158
    62     void    SetLoGainUsed(Bool_t b=kTRUE) { fLoGainUsed=b;      }
    63     Bool_t  IsLoGainUsed() const          { return fLoGainUsed; }
    64 
    6559    void    AddNumPhotons(Float_t f)      { fPhot += f; }
    6660    void    Scale(Float_t f)              { fPhot /= f; }
Note: See TracChangeset for help on using the changeset viewer.