Ignore:
Timestamp:
10/24/06 09:43:51 (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/MExtractBlindPixel.cc

    r5397 r8155  
    9292//
    9393MExtractBlindPixel::MExtractBlindPixel(const char *name, const char *title)
    94     : fHiGainSignal(NULL),
    95       fHiGainFirstDeriv(NULL),
    96       fHiGainSecondDeriv(NULL),
    97       fDataType(0)
     94    : fBlindPixel(0), fHiLoLast(0), fDataType(0)
    9895{
    9996 
     
    108105
    109106  Clear();
    110 
    111 }
    112 
    113 // --------------------------------------------------------------------------
    114 //
    115 // Destructor:
    116 //
    117 // - Deletes, (if not NULL):
    118 //   fHiGainSignal;
    119 //   fHiGainFirstDeriv;
    120 //   fHiGainSecondDeriv;
    121 //
    122 MExtractBlindPixel::~MExtractBlindPixel()
    123 {
    124 
    125   if (fHiGainSignal)
    126     delete [] fHiGainSignal;
    127   if (fHiGainFirstDeriv)
    128     delete [] fHiGainFirstDeriv;
    129   if (fHiGainSecondDeriv)
    130     delete [] fHiGainSecondDeriv;
    131107
    132108}
     
    150126void MExtractBlindPixel::Clear( const Option_t *o)
    151127{
    152 
    153   fExtractionType = 0;
    154 
    155   fBlindPixelIdx.Set(0);
    156   SetBlindPixelIdx();
    157 
    158   if (fHiGainSignal)
    159     {
    160       delete [] fHiGainSignal;
    161       fHiGainSignal = NULL;
    162     }
    163   if (fHiGainFirstDeriv)
    164     {
    165       delete [] fHiGainFirstDeriv;
    166       fHiGainFirstDeriv = NULL;
    167     }
    168   if (fHiGainSecondDeriv)
    169     {
    170       delete [] fHiGainSecondDeriv;
    171       fHiGainSecondDeriv = NULL;
    172     }
    173 
     128    fExtractionType = 0;
     129
     130    fBlindPixelIdx.Set(0);
     131    SetBlindPixelIdx();
    174132}
    175133
     
    246204{
    247205 
    248   if (fHiGainSignal)
    249     delete [] fHiGainSignal;
    250   if (fHiGainFirstDeriv)
    251     delete [] fHiGainFirstDeriv;
    252   if (fHiGainSecondDeriv)
    253     delete [] fHiGainSecondDeriv;
    254 
    255206  for (Int_t i=0;i<fNumBlindPixels;i++)
    256207    fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(i),i);
     
    258209  fBlindPixel->SetExtractionType(fExtractionType);
    259210
    260   for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
     211  for (UInt_t i=0;i<fBlindPixelIdx.GetSize();i++)
    261212  {
    262213
     
    317268  const Int_t range = fHiLoFirst ? fHiLoLast - fHiLoFirst + 1 : fHiGainLast - fHiGainFirst + fHiLoLast + 1;
    318269
    319   fHiGainSignal      = new Float_t[range];
    320   memset(fHiGainSignal,0,range*sizeof(Float_t));
    321   fHiGainFirstDeriv  = new Float_t[range];
    322   memset(fHiGainFirstDeriv,0,range*sizeof(Float_t));
    323   fHiGainSecondDeriv = new Float_t[range];
    324   memset(fHiGainSecondDeriv,0,range*sizeof(Float_t));
     270  fHiGainSignal.Set(range);
     271  fHiGainSignal.Reset();
     272
     273  fHiGainFirstDeriv.Set(range);
     274  fHiGainFirstDeriv.Reset();
     275
     276  fHiGainSecondDeriv.Set(range);
     277  fHiGainSecondDeriv.Reset();
    325278
    326279  *fLog << endl;
     
    670623  fBlindPixel->Clear();
    671624 
    672   for (Int_t id=0;id<fBlindPixelIdx.GetSize();id++)
     625  for (UInt_t id=0;id<fBlindPixelIdx.GetSize();id++)
    673626    {
    674627 
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h

    r5135 r8155  
    66#endif
    77
    8 #ifndef ROOT_TArrayI
    9 #include <TArrayI.h>
     8#ifndef MARS_MArrayI
     9#include "MArrayI.h"
     10#endif
     11#ifndef MARS_MArrayF
     12#include "MArrayF.h"
    1013#endif
    1114
    1215class MExtractedSignalBlindPixel;
     16
    1317class MExtractBlindPixel : public MExtractor
    1418{
     
    2731
    2832  Byte_t   fHiLoFirst;                     // If not zero, start extraction from fHiLoFirst slice of Low-Gain
     33  Byte_t   fHiLoLast;
    2934
    30   Float_t *fHiGainSignal;                  // Need fast access to the signals in a float way
    31   Float_t *fHiGainFirstDeriv;              // First derivative at intersection
    32   Float_t *fHiGainSecondDeriv;             // Second derivative at intersection
     35  MArrayF  fHiGainSignal;                  //! Need fast access to the signals in a float way
     36  MArrayF  fHiGainFirstDeriv;              //! First derivative at intersection
     37  MArrayF  fHiGainSecondDeriv;             //! Second derivative at intersection
    3338
    3439  Float_t fResolution;                     // The time resolution in FADC units
    35   TArrayI fBlindPixelIdx;                  // Array holding the IDs of the blind pixel(s)
     40  MArrayI fBlindPixelIdx;                  // Array holding the IDs of the blind pixel(s)
    3641  Int_t   fNSBFilterLimit;                 // Limit of sum of FADC slices for filter part
    3742
     
    5661
    5762  MExtractBlindPixel(const char *name=NULL, const char *title=NULL);
    58   ~MExtractBlindPixel();
    5963
    6064  void Clear( const Option_t *o ="");
     
    6569
    6670  // Setters
    67   void SetBlindPixelIdx(  const Int_t  idx=fgBlindPixelIdx, const Int_t nr=0 ) {
    68     if (nr>fBlindPixelIdx.GetSize()-1)
    69       fBlindPixelIdx.Set(nr+1);
    70     fBlindPixelIdx.AddAt(idx,nr); }
     71  void SetBlindPixelIdx(  const Int_t  idx=fgBlindPixelIdx, const UInt_t nr=0 )
     72  {
     73      if (nr>=fBlindPixelIdx.GetSize())
     74          fBlindPixelIdx.Set(nr+1);
     75      fBlindPixelIdx[nr] = idx;
     76  }
    7177  void SetExtractionType( const ExtractionType_t typ=kAmplitude );
    7278  void SetDataType    ( const DataType_t       typ=kRawEvt    ); 
  • trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc

    r7059 r8155  
    248248  *fLog << inf << "Taking " << fNumHiGainSamples
    249249        << " HiGain samples from slice " << (Int_t)fHiGainFirst
    250         << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl;
     250        << " to " << (Int_t)(fHiGainLast/*+fHiLoLast*/) << " incl" << endl;
    251251
    252252  return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.