00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef CLUSTER_H
00012 #define CLUSTER_H
00013
00014 #include "TObject.h"
00015 #include "TRefArray.h"
00016 #include "RecoBase/CellHit.h"
00017 #include <vector>
00018
00019 using namespace std;
00020
00021 namespace recobase {
00023 class Cluster : public TObject
00024 {
00025 public:
00026 Cluster();
00027 Cluster(vector<const recobase::CellHit*>& cellvec);
00028 ~Cluster();
00029
00030
00031
00032 bool Add(const recobase::CellHit* cell);
00033 int NPlane() const {return fXPlane.size() + fYPlane.size(); }
00034 int NXPlane() const {return fXPlane.size(); }
00035 int NYPlane() const {return fYPlane.size(); }
00036
00037 int Plane(int i) const;
00038 int XPlane(int i) const;
00039 int YPlane(int i) const;
00040
00041 int NCell() const;
00042 int NXCell() const;
00043 int NYCell() const;
00044 int NCell(geo::View_t view) const;
00045
00046 bool Is3D() const {return (this->NXPlane()>0 && this->NYPlane()>0); }
00047
00048 const recobase::CellHit* XCell(int i) const;
00049 const recobase::CellHit* YCell(int i) const;
00050 const recobase::CellHit* Cell(geo::View_t view, int i) const;
00051
00052 const recobase::CellHit* XCell(int icell, int iplane) const;
00053 const recobase::CellHit* YCell(int icell, int iplane) const;
00054 const recobase::CellHit* Cell(geo::View_t view, int icell, int iplane) const;
00055
00056 const double* XYZT() const { return f4Vec; }
00057 double Z() const {return f4Vec[2];}
00058 double dZ() const {return fd4Vec[2];}
00059 double T() const {return f4Vec[3];}
00060 double dT() const {return fd4Vec[3];}
00061 double X() const {return f4Vec[0];}
00062 double dX() const {return fd4Vec[0];}
00063 double Y() const {return f4Vec[1];}
00064 double dY() const {return fd4Vec[1];}
00065 double Q() const {return fQ;}
00066 double dQ() const {return fdQ;}
00067
00068 void SetQ(double q) { fQ = q; }
00069 void SetdQ(double dq) { fdQ = dq; }
00070 void SetXYZT(double x[]) { for (int i=0; i<4; ++i) f4Vec[i] = x[i]; }
00071 void SetdXYZT(double dx[]) { for (int i=0; i<4; ++i) fd4Vec[i] = dx[i]; }
00072
00073 void Clear();
00074
00075 private:
00076 vector<const recobase::CellHit*> fXCell;
00077 vector<const recobase::CellHit*> fYCell;
00078
00079 vector<int> fXPlane;
00080 vector<int> fYPlane;
00081 vector<int> fPlane;
00082
00083 short fStatus;
00084 double f4Vec[4];
00085 double fd4Vec[4];
00086 double fQ, fdQ;
00087
00088 ClassDef(Cluster, 2);
00089
00090 };
00091 }
00092
00093 #endif // CLUSTER_H