#ifndef FOR_HIT #define FOR_HIT ////////////////////////////////////////////////////////////////////////// // // // FOPI Forward Hit // // // // Class container for FOPI Forward hits // // // // paul.buehler@oeaw.ac.at // // // ////////////////////////////////////////////////////////////////////////// #include "TMath.h" #include "TObject.h" #include "TVector3.h" #include "TRotation.h" #include "TMatrixD.h" class TDirectory; class FopiForwardHit : public TObject { private: Double_t fRad; Int_t fType; // 0: local, else: global TVector3 fLocalPos; // hit position in local coordinate system TVector3 fGlobalPos; // hit position in global coordinate system TMatrixD *fLocalCov; TMatrixD *fGlobalCov; Int_t fHrsec; // reference sector for hits Float_t fTaroff; // z-offset of target Float_t fPhi0; // phi0 for sector-angle correlation TVector3 fHoff; // Helitron offset TVector3 fHrot; // Helitron rotation TRotation fSecMatrix; // Rotation Matrix to compensate for rotation // of sector TRotation fRotMatrix; // Rotation Matrix to compensate for rotation // of Helitron relative to beam coordinate system TVector3 fWireDirection; void ComputeSecMatrix(); void ComputeRotMatrix(); void Convert(); void ComputeWireDirection(); void SetLocalPos (Float_t x, Float_t y, Float_t z) {fLocalPos.SetXYZ(x,y,z);} void SetGlobalPos (Float_t x, Float_t y, Float_t z) {fGlobalPos.SetXYZ(x,y,z);} public: FopiForwardHit(); FopiForwardHit(Int_t type, Float_t hrsec, Float_t taroff, TVector3 hoff, TVector3 hrot); virtual ~FopiForwardHit() {Clear(); } // Modifiers ---------------------------------------------------- void SetPos (Int_t type, Float_t x, Float_t y, Float_t z); void SetPos (Float_t x, Float_t y, Float_t z); void SetPos (Int_t type, TVector3 pos); void SetPos (TVector3 pos); void SetCov (Int_t type, TMatrixD covmat) { fType = type; if (fType == 0) { fLocalCov->SetMatrixArray(covmat.GetMatrixArray()); } else { fGlobalCov->SetMatrixArray(covmat.GetMatrixArray()); } this->Convert(); // fGlobalCov->Print(); } void SetGlobalPos (TVector3 pos) {SetPos(1,pos);} void SetLocalPos (TVector3 pos) {SetPos(0,pos);} void SetType (Int_t type) { fType=type; this->Convert();} void SetHrsec (Int_t hrsec) { fHrsec=hrsec; this->ComputeSecMatrix(); this->ComputeWireDirection(); this->Convert();} void SetTaroff(Float_t taroff) { fTaroff = taroff; this->Convert();} void SetPhi0(Float_t phi0) {fPhi0 = phi0; this->Convert();} void SetHoff(TVector3 hoff) { fHoff=hoff; this->Convert();} void SetHrot(TVector3 hrot) { fHrot=hrot; this->ComputeRotMatrix(); this->Convert();} // Accessors ---------------------------------------------------- Int_t GetType() const {return fType;} TVector3 GetPos(Int_t type)const { if (type == 0) {return fLocalPos;} else {return fGlobalPos;}} TMatrixD GetCov(Int_t type)const { if (type == 0) {return *fLocalCov;} else {return *fGlobalCov;}} TVector3 GetLocalPos() const {return fLocalPos;} TVector3 GetGlobalPos() const {return fGlobalPos;} Int_t GetHrsec() const {return fHrsec;} Float_t GetTaroff() const {return fTaroff;} Float_t GetPhi0() const {return fPhi0;} TVector3 GetHoff() const {return fHoff;} TVector3 GetHrot() const {return fHrot;} TVector3 getWireDirection() const {return fWireDirection;} ClassDef(FopiForwardHit,1) //hit class }; #endif