Changeset 8155 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 10/24/06 09:43:51 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc
r5397 r8155 92 92 // 93 93 MExtractBlindPixel::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) 98 95 { 99 96 … … 108 105 109 106 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;131 107 132 108 } … … 150 126 void MExtractBlindPixel::Clear( const Option_t *o) 151 127 { 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(); 174 132 } 175 133 … … 246 204 { 247 205 248 if (fHiGainSignal)249 delete [] fHiGainSignal;250 if (fHiGainFirstDeriv)251 delete [] fHiGainFirstDeriv;252 if (fHiGainSecondDeriv)253 delete [] fHiGainSecondDeriv;254 255 206 for (Int_t i=0;i<fNumBlindPixels;i++) 256 207 fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(i),i); … … 258 209 fBlindPixel->SetExtractionType(fExtractionType); 259 210 260 for ( Int_t i=0;i<fBlindPixelIdx.GetSize();i++)211 for (UInt_t i=0;i<fBlindPixelIdx.GetSize();i++) 261 212 { 262 213 … … 317 268 const Int_t range = fHiLoFirst ? fHiLoLast - fHiLoFirst + 1 : fHiGainLast - fHiGainFirst + fHiLoLast + 1; 318 269 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(); 325 278 326 279 *fLog << endl; … … 670 623 fBlindPixel->Clear(); 671 624 672 for ( Int_t id=0;id<fBlindPixelIdx.GetSize();id++)625 for (UInt_t id=0;id<fBlindPixelIdx.GetSize();id++) 673 626 { 674 627 -
trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h
r5135 r8155 6 6 #endif 7 7 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" 10 13 #endif 11 14 12 15 class MExtractedSignalBlindPixel; 16 13 17 class MExtractBlindPixel : public MExtractor 14 18 { … … 27 31 28 32 Byte_t fHiLoFirst; // If not zero, start extraction from fHiLoFirst slice of Low-Gain 33 Byte_t fHiLoLast; 29 34 30 Float_t *fHiGainSignal; //Need fast access to the signals in a float way31 Float_t *fHiGainFirstDeriv; //First derivative at intersection32 Float_t *fHiGainSecondDeriv; //Second derivative at intersection35 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 33 38 34 39 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) 36 41 Int_t fNSBFilterLimit; // Limit of sum of FADC slices for filter part 37 42 … … 56 61 57 62 MExtractBlindPixel(const char *name=NULL, const char *title=NULL); 58 ~MExtractBlindPixel();59 63 60 64 void Clear( const Option_t *o =""); … … 65 69 66 70 // 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 } 71 77 void SetExtractionType( const ExtractionType_t typ=kAmplitude ); 72 78 void SetDataType ( const DataType_t typ=kRawEvt ); -
trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
r7059 r8155 248 248 *fLog << inf << "Taking " << fNumHiGainSamples 249 249 << " HiGain samples from slice " << (Int_t)fHiGainFirst 250 << " to " << (Int_t)(fHiGainLast +fHiLoLast) << " incl" << endl;250 << " to " << (Int_t)(fHiGainLast/*+fHiLoLast*/) << " incl" << endl; 251 251 252 252 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.