StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcCoordinate.h
1 /*********************************************************************
2  * $Id: StTpcCoordinate.h,v 1.2 2011/01/18 14:34:28 fisyak Exp $
3  * base class for TPC coordinate / direction transformations
4  */
5 #ifndef ST_TPC_COORDINATE_H
6 #define ST_TPC_COORDINATE_H
7 #include "Stiostream.h"
8 #include "StThreeVector.hh"
9 
11  public:
12  StTpcCoordinate(const Double_t x, const Double_t y, const Double_t z, const Int_t sect, Int_t row) :
13  mPosition(x,y,z), mFromSector(sect), mFromRow(row) {}
14  StTpcCoordinate(const StThreeVector<double>& position, const Int_t sect, Int_t row) :
15  mPosition(position), mFromSector(sect), mFromRow(row) {}
16  virtual ~StTpcCoordinate() {}
17  Int_t operator==(const StTpcCoordinate& p) const {return p.mPosition == mPosition;}
18  Int_t operator!=(const StTpcCoordinate& p) const {return !(*this == p);}
19 
20  // access functions provided by StThreeVector
21  virtual const StThreeVector<double>& position() const { return mPosition; }
22  Int_t fromSector() const { return mFromSector; }
23  Int_t fromRow() const { return mFromRow; }
24  Int_t sector() const { return mFromSector; }
25  Int_t row() const { return mFromRow; }
26  StThreeVector<double>& position() { return mPosition; }
27  virtual void setPosition(StThreeVector<double>& position) { mPosition = position; }
28  virtual void setSector(Int_t sector) { mFromSector = sector; }
29  virtual void setRow(Int_t row) { mFromRow = row; }
30 protected:
31  StThreeVector<double> mPosition;
32  Int_t mFromSector;
33  Int_t mFromRow;
34 };
35 // Non-member
36 ostream& operator<<(ostream&, const StTpcCoordinate&);
37 #endif