
//
// class to model the efficiency in a drift tube depending 
// on the distance of the crossing particle from the central wire
//
// The function is the sum of a straight line and a reversed gaussian,
// the parameters are saved or retrieved to/from a text file
//

class HitEfficiency {

 public:

  HitEfficiency();
  HitEfficiency( const char* fileName );
  ~HitEfficiency();

  // functions to get the boundaries
  float xMin() const;
  float xMax() const;
  float fMax() const;

  // operator function to get efficiency for distance x
  float operator()( float x ) const;

  // functions to dump or recover function parameters to/from a text file
  void dump   ( const char* fileName ) const;
  void recover( const char* fileName );

 protected:

  // cell width
  float wCell;

  // function parameters
  // line parameters
  float efMax;
  float slope;
  // gaussian parameters
  float iNorm;
  float width;

 private:

};


