Changeset 8519 for trunk/MagicSoft/Mars/mpedestal
- Timestamp:
- 05/16/07 14:56:18 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mpedestal
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r8498 r8519 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.3 0 2007-05-11 15:47:18tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.31 2007-05-16 13:56:17 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 648 648 649 649 // Do some handling if maxpos is last slice? 650 const Int_t maxposhi = fSignal->GetMax (idx, start, start+range-1);650 const Int_t maxposhi = fSignal->GetMaxPos(idx, start, start+range-1); 651 651 652 652 const Float_t *sig = fSignal->GetSamples(idx); -
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc
r8361 r8519 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1. 3 2007-03-04 12:01:37 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.4 2007-05-16 13:56:17 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 130 130 // -------------------------------------------------------------------------- 131 131 // 132 // Get the maximum of the slices [first,last] of pixel index. 132 // Get the maximum of the pedestal subtracted slices [first,last] of 133 // pixel with index idx. 133 134 // 134 135 // The position returned is the index of the position of the pedestal 135 136 // subtracted maximum w.r.t. to first. 136 // The value returned is the maximum of the raw-data.137 // The value returned is the maximum corresponding to this index. 137 138 // 138 139 // Warning: No range checks and no sanity checks are done! 139 140 // 140 Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const141 Int_t MPedestalSubtractedEvt::GetMax(const Int_t idx, const Int_t first, const Int_t last, Float_t &val) const 141 142 { 142 143 // Get pointer to first slice to be considered 143 Byte_t const *samb = GetSamplesRaw(idx); 144 Float_t const *samf = GetSamples(idx); 145 146 Byte_t const *ptrb = samb+first; 147 Float_t const *ptrf = samf+first; 144 Float_t const *sam = GetSamples(idx); 145 146 Float_t const *beg = sam+first; 148 147 149 148 // The best information so far: the first slice is the maximum 150 const Byte_t *maxb = ptrb; 151 const Float_t *maxf = ptrf; 152 153 // Store the pointer to the first slice 154 // const Byte_t *begb = ptrb; 155 const Float_t *begf = ptrf; 156 157 // Calculate the last slice to be considered 158 const Byte_t *endb = samb+last; 159 160 while (ptrb<endb) 161 { 162 // Pre-increment: check the second slice first 163 if (*++ptrb>*maxb) 164 maxb = ptrb; 165 if (*++ptrf>*maxf) 166 maxf = ptrf; 167 } 168 169 val = *maxb; 170 return maxf-begf; 149 const Float_t *max = beg; 150 151 for (const Float_t *ptr=beg+1; ptr<=sam+last; ptr++) 152 if (*++ptr>*max) 153 max = ptr; 154 155 val = *max; 156 return max-beg; 157 } 158 159 // -------------------------------------------------------------------------- 160 // 161 // Get the maximum of the raw slices [first,last] of pixel with index idx. 162 // 163 // The position returned is the index of the position of the raw-data 164 // w.r.t. to first. 165 // The value returned is the maximum corresponding to this index. 166 // 167 // Warning: No range checks and no sanity checks are done! 168 // 169 Int_t MPedestalSubtractedEvt::GetRawMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const 170 { 171 // Get pointer to first slice to be considered 172 Byte_t const *sam = GetSamplesRaw(idx); 173 174 Byte_t const *beg = sam+first; 175 176 // The best information so far: the first slice is the maximum 177 const Byte_t *max = beg; 178 179 for (const Byte_t *ptr=beg+1; ptr<=sam+last; ptr++) 180 if (*++ptr>*max) 181 max = ptr; 182 183 val = *max; 184 return max-beg; 171 185 } 172 186 -
trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h
r8446 r8519 41 41 Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const; 42 42 //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const; 43 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, UInt_t &val) const; 44 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const 43 44 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Float_t &val) const; 45 Int_t GetMax(const Int_t pixidx, Float_t &val) const 45 46 { 46 UInt_t val; 47 return GetMax(pixidx, 0, fNumSamples-1, val); 48 } 49 Int_t GetMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const 50 { 51 Float_t val; 47 52 return GetMax(pixidx, first, last, val); 48 53 } 49 Int_t GetMax (const Int_t pixidx, UInt_t &val) const54 Int_t GetMaxPos(const Int_t pixidx, Float_t &val) const 50 55 { 51 56 return GetMax(pixidx, 0, fNumSamples-1, val); 52 57 } 53 58 54 Int_t GetMax(const Int_t pixidx) const 59 Int_t GetMaxPos(const Int_t pixidx) const 60 { 61 Float_t val; 62 return GetMax(pixidx, 0, fNumSamples-1, val); 63 } 64 65 Int_t GetRawMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const; 66 Int_t GetRawMax(const Int_t pixidx, UInt_t &val) const 67 { 68 return GetRawMax(pixidx, 0, fNumSamples-1, val); 69 } 70 Int_t GetRawMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const 55 71 { 56 72 UInt_t val; 57 return Get Max(pixidx, 0, fNumSamples-1, val);73 return GetRawMax(pixidx, first, last, val); 58 74 } 75 Int_t GetRawMaxPos(const Int_t pixidx, UInt_t &val) const 76 { 77 return GetRawMax(pixidx, 0, fNumSamples-1, val); 78 } 79 80 Int_t GetRawMaxPos(const Int_t pixidx) const 81 { 82 UInt_t val; 83 return GetRawMax(pixidx, 0, fNumSamples-1, val); 84 } 85 86 UInt_t GetRawMaxVal(const Int_t idx, const Int_t first, const Int_t last) const 87 { 88 UInt_t val; 89 GetRawMax(idx, first, last, val); 90 return val; 91 } 92 93 59 94 Int_t GetSaturation(const Int_t pixidx, Int_t limit) const 60 95 {
Note:
See TracChangeset
for help on using the changeset viewer.