Changeset 3924


Ignore:
Timestamp:
05/01/04 12:28:43 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3923 r3924  
    2222   * macros/dohtml.C
    2323     - include directory mpedestal
     24
     25   * msignal/MExtractFixedWindow.[h,cc]
     26   * msignal/MExtractSlidingWindow.[h,cc]
     27   * msignal/MExtractFixedWindowPeakSearch.[h,cc]
     28   * msignal/MExtractor.[h,cc]
     29     - include the possibility to set the range for the hi-gain outside
     30       the range of MRawEvtPixelIter::GetNumHiGainSamples() and to take
     31       the "low-gain" slices instead. This is necessary for the March
     32       data!
    2433
    2534
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.cc

    r3884 r3924  
    6161// Default constructor.
    6262//
    63 // Calls:
    64 // - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast)
    65 //
    6663MExtractFixedWindow::MExtractFixedWindow(const char *name, const char *title)
    6764{
    6865  fName  = name  ? name  : "MExtractFixedWindow";
    6966  fTitle = title ? title : "Signal Extractor for a fixed FADC window";
    70 
    7167
    7268  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
     
    154150// - If *ptr is greater than fSaturationLimit, raise sat by 1
    155151//
    156 void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const
     152void MExtractFixedWindow::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const
    157153{
    158154
     
    169165        sat++;
    170166    }
     167
     168  if (fHiLoLast == 0)
     169    return;
     170 
     171  end = logain + fHiLoLast;
     172  while (logain<end)
     173    {
     174      sum += *logain;
     175     
     176      if (*logain++ >= fSaturationLimit)
     177            sat++;
     178    }
     179
    171180}
    172181
  • trunk/MagicSoft/Mars/msignal/MExtractFixedWindow.h

    r3883 r3924  
    2222  static const Byte_t fgLoGainLast;      // Last FADC slice Lo-Gain (currently set to: 14)
    2323
    24   void   FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const;
     24  void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const;
    2525  void   FindSignalLoGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const;
    2626
  • trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.h

    r3883 r3924  
    2020  Byte_t  fWindowSizeLoGain;             // Number of Lo Gain slices in window 
    2121 
    22   void   FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const;
     22  void   FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &max, Byte_t &sat) const;
    2323  void   FindSignalLoGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const; 
    2424
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r3893 r3924  
    8585MExtractor::MExtractor(const char *name, const char *title)
    8686    : fPedestals(NULL), fSignals(NULL), fRawEvt(NULL), fRunHeader(NULL),
    87       fNumHiGainSamples(0.), fNumLoGainSamples(0.), fSaturationLimit(fgSaturationLimit)
     87      fHiLoLast(0), fNumHiGainSamples(0.), fNumLoGainSamples(0.),
     88      fSaturationLimit(fgSaturationLimit)
    8889{
    8990
     
    158159// -  MRawRunHeader::GetNumSamplesLoGain()
    159160//
    160 // In case that the variables fHiGainLast and fLoGainLast are smaller than
     161// In case that the variable fLoGainLast is smaller than
    161162// the even part of the number of samples obtained from the run header, a
    162163// warning is given an the range is set back accordingly. A call to: 
    163 // - SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast) or
    164164// - SetRange(fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast-diff)
    165165// is performed in that case. The variable diff means here the difference
    166 // between the requested range (fHiGainLast) and the available one. Note that
     166// between the requested range (fLoGainLast) and the available one. Note that
    167167// the functions SetRange() are mostly overloaded and perform more checks,
    168168// modifying the ranges again, if necessary.
     169//
     170// In case that the variable fHiGainLast is smaller than the available range
     171// obtained from the run header, a warning is given that a part of the low-gain
     172// samples are used for the extraction of the high-gain signal.
    169173//
    170174// Call:
     
    175179{
    176180 
    177   Int_t lastdesired   = (Int_t)fHiGainLast;
    178   Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
    179  
    180   if (lastdesired > lastavailable)
    181     {
    182       const Int_t diff = lastdesired - lastavailable;
    183       *fLog << endl;
    184       *fLog << warn << GetDescriptor()
    185             << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [",
    186                     (int)fHiGainFirst,",",lastdesired,
    187                     "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
    188       *fLog << GetDescriptor() << ": Will reduce the upper edge to " << (int)(fHiGainLast - diff) << endl;
    189       SetRange(fHiGainFirst, fHiGainLast-diff, fLoGainFirst, fLoGainLast);
    190     }
    191 
    192   lastdesired   = (Int_t)(fLoGainLast);
    193   lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
     181  Int_t lastdesired   = (Int_t)(fLoGainLast);
     182  Int_t lastavailable = (Int_t)fRunHeader->GetNumSamplesLoGain()-1;
    194183 
    195184  if (lastdesired > lastavailable)
     
    205194    }
    206195
    207   fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast, fNumHiGainSamples,
     196  lastdesired   = (Int_t)fHiGainLast;
     197  lastavailable = (Int_t)fRunHeader->GetNumSamplesHiGain()-1;
     198 
     199  if (lastdesired > lastavailable)
     200    {
     201      const Int_t diff = lastdesired - lastavailable;
     202      *fLog << endl;
     203      *fLog << warn << GetDescriptor()
     204            << Form("%s%2i%s%2i%s%2i%s",": Selected Hi Gain FADC Window [",
     205                    (int)fHiGainFirst,",",lastdesired,
     206                    "] ranges out of the available limits: [0,",lastavailable,"].") << endl;
     207      *fLog << warn << GetDescriptor()
     208            << Form("%s%2i%s",": Will use ",diff," samples from the Low-Gain for the High-Gain extraction")
     209            << endl;
     210      fHiGainLast -= diff;
     211      fHiLoLast    = diff;
     212    }
     213
     214
     215  fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainLast+fHiLoLast, fNumHiGainSamples,
    208216                              fLoGainFirst, fLoGainLast, fNumLoGainSamples);
    209217
     
    213221
    214222
    215 void MExtractor::FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const
     223void MExtractor::FindSignalHiGain(Byte_t *firstused, Byte_t *logain, Int_t &sum, Byte_t &sat) const
    216224{
    217225  return;
     
    239247      Byte_t sathi;
    240248
    241       FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, sumhi, sathi);
     249      FindSignalHiGain(pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi);
    242250
    243251      Int_t  sumlo = 0;
  • trunk/MagicSoft/Mars/msignal/MExtractor.h

    r3880 r3924  
    3131    MRawRunHeader       *fRunHeader;    // RunHeader information
    3232
    33     Byte_t  fHiGainFirst;
    34     Byte_t  fLoGainFirst;
     33    Byte_t   fHiGainFirst;
     34    Byte_t   fLoGainFirst;
    3535
    36     Byte_t  fHiGainLast;
    37     Byte_t  fLoGainLast;
     36    Byte_t   fHiGainLast;
     37    Byte_t   fLoGainLast;
    3838
     39    Byte_t   fHiLoLast;
     40   
    3941    Float_t  fNumHiGainSamples;
    4042    Float_t  fNumLoGainSamples;
     
    4547    Byte_t  fSaturationLimit;
    4648
    47     virtual void FindSignalHiGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const;
     49    virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Int_t &sum, Byte_t &sat) const;
    4850    virtual void FindSignalLoGain(Byte_t *firstused, Int_t &sum, Byte_t &sat) const;
    4951
Note: See TracChangeset for help on using the changeset viewer.