#ifndef PND2TPCDEDX_HH #define PND2TPCDEDX_HH #include "TObject.h" #include "TVector3.h" #include #include typedef std::pair PAIR; class TpcdEdx : public TObject { public: TpcdEdx(); virtual ~TpcdEdx() {;} double simpleMean(); double truncMean(double trashLow = 0.1, double trashHigh = 0.4); unsigned int nEntries() const {return _data.size();} double getdE(int i){return _data.at(i).first;} double getdx(int i){return _data.at(i).second;} void add(double dE,double dx){ PAIR p; p.first = dE; p.second = dx; _data.push_back(p); } void setMom(const TVector3& m) {_mom = m;} TVector3 getMom() const {return _mom;} void setDistX(double d_x) {_distX = d_x;} double getDistX() const {return _distX;} void setDistY(double d_y) {_distY = d_y;} double getDistY() const {return _distY;} void setDistZ(double d_z) {_distZ = d_z;} double getDistZ() const {return _distZ;} PAIR getdEdx(unsigned int i) const; //return the energy loss spectra std::vector getESpectrum(bool sorted=false) const; private: std::vector _data; TVector3 _mom; //mom hypothesis from fit double _distX; // x deviation of the digi to the vector between the planes double _distY; // y deviation of the digi to the vector between the planes double _distZ; // z deviation of the digi to the vector between the planes public: ClassDef(TpcdEdx,4) }; #endif