Changeset 13742
- Timestamp:
- 05/16/12 08:59:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ratescan.cc
r13256 r13742 68 68 DimDescribedService fDimProc; 69 69 70 int f Seconds;71 int f SecondsMax;70 int fCounter; 71 int fCounterMax; 72 72 73 73 int fThreshold; … … 75 75 int fThresholdMax; 76 76 int fThresholdStep; 77 int fThresholdStepDyn; 77 78 78 79 double fRate; … … 159 160 const FTM::DimTriggerRates &sdata = *static_cast<FTM::DimTriggerRates*>(curr->getData()); 160 161 161 if (++f Seconds<0)162 return; 163 164 if (f Seconds==0)162 if (++fCounter<0) 163 return; 164 165 if (fCounter==0) 165 166 { 166 167 fRate = 0; … … 197 198 reference *= sdata.fElapsedTime; 198 199 199 if ((reference==0 || sqrt(reference)>fResolution*reference) && f Seconds<fSecondsMax)200 if ((reference==0 || sqrt(reference)>fResolution*reference) && fCounter<fCounterMax) 200 201 { 201 202 ostringstream out; … … 208 209 } 209 210 210 const double time = sdata.fElapsedTime*f Seconds;211 const double time = sdata.fElapsedTime*fCounter; 211 212 const uint32_t th = fThreshold; 212 213 … … 216 217 data[3] = time; // total elapsed time 217 218 data[4] = fOnTime/time; // relative on time 218 data[5] = fRate/f Seconds;219 data[5] = fRate/fCounter; 219 220 for (int i=0; i<40; i++) 220 data[i+6] = fRateBoard[i]/f Seconds;221 data[i+6] = fRateBoard[i]/fCounter; 221 222 for (int i=0; i<160; i++) 222 data[i+46] = fRatePatch[i]/f Seconds;223 data[i+46] = fRatePatch[i]/fCounter; 223 224 224 225 ostringstream sout1, sout2, sout3; … … 240 241 fThreshold += fThresholdStep; 241 242 242 if (f Seconds>=fSecondsMax)243 if (fCounter>=fCounterMax) 243 244 { 244 245 Message("Rate scan stopped due to timeout."); … … 254 255 } 255 256 256 //fSeconds = -2; // FIXME: In principle one missed report is enough 257 fSeconds = -1; 257 // Does this need to be shifted upwards? 258 if (fCounter>1 && fThresholdStepDyn>0) 259 { 260 //const double scale = fCounter/reference/fResolution/fResolution; 261 //const double step = floor(scale*fThresholdStepDyn); 262 263 fThresholdStep = fCounter*fThresholStepDyn; 264 } 265 266 //fCounter = -2; // FIXME: In principle one missed report is enough 267 fCounter = -1; 258 268 259 269 const int32_t cmd[2] = { -1, fThreshold }; … … 293 303 fCommand = "FTM_CONTROL/"+command; 294 304 305 const int32_t step = evt.Get<int32_t>(8); 306 295 307 fThresholdMin = evt.Get<uint32_t>(); 296 308 fThresholdMax = evt.Get<uint32_t>(4); 297 fThresholdStep = evt.Get<uint32_t>(8); 309 fThresholdStep = abs(step); 310 311 fThresholdStepDyn = step<0 ? -step : 0; 298 312 299 313 UpdateProc(); … … 325 339 326 340 fThreshold = fThresholdMin; 327 f Seconds= -2;341 fCounter = -2; 328 342 329 343 ostringstream msg; … … 527 541 int EvalOptions(Configuration &conf) 528 542 { 529 f SecondsMax = conf.Get<uint16_t>("max-wait");543 fCounterMax = conf.Get<uint16_t>("max-wait"); 530 544 fResolution = conf.Get<double>("resolution"); 531 545
Note:
See TracChangeset
for help on using the changeset viewer.