12 using namespace tauImpactParameter;
18 TLorentzVector
Tau(0,0,0,0);
28 TVectorT<double> inpar(size);
29 TMatrixTSym<double> incov(size);
43 inpar(
i+Nuoffset)=
Nu.parameter(
i)+1.0;
46 incov(
i+Nuoffset,
j+Nuoffset)=
Nu.covariance(
i,
j);
55 TVectorT<double> PAR_0(
npar);
68 cov.ResizeTo(npar,npar);
77 TVector3 TauDir=sv-
pv;
95 TVectorT<double> outpar(
npar);
96 for(
int i=0;
i<
npar;
i++){outpar(
i)=inpar(
i);}
130 else{outpar(
i)=nupar(
i)+a1par(
i);}
136 double Enu2 = nu_px*nu_px + nu_py*nu_py + nu_pz*
nu_pz;
141 double Ea12 = a1_px*a1_px + a1_py*a1_py + a1_pz*a1_pz + a1_m*
a1_m;
145 double P2=outpar_px*outpar_px + outpar_py*outpar_py + outpar_pz*outpar_pz;
160 std::vector<LorentzVectorParticle> refitParticles;
170 return refitParticles;
188 TauDir.SetMagThetaPhi(1.0,theta,phi);
196 TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
202 if(TauDir.Dot(a1.Vect())<0){
226 TVectorT<double> outpar(inpar.GetNrows());
227 TLorentzVector a1,nu;
231 TLorentzVector a1_d=a1;
232 TLorentzVector nu_d=nu;
233 TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
235 solveByRotation(TauDir,a1_d,Tau_plus,Tau_minus,nu_plus,nu_minus,isReal,
true);
236 if(amb==
plus)nu=nu_plus;
238 for(
int i=0;
i<outpar.GetNrows();
i++){ outpar(
i)=inpar(
i);}
239 outpar(
nu_px)=nu.Px();
240 outpar(
nu_py)=nu.Py();
241 outpar(
nu_pz)=nu.Pz();
247 TVectorT<double> outpar(inpar.GetNrows());
248 TLorentzVector a1,nu;
252 double theta_a1(a1.Theta()),phi_a1(a1.Phi()),theta_GJMax(
thetaGJMax(a1));
253 TauDir.RotateZ(-phi_a1);
254 TauDir.RotateY(-theta_a1);
255 double phiprime(TauDir.Phi());
256 TauDir=TVector3(
sin(theta_GJMax)*
cos(phiprime),
sin(theta_GJMax)*
sin(phiprime),
cos(theta_GJMax));
257 TauDir.RotateY(theta_a1);
258 TauDir.RotateZ(phi_a1);
259 for(
int i=0;
i<outpar.GetNrows();
i++) outpar(
i)=inpar(
i);
269 if(!(cov_tmp(0,0)>0))
return -999;
270 if(par_tmp(0)>0)
return par_tmp(0)/
sqrt(cov_tmp(0,0));
276 TVectorT<double> outpar(1);
277 TLorentzVector a1,nu;
281 double theta_a1(a1.Theta()),phi_a1(a1.Phi()),theta_GJMax(
thetaGJMax(a1));
282 TauDir.RotateZ(-phi_a1);
283 TauDir.RotateY(-theta_a1);
284 outpar(0)=(TauDir.Theta()-theta_GJMax);
virtual double covariance(int i, int j) const
static const std::string Nu
Sin< T >::type sin(const T &t)
double getTauRotationSignificance()
Geom::Theta< T > theta() const
static TVectorT< double > ComputeInitalExpPar(const TVectorT< double > &inpar)
static double thetaGJMax(const TLorentzVector &a1)
static TVectorT< double > ComputeA1LorentzVectorPar(const TVectorT< double > &inpar)
TMatrixTSym< double > expcov
static TVectorT< double > ComputeMotherLorentzVectorPar(const TVectorT< double > &inpar)
std::vector< LorentzVectorParticle > getRefitDaughters()
LorentzVectorParticle getMother()
TMatrixTSym< double > cov_0
Cos< T >::type cos(const T &t)
TVectorT< double > exppar
TauA1NuConstrainedFitter(unsigned int ambiguity, const LorentzVectorParticle &A1, const TVector3 &PVertex, const TMatrixTSym< double > &VertexCov)
static TVectorT< double > TauRot(const TVectorT< double > &inpar)
virtual double parameter(int i) const
static TVectorT< double > SolveAmbiguityAnalyticallywithRot(const TVectorT< double > &inpar, unsigned int ambiguity)
TMatrixTSym< double > cov
std::vector< LorentzVectorParticle > particles_
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
static TVectorT< double > ComputeNuLorentzVectorPar(const TVectorT< double > &inpar)
virtual double bField() const
static TVectorT< double > ComputeExpParToPar(const TVectorT< double > &inpar)
static TVectorT< double > SolveAmbiguityAnalytically(const TVectorT< double > &inpar, unsigned int ambiguity)
tuple size
Write out results.
static void solveByRotation(const TVector3 &TauDir, const TLorentzVector &A1, TLorentzVector &Tau_plus, TLorentzVector &Tau_minus, TLorentzVector &nu_plus, TLorentzVector &nu_minus, bool &isReal, bool rotateback=true)
static TMatrixTSym< double > propagateError(std::function< TVectorT< double >(const TVectorT< double > &)> f, const TVectorT< double > &inPar, TMatrixTSym< double > &inCov, double epsilon=0.001, double errorEpsilonRatio=1000)