Newer
Older
TB_Chris / TbUT / src / alibava / .svn / text-base / Tracer.h.svn-base
@iaro iaro on 9 May 2016 851 bytes first attempt of automated anal
  1. #ifndef TRACER_H_
  2. #define TRACER_H_
  3. #include <deque>
  4.  
  5. class TH1;
  6.  
  7. class Tracer
  8. {
  9. private:
  10. unsigned int size;
  11. int average;
  12. double cntr;
  13. double val;
  14. std::deque<double> queue;
  15. TH1 *hst;
  16.  
  17. public:
  18. /**
  19. * Defines a tracer. At input npts defines the size of
  20. * the buffer (a FIFO actually) with the values that the
  21. * Tracer will remember. Also, if average is given, the
  22. * Tracer will add as new points the average over 'average'
  23. * inputs
  24. */
  25. Tracer(const char*nam, const char *tit, int npts, int average=0);
  26. virtual ~Tracer();
  27.  
  28. void Draw(const char *opt="");
  29.  
  30. TH1 *get_hst()
  31. {
  32. return hst;
  33. }
  34.  
  35. void fill(double val);
  36. void add_point(double x);
  37. };
  38.  
  39. #endif /*TRACER_H_*/