#ifndef PtStatistic_h
#define PtStatistic_h

class Event;

class PtStatistic {

 public:

  PtStatistic( int id ); // id = 0 or 1 for hadrons or muons respectively
  ~PtStatistic();

  void add( const Event& ev );             // get data from a new event
  void compute();                          // compute mean and rms

  int nParticles() const { return nPart; } // return
                                           // number of accepted particles
  float ptMean()   const;                  // return mean pt
  float ptRMS()    const;                  // return rms  pt

 private:

  // dummy copy constructor and assignment to prevent unadvertent copy
  PtStatistic           ( const PtStatistic& x );
  PtStatistic& operator=( const PtStatistic& x );

  int select;     // 0 or 1 for hadrons or muons respectively
  int nPart;      // number of particles selected to compute mean pt

  float sum;      // sum of pt
  float sqr;      // sum of pt square
  float mean;     // mean pt
  float rms;      // rms  pt

};

#endif

