Changeset 11683 for trunk/FACT++/src
- Timestamp:
- 07/28/11 11:47:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DrsCalib.h
r11678 r11683 202 202 } 203 203 204 static void Apply(float *vec, const int16_t *val, const int16_t *start, uint32_t roi, 205 const int32_t *offset, const uint32_t scaleabs, 206 const int32_t *gain, const uint32_t scalegain, 207 const int32_t *trgoff, const uint32_t scalerel) 208 { 209 for (size_t ch=0; ch<1440; ch++) 210 { 211 const size_t pos = ch*roi; 212 213 const int16_t spos = start[ch]; 214 if (spos<0) 215 { 216 memset(vec+pos, 0, roi); 217 continue; 218 } 219 220 for (size_t i=0; i<roi; i++) 221 { 222 // Value is relative to trigger 223 // Offset is relative to DRS pipeline 224 // Abs is corresponding index relative to DRS pipeline 225 const size_t rel = pos + i; 226 const size_t abs = pos + (spos+i)%1024; 227 228 const int64_t v = 229 + int64_t(val[rel]) *scaleabs*scalerel 230 - int64_t(trgoff[rel])*scaleabs 231 - int64_t(offset[abs])*scalerel 232 ; 233 234 const int64_t div = int64_t(gain[abs])*scaleabs*scalerel; 235 236 vec[rel] = double(v*scalegain)/div; 237 } 238 } 239 } 240 241 static void Apply(float *vec, const int16_t *val, const int16_t *start, uint32_t roi) 242 { 243 for (size_t ch=0; ch<1440; ch++) 244 { 245 const size_t pos = ch*roi; 246 247 const int16_t spos = start[ch]; 248 if (spos<0) 249 { 250 memset(vec+pos, 0, roi); 251 continue; 252 } 253 254 for (size_t i=0; i<roi; i++) 255 vec[pos+i] = float(val[pos+i])/2; 256 } 257 } 258 204 259 pair<vector<double>,vector<double> > GetSampleStats() const 205 260 {
Note:
See TracChangeset
for help on using the changeset viewer.