17 const TVector3& PVertex,
18 const TMatrixTSym<double>& VertexCov)
20 TLorentzVector
Tau(0, 0, 0, 0);
30 TVectorT<double> inpar(
size);
31 TMatrixTSym<double> incov(
size);
41 incov(
i,
j) = VertexCov(
i,
j);
47 inpar(
i + Nuoffset) =
Nu.parameter(
i) + 1.0;
50 incov(
i + Nuoffset,
j + Nuoffset) =
Nu.covariance(
i,
j);
59 TVectorT<double> PAR_0(
npar);
67 for (
int i = 0;
i <
npar;
i++) {
68 for (
int j = 0;
j <
npar;
j++) {
86 TVector3 TauDir =
sv -
pv;
104 TVectorT<double> outpar(
npar);
105 for (
int i = 0;
i <
npar;
i++) {
106 outpar(
i) = inpar(
i);
141 outpar(
i) = a1par(
i);
143 outpar(
i) = nupar(
i) + a1par(
i);
159 double P2 = outpar_px * outpar_px + outpar_py * outpar_py + outpar_pz * outpar_pz;
168 for (
int i = 0;
i <
npar;
i++) {
170 for (
int j = 0;
j <
npar;
j++) {
177 std::vector<LorentzVectorParticle> refitParticles;
185 TMatrixTSym<double> a1cov =
189 TMatrixTSym<double> nucov =
192 return refitParticles;
203 TMatrixTSym<double> mcov =
210 const TVectorD&
v, TLorentzVector& a1, TLorentzVector& nu,
double& phi,
double&
theta, TVector3& TauDir) {
211 a1 = TLorentzVector(
v(
a1_px),
219 TauDir.SetMagThetaPhi(1.0,
theta, phi);
231 TLorentzVector Tau_plus, Tau_minus, nu_plus, nu_minus;
234 solveByRotation(TauDir, a1, Tau_plus, Tau_minus, nu_plus, nu_minus, isReal);
237 if (TauDir.Dot(a1.Vect()) < 0) {
267 TVectorT<double> outpar(inpar.GetNrows());
268 TLorentzVector a1, nu;
269 double phi(0),
theta(0);
272 TLorentzVector a1_d = a1;
273 TLorentzVector nu_d = nu;
274 TLorentzVector Tau_plus, Tau_minus, nu_plus, nu_minus;
276 solveByRotation(TauDir, a1_d, Tau_plus, Tau_minus, nu_plus, nu_minus, isReal,
true);
281 for (
int i = 0;
i < outpar.GetNrows();
i++) {
282 outpar(
i) = inpar(
i);
284 outpar(
nu_px) = nu.Px();
285 outpar(
nu_py) = nu.Py();
286 outpar(
nu_pz) = nu.Pz();
291 unsigned int ambiguity) {
293 TVectorT<double> outpar(inpar.GetNrows());
294 TLorentzVector a1, nu;
295 double phi(0),
theta(0);
298 double theta_a1(a1.Theta()), phi_a1(a1.Phi()), theta_GJMax(
thetaGJMax(a1));
299 TauDir.RotateZ(-phi_a1);
300 TauDir.RotateY(-theta_a1);
301 double phiprime(TauDir.Phi());
302 TauDir = TVector3(
sin(theta_GJMax) *
cos(phiprime),
sin(theta_GJMax) *
sin(phiprime),
cos(theta_GJMax));
303 TauDir.RotateY(theta_a1);
304 TauDir.RotateZ(phi_a1);
305 for (
int i = 0;
i < outpar.GetNrows();
i++)
306 outpar(
i) = inpar(
i);
307 outpar(
tau_phi) = TauDir.Phi();
316 if (!(cov_tmp(0, 0) > 0))
319 return par_tmp(0) /
sqrt(cov_tmp(0, 0));
324 TVectorT<double> outpar(1);
325 TLorentzVector a1, nu;
326 double phi(0),
theta(0);
329 double theta_a1(a1.Theta()), phi_a1(a1.Phi()), theta_GJMax(
thetaGJMax(a1));
330 TauDir.RotateZ(-phi_a1);
331 TauDir.RotateY(-theta_a1);
332 outpar(0) = (TauDir.Theta() - theta_GJMax);
virtual double bField() const
static const std::string Nu
Sin< T >::type sin(const T &t)
double getTauRotationSignificance()
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
virtual double covariance(int i, int j) const
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)
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)
static TVectorT< double > ComputeExpParToPar(const TVectorT< double > &inpar)
static TVectorT< double > SolveAmbiguityAnalytically(const TVectorT< double > &inpar, unsigned int ambiguity)
Geom::Theta< T > theta() const
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)
double parameter(int i) const override
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)