Changeset 8250 for trunk/MagicSoft
- Timestamp:
- 01/15/07 12:06:22 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8249 r8250 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2007/01/15 Thomas Bretz 22 23 * mpedestal/MPedestalSubtract.cc: 24 - added a sanity check tomake sure that the pixel array has the 25 correct size when filled 26 - made sure the the number of pixels in the camera nd not the 27 number of connected pixels is used to initialize the size of 28 the arrays. 29 30 * mpedestal/MPedestalSubtractedEvt.[h,cc]: 31 - allow the initialization of nuber of pixels and samples 32 independanly. 33 20 34 21 35 2007/01/15 Daniela Dorner -
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc
r8158 r8250 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1. 3 2006-10-24 12:39:00tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.4 2007-01-15 12:06:15 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 128 128 129 129 // initialize fSignal 130 fSignal->InitSamples( fRawEvt->GetNumPixels(), numh+numl);130 fSignal->InitSamples(numh+numl);//, fRawEvt->GetNumPixels(), numh+numl); 131 131 132 132 // iterate over all pixels … … 137 137 const Int_t pixidx = pixel.GetPixelId(); 138 138 139 if (pixidx>=fSignal->GetNumPixels()) 140 { 141 *fLog << err << "ERROR - Pixel index " << pixidx << " out of bounds... abort." << endl; 142 return kERROR; 143 } 139 144 // Get pointer were to store merged raw data 140 145 Byte_t *sample = fSignal->GetSamplesRaw(pixidx); -
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc
r8154 r8250 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1. 1 2006-10-24 08:22:41tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.2 2007-01-15 12:06:15 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 47 47 // And reset its contents to 0. 48 48 // 49 void MPedestalSubtractedEvt::InitSamples(UInt_t pixels, UInt_t samples)49 void MPedestalSubtractedEvt::InitSamples(UInt_t samples, UInt_t pixels) 50 50 { 51 51 fNumSamples = samples; 52 fNumPixels = pixels; 53 54 fSamples.Set(pixels*samples); 55 fSamplesRaw.Set(pixels*samples); 52 53 if (pixels>0) 54 fNumPixels = pixels; 55 56 fSamples.Set(fNumPixels*fNumSamples); 57 fSamplesRaw.Set(fNumPixels*fNumSamples); 56 58 57 59 fSamples.Reset(); … … 169 171 } 170 172 173 /* 174 #include <TSpline.h> 175 #include "MArrayD.h" 176 void MPedestalSubtractedEvt::InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const 177 { 178 MArrayD x(GetNumSamples()); 179 MArrayD y(GetNumSamples()); 180 181 Float_t *s = GetSamples(idx); 182 183 Int_t n = 0; 184 for (unsigned int i=0; i<GetNumSamples(); i++) 185 { 186 if (s[i]>limit) 187 continue; 188 x[n] = i; 189 y[n] = s[i]; 190 n++; 191 } 192 193 TSpline5 sp("", x.GetArray(), y.GetArray(), n); 194 195 for (unsigned int i=0; i<GetNumSamples(); i++) 196 { 197 if (s[i]>limit) 198 s[i] = sp.Eval(i); 199 } 200 } 201 */ -
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h
r8158 r8250 30 30 } 31 31 32 void InitSamples(UInt_t pixels, UInt_t samples); 32 void InitSize(const UInt_t i) { fNumPixels=i; } 33 void InitSamples(UInt_t samples, UInt_t pixels=0); 33 34 34 35 Float_t *GetSamples(UInt_t pixel) const; … … 39 40 40 41 Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const; 42 //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const; 41 43 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Int_t &val) const; 42 44 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const
Note:
See TracChangeset
for help on using the changeset viewer.