Changeset 12625 for trunk/Mars/mpedestal
- Timestamp:
- 11/23/11 14:09:26 (13 years ago)
- Location:
- trunk/Mars/mpedestal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mpedestal/MPedestalSubtractedEvt.cc
r10166 r12625 32 32 #include "MPedestalSubtractedEvt.h" 33 33 34 #include <TMath.h> 35 34 36 #include "MLogManip.h" 35 37 … … 127 129 } 128 130 131 void MPedestalSubtractedEvt::GetStat(const Int_t idx, Float_t &mean, Float_t &rms) const 132 { 133 if (fNumSamples<20) 134 return; 135 136 // Get pointer to first slice to be considered 137 Float_t const *sam = GetSamples(idx); 138 Float_t const *beg = sam; 139 140 Double_t sum = 0; 141 Double_t sum2 = 0; 142 143 for (const Float_t *ptr=beg+10; ptr<sam+fNumSamples-10; ptr++) 144 { 145 sum += *ptr; 146 sum2 += *ptr * *ptr; 147 } 148 149 sum /= fNumSamples-20; 150 sum2 /= fNumSamples-20; 151 152 mean = sum; 153 rms = TMath::Sqrt(sum2 - sum * sum); 154 } 155 129 156 // -------------------------------------------------------------------------- 130 157 // … … 206 233 } 207 234 *fLog << endl; 235 } 236 237 Bool_t MPedestalSubtractedEvt::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 238 { 239 switch (type) 240 { 241 case 0: 242 case 1: 243 { 244 Float_t mean, rms; 245 GetStat(idx, mean, rms); 246 val = type==0 ? mean : rms; 247 } 248 break; 249 case 2: 250 { 251 Float_t flt; 252 GetMaxPos(idx, flt); 253 val = flt; 254 } 255 break; 256 } 257 258 return kTRUE; 208 259 } 209 260 -
trunk/Mars/mpedestal/MPedestalSubtractedEvt.h
r9226 r12625 93 93 } 94 94 95 void GetStat(const Int_t idx, Float_t &mean, Float_t &rms) const; 95 96 96 97 Int_t GetSaturation(const Int_t pixidx, Int_t limit) const … … 116 117 void Print(Option_t *o="") const; 117 118 118 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }119 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 119 120 void DrawPixelContent(Int_t num) const { } 120 121
Note:
See TracChangeset
for help on using the changeset viewer.