8 #include "TMatrixTSym.h"
10 using namespace tauImpactParameter;
15 x_minus=(-b+
sqrt(R))/(2.0*a);
16 x_plus=(-b-
sqrt(R))/(2.0*a);
20 double a=(A1.Pz()*A1.Pz())/(A1.E()*A1.E())-1.0;
22 double b=2.0*K*A1.Pz()/A1.E();
23 double c=K*K-A1.Pt()*A1.Pt();
24 double z_plus(0),z_minus(0);
26 nu_plus.SetPxPyPzE(-A1.Px(),-A1.Py(),z_plus,
sqrt(z_plus*z_plus+A1.Pt()*A1.Pt()));
27 nu_minus.SetPxPyPzE(-A1.Px(),-A1.Py(),z_minus,
sqrt(z_minus*z_minus+A1.Pt()*A1.Pt()));
33 TLorentzVector nu,
tau;
34 for(
int i=0;
i<=(int)(rmax-rmin)/
step;
i++){
35 nu.SetPxPyPzE(-A1.Px(),-A1.Py(),
z,
sqrt(z*z+A1.Pt()*A1.Pt()));
38 if(m2-mtau2<0 && prev-mtau2>=0) z1=
z;
39 if(m2-mtau2>0 && prev-mtau2<=0) z2=
z;
44 if(z1!=-999 && z2!=-999){
45 nu_plus.SetPxPyPzE(-A1.Px(),-A1.Py(),z1,
sqrt(z1*z1+A1.Pt()*A1.Pt()));
46 nu_minus.SetPxPyPzE(-A1.Px(),-A1.Py(),z2,
sqrt(z2*z2+A1.Pt()*A1.Pt()));
55 TLorentzVector& nu_plus,TLorentzVector& nu_minus,
bool rotateback){
56 TLorentzVector A1rot=A1;
57 double phi(TauDir.Phi()),
theta(TauDir.Theta());
59 A1rot.RotateY(-
theta);
66 nu_plus.RotateY(
theta);
70 nu_minus.RotateY(
theta);
71 nu_minus.RotateZ(
phi);
72 Tau_minus=A1+nu_minus;
75 Tau_plus=A1rot+nu_plus;
76 Tau_minus=A1rot+nu_minus;
82 double dtheta=(theta-a1.Theta());
83 double dphi=fmod(fabs(phi-a1.Phi()),2*
TMath::Pi());
if(phi<a1.Phi())dphi*=-1.0;
84 double dphitheta=
sqrt(dtheta*dtheta+dphi*dphi);
85 if(thetaGJMax_a1<dphitheta || scale<0){
86 theta=a1.Theta()+dtheta*(thetaGJMax_a1/dphitheta)*fabs(scale);
87 phi=a1.Phi()+dphi*(thetaGJMax_a1/dphitheta)*fabs(scale);
98 TLorentzVector lorentzA1=a1.
p4();
100 TVector3 tauFlghtDir=sv-pv;
101 TLorentzVector nuGuess;
103 TVector3 startingtauFlghtDir=tauFlghtDir.Unit();
105 double theta=tauFlghtDir.Theta();
106 double phi=tauFlghtDir.Phi();
108 startingtauFlghtDir.SetMagThetaPhi(1.0,theta,phi);
110 TLorentzVector tau1,tau2,nu1,nu2;
112 if(ambiguity==
plus){ nuGuess=nu1; tau=tau1; }
113 if(ambiguity==
minus){ nuGuess=nu2; tau=tau1; }
114 if(ambiguity==
zero){ nuGuess=nu1; tau=tau1; }
124 TMatrixTSym<double> pvCov=a1.
vertexCov();
126 for(
int j=0;
j<=
i;
j++){
132 if(v<1000.0) v=1000.0;
139 TVectorT<double> outpar(3);
140 TVector3 res(inpar(0),inpar(1),inpar(2));
141 TVector3 Uz;Uz.SetMagThetaPhi(1,inpar(4),inpar(3));
TMatrixTSym< double > vertexCov() const
TLorentzVector p4() const
static TVectorT< double > rotateToTauFrame(const TVectorT< double > &inpar)
Geom::Theta< T > theta() const
static void analyticESolver(TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1)
static bool setTauDirectionatThetaGJMax(const TLorentzVector &a1, double &theta, double &phi, double scale=1.0)
static double thetaGJMax(const TLorentzVector &a1)
static void numericalESolver(TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1)
static void quadratic(double &x_plus, double &x_minus, double a, double b, double c)
static LorentzVectorParticle estimateNu(const LorentzVectorParticle &a1, const TVector3 &pv, int ambiguity, TLorentzVector &tau)
virtual double parameter(int i) const
static void solveByRotation(const TVector3 &TauDir, const TLorentzVector &A1, TLorentzVector &Tau_plus, TLorentzVector &Tau_minus, TLorentzVector &nu_plus, TLorentzVector &nu_minus, bool rotateback=true)
virtual double bField() const