FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PndRiemannTrack Class Reference

#include <PndRiemannTrack.h>

Inheritance diagram for PndRiemannTrack:

Public Member Functions

 PndRiemannTrack ()
 
 PndRiemannTrack (PndTrackCand *trackCand)
 
 ~PndRiemannTrack ()
 
const TVectorD & n () const
 
double c () const
 
const TVectorD & av () const
 
TVectorD orig () const
 
double dX ()
 
double dY ()
 
double r () const
 
double dR ()
 
double dip ()
 
double dipangle ()
 
double dDip ()
 
double Pt (double B)
 
double Pl (double B)
 
double P (double B)
 
double sign () const
 
double getSZm () const
 
double getSZt () const
 
unsigned int getNumHits ()
 
PndRiemannHitgetHit (unsigned int i)
 
PndRiemannHitgetLastHit ()
 
std::vector< PndRiemannHitgetHits () const
 
TVector3 getPforHit (int i, double B)
 
PndTrack getPndTrack (Double_t B)
 
FairTrackParP getTrackParPForHit (Int_t i, Double_t B)
 
Int_t getCharge (Double_t B)
 
double calcZPosByS (double s)
 
TVector3 calcPosByS (double s)
 
void calcStartStopAlpha ()
 
double calcAlpha (PndRiemannHit *myHit)
 
void calcSForHits ()
 
int calcIntersection (PndRiemannTrack &track, TVector3 &p1, TVector3 &p2)
 
void sortHits ()
 
double weight () const
 
TMatrixD covPlane () const
 
TMatrixD jacRXY () const
 
TMatrixD covRXY () const
 
double m () const
 
double mError () const
 
double t () const
 
double tError () const
 
void addHit (PndRiemannHit &hit)
 
void addPndTrackCand (PndTrackCand *trackCand)
 
void init (double x0, double y0, double R, double dip, double z0)
 
void refit (bool withErrorCalc=true)
 
double dist (PndRiemannHit *hit)
 
double distError (PndRiemannHit *hit)
 
double distCircle (PndRiemannHit *hit)
 
double ChiSquareDistCircle ()
 
void szFit (bool withErrorCalc=true)
 
double calcChi2Plane ()
 
double calcSZChi2 (PndRiemannHit *hit)
 
double szDist (PndRiemannHit *hit)
 
double szError (PndRiemannHit *hit)
 
double szChi2 () const
 
void SetVerbose (int i)
 
void SetVertexCut (double cut)
 
TVector3 calcErrorPosByS (Double_t s, Double_t dS)
 
void correctSttHits ()
 
PndRiemannHit correctSttHit (PndSttHit *mySttHit)
 
PndRiemannHit correctSttSkewedHit (PndSttHit *mySttHit, PndSttTube *myTube)
 
void PrintHits ()
 
virtual void Print (std::ostream &out=std::cout)
 

Private Member Functions

void calcJacRXY ()
 calcualtes fjacRXY More...
 
TVector3 calcErrorLineNorm (PndRiemannTrack &track)
 
TVector3 calcErrorLineOffset (PndRiemannTrack &track)
 
TVectorD calcErrorXY1XY2 (TVector3 &line, TVector3 &dLine, TVector3 &offset, TVector3 &dOffset)
 
Double_t calcErrorS (TVector2 &XY, TVector2 &dXY, PndRiemannTrack *track)
 
Int_t GetBranchId (TString branchName)
 

Private Attributes

TVectorD fn
 normal vector to plane; More...
 
TVectorD fav
 average over all hits More...
 
double fc
 distance of plane to origin More...
 
double fm
 parameters of sz-fit More...
 
double ft
 
double fmError
 Error of fit. More...
 
double ftError
 Error of fit. More...
 
double fChi2
 Chisquare of sz fit. More...
 
TMatrixD fcovPlane
 full covarince matrix of the plane; More...
 
TMatrixD fjacRXY
 jacobian matrix to transform from c,n1,n2,n2 to r,x,y More...
 
TMatrixD fcovRXY
 
int fVerbose
 
bool fFitDone
 
bool fSZFitDone
 
bool fErrorCalcDone
 
double fweight
 sum over all weights (1/(sigmaXY*sigmaXY)) More...
 
bool ftrefit
 
double fVertexCut
 
std::vector< PndRiemannHitfHits
 
Double_t fStartAlpha
 
Double_t fStopAlpha
 
std::map< TString, Int_t > fBranchNameMap
 

Friends

std::ostreamoperator<< (std::ostream &out, PndRiemannTrack &track)
 

Detailed Description

Definition at line 46 of file PndRiemannTrack.h.

Constructor & Destructor Documentation

PndRiemannTrack::PndRiemannTrack ( )

Definition at line 53 of file PndRiemannTrack.cxx.

References fHits.

53  :
54  fn(3),fav(3), fc(0), fm(0), ft(0), fmError(0), ftError(0), fChi2(0), fcovPlane(4,4), fjacRXY(3,4), fcovRXY(3,3),
55  fVerbose(0), fFitDone(false), fSZFitDone(false), fErrorCalcDone(false), fweight(0),ftrefit(false),fVertexCut(0.5),
56  fStartAlpha(0), fStopAlpha(0)
57 {
58  fHits.clear();
59 }
double fweight
sum over all weights (1/(sigmaXY*sigmaXY))
std::vector< PndRiemannHit > fHits
double fmError
Error of fit.
double fChi2
Chisquare of sz fit.
TVectorD fn
normal vector to plane;
TMatrixD fjacRXY
jacobian matrix to transform from c,n1,n2,n2 to r,x,y
double fc
distance of plane to origin
TMatrixD fcovPlane
full covarince matrix of the plane;
double fm
parameters of sz-fit
TVectorD fav
average over all hits
double ftError
Error of fit.
PndRiemannTrack::PndRiemannTrack ( PndTrackCand trackCand)

Definition at line 61 of file PndRiemannTrack.cxx.

References addPndTrackCand(), and fHits.

61  :
62  fn(3),fav(3), fc(0), fm(0), ft(0), fmError(0), ftError(0), fChi2(0), fcovPlane(4,4), fjacRXY(3,4), fcovRXY(3,3),
63  fVerbose(0), fFitDone(false), fSZFitDone(false), fErrorCalcDone(false), fweight(0),ftrefit(false),fVertexCut(0.5),
64  fStartAlpha(0), fStopAlpha(0)
65 {
66  fHits.clear();
67  addPndTrackCand(trackCand);
68 }
double fweight
sum over all weights (1/(sigmaXY*sigmaXY))
std::vector< PndRiemannHit > fHits
double fmError
Error of fit.
double fChi2
Chisquare of sz fit.
void addPndTrackCand(PndTrackCand *trackCand)
TVectorD fn
normal vector to plane;
TMatrixD fjacRXY
jacobian matrix to transform from c,n1,n2,n2 to r,x,y
double fc
distance of plane to origin
TMatrixD fcovPlane
full covarince matrix of the plane;
double fm
parameters of sz-fit
TVectorD fav
average over all hits
double ftError
Error of fit.
PndRiemannTrack::~PndRiemannTrack ( )

Definition at line 82 of file PndRiemannTrack.cxx.

83 {
84 }

Member Function Documentation

void PndRiemannTrack::addHit ( PndRiemannHit hit)

Definition at line 102 of file PndRiemannTrack.cxx.

References fav, fErrorCalcDone, fFitDone, fHits, fSZFitDone, ftrefit, fVerbose, fweight, PndRiemannHit::sigmaX(), PndRiemannHit::sigmaXY(), PndRiemannHit::sigmaY(), and PndRiemannHit::x().

Referenced by PndMvdRiemannTrackFinderTaskEff::AddGhostTrack(), addPndTrackCand(), PndMvdSttGemRiemannTrackFinder::AssignGemHits(), PndMvdSttGemRiemannTrackFinder::AssignSkewedSttHits(), PndMvdSttGemRiemannTrackFinder::AssignSttHits(), PndMvdRiemannTrackFinderTaskCutPar::CalcRiemannTracks(), PndRiemannTrackFinder::CreateRiemannTrack(), PndSttCellTrackletGenerator::CreateRiemannTrack(), PndMvdEventAnaTask::Exec(), PndRiemannTrackFinder::FindTracks(), PndMvdSttGemRiemannTrackFinder::FindTracks(), PndSciTAnaIdeal::GetRiemannTrack(), PndMvdSttGemRiemannTrackFinder::GetStartTracks(), PndRiemannTrackFinder::GetStartTracks(), and PndMvdRiemannVertexFinderTask::refit().

102  {
103 // SetVerbose(3);
104  //int nbefore=fHits.size(); //[R.K. 01/2017] unused variable?
105  fHits.push_back(hit);
106 // std::cout << "fweight before addHit: " << fweight << std::endl;
107  //ADDED by ME//
108  if ( ftrefit ) {
109  fav *= fweight;
110  ftrefit = false;
111  }
112 
113  if (fVerbose > 1) std::cout << "-I- PndRiemannTrack::addHit " << fHits.size() -1 << ": " << hit.x().X() << " " << hit.x().Y() << " "
114  << hit.sigmaX() << " " << hit.sigmaY() << " " << hit.sigmaXY() << std::endl;
115  //fav*=(double)nbefore;
116  fav[0]+=hit.x().X() /(hit.sigmaXY()*hit.sigmaXY());
117  fav[1]+=hit.x().Y() /(hit.sigmaXY()*hit.sigmaXY());;
118  fav[2]+=hit.x().Z() /(hit.sigmaXY()*hit.sigmaXY());;
119  //fav*=1./(double)(nbefore+1);
120  fweight += 1/(hit.sigmaXY()*hit.sigmaXY());
121 
122 // std::cout << "fweight after addHit: " << fweight << std::endl;
123  fFitDone = false;
124  fSZFitDone = false;
125  fErrorCalcDone = false;
126 }
double fweight
sum over all weights (1/(sigmaXY*sigmaXY))
double sigmaXY() const
std::vector< PndRiemannHit > fHits
double sigmaX() const
Definition: PndRiemannHit.h:78
const TVector3 & x() const
Definition: PndRiemannHit.h:71
TVectorD fav
average over all hits
double sigmaY() const
Definition: PndRiemannHit.h:79
void PndRiemannTrack::addPndTrackCand ( PndTrackCand trackCand)

Definition at line 70 of file PndRiemannTrack.cxx.

References addHit().

Referenced by PndRiemannTrack().

71 {
72  FairRootManager* ioman = FairRootManager::Instance();
73  std::set<FairLink> linksToHits = trackCand->GetLinks();
74  for (std::set<FairLink>::iterator iter = linksToHits.begin(); iter != linksToHits.end(); iter++)
75  {
76  PndRiemannHit riemannHit((FairHit*)ioman->GetCloneOfLinkData(*iter));
77  addHit(riemannHit);
78  }
79 }
void addHit(PndRiemannHit &hit)
const TVectorD& PndRiemannTrack::av ( ) const
inline

Definition at line 58 of file PndRiemannTrack.h.

References fav.

58 {return fav;}
TVectorD fav
average over all hits
double PndRiemannTrack::c ( ) const
inline

Definition at line 57 of file PndRiemannTrack.h.

References fc.

Referenced by calcErrorLineOffset(), calcIntersection(), correctSttHit(), and Print().

57 {return fc;}
double fc
distance of plane to origin
double PndRiemannTrack::calcAlpha ( PndRiemannHit myHit)

Definition at line 930 of file PndRiemannTrack.cxx.

References orig(), and PndRiemannHit::x().

Referenced by calcStartStopAlpha().

931 {
932  TVectorD origin = orig();
933  TVector2 myVector(myHit->x().x() - origin[0], myHit->x().y() - origin[1]);
934  return myVector.Phi();
935 }
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
double PndRiemannTrack::calcChi2Plane ( )

Definition at line 501 of file PndRiemannTrack.cxx.

References dist(), distError(), fFitDone, getHit(), getNumHits(), i, r(), and refit().

Referenced by Print().

502 {
503  double chiSquare = 0;
504  if (fFitDone == false)
505  refit ();
506  if (r() > 0) {
507  for (size_t i = 0; i < getNumHits(); i++){
508  PndRiemannHit* actualHit = getHit(i);
509 // chiSquare += TMath::Power((dist(actualHit)/actualHit->sigmaXY()),2);
510 // std::cout << "Dist: " << " "<< dist(actualHit) << std::endl;
511  chiSquare += TMath::Power((dist(actualHit)/distError(actualHit)),2);
512  }
513  if (getNumHits() > 3)
514  chiSquare /= (getNumHits() - 3);
515  else
516  chiSquare = 0;
517  }
518  return chiSquare;
519 }
unsigned int getNumHits()
double distError(PndRiemannHit *hit)
Int_t i
Definition: run_full.C:25
double dist(PndRiemannHit *hit)
void refit(bool withErrorCalc=true)
double r() const
PndRiemannHit * getHit(unsigned int i)
TVector3 PndRiemannTrack::calcErrorLineNorm ( PndRiemannTrack track)
private

