//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Implementation of class PndTpcRiemannHit // see PndTpcRiemannHit.hh for details // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // // //----------------------------------------------------------- // Panda Headers ---------------------- // This Class' Header ------------------ #include "PndTpcRiemannHit.h" #include "TMath.h" // C/C++ Headers ---------------------- #include "PndTpcCluster.h" #include // Collaborating Class Headers -------- #include "PndTpcRiemannTrack.h" // Class Member definitions ----------- // scale factor! r=1 => z'=0.5 !!! // to normalize cm-range #define RIEMANNSCALE 100. ClassImp(PndTpcRiemannHit) PndTpcRiemannHit::PndTpcRiemannHit(double r, double phi) : _cluster(NULL) { double r2=r*r; double d=1+r2; _x.SetX(r*TMath::Cos(phi)/d); _x.SetY(r*TMath::Sin(phi)/d); _x.SetZ(r2/d); } PndTpcRiemannHit::PndTpcRiemannHit(PndTpcCluster* cl) : _cluster(cl) { TVector2 a(cl->pos().X(),cl->pos().Y()); double r=a.Mod()/RIEMANNSCALE; double phi=a.Phi(); double r2=r*r; double d=1+r2; _x.SetX(r*TMath::Cos(phi)/d); _x.SetY(r*TMath::Sin(phi)/d); _x.SetZ(r2/d); } PndTpcRiemannHit::~PndTpcRiemannHit(){} double PndTpcRiemannHit::z()const { if(_cluster==NULL)return 0; else return _cluster->pos().Z(); } void PndTpcRiemannHit::calcPosOnTrk(PndTpcRiemannTrack* trk){ assert(trk!=NULL); TVectorD o=trk->orig(); o*=RIEMANNSCALE;// convert back to cm; double r=trk->r(); r*=RIEMANNSCALE; const PndTpcCluster* firstCl=trk->getHit(0)->cluster(); assert(firstCl!=NULL); TVector2 k(firstCl->pos().X()-o[0],firstCl->pos().Y()-o[1]); TVector2 l(_cluster->pos().X()-o[0],_cluster->pos().Y()-o[1]); _alpha=l.DeltaPhi(k); _s=_alpha*r; }