13 using namespace tauImpactParameter;
19 TLorentzVector
Tau(0,0,0,0);
29 TVectorT<double> inpar(size);
30 TMatrixTSym<double> incov(size);
44 inpar(
i+Nuoffset)=
Nu.parameter(
i)+1.0;
47 incov(
i+Nuoffset,
j+Nuoffset)=
Nu.covariance(
i,
j);
56 TVectorT<double> PAR_0(
npar);
69 cov.ResizeTo(npar,npar);
78 TVector3 TauDir=sv-
pv;
96 TVectorT<double> outpar(
npar);
97 for(
int i=0;
i<
npar;
i++){outpar(
i)=inpar(
i);}
131 else{outpar(
i)=nupar(
i)+a1par(
i);}
137 double Enu2 = nu_px*nu_px + nu_py*nu_py + nu_pz*
nu_pz;
142 double Ea12 = a1_px*a1_px + a1_py*a1_py + a1_pz*a1_pz + a1_m*
a1_m;
146 double P2=outpar_px*outpar_px + outpar_py*outpar_py + outpar_pz*outpar_pz;
161 std::vector<LorentzVectorParticle> refitParticles;
171 return refitParticles;
189 TauDir.SetMagThetaPhi(1.0,theta,phi);
197 TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
203 if(TauDir.Dot(a1.Vect())<0){
227 TVectorT<double> outpar(inpar.GetNrows());
228 TLorentzVector a1,nu;
232 TLorentzVector a1_d=a1;
233 TLorentzVector nu_d=nu;
234 TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
236 solveByRotation(TauDir,a1_d,Tau_plus,Tau_minus,nu_plus,nu_minus,isReal,
true);
237 if(amb==
plus)nu=nu_plus;
239 for(
int i=0;
i<outpar.GetNrows();
i++){ outpar(
i)=inpar(
i);}
240 outpar(
nu_px)=nu.Px();
241 outpar(
nu_py)=nu.Py();
242 outpar(
nu_pz)=nu.Pz();
248 TVectorT<double> outpar(inpar.GetNrows());
249 TLorentzVector a1,nu;
253 double theta_a1(a1.Theta()),phi_a1(a1.Phi()),theta_GJMax(
thetaGJMax(a1));
254 TauDir.RotateZ(-phi_a1);
255 TauDir.RotateY(-theta_a1);
256 double phiprime(TauDir.Phi());
257 TauDir=TVector3(
sin(theta_GJMax)*
cos(phiprime),
sin(theta_GJMax)*
sin(phiprime),
cos(theta_GJMax));
258 TauDir.RotateY(theta_a1);
259 TauDir.RotateZ(phi_a1);
260 for(
int i=0;
i<outpar.GetNrows();
i++) outpar(
i)=inpar(
i);
270 if(!(cov_tmp(0,0)>0))
return -999;
271 if(par_tmp(0)>0)
return par_tmp(0)/
sqrt(cov_tmp(0,0));
277 TVectorT<double> outpar(1);
278 TLorentzVector a1,nu;
282 double theta_a1(a1.Theta()),phi_a1(a1.Phi()),theta_GJMax(
thetaGJMax(a1));
283 TauDir.RotateZ(-phi_a1);
284 TauDir.RotateY(-theta_a1);
285 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)
Abs< T >::type abs(const T &t)
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_
Geom::Phi< T > phi() const
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)