Ignore:
Timestamp:
08/04/06 08:48:43 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msignal
Files:
3 edited

Legend:

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

    r7804 r7842  
    138138Bool_t MArrivalTimeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
    139139{
     140    if (idx>=GetSize())
     141        return kFALSE;
     142
     143    const MArrivalTimePix &pix = (*this)[idx];
     144
    140145    switch (type)
    141146    {
    142147    case 0:
    143         val = (*this)[idx].GetArrivalTimeHiGain();
    144         break;
     148        val = pix.GetArrivalTimeHiGain();
     149        return pix.IsHiGainValid();
     150
    145151    case 1:
    146         val = (*this)[idx].GetArrivalTimeHiGainError();
    147         break;
     152        val = pix.GetArrivalTimeHiGainError();
     153        return val>0;
     154
    148155    case 2:
    149         val = (*this)[idx].GetArrivalTimeLoGain();
    150         break;
     156        val = pix.GetArrivalTimeLoGain();
     157        return pix.IsLoGainValid();
     158
    151159    case 3:
    152         val = (*this)[idx].GetArrivalTimeLoGainError();
    153         break;
     160        val = pix.GetArrivalTimeLoGainError();
     161        return val>0;
     162
    154163    case 4:
    155164    case 6:
    156         if ((*this)[idx].GetNumHiGainSaturated() > 0)
    157             val = (*this)[idx].GetArrivalTimeLoGain();
    158         else
    159             val = (*this)[idx].GetArrivalTimeHiGain();
    160         break;
     165        val = pix.GetArrivalTime();
     166        return pix.IsValid();
     167
     168        // This is for the case the signal has been
     169        // extracted from lo- and hi-gain
    161170    case 7:
    162         if ((*this)[idx].GetNumHiGainSaturated() == 0)
     171        if (!pix.IsLoGainValid() || !pix.IsHiGainValid())
    163172            return kFALSE;
    164173
    165         val = (*this)[idx].GetArrivalTimeHiGain()-(*this)[idx].GetArrivalTimeLoGain();
    166         return kTRUE;
     174        val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain();
     175
     176        if (pix.GetArrivalTimeHiGain()<3 || pix.GetArrivalTimeHiGain()>12 ||
     177            pix.GetArrivalTimeLoGain()<3 || pix.GetArrivalTimeLoGain()>12)
     178            return kFALSE;
     179
     180        val = pix.GetArrivalTimeLoGain()-pix.GetArrivalTimeHiGain();
     181        return TMath::Abs(val)<2; // FIXME: Is this a good value?
    167182
    168183    default:
    169184        return kFALSE;
    170185    }
    171     return val>=0;
     186
     187    return kFALSE;
    172188}
    173189
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.cc

    r7810 r7842  
    154154Bool_t MExtractedSignalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
    155155{
     156    if (idx>=GetSize())
     157        return kFALSE;
     158
     159    const MExtractedSignalPix &pix = (*this)[idx];
     160
    156161    switch (type)
    157162    {
    158163    case 0:
    159         val = (*this)[idx].GetExtractedSignalHiGain();
    160         break;
     164        val = pix.GetExtractedSignalHiGain();
     165        return pix.IsHiGainValid();
     166
    161167    case 1:
    162         val = (*this)[idx].GetExtractedSignalHiGainError();
    163         break;
     168        val = pix.GetExtractedSignalHiGainError();
     169        return val>0;
     170
    164171    case 2:
    165         val = (*this)[idx].GetExtractedSignalLoGain();
    166         break;
     172        val = pix.GetExtractedSignalLoGain();
     173        return pix.IsLoGainValid();
     174
    167175    case 3:
    168         val = (*this)[idx].GetExtractedSignalLoGainError();
    169         break;
     176        val = pix.GetExtractedSignalLoGainError();
     177        return val>0;
     178
     179        // This is for the case the signal has been
     180        // extracted from lo- and hi-gain
     181    case 4:
     182        if (!pix.IsLoGainValid() || !pix.IsHiGainValid())
     183            return kFALSE;
     184
     185        val = pix.GetExtractedSignalHiGain()/pix.GetExtractedSignalLoGain();
     186        return pix.GetExtractedSignalLoGain()>2 && val<25;
     187
    170188    default:
    171189        return kFALSE;
    172190    }
    173     return val>=0;
     191
     192    return kFALSE;
    174193}
    175194
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.h

    r7810 r7842  
    1515  Float_t fExtractedSignalLoGainError; // error of the mean value of the extracted signal
    1616
    17   Byte_t fNumHiGainSaturated;
    18   Byte_t fNumLoGainSaturated;
     17  Byte_t fNumHiGainSaturated;          // Number of first hi-gain slice which has saturated (could be negative if already the first slice saturates)
     18  Byte_t fNumLoGainSaturated;          // Number of first lo-gain slices which have saturated
    1919
    2020public:
     
    4040
    4141  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; }
    4244  Bool_t IsValid()                        const;   
    4345
Note: See TracChangeset for help on using the changeset viewer.