Definition at line 743 of file PndRiemannTrack.cxx.

References covPlane(), Double_t, n(), and CAMath::Sqrt().

Referenced by calcIntersection().

744 {
745  TVectorD n1=n();
746  TVectorD n2=track.n();
747 
748  TMatrixD covN1 = covPlane();
749  TMatrixD covN2 = track.covPlane();
750 
751  TVector3 dN1(TMath::Sqrt(covN1[1][1]), TMath::Sqrt(covN1[2][2]), TMath::Sqrt(covN1[3][3]));
752  TVector3 dN2(TMath::Sqrt(covN2[1][1]), TMath::Sqrt(covN2[2][2]), TMath::Sqrt(covN2[3][3]));
753 
754  Double_t dLineNorm1 = TMath::Sqrt(TMath::Power(dN1[1]*n2[2],2) + TMath::Power(n1[1]*dN2[2],2) +
755  TMath::Power(dN1[2]*n2[1],2) + TMath::Power(n1[2]*dN2[1],2));
756 
757  Double_t dLineNorm2 = TMath::Sqrt(TMath::Power(dN1[2]*n2[0],2) + TMath::Power(n1[2]*dN2[0],2) +
758  TMath::Power(dN1[0]*n2[2],2) + TMath::Power(n1[0]*dN2[2],2));
759 
760  Double_t dLineNorm3 = TMath::Sqrt(TMath::Power(dN1[0]*n2[1],2) + TMath::Power(n1[0]*dN2[1],2) +
761  TMath::Power(dN1[1]*n2[0],2) + TMath::Power(n1[1]*dN2[0],2));
762 
763  return TVector3(dLineNorm1, dLineNorm2, dLineNorm3);
764 
765 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
const TVectorD & n() const
Double_t
TMatrixD covPlane() const
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
TVector3 PndRiemannTrack::calcErrorLineOffset ( PndRiemannTrack track)
private

Definition at line 767 of file PndRiemannTrack.cxx.

References c(), c1, c2, covPlane(), Double_t, dx, dy, n(), and CAMath::Sqrt().

Referenced by calcIntersection().

768 {
769  TVectorD n1=n();
770  Double_t c1=c();
771  TVectorD n2=track.n();
772  Double_t c2=track.c();
773 
774  TMatrixD covN1 = covPlane();
775  TMatrixD covN2 = track.covPlane();
776 
777  TVector3 dN1(TMath::Sqrt(covN1[1][1]), TMath::Sqrt(covN1[2][2]), TMath::Sqrt(covN1[3][3]));
778  TVector3 dN2(TMath::Sqrt(covN2[1][1]), TMath::Sqrt(covN2[2][2]), TMath::Sqrt(covN2[3][3]));
779  Double_t dC1(TMath::Sqrt(covN1[0][0]));
780  Double_t dC2(TMath::Sqrt(covN2[0][0]));
781 
782  Double_t denom = n1[0]*n2[1] - n1[1]*n2[0];
783 // Double_t dDenom2 = (TMath::Power(dN1[0]*n2[1],2) + TMath::Power(n1[0]*dN2[1],2) +
784 // TMath::Power(dN1[1]*n2[0],2) + TMath::Power(n1[1]*dN2[0],2));
785 
786  Double_t qX = (n1[1]*c2-n2[1]*c1)/(TMath::Power(denom,2));
787  Double_t qY = (n2[0]*c1-n1[0]*c2)/(TMath::Power(denom,2));
788 
789  Double_t dx = TMath::Sqrt(TMath::Power(n2[1]*dC1/denom,2) + TMath::Power(n1[1]*dC2/denom,2) +
790  TMath::Power(qX*n2[1]*dN1[0],2) + TMath::Power(qX*n1[1]*dN2[0],2) +
791  TMath::Power((c1/denom + qX*n2[0])*dN1[1],2) +
792  TMath::Power((c1/denom + qX*n1[0])*dN2[1],2));
793 
794  Double_t dy = TMath::Sqrt(TMath::Power(n2[0]*dC1/denom,2) + TMath::Power(n1[0]*dC2/denom,2) +
795  TMath::Power(qX*n2[0]*dN1[1],2) + TMath::Power(qX*n1[0]*dN2[1],2) +
796  TMath::Power((c1/denom + qY*n2[1])*dN1[0],2) +
797  TMath::Power((c1/denom + qY*n1[1])*dN2[0],2));
798 
799  return TVector3(dx, dy, 0);
800 
801 }
double dy
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
c2
Definition: plot_dirc.C:39
const TVectorD & n() const
Double_t
c1
Definition: plot_dirc.C:35
double dx
TMatrixD covPlane() const
double c() const
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
TVector3 PndRiemannTrack::calcErrorPosByS ( Double_t  s,
Double_t  dS 
)

Definition at line 878 of file PndRiemannTrack.cxx.

References CAMath::Cos(), Double_t, dPhi, dR(), dX(), dY(), fVerbose, getHit(), m(), mError(), orig(), phi, r(), CAMath::Sin(), CAMath::Sqrt(), tError(), and PndRiemannHit::x().

Referenced by calcIntersection().

879 {
880  TVectorD o=orig();
881  const PndRiemannHit* firstHit=getHit(0);
882  assert(firstHit!=NULL);
883  TVector2 k(firstHit->x().X()-o[0],firstHit->x().Y()-o[1]);
884  Double_t dPhi = TMath::Sqrt(TMath::Power(dS/r(),2) + TMath::Power(s/(r()*r())*dR(),2));
885  Double_t phi = s/r();
886  Double_t dL1 = TMath::Sqrt(TMath::Power((-k.X()*TMath::Sin(phi)-k.Y()*TMath::Cos(phi))*dPhi,2));
887  Double_t dL2 = TMath::Sqrt(TMath::Power((k.X()*TMath::Cos(phi)-k.Y()*TMath::Sin(phi))*dPhi,2));
888  Double_t dZCoord = TMath::Sqrt(TMath::Power(m()*dS,2) + TMath::Power(s*mError(),2) + TMath::Power(tError(),2));
889 
890  Double_t resX = TMath::Sqrt(TMath::Power(dL1,2) + TMath::Power(dX(),2));
891  Double_t resY = TMath::Sqrt(TMath::Power(dL2,2) + TMath::Power(dY(),2));
892 
893  TVector3 result(resX, resY, dZCoord);
894 
895  if (fVerbose > 1) std::cout<< "PosBySError: s:" << dS << " Vector: " << result.x() << " " << result.y() << " " << result.z() << std::endl;
896  return result;
897 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TLorentzVector s
Definition: Pnd2DStar.C:50
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
double m() const
double tError() const
Double_t
double r() const
double mError() const
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
double dPhi
Definition: RiemannTest.C:17
PndRiemannHit * getHit(unsigned int i)
double PndRiemannTrack::calcErrorS ( TVector2 &  XY,
TVector2 &  dXY,
PndRiemannTrack track 
)
private

Definition at line 857 of file PndRiemannTrack.cxx.

References alpha, dR(), getHit(), orig(), R, r(), CAMath::Sqrt(), and PndRiemannHit::x().

Referenced by calcIntersection().

858 {
859  assert(track!=NULL);
860  TVectorD o=track->orig();
861  double R=track->r();
862  double dr = track->dR();
863 
864  const PndRiemannHit* firstHit=track->getHit(0);
865  assert(firstHit!=NULL);
866  TVector2 k(firstHit->x().X()-o[0],firstHit->x().Y()-o[1]);
867  TVector2 l(XY.X()-o[0],XY.Y()-o[1]);
868 
869  double alpha=l.DeltaPhi(k);
870  double dAlpha = TMath::Sqrt(TMath::Power(XY.X()*dXY.Y(),2) + TMath::Power(XY.Y()*dXY.X(),2))/(TMath::Power(XY.X(),2) + TMath::Power(XY.Y(),2));
871 
872  double dS = TMath::Sqrt(TMath::Power(dAlpha*R,2) + TMath::Power(alpha*dr,2));
873 
874  return dS;
875 
876 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double r() const
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
double alpha
Definition: f_Init.h:9
Double_t R
Definition: checkhelixhit.C:61
PndRiemannHit * getHit(unsigned int i)
TVectorD PndRiemannTrack::calcErrorXY1XY2 ( TVector3 &  line,
TVector3 &  dLine,
TVector3 &  offset,
TVector3 &  dOffset 
)
private

Definition at line 803 of file PndRiemannTrack.cxx.

References Double_t, p, and CAMath::Sqrt().

Referenced by calcIntersection().

804 {
805  const double SMALL = 1E-12;
806  Double_t denom = (TMath::Power(line[0],2) + TMath::Power(line[1],2));
807  Double_t p = (2*(offset[0]*line[0] + offset[1]*line[1]) - line[2]) / denom;
808  Double_t q = (TMath::Power(offset[0],2)+TMath::Power(offset[1],2) - offset[2]) / denom;
809  Double_t S1 = -(p/2) + TMath::Sqrt(TMath::Power(p/2,2) - q);
810  Double_t S2 = -(p/2) - TMath::Sqrt(TMath::Power(p/2,2) - q);
811 
812 // std::cout << "S1: " << S1 << " S2: " << S2 << std::endl;
813  Double_t prod = (2*(offset[0]*line[0] + offset[1]*line[1]) - line[2]) / TMath::Power(denom,2);
814 // std::cout << "denom: " << denom << " prod1: " << prod * line[0] * dLine[0] << " prod2: " << prod * line[1] * dLine[1]<< std::endl;
815 
816  if ((TMath::Power(p/2,2)-q) < SMALL)
817  return TVectorD(6);
818 
819  Double_t sqrterm = TMath::Sqrt(TMath::Power(p/2,2)-q);
820 
821  Double_t dP = TMath::Sqrt(TMath::Power(2*line[0]*dOffset[0]/denom,2) + TMath::Power(2*line[1]*dOffset[1]/denom,2) +
822  TMath::Power(dLine[2]/denom,2) +
823  TMath::Power((2*offset[0]/denom - 2*prod*line[0])*dLine(0),2) +
824  TMath::Power((2*offset[1]/denom - 2*prod*line[1])*dLine(1),2));
825 // std::cout << "dP1: " << TMath::Power(2*line[0]*dOffset[0]/denom,2) << " dP2: " << TMath::Power(2*line[1]*dOffset[1]/denom,2) << std::endl;
826 // std::cout << "dP3: " << TMath::Power(dLine[2]/denom,2) << std::endl;
827 // std::cout << "dP4: " << TMath::Power((2*offset[0]/denom - 2*prod*line[0])*dLine(0),2) << " dP5: " << TMath::Power((2*offset[1]/denom - 2*prod*line[1])*dLine(1),2) << std::endl;
828 
829 // std::cout << "P: " << p << "+/-" << dP << std::endl;
830  Double_t dQ = TMath::Sqrt(TMath::Power(2*offset[0]/denom*dOffset[0],2) +
831  TMath::Power(2*offset[1]/denom*dOffset[1],2) +
832  TMath::Power(dOffset[2]/denom,2));
833 // std::cout << "Q: " << q << "+/-" << dQ << std::endl;
834  Double_t dS1 = TMath::Sqrt(TMath::Power((-1/2 + p/(4*sqrterm)) * dP,2) + TMath::Power(1/(2*sqrterm)*dQ, 2));
835  Double_t dS2 = TMath::Sqrt(TMath::Power((-1/2 - p/(4*sqrterm)) * dP,2) + TMath::Power(1/(2*sqrterm)*dQ, 2));
836 
837  Double_t dX1 = TMath::Sqrt(TMath::Power(dOffset[0],2) + TMath::Power(line[0]*dS1,2) + TMath::Power(dLine[0]*S1,2));
838  Double_t dY1 = TMath::Sqrt(TMath::Power(dOffset[1],2) + TMath::Power(line[1]*dS1,2) + TMath::Power(dLine[1]*S1,2));
839 
840 // std::cout << "dX1: " << dX1 << " dY1: " << dY1 << std::endl;
841 
842  Double_t dX2 = TMath::Sqrt(TMath::Power(dOffset[0],2) + TMath::Power(line[0]*dS2,2) + TMath::Power(dLine[0]*S2,2));
843  Double_t dY2 = TMath::Sqrt(TMath::Power(dOffset[1],2) + TMath::Power(line[1]*dS2,2) + TMath::Power(dLine[1]*S2,2));
844 
845 // std::cout << "dX2: " << dX2 << " dY2: " << dY2 << std::endl;
846  TVectorD result(6);
847  result[0] = dX1;
848  result[1] = dY1;
849  result[2] = dX2;
850  result[3] = dY2;
851  result[4] = dS1;
852  result[5] = dS2;
853  return result;
854 
855 }
Double_t p
Definition: anasim.C:58
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TVector3 offset(2, 0, 0)
Double_t
int PndRiemannTrack::calcIntersection ( PndRiemannTrack track,
TVector3 &  p1,
TVector3 &  p2 
)

Definition at line 610 of file PndRiemannTrack.cxx.

References c(), c1, c2, calcErrorLineNorm(), calcErrorLineOffset(), calcErrorPosByS(), calcErrorS(), calcErrorXY1XY2(), PndRiemannHit::calcPosOnTrk(), calcZPosByS(), Double_t, fn, fVerbose, fVertexCut, getNumHits(), n(), p, PndRiemannHit::s(), PndRiemannHit::setXYZ(), CAMath::Sqrt(), x0, and y0.

Referenced by PndMvdRiemannVertexFinderTask::FindVertex().

611 {
612  const double SMALL = 1E-12;
613  const double VERTEX_CUT = fVertexCut;
614  if (track.getNumHits() < 3){
615  if (fVerbose > 1) std::cout << "-I- PndRiemannTrack::clacIntersection: less than 3 hits in track!" << std::endl;
616  return 0;
617  }
618 
619  TVector3 n1(fn[0],fn[1],fn[2]); //normal vector of THIS plane
620  TVectorD tempn = track.n();
621  TVector3 n2(tempn[0], tempn[1], tempn[2]); //normal vector of track plane
622  Double_t c1 = c(); //offset of THIS plane
623  Double_t c2 = track.c(); //offset of track plane
624 
625  if(fVerbose > 1) std::cout << "n1: " << n1.X() << " " << n1.Y() << " " << n1.Z() << " c1: " << c1 << std::endl;
626  if(fVerbose > 1) std::cout << "n2: " << n2.X() << " " << n2.Y() << " " << n2.Z() << " c2: " << c2 << std::endl;
627 
628  TVector3 lineNorm = n1.Cross(n2);
629 
630  TVector3 dLineNorm = calcErrorLineNorm(track);
631 
632  if (lineNorm.Mag() < SMALL)
633  return 0;
634  //lineNorm.SetMag(1.); //normalized normal vector of intersection line between the two planes
635  if(fVerbose > 1) std::cout << "n1 x n2: " << lineNorm.X() << "+/-" << dLineNorm.X() << " "
636  << lineNorm.Y() << "+/-" << dLineNorm.Y() << " "
637  << lineNorm.Z() << "+/-" << dLineNorm.Z() << std::endl;
638 
639  double denom = n1[0]*n2[1]-n1[1]*n2[0];
640  double x0 = (n1[1]*c2-c1*n2[1])/denom;
641  double y0 = (c1*n2[0] - n1[0]*c2)/denom;
642  TVector3 lineOffset(x0, y0, 0); //point on the intersection line
643  TVector3 dLineOffset = calcErrorLineOffset(track);
644  if(fVerbose > 1) std::cout << "lineOffset: " << lineOffset.X() << "+/-" << dLineOffset.X() << " "
645  << lineOffset.Y() << "+/-" << dLineOffset.Y() << std::endl;
646 
647  //---------- Calculation of intersection of line with parabola ------------
648  double denom2 = lineNorm[0]*lineNorm[0]+lineNorm[1]*lineNorm[1];
649  double p = (2*(lineNorm[0]*lineOffset[0]+lineNorm[1]*lineOffset[1]) - lineNorm[2])/denom2;
650  double q = (lineOffset[0]*lineOffset[0]+lineOffset[1]*lineOffset[1] - lineOffset[2])/denom2;
651 
652  double rad = (p/2)*(p/2) - q;
653  if (rad < 0){
654  if (fVerbose > 1)
655  std::cout << "PndRiemannTrack::calcIntersection: No match with parabola" << std::endl;
656  return 0;
657  }
658  double l1 = -(p/2)+TMath::Sqrt(rad);
659  double l2 = -(p/2)-TMath::Sqrt(rad);
660 
661  TVectorD dXY12 = calcErrorXY1XY2(lineNorm, dLineNorm, lineOffset, dLineOffset);
662 
663  if (fVerbose > 1)
664  std::cout << "l1: " << l1 << "+/-" << dXY12[4] << " l2: " << l2 << "+/-" << dXY12[5] << std::endl;
665 
666  TVector3 inter1 = lineNorm * l1 + lineOffset; //intersection point1 of line with parabola
667  TVector3 inter2 = lineNorm * l2 + lineOffset; //intersection point2 of line with parabola
668  if (fVerbose > 1){
669  std::cout << "intersection parabola 1: " << inter1.X() << "+/-" << dXY12[0] << " " << inter1.Y() << "+/-" << dXY12[1] << " " << inter1.Z()<< std::endl;
670  std::cout << "intersection parabola 2: " << inter2.X() << "+/-" << dXY12[2] << " " << inter2.Y() << "+/-" << dXY12[3] << " " << inter2.Z()<< std::endl;
671  }
672  PndRiemannHit hit1, hit2;
673  hit1.setXYZ(inter1.X(), inter1.Y(), inter1.Z());
674  hit2.setXYZ(inter2.X(), inter2.Y(), inter2.Z());
675 
676  hit1.calcPosOnTrk(this);
677  double s1 = hit1.s(); //arc length of hit1 for THIS track
678  TVector2 dummy1(inter1.X(), inter2.Y());
679  TVector2 dummy2(dXY12[0], dXY12[1]);
680  double dS1 = calcErrorS(dummy1, dummy2, this);
681  if (fVerbose > 1) std::cout << "S1 for track1: " << s1 << "+/-" << dS1 << std::endl;
682 
683  hit1.calcPosOnTrk(&track);
684  double s2 = hit1.s(); //arc length of hit1 for track
685  double dS2 = calcErrorS(dummy1, dummy2, &track);
686  if (fVerbose > 1) std::cout << "S1 for track2: " << s2 << "+/-" << dS2 << std::endl;
687 
688 
689  TVector3 vertex1;// = calcPosByS(s1); //backcalculated vertex position from s1 with z-Value
690  TVector3 vertex2;// = track.calcPosByS(s2); //backcalculated vertex position from s2 with z-Value
691  TVector3 dVertex1 = calcErrorPosByS(s1, dS1);
692  TVector3 dVertex2 = track.calcErrorPosByS(s2, dS2);
693 
694  vertex1.SetXYZ(inter1.X(),inter1.Y(),calcZPosByS(s1)); // skip calculation error (from (Xv,Yv) to S and then back from S to (Xv,Yv))
695  vertex2.SetXYZ(inter1.X(),inter1.Y(),track.calcZPosByS(s2));
696 
697  if (fVerbose > -1){
698  std::cout << "vertex candidate1 for hit1: " << vertex1.X() << " " << vertex1.Y() << " " << vertex1.Z()<< std::endl;
699  std::cout << "vertex candidate2 for hit1: " << vertex2.X() << " " << vertex2.Y() << " " << vertex2.Z()<< std::endl;
700  }
701 
702  if ((vertex1-vertex2).Mag() < VERTEX_CUT){
703  if (fVerbose > -1) std::cout << "Vertex Found!" << std::endl;
704  p1 = vertex1;
705  p2 = vertex2;
706  return 1;
707  }
708 
709  hit2.calcPosOnTrk(this);
710  double s1b = hit2.s();
711  dummy1.Set(inter2.X(),inter2.Y());
712  dummy2.Set(dXY12[2],dXY12[3]);
713  double dS1b = calcErrorS(dummy1, dummy2, this);
714  if (fVerbose > 1) std::cout << "S1b for track1: " << s1b << "+/-" << dS1b << std::endl;
715 
716  hit2.calcPosOnTrk(&track);
717  double s2b = hit2.s();
718  double dS2b = calcErrorS(dummy1, dummy2, &track);
719  if (fVerbose > 1) std::cout << "S1b for track2: " << s2b << "+/-" << dS2b << std::endl;
720 
721 // vertex1 = calcPosByS(s1b);
722 // vertex2 = track.calcPosByS(s2b);
723 
724  vertex1.SetXYZ(inter2.X(),inter2.Y(),calcZPosByS(s1b)); // skip calculation error (from (Xv,Yv) to S and then back from S to (Xv,Yv))
725  vertex2.SetXYZ(inter2.X(),inter2.Y(),track.calcZPosByS(s2b));
726 
727  dVertex1 = calcErrorPosByS(s1b, dS1b);
728  dVertex2 = track.calcErrorPosByS(s2b, dS2b);
729 
730  if (fVerbose > -1){
731  std::cout << "vertex candidate1 for hit2: " << vertex1.X() << " " << vertex1.Y() << " " << vertex1.Z()<< std::endl;
732  std::cout << "vertex candidate2 for hit2: " << vertex2.X() << " " << vertex2.Y() << " " << vertex2.Z()<< std::endl;
733  }
734  if ((vertex1-vertex2).Mag() < VERTEX_CUT){
735  if (fVerbose > -1) std::cout << "Vertex Found!" << std::endl;
736  p1 = vertex1;
737  p2 = vertex2;
738  return 1;
739  }
740  return 0;
741 }
Double_t x0
Definition: checkhelixhit.C:70
unsigned int getNumHits()
Double_t p
Definition: anasim.C:58
double calcZPosByS(double s)
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
c2
Definition: plot_dirc.C:39
double s() const
Definition: PndRiemannHit.h:74
TVector3 calcErrorPosByS(Double_t s, Double_t dS)
TVector3 calcErrorLineOffset(PndRiemannTrack &track)
const TVectorD & n() const
TVector3 calcErrorLineNorm(PndRiemannTrack &track)
Double_t
TVectorD fn
normal vector to plane;
Double_t y0
Definition: checkhelixhit.C:71
void setXYZ(double x, double y, double z)
TVectorD calcErrorXY1XY2(TVector3 &line, TVector3 &dLine, TVector3 &offset, TVector3 &dOffset)
c1
Definition: plot_dirc.C:35
TPad * p2
Definition: hist-t7.C:117
double c() const
TPad * p1
Definition: hist-t7.C:116
Double_t calcErrorS(TVector2 &XY, TVector2 &dXY, PndRiemannTrack *track)
void calcPosOnTrk(PndRiemannTrack *trk)
void PndRiemannTrack::calcJacRXY ( )
private

calcualtes fjacRXY

Definition at line 1124 of file PndRiemannTrack.cxx.

References fc, fjacRXY, fn, CAMath::Sqrt(), and val.

Referenced by refit().

1125 {
1126  double val = -1.;
1127  if ((1-fn[2]*fn[2]-4*fc*fn[2]) > 0)
1128  val = (TMath::Sqrt(1-fn[2]*fn[2]-4*fc*fn[2]));
1129  else{
1130  std::cout << "-E- PndRiemannTrack::calcJacRXY val is imaginary: Sqrt of " << (1-fn[2]*fn[2]-4*fc*fn[2]) << std::endl;
1131  return;
1132  }
1133  fjacRXY.Clear();
1134  fjacRXY.ResizeTo(3,4);
1135 /* fjacRXY[0][0] = -1/val;
1136  fjacRXY[0][3] = -1/(2*fn[2]) * (fn[2]+2*fc)/val - val/(2*fn[2]*fn[2]);
1137  fjacRXY[1][1] = -fn[0]/(2*fn[2]);
1138  fjacRXY[1][3] = fn[0]/(2*fn[2]*fn[2]);
1139  fjacRXY[2][2] = -fn[1]/(2*fn[2]);
1140  fjacRXY[2][3] = fn[1]/(2*fn[2]*fn[2]);*/
1141 
1142  if (fn[2] != 0.){
1143  fjacRXY[0][0] = -1/val;
1144  fjacRXY[0][3] = -1/(2*fn[2]) * (fn[2]+2*fc)/val - val/(2*fn[2]*fn[2]);
1145  fjacRXY[1][1] = -1/(2*fn[2]);//<---------
1146  fjacRXY[1][3] = fn[0]/(2*fn[2]*fn[2]);
1147  fjacRXY[2][2] = -1/(2*fn[2]);//<---------
1148  fjacRXY[2][3] = fn[1]/(2*fn[2]*fn[2]);
1149  }
1150  else
1151  std::cout << "-E- PndRiemannTrack::calcJacRXY fn[2] is zero!" << std::endl;
1152 }
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TVectorD fn
normal vector to plane;
TMatrixD fjacRXY
jacobian matrix to transform from c,n1,n2,n2 to r,x,y
double fc
distance of plane to origin
TVector3 PndRiemannTrack::calcPosByS ( double  s)

Definition at line 589 of file PndRiemannTrack.cxx.

References calcZPosByS(), Double_t, getHit(), orig(), r(), and PndRiemannHit::x().

Referenced by getCharge(), and getTrackParPForHit().

590 {
591 // calcSForHits();
592  TVectorD o=orig();
593  const PndRiemannHit* firstHit=getHit(0);
594 
595 
596 
597  TVector2 k(firstHit->x().X()-o[0],firstHit->x().Y()-o[1]);
598 
599  Double_t start_phi = k.Phi();
600  Double_t delta_phi = s / r();
601  TVector2 Res2D(r(), 0);
602 
603  TVector2 rotated = Res2D.Rotate(start_phi + delta_phi);
604 
605  TVector3 result(rotated.X() + o[0], rotated.Y() + o[1], calcZPosByS(s));
606 
607  return result;
608 }
double calcZPosByS(double s)
TLorentzVector s
Definition: Pnd2DStar.C:50
Double_t
double r() const
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
PndRiemannHit * getHit(unsigned int i)
void PndRiemannTrack::calcSForHits ( )

Definition at line 937 of file PndRiemannTrack.cxx.

References fHits, i, and sortHits().

Referenced by getTrackParPForHit(), and refit().

937  {
938  for (size_t i = 0; i < fHits.size(); i++){
939  fHits[i].calcPosOnTrk(this);
940  }
941  sortHits();
942 }
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
void PndRiemannTrack::calcStartStopAlpha ( )

Definition at line 920 of file PndRiemannTrack.cxx.

References calcAlpha(), fStartAlpha, fStopAlpha, getHit(), and getLastHit().

Referenced by refit().

921 {
922  PndRiemannHit* first = getHit(0);
923  PndRiemannHit* last = getLastHit();
924 
925  fStartAlpha = calcAlpha(first);
926  fStopAlpha = calcAlpha(last);
927 
928 }
PndRiemannHit * getLastHit()
double calcAlpha(PndRiemannHit *myHit)
PndRiemannHit * getHit(unsigned int i)
double PndRiemannTrack::calcSZChi2 ( PndRiemannHit hit)

Definition at line 522 of file PndRiemannTrack.cxx.

References PndRiemannHit::calcPosOnTrk(), f, fFitDone, fHits, fVerbose, g, GetBranchId(), getNumHits(), hit, i, num, r(), refit(), s, PndRiemannHit::s(), PndRiemannHit::z(), and z.

Referenced by PndRiemannTrackFinder::CheckRiemannHit(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitGem(), and PndMvdSttGemRiemannTrackFinder::CheckRiemannHitMvd().

522  {
523  // get s'es and zs
524  TF1* f = 0;
525  if (fFitDone == false)
526  refit ();
527  if (r() > 0) {
528  unsigned int num = getNumHits();
529  if (fVerbose > 1)
530  std::cout << "szChi2Fit(hit) for " << num + 1 << " Points!" << std::endl;
531  TGraph g(num + 1);
532  int j = 0;
533  for (unsigned int i = 0; i < num; ++i) {
534  if (fHits[i].hit() != 0 && fHits[i].hit()->GetEntryNr().GetType() == GetBranchId("STTHit")){
535  continue;
536  }
537  fHits[i].calcPosOnTrk(this);
538  if (fVerbose > 1){
539 
540  std::cout << "Point: " << j << ": ";
541  if (fHits[i].hit() != 0)
542  std::cout << fHits[i].hit()->GetEntryNr() << " ";
543  std::cout << fHits[i].s() << " " << fHits[i].z() << std::endl;
544 
545  }
546  g.SetPoint(j, fHits[i].s(), fHits[i].z());
547  j++;
548  }
549  if (fVerbose > 1)
550  std::cout << "Additional hit: ";
551  hit->calcPosOnTrk(this);
552  if (fVerbose > 1)
553  std::cout << hit->s() << " " << hit->z() << std::endl;
554  g.SetPoint(j, hit->s(), hit->z());
555  g.Set(j+1);
556  g.Fit("pol1", "Q0");
557  f = g.GetFunction("pol1");
558 
559  // fChi2 = chis;
560  if (fVerbose > 1)
561  std::cout << "t, m: " << f->GetParameter(0) << " +/- "
562  << f->GetParError(0) << " / " << f->GetParameter(1)
563  << " +/- " << f->GetParError(1) << "Chi2: "
564  << f->GetChisquare() << std::endl;
565 
566  return f->GetChisquare() / f->GetNDF();
567  // delete(f);
568  } else {
569  std::cout << "-W- PndRiemannTrack::calcSZChi2 r == 0: " << *this << std::endl;
570  return -1;
571  }
572 }
unsigned int getNumHits()
int num[96]
Definition: ranlxd.cxx:381
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
TLorentzVector s
Definition: Pnd2DStar.C:50
TFile * g
Int_t GetBranchId(TString branchName)
double s() const
Definition: PndRiemannHit.h:74
void refit(bool withErrorCalc=true)
TFile * f
Definition: bump_analys.C:12
Double_t z
double r() const
double z() const
PndSdsMCPoint * hit
Definition: anasim.C:70
void calcPosOnTrk(PndRiemannTrack *trk)
double PndRiemannTrack::calcZPosByS ( double  s)

Definition at line 574 of file PndRiemannTrack.cxx.

References Double_t, m(), and t().

Referenced by calcIntersection(), and calcPosByS().

575 {
576 // TVectorD o=orig();
577 // const PndRiemannHit* firstHit=getHit(0);
578 // assert(firstHit!=NULL);
579 // TVector2 k(firstHit->x().X()-o[0],firstHit->x().Y()-o[1]);
580 // TVector2 l = k.Rotate(s/r());
581  Double_t zCoord = s*m()+t();
582 // TVector3 result(l.X()+o[0], l.Y()+o[1], zCoord);
583 
584 // if (fVerbose > 0) std::cout<< "PosByS: s:" << s << " Vector: " << result.x() << " " << result.y() << " " << result.z() << std::endl;
585 // return result;
586  return zCoord;
587 }
TLorentzVector s
Definition: Pnd2DStar.C:50
double m() const
double t() const
Double_t
double PndRiemannTrack::ChiSquareDistCircle ( )

Definition at line 162 of file PndRiemannTrack.cxx.

References distCircle(), fHits, and i.

Referenced by refit().

162  {
163  double sum = 0;
164  for (size_t i = 0; i < fHits.size(); i++){
165  double distance = distCircle(&(fHits[i]));
166  sum += TMath::Power(distance / fHits[i].sigmaXY(), 2);
167  }
168  return sum;
169 }
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
double distCircle(PndRiemannHit *hit)
PndRiemannHit PndRiemannTrack::correctSttHit ( PndSttHit mySttHit)

Definition at line 1174 of file PndRiemannTrack.cxx.

References CAMath::ATan2(), c(), CAMath::Cos(), dist(), Double_t, fabs(), fVerbose, PndSttHit::GetIsochrone(), n(), phi, Pi, PndRiemannHit::setDXYZ(), PndRiemannHit::setXYZ(), CAMath::Sin(), PndRiemannHit::x(), and PndRiemannHit::z().

Referenced by PndMvdSttGemRiemannTrackFinder::CheckRiemannHitStt(), correctSttHits(), and PndMvdSttGemRiemannTrackFinderTask::Exec().

1175 {
1176 
1177  TVectorD normalVector = n();
1178  if (fVerbose > 0)
1179  std::cout << "MySttHit: " << mySttHit << std::endl;
1180  Double_t x_val = mySttHit->GetX();
1181  Double_t y_val = mySttHit->GetY();
1182 
1183  Double_t phi = TMath::ATan2((normalVector[1]+2*normalVector[2]*y_val), (normalVector[0]+2*normalVector[2]*x_val));
1184 
1185  Double_t correctedX = x_val+TMath::Cos(phi)*mySttHit->GetIsochrone();
1186  Double_t correctedY = y_val+TMath::Sin(phi)*mySttHit->GetIsochrone();
1187 
1188  Double_t correctedX1 = x_val+TMath::Cos(phi+TMath::Pi())*mySttHit->GetIsochrone();
1189  Double_t correctedY1 = y_val+TMath::Sin(phi+TMath::Pi())*mySttHit->GetIsochrone();
1190 
1191  PndRiemannHit myRiemannHit(mySttHit);
1192  PndRiemannHit myRiemannHit1(mySttHit);
1193  myRiemannHit1.setXYZ(correctedX, correctedY, 0);
1194  PndRiemannHit myRiemannHit2(mySttHit);
1195  myRiemannHit2.setXYZ(correctedX1, correctedY1, 0);
1196 
1197  Double_t finalX, finalY;
1198 
1199  if (fabs(dist(&myRiemannHit)) < fabs(dist(&myRiemannHit1))){
1200  if (fabs(dist(&myRiemannHit)) < fabs(dist(&myRiemannHit2))){
1201  finalX = x_val;
1202  finalY = y_val;
1203  }
1204  else {
1205  finalX = correctedX1;
1206  finalY = correctedY1;
1207  }
1208  } else {
1209  if (fabs(dist(&myRiemannHit1)) < fabs(dist(&myRiemannHit2))){
1210  finalX = correctedX;
1211  finalY = correctedY;
1212  } else {
1213  finalX = correctedX1;
1214  finalY = correctedY1;
1215  }
1216 
1217  }
1218 
1219  if (fVerbose > 1){
1220  std::cout << "TrackNormal + Length: " << normalVector[0] << "/" << normalVector[1] << "/" << normalVector[2] << " o: " << c() << std::endl;
1221  std::cout << "CalculateCorrectedSTTHit: TubeCenter(" << x_val << "/" << y_val << ") Radius: " << mySttHit->GetIsochrone() << " Distance: " << dist(&myRiemannHit) << std::endl;
1222  std::cout << "CalculateCorrectedSTTHit: Corrected1(" << correctedX << "/" << correctedY << ") Distance: " << dist(&myRiemannHit1) << " phi: " << phi << std::endl;
1223  std::cout << "CalculateCorrectedSTTHit: Corrected2(" << correctedX1 << "/" << correctedY1 << ") Distance: " << dist(&myRiemannHit2) << " phi: " << phi << std::endl;
1224 
1225  std::cout << "Result: " << finalX << "/" << finalY << std::endl;
1226  }
1227  PndRiemannHit result(mySttHit);
1228  if (fVerbose > 1){
1229  std::cout << "result: " << mySttHit << " " << result.x().X() << "/" << result.x().Y() << "/" << result.x().Z() << " " << result.z() << std::endl;
1230  }
1231  result.setXYZ(finalX, finalY, 0);
1232  result.setDXYZ(0.01,0.01,200);
1233 
1234  if (fVerbose > 1){
1235  std::cout << "result: " << result.x().X() << "/" << result.x().Y() << "/" << result.x().Z() << " " << result.z() << std::endl;
1236  }
1237  return result;
1238 }
static T Sin(const T &x)
Definition: PndCAMath.h:42
double dist(PndRiemannHit *hit)
static T Cos(const T &x)
Definition: PndCAMath.h:43
const TVectorD & n() const
Double_t GetIsochrone() const
Definition: PndSttHit.h:62
Double_t
static T ATan2(const T &y, const T &x)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
double c() const
Double_t Pi
void PndRiemannTrack::correctSttHits ( )

Definition at line 1268 of file PndRiemannTrack.cxx.

References correctSttHit(), fHits, GetBranchId(), hit, i, and PndRiemannHit::x().

Referenced by PndMvdSttGemRiemannTrackFinder::FindTracks().

1269 {
1270 
1271  for (size_t i = 0; i < fHits.size(); i++){
1272  if (fHits[i].hit()->GetEntryNr().GetType() == GetBranchId("STTHit")){
1273 
1274  PndRiemannHit myHit = fHits[i];
1275  PndSttHit* mySttHit = (PndSttHit*)fHits[i].hit();
1276 
1277  PndRiemannHit correctedHit = correctSttHit(mySttHit);
1278 // TVectorD normalVector = n();
1279 // Double_t phi = TMath::ATan2((normalVector[1]+2*normalVector[2]*myHit.x().Y()), (normalVector[0]+2*normalVector[2]*myHit.x().X()));
1280 //
1281 // Double_t correctedX = myHit.x().X()+TMath::Cos(phi)*mySttHit->GetIsochrone();
1282 // Double_t correctedY = myHit.x().Y()+TMath::Sin(phi)*mySttHit->GetIsochrone();
1283 //
1284 // Double_t correctedX1 = myHit.x().X()+TMath::Cos(phi+TMath::Pi())*mySttHit->GetIsochrone();
1285 // Double_t correctedY1 = myHit.x().Y()+TMath::Sin(phi+TMath::Pi())*mySttHit->GetIsochrone();
1286 //
1287 // PndRiemannHit myRiemannHit(myHit);
1288 // PndRiemannHit myRiemannHit1(myHit);
1289 // myRiemannHit1.setXYZ(correctedX, correctedY, 0);
1290 // PndRiemannHit myRiemannHit2(myHit);
1291 // myRiemannHit2.setXYZ(correctedX1, correctedY1, 0);
1292 //
1293 // Double_t finalX, finalY;
1294 //
1295 // if (fabs(dist(&myRiemannHit)) < fabs(dist(&myRiemannHit1))){
1296 // if (fabs(dist(&myRiemannHit)) < fabs(dist(&myRiemannHit2))){
1297 // finalX = myHit.x().X();
1298 // finalY = myHit.x().Y();
1299 // }
1300 // else {
1301 // finalX = correctedX1;
1302 // finalY = correctedY1;
1303 // }
1304 // } else {
1305 // if (fabs(dist(&myRiemannHit1)) < fabs(dist(&myRiemannHit2))){
1306 // finalX = correctedX;
1307 // finalY = correctedY;
1308 // } else {
1309 // finalX = correctedX1;
1310 // finalY = correctedY1;
1311 // }
1312 //
1313 // }
1314 //
1315 // if (fVerbose > 1){
1316 // std::cout << "TrackNormal + Length: " << normalVector[0] << "/" << normalVector[1] << "/" << normalVector[2] << " o: " << c() << std::endl;
1317 // std::cout << "CalculateCorrectedSTTHit: TubeCenter(" << myHit.x().X() << "/" << myHit.x().Y() << ") Radius: " << mySttHit->GetIsochrone() << " Distance: " << dist(&myRiemannHit) << std::endl;
1318 // std::cout << "CalculateCorrectedSTTHit: Corrected1(" << correctedX << "/" << correctedY << ") Distance: " << dist(&myRiemannHit1) << " phi: " << phi << std::endl;
1319 // std::cout << "CalculateCorrectedSTTHit: Corrected2(" << correctedX1 << "/" << correctedY1 << ") Distance: " << dist(&myRiemannHit2) << " phi: " << phi << std::endl;
1320 //
1321 // std::cout << "Result: " << finalX << "/" << finalY << std::endl;
1322 // }
1323  fHits[i].setXYZ(correctedHit.x().X(), correctedHit.x().Y(), 0);
1324  fHits[i].setDXYZ(0.001,0.001,200);
1325  }
1326  }
1327 
1328 // return result;
1329 }
Int_t i
Definition: run_full.C:25
PndRiemannHit correctSttHit(PndSttHit *mySttHit)
std::vector< PndRiemannHit > fHits
Int_t GetBranchId(TString branchName)
const TVector3 & x() const
Definition: PndRiemannHit.h:71
PndSdsMCPoint * hit
Definition: anasim.C:70
PndRiemannHit PndRiemannTrack::correctSttSkewedHit ( PndSttHit mySttHit,
PndSttTube myTube 
)

Definition at line 1241 of file PndRiemannTrack.cxx.

References Double_t, fVerbose, PndSttTube::GetHalfLength(), PndSttTube::GetPosition(), PndSttTube::GetWireDirection(), n(), and PndRiemannHit::setXYZ().

1242 {
1243  TVectorD nVec = n();
1244  if (fVerbose > 0)
1245  std::cout << "MySttHit: " << mySttHit << std::endl;
1246 
1247  TVector3 tubeDir = myTube->GetWireDirection();
1248  TVector3 tubeMidPos = myTube->GetPosition();
1249 
1250  Double_t nominator = nVec[0]*tubeDir.x() + nVec[1]*tubeDir.y() + 2*nVec[2]*(tubeDir.x() + tubeDir.y());
1251  Double_t denominator = 2*nVec[2]*myTube->GetHalfLength()*(tubeDir.x() * tubeDir.x() + tubeDir.y()*tubeDir.y());
1252 
1253  Double_t posOnTube = nominator/denominator;
1254  if (posOnTube > 1){
1255  posOnTube = 1;
1256  } else if (posOnTube < -1) {
1257  posOnTube = -1;
1258  }
1259 
1260  PndRiemannHit result(mySttHit);
1261  result.setXYZ(tubeMidPos.x()+posOnTube*myTube->GetHalfLength()*tubeDir.x(),
1262  tubeMidPos.y()+posOnTube*myTube->GetHalfLength()*tubeDir.y(),
1263  tubeMidPos.z()+posOnTube*myTube->GetHalfLength()*tubeDir.z());
1264  return result;
1265 }
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
const TVectorD & n() const
Double_t
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
TMatrixD PndRiemannTrack::covPlane ( ) const
inline

Definition at line 95 of file PndRiemannTrack.h.

References fcovPlane.

Referenced by calcErrorLineNorm(), and calcErrorLineOffset().

95 {return fcovPlane;};
TMatrixD fcovPlane
full covarince matrix of the plane;
TMatrixD PndRiemannTrack::covRXY ( ) const
inline

Definition at line 97 of file PndRiemannTrack.h.

References fcovRXY.

97 {return fcovRXY;};
double PndRiemannTrack::dDip ( )

Definition at line 960 of file PndRiemannTrack.cxx.

References fabs(), fm, fmError, fSZFitDone, sin(), and szFit().

Referenced by PndRiemannTrackFinder::FindTracks(), and Print().

961 {
962  if (fSZFitDone == false)
963  szFit();
964  //return (fabs(sin(1/(1+fm*fm))) * fmError);
965  //WRONG derivative!!!!!!!
966  return (fabs(sin(atan(fm))/(1+fm*fm)) * fmError);
967 }
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
double fmError
Error of fit.
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void szFit(bool withErrorCalc=true)
double fm
parameters of sz-fit
double PndRiemannTrack::dip ( )

Definition at line 946 of file PndRiemannTrack.cxx.

References cos(), fm, fSZFitDone, and szFit().

Referenced by PndMvdRiemannTrackFinderTaskEff::AddGhostTrack(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitMvd(), PndMvdSttGemRiemannTrackFinder::CheckSZ(), PndSciTAnaIdeal::Exec(), PndRiemannTrackFinder::FindTracks(), PndMvdSttGemRiemannTrackFinder::FindTracks(), and Print().

946  {
947  if (fSZFitDone == false)
948  szFit();
949  return cos(atan(fm));
950 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
void szFit(bool withErrorCalc=true)
double fm
parameters of sz-fit
double PndRiemannTrack::dipangle ( )

Definition at line 954 of file PndRiemannTrack.cxx.

References fm, fSZFitDone, and szFit().

954  {
955  if (fSZFitDone == false)
956  szFit();
957  return (atan(fm));
958 }
void szFit(bool withErrorCalc=true)
double fm
parameters of sz-fit
double PndRiemannTrack::dist ( PndRiemannHit hit)

Definition at line 129 of file PndRiemannTrack.cxx.

References fc, fn, fVerbose, and PndRiemannHit::x().

Referenced by calcChi2Plane(), PndRiemannTrackFinder::CheckRiemannHit(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitGem(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitMvd(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitSkewedStt(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitStt(), correctSttHit(), PndSttCellTrackletGenerator::CreateRiemannTrack(), and PrintHits().

129  {
130  double d2=fc;
131  d2+=hit->x().X()*fn[0];
132  d2+=hit->x().Y()*fn[1];
133  d2+=hit->x().Z()*fn[2];
134 
135  if (fVerbose > 1) {
136  std::cout << "PndRiemannTrack::dist: c " << fc << " n: " << fn[0] << "/" << fn[1] << "/" << fn[2] <<
137  " hit: " << hit->x().X() << "/" << hit->x().Y() << "/" << hit->x().Z() << " Dist: " << d2 << std::endl;
138  }
139  return d2;
140 }
TVectorD fn
normal vector to plane;
const TVector3 & x() const
Definition: PndRiemannHit.h:71
double fc
distance of plane to origin
double PndRiemannTrack::distCircle ( PndRiemannHit hit)

Definition at line 149 of file PndRiemannTrack.cxx.

References orig(), pos, r(), and PndRiemannHit::x().

Referenced by ChiSquareDistCircle().

149  {
150  TVector2 pos;
151  TVectorD origin(2);
152  origin = orig();
153  TVector2 diff;
154 
155  pos.Set(hit->x().x(), hit->x().y());
156  diff.Set(pos.X() - origin[0], pos.Y() - origin[1]);
157 
158  return (diff.Mod() - r());
159 }
TVector3 pos
double r() const
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
double PndRiemannTrack::distError ( PndRiemannHit hit)

Definition at line 143 of file PndRiemannTrack.cxx.

References PndRiemannHit::sigmaW(), PndRiemannHit::sigmaX(), PndRiemannHit::sigmaY(), and CAMath::Sqrt().

Referenced by calcChi2Plane().

143  {
144  //for the time being the plane errors are ignored!
145  return TMath::Sqrt(TMath::Power(hit->sigmaX(),2) +TMath::Power(hit->sigmaY(),2) +TMath::Power(hit->sigmaW(),2));
146 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double sigmaW() const
Definition: PndRiemannHit.h:80
double sigmaX() const
Definition: PndRiemannHit.h:78
double sigmaY() const
Definition: PndRiemannHit.h:79
double PndRiemannTrack::dR ( )

Definition at line 435 of file PndRiemannTrack.cxx.

References fcovRXY, and CAMath::Sqrt().

Referenced by calcErrorPosByS(), calcErrorS(), PndRiemannTrackFinder::FindTracks(), and Print().

436 {
437  return TMath::Sqrt(fcovRXY[0][0]);
438 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double PndRiemannTrack::dX ( )
inline

Definition at line 61 of file PndRiemannTrack.h.

References fcovRXY, and CAMath::Sqrt().

Referenced by calcErrorPosByS(), PndRiemannTrackFinder::FindTracks(), and Print().

61 {return TMath::Sqrt(fcovRXY[1][1]);}
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double PndRiemannTrack::dY ( )
inline

Definition at line 62 of file PndRiemannTrack.h.

References fcovRXY, and CAMath::Sqrt().

Referenced by calcErrorPosByS(), PndRiemannTrackFinder::FindTracks(), and Print().

62 {return TMath::Sqrt(fcovRXY[2][2]);}
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Int_t PndRiemannTrack::GetBranchId ( TString  branchName)
private

Definition at line 1332 of file PndRiemannTrack.cxx.

References fBranchNameMap.

Referenced by calcSZChi2(), correctSttHits(), and szFit().

1333 {
1334  if (fBranchNameMap.count(branchName) == 0){
1335  fBranchNameMap[branchName] = FairRootManager::Instance()->GetBranchId(branchName);
1336  }
1337  return fBranchNameMap[branchName];
1338 }
std::map< TString, Int_t > fBranchNameMap
Int_t PndRiemannTrack::getCharge ( Double_t  B)

Definition at line 1055 of file PndRiemannTrack.cxx.

References calcPosByS(), Double_t, getHit(), getPforHit(), orig(), p, pt(), s, and PndRiemannHit::s().

Referenced by getTrackParPForHit().

1056 {
1057  TVector3 p = getPforHit(0, B);
1058  Double_t s = getHit(0)->s();
1059  TVector3 hitPos = calcPosByS(s);
1060  TVector2 hitPos2D(hitPos.x(), hitPos.y());
1061 
1062  TVector2 pt(p.x(), p.y());
1063  TVectorD origin = orig();
1064  TVector2 orig2(origin[0], origin[1]);
1065 
1066  orig2 -= hitPos2D;
1067 
1068  TVector2 origRotated = orig2.Rotate(-pt.Phi());
1069 
1070  //std::cout << "OrigRotated: " << origRotated.X() << " " << origRotated.Y() << std::endl;
1071 
1072  if (origRotated.Y() < 0)
1073  return 1;
1074  else
1075  return -1;
1076 }
Double_t p
Definition: anasim.C:58
TLorentzVector s
Definition: Pnd2DStar.C:50
double s() const
Definition: PndRiemannHit.h:74
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
Double_t
TVectorD orig() const
TVector3 getPforHit(int i, double B)
TVector3 calcPosByS(double s)
PndRiemannHit * getHit(unsigned int i)
PndRiemannHit* PndRiemannTrack::getHit ( unsigned int  i)
inline
std::vector<PndRiemannHit> PndRiemannTrack::getHits ( ) const
inline
PndRiemannHit* PndRiemannTrack::getLastHit ( )
inline

Definition at line 76 of file PndRiemannTrack.h.

References getHit(), and getNumHits().

Referenced by calcStartStopAlpha().

76 {return getHit(getNumHits()-1);}
unsigned int getNumHits()
PndRiemannHit * getHit(unsigned int i)
unsigned int PndRiemannTrack::getNumHits ( )
inline
TVector3 PndRiemannTrack::getPforHit ( int  i,
double  B 
)

Definition at line 1003 of file PndRiemannTrack.cxx.

References Double_t, fStartAlpha, fVerbose, getHit(), getNumHits(), orig(), phi, Pl(), Pt(), pt(), r(), PndRiemannHit::s(), and PndRiemannHit::x().

Referenced by getCharge(), and getTrackParPForHit().

1004 {
1005  double pt = Pt(B);
1006  //double p = P(B); //[R.K. 01/2017] unused variable?
1007  double pl = Pl(B);
1008  TVectorD origin = orig();
1009  TVector3 result;
1010 // PndRiemannHit* startHit = getHit(0);
1011 // PndRiemannHit* lastHit = getLastHit();
1012 // if (lastHit->z() < startHit->z()){
1013 // pl *= -1;
1014 // }
1015 
1016 
1017  if (i < (int)getNumHits())
1018  {
1019  PndRiemannHit* myHit = getHit(i);
1020  //std::cout << "MyHit: " << myHit->x().X() << " " << myHit->x().Y() << std::endl;
1021  Double_t arclength = myHit->s()/r();
1022 
1023  Double_t phi = fStartAlpha + arclength;
1024  TVector2 ptVec(0,pt);
1025  ptVec = ptVec.Rotate(phi);
1026  if (i > 0){
1027  PndRiemannHit* myHitBefore = getHit(i-1);
1028  //std::cout << "MyHitBefore: " << myHitBefore->x().X() << " " << myHitBefore->x().Y() << std::endl;
1029  TVector2 difVec(myHit->x().x() - myHitBefore->x().x(), myHit->x().y() - myHitBefore->x().y());
1030  //std::cout <<"DifVec: " << difVec.X() << " " << difVec.Y() << std::endl;
1031  Double_t length = ptVec * difVec;
1032  //std::cout << "Length: " << length << std::endl;
1033  if (length < 0){
1034  ptVec *= -1;
1035  }
1036  }
1037  else if(getNumHits() > 0){
1038  PndRiemannHit* myHitAfter = getHit(1);
1039  //std::cout << "MyHitAfter: " << myHitAfter->x().X() << " " << myHitAfter->x().Y() << std::endl;
1040  TVector2 difVec2(myHitAfter->x().x() - myHit->x().x(), myHitAfter->x().y() - myHit->x().y());
1041  //std::cout <<"DifVec: " << difVec2.X() << " " << difVec2.Y() << std::endl;
1042  Double_t length2 = ptVec * difVec2;
1043  //std::cout << "Length: " << length2 << std::endl;
1044  if (length2 < 0){
1045  ptVec *= -1;
1046  }
1047  }
1048  result.SetXYZ(ptVec.X(), ptVec.Y(), pl);
1049  }
1050 
1051  if (fVerbose > 0) std::cout << "P-Vector for point " << i << " : " << result.X() << " " << result.Y() << " " << result.Z() << std::endl;
1052  return result;
1053 }
unsigned int getNumHits()
Int_t i
Definition: run_full.C:25
double s() const
Definition: PndRiemannHit.h:74
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
Double_t
double Pt(double B)
double r() const
TVectorD orig() const
const TVector3 & x() const
Definition: PndRiemannHit.h:71
PndRiemannHit * getHit(unsigned int i)
double Pl(double B)
PndTrack PndRiemannTrack::getPndTrack ( Double_t  B)

Definition at line 1105 of file PndRiemannTrack.cxx.

References getNumHits(), and getTrackParPForHit().

Referenced by PndSttCellTrackletGenerator::CreatePndTrackCands().

1106 {
1107  FairTrackParP first, last;
1108  PndTrackCand myCand;
1109  if (getNumHits() > 0){
1110  first = getTrackParPForHit(0, B);
1111  last = getTrackParPForHit(getNumHits()-1, B);
1112  //FairTrackParP last;
1113  }
1114  return PndTrack(first, last, myCand);
1115 }
unsigned int getNumHits()
FairTrackParP getTrackParPForHit(Int_t i, Double_t B)
double PndRiemannTrack::getSZm ( ) const
inline

Definition at line 72 of file PndRiemannTrack.h.

References fm.

Referenced by PndRiemannTrackFinder::FindTracks(), and PndMvdSttGemRiemannTrackFinder::FindTracks().

72 {return fm;}
double fm
parameters of sz-fit
double PndRiemannTrack::getSZt ( ) const
inline

Definition at line 73 of file PndRiemannTrack.h.

References ft.

Referenced by PndRiemannTrackFinder::FindTracks(), and PndMvdSttGemRiemannTrackFinder::FindTracks().

73 {return ft;}
FairTrackParP PndRiemannTrack::getTrackParPForHit ( Int_t  i,
Double_t  B 
)

Definition at line 1078 of file PndRiemannTrack.cxx.

References calcPosByS(), calcSForHits(), Double_t, getCharge(), getHit(), getNumHits(), getPforHit(), PndRiemannHit::hit(), s, and PndRiemannHit::s().

Referenced by getPndTrack().

1079 {
1080  calcSForHits();
1081 
1082 
1083  TVector3 hitPos;
1084  TVector3 hitPosError;
1085  TVector3 momError(2, 2, 2);
1086  TVector3 dj(1,0,0);
1087  TVector3 dk(0,1,0);
1088  TVector3 origin(0, 0, 1);
1089 
1090  if (i < (int)getNumHits()){
1091  Double_t s = getHit(i)->s();
1092  getHit(i)->hit()->Position(hitPos);
1093  hitPos = calcPosByS(s);
1094  // getHit(i)->hit()->Position(hitPos);
1095  getHit(i)->hit()->PositionError(hitPosError);
1096  FairTrackParP result(hitPos, getPforHit(i, B), hitPosError, momError, getCharge(B), origin, dj, dk);
1097 
1098  return result;
1099  }
1100  else {
1101  return FairTrackParP();
1102  }
1103 }
unsigned int getNumHits()
Int_t i
Definition: run_full.C:25
const FairHit * hit() const
Definition: PndRiemannHit.h:72
TLorentzVector s
Definition: Pnd2DStar.C:50
double s() const
Definition: PndRiemannHit.h:74
Int_t getCharge(Double_t B)
Double_t
TVector3 getPforHit(int i, double B)
TVector3 calcPosByS(double s)
PndRiemannHit * getHit(unsigned int i)
void PndRiemannTrack::init ( double  x0,
double  y0,
double  R,
double  dip,
double  z0 
)

Definition at line 87 of file PndRiemannTrack.cxx.

References acos(), fc, fm, fn, and CAMath::Sqrt().

88  {// z0 //[R.K.03/2017] unused variable(s)
89 
90  fn[1] = TMath::Sqrt(4*y0_*y0_/(4*y0_*y0_+4*x0_*x0_+1));
91  fn[0] = x0_/y0_*fn[1];
92  fn[2] = TMath::Sqrt(1 - fn[0]*fn[0] - fn[1]*fn[1]);
93  double fn2 = fn[2] * fn[2];
94  fc = fn2*4*R_*R_-1+fn2/(-4*fn[2]);
95 
96  fm = tan(acos(mydip));
97 
98 }
friend F32vec4 acos(const F32vec4 &a)
Definition: P4_F32vec4.h:113
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TVectorD fn
normal vector to plane;
double fc
distance of plane to origin
double fm
parameters of sz-fit
TMatrixD PndRiemannTrack::jacRXY ( ) const
inline

Definition at line 96 of file PndRiemannTrack.h.

References fjacRXY.

96 {return fjacRXY;};
TMatrixD fjacRXY
jacobian matrix to transform from c,n1,n2,n2 to r,x,y
double PndRiemannTrack::m ( ) const
inline

Definition at line 98 of file PndRiemannTrack.h.

References fm.

Referenced by calcErrorPosByS(), calcZPosByS(), and Pl().

98 {return fm;}
double fm
parameters of sz-fit
double PndRiemannTrack::mError ( ) const
inline

Definition at line 99 of file PndRiemannTrack.h.

References fmError.

Referenced by calcErrorPosByS().

99 {return fmError;}
double fmError
Error of fit.
const TVectorD& PndRiemannTrack::n ( ) const
inline

Definition at line 56 of file PndRiemannTrack.h.

References fn.

Referenced by calcErrorLineNorm(), calcErrorLineOffset(), calcIntersection(), correctSttHit(), correctSttSkewedHit(), PndMvdEventAnaTask::Exec(), and Print().

56 {return fn;}
TVectorD fn
normal vector to plane;
TVectorD PndRiemannTrack::orig ( ) const
double PndRiemannTrack::P ( double  B)

Definition at line 997 of file PndRiemannTrack.cxx.

References Pl(), Pt(), and CAMath::Sqrt().

998 {
999  double result = TMath::Sqrt(Pl(B) * Pl(B) + Pt(B) * Pt(B));
1000  return result;
1001 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double Pt(double B)
double Pl(double B)
double PndRiemannTrack::Pl ( double  B)

Definition at line 977 of file PndRiemannTrack.cxx.

References getHit(), getNumHits(), m(), Pt(), and PndRiemannHit::z().

Referenced by getPforHit(), and P().

978 {
979  double pl = Pt(B) * m();
980 
981  if (getNumHits() > 2){
982  PndRiemannHit* startHit = getHit(0);
983  PndRiemannHit* nextHit = getHit(1);
984  if (nextHit->z() - startHit->z() > 0){
985  if (pl < 0)
986  pl *= -1;
987  }
988  else{
989  if (pl > 0){
990  pl *= -1;
991  }
992  }
993  }
994  return pl;
995 }
unsigned int getNumHits()
double m() const
double Pt(double B)
double z() const
PndRiemannHit * getHit(unsigned int i)
virtual void PndRiemannTrack::Print ( std::ostream out = std::cout)
inlinevirtual

Definition at line 132 of file PndRiemannTrack.h.

References c(), calcChi2Plane(), dDip(), dip(), dR(), dX(), dY(), fStartAlpha, fStopAlpha, n(), orig(), out, PrintHits(), and r().

132  {
133 
134  out << std::setprecision(6) << "Riemann Track: Radius " << r() << " +/- " << dR() << " Origin: " << orig()[0] << " +/- " << dX() << " / " << orig()[1] << " +/- " << dY() << std::endl;
135  out << "RiemannTrack: Normal: " << n()[0] << "/" << n()[1] << "/" << n()[2] << " c: " << c() << std::endl;
136  out << "Dip: " << dip() << " +/- " << dDip() << " StartAlpha: " << fStartAlpha << " StopAlpha: " << fStopAlpha << std::endl;
137  out << "Chi2Plane: " << calcChi2Plane() << std::endl;
138  PrintHits();
139  }
const TVectorD & n() const
double r() const
double c() const
TVectorD orig() const
void PndRiemannTrack::PrintHits ( )

Definition at line 1154 of file PndRiemannTrack.cxx.

References dist(), fHits, hit, and i.

Referenced by Print().

1155 {
1156  std::cout << "-I- PndRiemannTrack::PrintHits: " << fHits.size() << std::endl;
1157  //bool first = false; //[R.K. 01/2017] unused variable?
1158  for (size_t i = 0; i < fHits.size(); i++){
1159  std::cout << i << ": ";
1160 
1161  if (fHits[i].hit() != 0) {
1162 // std::cout << fHits[i].hit()->GetEntryNr() << " : ";
1163  }
1164  std::cout << fHits[i].x().X() << " +/- " << fHits[i].sigmaX()
1165  << "\t" << fHits[i].x().Y()<< " +/- " << fHits[i].sigmaY()
1166  << "\t" << fHits[i].z() << " s: " << fHits[i].s() << "\t" << " dist: " << dist(&fHits[i]);
1167  // calcPosByS(fHits[i].s()).Print();
1168  std::cout << std::endl;
1169 
1170  }
1171 }
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
double dist(PndRiemannHit *hit)
PndSdsMCPoint * hit
Definition: anasim.C:70
double PndRiemannTrack::Pt ( double  B)

Definition at line 969 of file PndRiemannTrack.cxx.

References fVerbose, and r().

Referenced by getPforHit(), P(), and Pl().

970 {
971  double result = 0.3 * B * r() * 0.01;
972  if (fVerbose > 0) std::cout << "Pt: " << result << std::endl;
973 
974  return result;
975 }
double r() const
double PndRiemannTrack::r ( ) const

Definition at line 416 of file PndRiemannTrack.cxx.

References a, CAMath::Abs(), fc, fn, fVerbose, and sqrt().

Referenced by PndMvdRiemannTrackFinderTaskEff::AddGhostTrack(), calcChi2Plane(), PndSttCellTrackletGenerator::CalcDeviation(), PndSttCellTrackletGenerator::CalcDeviationOfRiemannTrack(), calcErrorPosByS(), calcErrorS(), calcPosByS(), PndRiemannHit::calcPosOnTrk(), calcSZChi2(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitMvd(), PndMvdSttGemRiemannTrackFinder::CheckSZ(), distCircle(), PndSttCellTrackFinderAnalysisTask::DrawCombiRiemannPlots(), PndSttCellTrackFinderAnalysisTask::DrawFirstRiemannPlots(), PndSciTAnaIdeal::Exec(), PndRiemannTrackFinder::FindTracks(), PndMvdSttGemRiemannTrackFinder::FindTracks(), PndSttCellTrackletGenerator::GetDeviationCount(), getPforHit(), PndRiemannTrackFinder::GetStartTracks(), Print(), Pt(), refit(), and szFit().

416  {
417 // if(fc==0)return 0;
418  //if(fabs(fc)>100)return 0;???????????????????????????
419  double a=2.*fn[2]; // modified for paraboloid
420  //if(a==0){
421  // if (fVerbose > 0) std::cout<<"PndRiemannTrack:: a==0 cannot calc r! set r=1E4"<<std::endl;
422  // return 1.E-4;
423  //}
424  //if (fVerbose > 0) std::cout<<fn[0]<<" "<<fn[1]<<" "<<fc<<" "<<a<<std::endl;
425  double nom = 1-fn[2]*fn[2]-4*fc*fn[2]; // modified for paraboloid
426  if(nom<0.0){
427  nom=1.E-4;
428  if (fVerbose > 1) std::cout<<"PndRiemannTrack::nom<0! set r=1E-4!"<<std::endl;
429  }
430  if (TMath::Abs(a) > 0)
431  return sqrt(nom)/TMath::Abs(a);
432  else return 0;
433 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t a
Definition: anaLmdDigi.C:126
TVectorD fn
normal vector to plane;
double fc
distance of plane to origin
void PndRiemannTrack::refit ( bool  withErrorCalc = true)

Definition at line 172 of file PndRiemannTrack.cxx.

References calcJacRXY(), calcSForHits(), calcStartStopAlpha(), ChiSquareDistCircle(), d, fav, fc, fcovPlane, fcovRXY, fErrorCalcDone, fFitDone, fHits, fjacRXY, fn, fSZFitDone, ftrefit, fVerbose, fweight, g, h, i, MatrixOutput(), orig(), r(), res, sortHits(), CAMath::Sqrt(), and val.

Referenced by PndMvdRiemannTrackFinderTaskEff::AddGhostTrack(), PndMvdSttGemRiemannTrackFinder::AssignSkewedSttHits(), PndMvdSttGemRiemannTrackFinder::AssignSttHits(), calcChi2Plane(), PndMvdRiemannTrackFinderTaskCutPar::CalcRiemannTracks(), calcSZChi2(), PndRiemannTrackFinder::CreateRiemannTrack(), PndSttCellTrackletGenerator::CreateRiemannTrack(), PndMvdEventAnaTask::Exec(), PndRiemannTrackFinder::FindTracks(), PndMvdSttGemRiemannTrackFinder::FindTracks(), PndSciTAnaIdeal::GetRiemannTrack(), PndMvdSttGemRiemannTrackFinder::GetStartTracks(), PndRiemannTrackFinder::GetStartTracks(), PndMvdRiemannVertexFinderTask::refit(), and szFit().

173 {
174 
175  TMatrixT<double> my_av(3,1);
176  if (fVerbose > 1) std::cout << "fweight: " << fweight << std::endl;
177  //fav *= TMath::Power(fweight,-1); //TS
179  if (!ftrefit){
180  fav *= TMath::Power(fweight,-1); //TS
181  }
183  my_av[0][0]=fav[0];// *fweight; //TS *fweight added
184  my_av[1][0]=fav[1];// *fweight;
185  my_av[2][0]=fav[2];// *fweight;
186 
187  if (fVerbose > 1) std::cout << "fav: " << fav[0] << " " << fav[1] << " " << fav[2] << std::endl;
188 
189  TMatrixD sampleCov(3,3);
190 
191  int nh=fHits.size();
192  for(int i=0;i<nh;++i){
193  TMatrixD h(3,1);
194  h[0][0]=fHits[i].x().X();
195  h[1][0]=fHits[i].x().Y();
196  h[2][0]=fHits[i].x().Z();
197  TMatrixD d(3,1);
198  d=h-my_av;
199  TMatrixD dt(TMatrixD::kTransposed,d);
200  TMatrixD ddt(d,TMatrixD::kMult,dt);
201  if (fHits[i].sigmaXY() != 0)
202  ddt *= 1/(fHits[i].sigmaXY()*fHits[i].sigmaXY()); //TS
203  else
204  std::cout << "-E- PndRiemannTrack::refit sigmaXY() == 0" << std::endl;
205  sampleCov+=ddt;
206  }
207 
208  if (nh != 0)
209  sampleCov*=1./(double)nh;
210  else {
211  std::cout << "-E- PndRiemannTrack::refit nh == 0" << std::endl;
212  return;
213  }
214 
215  if (fVerbose > 1) std::cout << "sampleCov: " << std::endl;
216  if (fVerbose > 1) MatrixOutput(sampleCov);
217 
218  TVectorD eigenValues(3);
219  TMatrixD eigenVec=sampleCov.EigenVectors(eigenValues);
220 
221  // find smallest eigenvalue
222 // double val=eigenValues[0]; int g=0;
223 // for(int k=1;k<3;++k){
224 // if(eigenValues[k]<val){
225 // val=eigenValues[k];
226 // g=k;
227 // }
228 // }
229 
230  int g = 0;
231  double smallestDistance = -1;
232  int smallestVec = 0;
233  TVectorD correctN(3);
234  double correctC;
235  double val;
236  for (int i = 0; i < 3; i++){
237  g = i;
238  fn=TMatrixDColumn(eigenVec,g);
239 
240  if (fVerbose > 1) std::cout << "eigenVec: " << std::endl;
241  if (fVerbose > 1) MatrixOutput(eigenVec);
242 
243  if (fVerbose > 1) std::cout << "eigenValues: ";
244  for (int j = 0; j < 3; j++){
245  if (fVerbose > 1) std::cout << eigenValues[j] << " ";
246  }
247  if (fVerbose > 1) std::cout << std::endl;
248 
249  double norm = 1;
250  if (fn.Norm2Sqr() != 0)
251  norm=1./TMath::Sqrt(fn.Norm2Sqr());
252 
253  fn*=norm;
254  fc=-1.*fn*fav;
255  if (smallestDistance < 0){
256  smallestDistance = ChiSquareDistCircle();
257  smallestVec = i;
258  correctN = fn;
259  correctC = fc;
260  val = eigenValues[i];
261  } else if (smallestDistance > ChiSquareDistCircle()) {
262  smallestDistance = ChiSquareDistCircle();
263  smallestVec = i;
264  correctN = fn;
265  correctC = fc;
266  val = eigenValues[i];
267  }
268 
269  if (fVerbose > 1) std::cout << "fn: " << fn[0] << " " << fn[1] << " " << fn[2] << std::endl;
270  if (fVerbose > 1) std::cout << "fc: " << fc << std::endl;
271  if (fVerbose > 1) {
272  TVectorD origin = orig();
273  std::cout << "Origin: " << origin[0] << " " << origin[1] << std::endl;
274  }
275  if (fVerbose > 1) std::cout << "r: " << r() << std::endl;
276  if (fVerbose > 1) std::cout << "ChiSquareCircleDistance: " << ChiSquareDistCircle() << std::endl;
277  }
278 
279  g = smallestVec;
280  fn = correctN;
281  fc = correctC;
282  //------------ Calculation of the full covariance matrix -----------
283 
284  // 1. Calculation of the covarianz matrix of the normal vector
285  if (withErrorCalc){
286  TMatrixD CovNorm(3,3);
287 
288  for (int i = 0; i < 3; i++){
289  if (i != g){
290  TMatrixD res = eigenVec.GetSub(0,2,i,i)*eigenVec.GetSub(0,2,i,i).T();
291  CovNorm += res * (val * eigenValues[i]/TMath::Power(val-eigenValues[i],2));
292  }
293  }
294  // if (fHits.size() > 5)
295  // CovNorm *= TMath::Power(fHits.size()-5,-1); //-5 is very strange. According to the paper this value has to be fixed with simulation???
296  // else
297  CovNorm *= TMath::Power(fHits.size(),-1);
298  if (fVerbose > 1) std::cout << "CovNorm: " << std::endl;
299  if (fVerbose > 1) MatrixOutput(CovNorm);
300 
301 
302  // 2. Calculation of the covarianz matrix of fav
303 
304  TMatrixD covAv(3,3);
305  for (size_t i = 0; i < fHits.size();i++){
306  covAv[0][0] += fHits[i].covX(0,0)/(TMath::Power(fHits[i].sigmaXY(),4));
307  covAv[1][1] += fHits[i].covX(1,1)/(TMath::Power(fHits[i].sigmaXY(),4));
308  covAv[1][0] += fHits[i].covX(1,0)/(TMath::Power(fHits[i].sigmaXY(),4));
309  covAv[2][0] += 2 * (fHits[i].covX(0,0) * fHits[i].x().X() + fHits[i].covX(1,0) * fHits[i].x().Y())
310  /(TMath::Power(fHits[i].sigmaXY(),4));
311  covAv[2][1] += 2 * (fHits[i].covX(1,1) * fHits[i].x().Y() + fHits[i].covX(1,0) * fHits[i].x().X())
312  /(TMath::Power(fHits[i].sigmaXY(),4));
313  covAv[2][2] += 4 * (fHits[i].covX(0,0) * fHits[i].x().X() * fHits[i].x().X() +
314  2 * fHits[i].covX(1,0) * fHits[i].x().X() * fHits[i].x().Y() +
315  fHits[i].covX(1,1) * fHits[i].x().Y() * fHits[i].x().Y())
316  /(TMath::Power(fHits[i].sigmaXY(),4));
317  }
318  covAv[0][1] = covAv[1][0];
319  covAv[0][2] = covAv[2][0];
320  covAv[1][2] = covAv[2][1];
321 
322  covAv *= TMath::Power(fweight,-2);
323 
324 
325  if (fVerbose > 1) std::cout << "covAv: " << std::endl;
326  if (fVerbose > 1) MatrixOutput(covAv);
327 
328 
329  // 3. Calculation of var(fc)
330 
331  double nCrn = (fn * (covAv * fn));
332  double rCnr = (fav * (CovNorm * fav));
333 
334  TMatrixD CnCr(CovNorm,TMatrixD::kMult,covAv);
335  double trCnCr = 0;
336  for (int i = 0; i < CnCr.GetNcols(); i++){
337  trCnCr += CnCr[i][i];
338  }
339  if (fVerbose > 1) std::cout << "nCrn: " << nCrn << " rCnr: " << rCnr << " trCnCr: " << trCnCr << std::endl;
340  double varc = nCrn + rCnr + trCnCr;
341 
342  TVectorD corr_cn = CovNorm * fav;
343  corr_cn *= -1;
344 
345  // 4. Calculation of the covarianz matrix of c,n
346 
347  fcovPlane[0][0] = varc;
348  fcovPlane[1][1] = CovNorm[0][0];
349  fcovPlane[2][1] = CovNorm[1][0];
350  fcovPlane[2][2] = CovNorm[1][1];
351  fcovPlane[3][1] = CovNorm[2][0];
352  fcovPlane[3][2] = CovNorm[2][1];
353  fcovPlane[3][3] = CovNorm[2][2];
354  fcovPlane[1][0] = corr_cn[0];
355  fcovPlane[2][0] = corr_cn[1];
356  fcovPlane[3][0] = corr_cn[2];
358 
359  fcovPlane[1][2] = CovNorm[1][0];
360 
361  fcovPlane[1][3] = CovNorm[2][0];
362  fcovPlane[2][3] = CovNorm[2][1];
363 
364  fcovPlane[0][1] = corr_cn[0];
365  fcovPlane[0][2] = corr_cn[1];
366  fcovPlane[0][3] = corr_cn[2];
368 
369  //5. Convert plane covariance in start parameter(r,x0,y0) covariances
370  calcJacRXY();
371 
372  if (fVerbose > 1) std::cout << "jacRXY: " << std::endl;
373  if (fVerbose > 1) MatrixOutput(fjacRXY);
374 
375  //fcovRXY = fjacRXY * fcovPlane * fjacRXY.T();
376 
377  TMatrixD temp(fjacRXY,TMatrixD::kMult, fcovPlane);
378  if (fVerbose > 1) std::cout << "temp: " << temp.GetNrows() << "x" << temp.GetNcols() << std::endl;
379 
380  if (fVerbose > 1) std::cout << "temp: " << std::endl;
381  if (fVerbose > 1) MatrixOutput(temp);
382 
383  fcovRXY = temp * fjacRXY.T(); // J * fcovPlane * J.T()
384 
385  if (fVerbose > 1) std::cout << "covPlane: " << std::endl;
386  if (fVerbose > 1) MatrixOutput(fcovPlane);
387 
388  if (fVerbose > 1) std::cout << "covRXY: " << std::endl;
389  if (fVerbose > 1) MatrixOutput(fcovRXY);
390  fErrorCalcDone = true;
391  }
392 
393  fFitDone = true;
394  fSZFitDone = false;
395  ftrefit = true;
396 
397  calcSForHits();
398 
399  sortHits();
401 }
double fweight
sum over all weights (1/(sigmaXY*sigmaXY))
TObjArray * d
Int_t res
Definition: anadigi.C:166
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
TFile * g
void calcJacRXY()
calcualtes fjacRXY
TVectorD fn
normal vector to plane;
double ChiSquareDistCircle()
double r() const
TVectorD orig() const
TMatrixD fjacRXY
jacobian matrix to transform from c,n1,n2,n2 to r,x,y
double fc
distance of plane to origin
void MatrixOutput(TMatrixD mat)
TMatrixD fcovPlane
full covarince matrix of the plane;
TVectorD fav
average over all hits
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
void PndRiemannTrack::SetVerbose ( int  i)
inline

Definition at line 122 of file PndRiemannTrack.h.

References fVerbose, and i.

Referenced by PndMvdEventAnaTask::Exec(), and PndMvdRiemannVertexFinderTask::FindVertex().

122 {fVerbose = i;}
Int_t i
Definition: run_full.C:25
void PndRiemannTrack::SetVertexCut ( double  cut)
inline

Definition at line 123 of file PndRiemannTrack.h.

References cut, and fVertexCut.

Referenced by PndMvdRiemannVertexFinderTask::refit().

123 {fVertexCut = cut;}
double cut[MAX]
Definition: autocutx.C:36
double PndRiemannTrack::sign ( ) const

Definition at line 1119 of file PndRiemannTrack.cxx.

References fHits, and s.

1119  {
1120  double s=fHits[3].s();
1121  return s<0 ? -1. : 1;
1122 }
std::vector< PndRiemannHit > fHits
TLorentzVector s
Definition: Pnd2DStar.C:50
void PndRiemannTrack::sortHits ( )
inline

Definition at line 92 of file PndRiemannTrack.h.

References fHits.

Referenced by calcSForHits(), and refit().

92 { std::sort(fHits.begin(), fHits.end());}
std::vector< PndRiemannHit > fHits
double PndRiemannTrack::szChi2 ( ) const
inline

Definition at line 120 of file PndRiemannTrack.h.

References fChi2.

Referenced by PndMvdSttGemRiemannTrackFinder::CheckSZ(), and PndRiemannTrackFinder::CheckSZ().

120 {return fChi2;};
double fChi2
Chisquare of sz fit.
double PndRiemannTrack::szDist ( PndRiemannHit hit)

Definition at line 900 of file PndRiemannTrack.cxx.

References PndRiemannHit::calcPosOnTrk(), fm, fSZFitDone, ft, hits, PndRiemannHit::s(), szFit(), and PndRiemannHit::z().

Referenced by PndRiemannTrackFinder::CheckRiemannHit(), PndMvdSttGemRiemannTrackFinder::CheckRiemannHitGem(), and PndMvdSttGemRiemannTrackFinder::CheckRiemannHitMvd().

900  {
901 
902  if (fSZFitDone == false)
903  szFit();
904  hit->calcPosOnTrk(this);
905  double hits=hit->s();
906  double predz=hits*fm+ft;
907  return predz-hit->z();
908 }
double s() const
Definition: PndRiemannHit.h:74
double z() const
void szFit(bool withErrorCalc=true)
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void calcPosOnTrk(PndRiemannTrack *trk)
double fm
parameters of sz-fit
double PndRiemannTrack::szError ( PndRiemannHit hit)

Definition at line 910 of file PndRiemannTrack.cxx.

References PndRiemannHit::calcPosOnTrk(), fmError, fSZFitDone, ftError, hits, PndRiemannHit::s(), CAMath::Sqrt(), and szFit().

910  {
911  if (fSZFitDone == false)
912  szFit();
913  hit->calcPosOnTrk(this);
914  double hits=hit->s();
915  double result = TMath::Sqrt(TMath::Power((hits*fmError),2)+TMath::Power(ftError,2));
916  //if (fVerbose > 0) std::cout << "Error on szDist is: " << result;
917  return result;
918 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double s() const
Definition: PndRiemannHit.h:74
double fmError
Error of fit.
void szFit(bool withErrorCalc=true)
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void calcPosOnTrk(PndRiemannTrack *trk)
double ftError
Error of fit.
void PndRiemannTrack::szFit ( bool  withErrorCalc = true)

Definition at line 441 of file PndRiemannTrack.cxx.

References f, fChi2, fFitDone, fHits, fm, fmError, fSZFitDone, ft, ftError, fVerbose, g, GetBranchId(), getNumHits(), hit, i, num, r(), refit(), s, and z.

Referenced by PndMvdRiemannTrackFinderTaskEff::AddGhostTrack(), PndMvdRiemannTrackFinderTaskCutPar::CalcRiemannTracks(), PndMvdSttGemRiemannTrackFinder::CheckSZ(), PndRiemannTrackFinder::CheckSZ(), PndRiemannTrackFinder::CreateRiemannTrack(), dDip(), dip(), dipangle(), PndMvdEventAnaTask::Exec(), PndRiemannTrackFinder::FindTracks(), PndMvdSttGemRiemannTrackFinder::FindTracks(), PndSciTAnaIdeal::GetRiemannTrack(), PndMvdRiemannVertexFinderTask::refit(), szDist(), and szError().

441  {
442  if (fFitDone == false)
443  refit(withErrorCalc);
444  unsigned int num=getNumHits();
445  if (fVerbose > 1) std::cout << "szFit() for " << num << " Points!" << std::endl;
446  if (r() > 0) {
447 
448  TGraph g(num);
449  // get s'es and zs
450  int j=0;
451  for(unsigned int i=0;i<num;++i){
452  if (fVerbose > 1)
453  if (fHits[i].hit() != NULL)
454  std::cout << "Point: " << i << ": " << fHits[i].hit()->GetEntryNr() << " ";
455  if (fHits[i].hit() != 0 && fHits[i].hit()->GetEntryNr().GetType() == GetBranchId("STTHit")){
456  continue;
457  }
458  fHits[i].calcPosOnTrk(this);
459  if (fVerbose > 1) std::cout << fHits[i].s() << " " << fHits[i].z() << std::endl;
460  g.SetPoint(j,fHits[i].s(),fHits[i].z());
461  j++;
462  }
463  if (j > 1){
464  g.Set(j);
465  g.Fit("pol1","Q0"); // << std::endl;
466  TF1* f = g.GetFunction("pol1");
467  //std::cout << "f: " << f << std::endl;
468  ft = f->GetParameter(0);
469  fm = f->GetParameter(1);
470  ftError = f->GetParError(0);
471  fmError = f->GetParError(1);
472  fChi2 = f->GetChisquare()/f->GetNDF();
473  fSZFitDone = true;
474  } else {
475  ft = 0;
476  fm = 0;
477  ftError = 0;
478  fmError = 0;
479  fChi2 = -1;
480  fSZFitDone = true;
481 
482  if (fVerbose > 0)
483  std::cout << "-W- PndRiemannTrack::calcSZ less than 2 points with z-Info: " << *this << std::endl;
484  }
485  } else {
486  ft = 0;
487  fm = 0;
488  ftError = 0;
489  fmError = 0;
490  fChi2 = -1;
491  fSZFitDone = true;
492 
493  if (fVerbose > 0)
494  std::cout << "-W- PndRiemannTrack::calcSZ r == 0: " << *this << std::endl;
495 
496  }
497  if (fVerbose > 1) std::cout << "t, m: " << ft << " +/- " << ftError << " / " << fm << " +/- " << fmError << " Chi2: " << fChi2 << std::endl;
498  return;
499 }
unsigned int getNumHits()
int num[96]
Definition: ranlxd.cxx:381
Int_t i
Definition: run_full.C:25
std::vector< PndRiemannHit > fHits
TLorentzVector s
Definition: Pnd2DStar.C:50
TFile * g
Int_t GetBranchId(TString branchName)
double fmError
Error of fit.
double fChi2
Chisquare of sz fit.
void refit(bool withErrorCalc=true)
TFile * f
Definition: bump_analys.C:12
Double_t z
double r() const
PndSdsMCPoint * hit
Definition: anasim.C:70
double fm
parameters of sz-fit
double ftError
Error of fit.
double PndRiemannTrack::t ( ) const
inline

Definition at line 100 of file PndRiemannTrack.h.

References ft.

Referenced by calcZPosByS().

100 {return ft;}
double PndRiemannTrack::tError ( ) const
inline

Definition at line 101 of file PndRiemannTrack.h.

References ftError.

Referenced by calcErrorPosByS().

101 {return ftError;}
double ftError
Error of fit.
double PndRiemannTrack::weight ( ) const
inline

Definition at line 94 of file PndRiemannTrack.h.

References fweight.

94 {return fweight;};
double fweight
sum over all weights (1/(sigmaXY*sigmaXY))

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream out,
PndRiemannTrack track 
)
friend

Definition at line 141 of file PndRiemannTrack.h.

141  {
142  track.Print(out);
143  return out;
144  }
TFile * out
Definition: reco_muo.C:20
virtual void Print(std::ostream &out=std::cout)

Member Data Documentation

TVectorD PndRiemannTrack::fav
private

average over all hits

Definition at line 150 of file PndRiemannTrack.h.

Referenced by addHit(), av(), and refit().

std::map<TString, Int_t> PndRiemannTrack::fBranchNameMap
private

Definition at line 175 of file PndRiemannTrack.h.

Referenced by GetBranchId().

double PndRiemannTrack::fc
private

distance of plane to origin

Definition at line 151 of file PndRiemannTrack.h.

Referenced by c(), calcJacRXY(), dist(), init(), r(), and refit().

double PndRiemannTrack::fChi2
private

Chisquare of sz fit.

Definition at line 157 of file PndRiemannTrack.h.

Referenced by szChi2(), and szFit().

TMatrixD PndRiemannTrack::fcovPlane
private

full covarince matrix of the plane;

Definition at line 158 of file PndRiemannTrack.h.

Referenced by covPlane(), and refit().

TMatrixD PndRiemannTrack::fcovRXY
private

Definition at line 160 of file PndRiemannTrack.h.

Referenced by covRXY(), dR(), dX(), dY(), and refit().

bool PndRiemannTrack::fErrorCalcDone
private

Definition at line 166 of file PndRiemannTrack.h.

Referenced by addHit(), and refit().

bool PndRiemannTrack::fFitDone
private

Definition at line 164 of file PndRiemannTrack.h.

Referenced by addHit(), calcChi2Plane(), calcSZChi2(), refit(), and szFit().

std::vector<PndRiemannHit> PndRiemannTrack::fHits
private
TMatrixD PndRiemannTrack::fjacRXY
private

jacobian matrix to transform from c,n1,n2,n2 to r,x,y

Definition at line 159 of file PndRiemannTrack.h.

Referenced by calcJacRXY(), jacRXY(), and refit().

double PndRiemannTrack::fm
private

parameters of sz-fit

Definition at line 153 of file PndRiemannTrack.h.

Referenced by dDip(), dip(), dipangle(), getSZm(), init(), m(), szDist(), and szFit().

double PndRiemannTrack::fmError
private

Error of fit.

Definition at line 155 of file PndRiemannTrack.h.

Referenced by dDip(), mError(), szError(), and szFit().

TVectorD PndRiemannTrack::fn
private

normal vector to plane;

Definition at line 149 of file PndRiemannTrack.h.

Referenced by calcIntersection(), calcJacRXY(), dist(), init(), n(), orig(), r(), and refit().

Double_t PndRiemannTrack::fStartAlpha
private

Definition at line 172 of file PndRiemannTrack.h.

Referenced by calcStartStopAlpha(), getPforHit(), and Print().

Double_t PndRiemannTrack::fStopAlpha
private

Definition at line 173 of file PndRiemannTrack.h.

Referenced by calcStartStopAlpha(), and Print().

bool PndRiemannTrack::fSZFitDone
private

Definition at line 165 of file PndRiemannTrack.h.

Referenced by addHit(), dDip(), dip(), dipangle(), refit(), szDist(), szError(), and szFit().

double PndRiemannTrack::ft
private

Definition at line 154 of file PndRiemannTrack.h.

Referenced by getSZt(), szDist(), szFit(), and t().

double PndRiemannTrack::ftError
private

Error of fit.

Definition at line 156 of file PndRiemannTrack.h.

Referenced by szError(), szFit(), and tError().

bool PndRiemannTrack::ftrefit
private

Definition at line 168 of file PndRiemannTrack.h.

Referenced by addHit(), and refit().

int PndRiemannTrack::fVerbose
private
double PndRiemannTrack::fVertexCut
private

Definition at line 169 of file PndRiemannTrack.h.

Referenced by calcIntersection(), and SetVertexCut().

double PndRiemannTrack::fweight
private

sum over all weights (1/(sigmaXY*sigmaXY))

Definition at line 167 of file PndRiemannTrack.h.

Referenced by addHit(), refit(), and weight().


The documentation for this class was generated from the following files: