FACT++  1.0
int StateMachineSmartFACT::HandleTngWeatherDust ( const EventImp d)
inlineprivate

Definition at line 1035 of file smartfact.cc.

References EventImp::GetFloat(), EventImp::GetJavaDate(), EventImp::GetTime(), and StateMachineSmartFACT::Statistics::max.

Referenced by StateMachineSmartFACT().

1036  {
1037  if (!CheckDataSize(d, "TngWeather:Dust", 4))
1038  return GetCurrentState();
1039 
1041 
1042  fTngWeatherDustHist.push_back(d.GetFloat());
1043  if (fTngWeatherDustHist.size()>300)
1044  fTngWeatherDustHist.pop_front();
1045 
1046  const Statistics stat(fTngWeatherDustHist);
1047 
1048  const double scale = stat.max>0 ? pow(10, ceil(log10(stat.max))) : 0;
1049 
1050  WriteHist(d, "hist-tng-dust", fTngWeatherDustHist, scale);
1051 
1052  ostringstream out;
1053  out << d.GetJavaDate() << '\n';
1054 
1055  ofstream(fPath+"/tngdust.data") << out.str();
1056 
1057  return GetCurrentState();
1058  }
float GetFloat() const
Definition: EventImp.h:97
int GetCurrentState() const
return the current state of the machine
deque< float > fTngWeatherDustHist
Definition: smartfact.cc:542
bool CheckDataSize(const EventImp &d, const char *name, size_t size, bool min=false)
Definition: smartfact.cc:669
void WriteHist(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
Definition: smartfact.cc:752
virtual Time GetTime() const
Definition: EventImp.h:57
uint64_t GetJavaDate() const
Definition: EventImp.cc:303

+ Here is the call graph for this function:

+ Here is the caller graph for this function: