#ifndef FRONTMOMENTUM_HH
#define FRONTMOMENTUM_HH

#include "DecisionTool.hh"
#include "SmartSamplerData.hh"
#include "FMLogger.hh"

/****************************************************************************
 *
 * Momentum based front sampling tool.
 *
 ****************************************************************************/

class dtFrontMomentum : public DecisionTool{
public:
  dtFrontMomentum(char *nameIn);
  ~dtFrontMomentum();

  void loadConfig(char *cfgname,SmartSamplerData *ssdIn);
  bool update();
  void reset();

private:
  char *name;
  SmartSamplerData *ssd;
  FMLogger log;

  double prevEst,kalmanP, // kalman filter carryovers
    up_mo,down_mo,        // momentum carryovers
    yo_max,yo_min,        // profile statistics
    kalmanF,kalmanH,      // config parameters
    kalmanQ,kalmanR,mo_thresh,decel;
  int column,d_down,d_up,u_down,u_up;
  bool first_profile;
  
  SmartSamplerData::ssd_measurement_t datatype;

}; // dtFrontMomentum

#endif // FRONTMOMENTUM_HH
