//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // a cluster in the tpc // // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // // //----------------------------------------------------------- #ifndef TPCCLUSTER_HH #define TPCCLUSTER_HH // Base Class Headers ---------------- #include "FairHit.h" // Collaborating Class Headers ------- #include // remove if you do not need streaming op #include #include #include "TVector3.h" #include "McIdCollection.h" #include "TMatrixD.h" #include "PndTpcDigi.h" #include "PndTpcDigiMapper.h" #include "PndTpcDigiAge.h" // Collaborating Class Declarations -- class PndTpcCluster : public FairHit { friend class PndTpcLaserCorrectionTask; public: // Constructors/Destructors --------- PndTpcCluster(); PndTpcCluster(const PndTpcCluster&); PndTpcCluster(const TVector3& Pos, double Amp, unsigned int Index, unsigned int Size=1); PndTpcCluster(const TVector3& Pos, const TVector3& Sig, double Amp, unsigned int Index, unsigned int Size=1); virtual ~PndTpcCluster(); friend std::ostream& operator<< (std::ostream& s, const PndTpcCluster& me); // Accessors ----------------------- const TVector3& pos() const {return fpos;} const TVector3& sig() const {return fsig;} const TMatrixD& cov() const {return fcov;} TVector3 axis(unsigned int i=0) const {return calcAxis(i);} double amp() const {return famp;} unsigned int size() const {return fsize;} unsigned int nPad() const {return fnPad;} unsigned int nPadX() const {return fnPadX;} unsigned int nPadY() const {return fnPadY;} unsigned int index() const {return findex;} unsigned int get2DSize(); const McIdCollection& mcId() const {return fmcid;} unsigned int nMcIds() const {return fmcid.nIDs();} double maxMcWeight() const {return fmcid.MaxRelWeight();} unsigned int sector() const {return fsector;} // Modifiers ----------------------- void SetMcId(const McIdCollection& m){fmcid=m;} void SetIndex(unsigned int id){findex=id;} void SetCov(const TMatrixD& Cov){fcov=Cov;fhasaxis=false;} void SetPos(const TVector3& p) {fpos = p;} //allows for position correction. TODO: what happens to error? void SetSector(unsigned int id){fsector=id;} void SetIndexInTrack(int indexInTrack ) {findexInTrack=indexInTrack; }//for spatial sorting int GetIndexInTrack() const {return findexInTrack; } //for spatial sorting void nPad(unsigned int i) {fnPad=i;} void nPadX(unsigned int i) {fnPadX=i;} void nPadY(unsigned int i) {fnPadY=i;} // Operations ---------------------- void ClearDigis(){digis.clear();} //TRANSIENT FUNCTIONALITY: ------------------------------------------------------ unsigned int nDigi() const { return digis.size(); } // digis are COPIED and stored in the cluster void addDigi(const PndTpcDigi* d); void addDigi(const PndTpcDigi* d, double share); // returns a reference to a digi belonging to the cluster (a copy!) const PndTpcDigi* getDigi(int i) const; //-------------------------------------------------------------------------------- TVector3 calcAxis(unsigned int i=0) const; // calculate major axis from cluster shape private: // Private Data Members ------------ TVector3 fpos; TVector3 fsig; // errors TMatrixD fcov; // 2nd moment of cluster shape TVector3 faxis; // main axis of the cluster EXPERIMENTAL bool fhasaxis; double famp; unsigned int fsize; unsigned int fnPad; unsigned int fnPadX; unsigned int fnPadY; unsigned int findex; McIdCollection fmcid; unsigned int fsector; // sector on tpc where cluster was produced int findexInTrack; //index in track for spatial sorting //for optional saving of raw info that went into the cluster std::vector digis; // Private Methods ----------------- public: ClassDef(PndTpcCluster,6) }; #endif //-------------------------------------------------------------- // $Log$ //--------------------------------------------------------------