Changeset 16428 for trunk/Mars
- Timestamp:
- 05/29/13 14:04:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r15278 r16428 220 220 } 221 221 222 static double FindStep(const size_t ch0, const float *vec, int16_t roi, const int16_t pos, const uint16_t *map )222 static double FindStep(const size_t ch0, const float *vec, int16_t roi, const int16_t pos, const uint16_t *map=NULL) 223 223 { 224 224 // We have about 1% of all cases which are not ahndled here, … … 237 237 { 238 238 const size_t hw = ch0+p; 239 const size_t sw = map[hw]*roi + pos;239 const size_t sw = (map?map[hw]:hw)*roi + pos; 240 240 241 241 const double diff = vec[sw]-vec[sw-1]; … … 250 250 } 251 251 252 static void SubtractStep(const size_t ch0, const double avg, float *vec, int16_t roi, int32_t pos, const uint16_t *map )252 static void SubtractStep(const size_t ch0, const double avg, float *vec, int16_t roi, int32_t pos, const uint16_t *map=NULL) 253 253 { 254 254 if (pos==0 || pos>=roi) … … 265 265 { 266 266 const size_t hw = ch0+p; 267 const size_t sw = map[hw]*roi + j;267 const size_t sw = (map?map[hw]:hw)*roi + j; 268 268 269 269 vec[sw] -= sub; … … 307 307 static Step CorrectStep(float *vec, uint16_t nch, uint16_t roi, 308 308 const int16_t *prev, const int16_t *start, 309 const int16_t offset, const uint16_t *map )309 const int16_t offset, const uint16_t *map=NULL) 310 310 { 311 311 312 312 std::vector<Step> list; 313 list.reserve(nch); 313 314 314 315 // Fill steps into array … … 331 332 } 332 333 333 if (list. size()==0)334 if (list.empty()) 334 335 return Step(); 335 336 … … 522 523 static void SlidingAverage(float *const vec, const uint32_t roi, const uint16_t w) 523 524 { 524 if (w==0) 525 return; 526 527 if (w>roi) 525 if (w==0 || w>roi) 528 526 return; 529 527 … … 954 952 955 953 DrsCalibration() : 956 fOffset 957 fGain 958 fTrgOff 954 fOffset(1440*1024, 0), 955 fGain(1440*1024, 4096), 956 fTrgOff (1600*1024, 0), 959 957 fNumOffset(1), 960 958 fNumGain(2000), … … 969 967 fDateRunEnd[i] = "1970-01-01T00:00:00"; 970 968 } 969 } 970 971 DrsCalibration(const DrsCalibration &cpy) : 972 fOffset(cpy.fOffset), 973 fGain(cpy.fGain), 974 fTrgOff(cpy.fTrgOff), 975 fNumOffset(cpy.fNumOffset), 976 fNumGain(cpy.fNumGain), 977 fNumTrgOff(cpy.fNumTrgOff), 978 fStep(cpy.fStep), 979 fRoi(cpy.fRoi), 980 fNumTm(cpy.fNumTm), 981 fDateObs(cpy.fDateObs), 982 fDateRunBeg(cpy.fDateRunBeg), 983 fDateRunEnd(cpy.fDateRunEnd), 984 fDateEnd(cpy.fDateEnd) 985 { 971 986 } 972 987
Note:
See TracChangeset
for help on using the changeset viewer.