21 PndTrkTrack::PndTrkTrack(
PndTrkCluster *cluster,
double x,
double y,
double radius) : fCluster(*cluster), fRefHit(NULL), fCenterX(x), fCenterY(y), fRadius(radius), fTanL(0), fZ0(0), fCharge(0) , fPhiMin(0), fPhiMax(360){}
23 PndTrkTrack::PndTrkTrack(
PndTrkHit *
hit,
PndTrkCluster *cluster,
double x,
double y,
double radius) : fCluster(*cluster), fRefHit(hit), fCenterX(x), fCenterY(y), fRadius(radius), fTanL(0), fZ0(0), fCharge(0), fPhiMin(0), fPhiMax(360) {}
25 PndTrkTrack::PndTrkTrack(
double x,
double y,
double radius) : fCluster(
PndTrkCluster()), fRefHit(NULL), fCenterX(x), fCenterY(y), fRadius(radius), fTanL(0), fZ0(0), fCharge(0), fPhiMin(0), fPhiMax(360) {}
40 TVector2 radius = momentum.XYvector();
41 radius = radius.Unit();
42 double rotx = radius.X();
43 double roty = radius.Y();
47 TVector2 center = myrad + position.XYvector();
66 else if(fCharge < 0 && fPhiMin >
fPhiMax) fPhiMax += 360;
71 PndTrkTrack::PndTrkTrack(
const PndTrkTrack &
track) : TObject(track), fCluster(
PndTrkCluster()), fRefHit(NULL), fCenterX(0), fCenterY(0), fRadius(0), fTanL(0), fZ0(0), fCharge(0), fPhiMin(0), fPhiMax(360) {
114 trkcand.
AddHit(detid, hitid, ihit);
133 TVector3 dj(1, 0, 0), dk(0, 0, 1);
134 TVector3 dpos1(2., 2., 10.);
135 TVector3 dpos2(2., 2., 10.);
136 TVector3 dmom1(0.2, 0.2, 0.5);
137 TVector3 dmom2(0.2, 0.2, 0.5);
139 FairTrackParP firstpar(pos1, mom1,
143 FairTrackParP lastpar(pos2, mom2,
149 if(mom1.Z() == -999) track.
SetFlag(-1);
203 Int_t nmore = 0, nless = 0;
211 TVector3 direction1 = position1 - TVector3(
fCenterX, fCenterY, 0);
212 double tmpphi = direction1.Phi();
214 if(direction1.Y()) tmpphi += 2 *
TMath::Pi();
221 TVector3 direction = position - TVector3(
fCenterX, fCenterY, 0);
222 double phi = direction.Phi();
223 if(ihit > 1) phi >= tmpphi ? nmore++ : nless++;
228 if(nmore > nless)
fCharge = -1;
294 TVector3 momentum(-999, -999, -999);
295 newposition = position;
302 TVector2
pos = TVector2(position.X(), position.Y());
303 TVector2 myrad = center -
pos;
312 myrad = center -
pos;
382 TVector2
v(x0 -
fCenterX, y0 - fCenterY);
391 if((
fCharge > 0 && ((Phi0 > 0 && ((alpha > 0 && alpha > Phi0) ||
392 (alpha < 0 && alpha < Phi0 - pi)))
394 ((Phi0 < 0 && ((alpha > 0 && alpha < pi + Phi0) ||
395 (alpha < 0 && alpha > Phi0)))) ))) Fi = - (pi2 + Fi) ;
396 else if((
fCharge < 0 && ((Phi0 > 0 && ((alpha > 0 && alpha < Phi0) ||
397 (alpha < 0 && alpha > Phi0 - pi)))
399 ((Phi0 < 0 && ((alpha > 0 && alpha > pi + Phi0) ||
400 (alpha < 0 && alpha < Phi0)))) ))) Fi = pi2 - Fi ;
404 return (Phi0 + Fi) * TMath::RadToDeg();
413 TVector3 fromcentertofrom = from - center;
414 double phi0 = fromcentertofrom.Phi();
421 TVector3 trarothit = TVector3(xp, yp, 0.);
434 double phi = trarothit.Phi();
459 if((
fCharge > 0 && ((Phi0 > 0 && ((alpha > 0 && alpha > Phi0) ||
460 (alpha < 0 && alpha < Phi0 - pi)))
462 ((Phi0 < 0 && ((alpha > 0 && alpha < pi + Phi0) ||
463 (alpha < 0 && alpha > Phi0)))) ))) Fi = - (pi2 + Fi) ;
464 else if((
fCharge < 0 && ((Phi0 > 0 && ((alpha > 0 && alpha < Phi0) ||
465 (alpha < 0 && alpha > Phi0 - pi)))
467 ((Phi0 < 0 && ((alpha > 0 && alpha > pi + Phi0) ||
468 (alpha < 0 && alpha < Phi0)))) ))) Fi = pi2 - Fi ;
472 return Fi * TMath::RadToDeg();
478 cout <<
"draw" << endl;
502 track->SetFillStyle(0);
503 track->SetLineColor(color);
504 track->Draw(
"only SAME");
void Clear(Option_t *opt="")
PndTrack ConvertToPndTrack()
Bool_t operator==(PndTrkTrack track)
PndTrackCand ConvertToPndTrackCand()
static T Sqrt(const T &x)
PndTrkCluster GetCluster()
PndTrkHit * GetHit(int index)
TString pt(TString pts, TString exts="px py pz")
Double_t ComputePhi(TVector3 hit)
TVector3 ComputeMomentumAtPosition(TVector3 position, TVector3 &newposition)
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
void Clear(Option_t *="")
PndTrkTrack & operator=(const PndTrkTrack &track)
static T ATan2(const T &y, const T &x)
FairTrackParP GetParamLast()
void Draw(Color_t color=kBlack)
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
FairTrackParP GetParamFirst()
Double_t ComputePhiFrom(TVector3 hit, TVector3 from)