CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
tauImpactParameter::TauA1NuConstrainedFitter Class Reference

#include <TauA1NuConstrainedFitter.h>

Inheritance diagram for tauImpactParameter::TauA1NuConstrainedFitter:
tauImpactParameter::MultiProngTauSolver

Public Types

enum  ExpandedPars { a1_vx =9, a1_vy, a1_vz, nexpandedpar }
 
enum  OrignialPars { norigpar =13 }
 
enum  Pars {
  tau_phi =0, tau_theta, a1_px, a1_py,
  a1_pz, a1_m, nu_px, nu_py,
  nu_pz, npar
}
 
- Public Types inherited from tauImpactParameter::MultiProngTauSolver
enum  Ambiguity { zero, minus, plus, NAmbiguity }
 

Public Member Functions

bool fit ()
 
LorentzVectorParticle getMother ()
 
std::vector< LorentzVectorParticlegetRefitDaughters ()
 
double getTauRotationSignificance ()
 
 TauA1NuConstrainedFitter (unsigned int ambiguity, const LorentzVectorParticle &A1, const TVector3 &PVertex, const TMatrixTSym< double > &VertexCov)
 
 ~TauA1NuConstrainedFitter () override
 
- Public Member Functions inherited from tauImpactParameter::MultiProngTauSolver
 MultiProngTauSolver ()
 
virtual ~MultiProngTauSolver ()
 

Private Member Functions

void UpdateExpandedPar ()
 

Static Private Member Functions

static TVectorT< double > ComputeA1LorentzVectorPar (const TVectorT< double > &inpar)
 
static TVectorT< double > ComputeExpParToPar (const TVectorT< double > &inpar)
 
static TVectorT< double > ComputeInitalExpPar (const TVectorT< double > &inpar)
 
static TVectorT< double > ComputeMotherLorentzVectorPar (const TVectorT< double > &inpar)
 
static TVectorT< double > ComputeNuLorentzVectorPar (const TVectorT< double > &inpar)
 
static void CovertParToObjects (const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
 
static TVectorT< double > SolveAmbiguityAnalytically (const TVectorT< double > &inpar, unsigned int ambiguity)
 
static TVectorT< double > SolveAmbiguityAnalyticallywithRot (const TVectorT< double > &inpar, unsigned int ambiguity)
 
static TVectorT< double > TauRot (const TVectorT< double > &inpar)
 

Private Attributes

unsigned int ambiguity_
 
TMatrixTSym< double > cov
 
TMatrixTSym< double > cov_0
 
TMatrixTSym< double > expcov
 
TVectorT< double > exppar
 
TVectorT< double > par
 
TVectorT< double > par_0
 
std::vector< LorentzVectorParticleparticles_
 

Additional Inherited Members

- Static Public Member Functions inherited from tauImpactParameter::MultiProngTauSolver
static void analyticESolver (TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1, bool &isReal)
 
static LorentzVectorParticle estimateNu (const LorentzVectorParticle &a1, const TVector3 &pv, int ambiguity, TLorentzVector &tau)
 
static void numericalESolver (TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1, bool &isReal)
 
static void quadratic (double &x_plus, double &x_minus, double a, double b, double c, bool &isReal)
 
static TVectorT< double > rotateToTauFrame (const TVectorT< double > &inpar)
 
static bool setTauDirectionatThetaGJMax (const TLorentzVector &a1, double &theta, double &phi, double scale=1.0)
 
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 double thetaGJMax (const TLorentzVector &a1)
 

Detailed Description

Definition at line 21 of file TauA1NuConstrainedFitter.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

TauA1NuConstrainedFitter::TauA1NuConstrainedFitter ( unsigned int  ambiguity,
const LorentzVectorParticle A1,
const TVector3 &  PVertex,
const TMatrixTSym< double > &  VertexCov 
)

Definition at line 15 of file TauA1NuConstrainedFitter.cc.

References tauImpactParameter::Particle::bField(), ComputeExpParToPar(), ComputeInitalExpPar(), cov, cov_0, tauImpactParameter::Particle::covariance(), expcov, exppar, mps_fire::i, nexpandedpar, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, npar, TtFullLepDaughter::Nu, tauImpactParameter::PDGInfo::nu_tau, tauImpactParameter::LorentzVectorParticle::NVertex, par, par_0, tauImpactParameter::LorentzVectorParticle::parameter(), particles_, tauImpactParameter::ErrorMatrixPropagator::propagateError(), findQualityFiles::size, tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, and tauImpactParameter::LorentzVectorParticle::vz.

15  :
17  ambiguity_(ambiguity)
18 {
19  TLorentzVector Tau(0,0,0,0);
20  //dummy substitution not used later
21  TVectorT<double> nu_par(LorentzVectorParticle::NLorentzandVertexPar,1);
22  TMatrixTSym<double> nu_cov(LorentzVectorParticle::NLorentzandVertexPar);
23  LorentzVectorParticle Nu(nu_par,nu_cov,PDGInfo::nu_tau,0.0,A1.bField());
24  particles_.push_back(A1);
25  particles_.push_back(Nu);
26 
27  // setup 13 by 13 matrix
29  TVectorT<double> inpar(size);
30  TMatrixTSym<double> incov(size);
31 
32  // Get primary vertex information
33  if(VertexCov.GetNrows()!=LorentzVectorParticle::NVertex)return;
34  inpar(LorentzVectorParticle::vx)=PVertex.X();
35  inpar(LorentzVectorParticle::vy)=PVertex.Y();
36  inpar(LorentzVectorParticle::vz)=PVertex.Z();
37  for(int i=0; i<LorentzVectorParticle::NVertex;i++){
38  for(int j=0; j<LorentzVectorParticle::NVertex;j++)incov(i,j)=VertexCov(i,j);
39  }
40  int A1offset=LorentzVectorParticle::NVertex;
43  inpar(i+A1offset)=A1.parameter(i);
44  inpar(i+Nuoffset)=Nu.parameter(i)+1.0;// offset by 1 GeV to prevent convergence on first iteration
46  incov(i+A1offset,j+A1offset)=A1.covariance(i,j);
47  incov(i+Nuoffset,j+Nuoffset)=Nu.covariance(i,j);
48  }
49  }
50 
51  exppar.ResizeTo(nexpandedpar,1);
55 
56  TVectorT<double> PAR_0(npar);
57  par_0.ResizeTo(npar);
58  cov_0.ResizeTo(npar,npar);
60  for(int i=0; i<npar;i++)par_0(i)=PAR_0(i);
62 
63  for(int i=0; i<npar;i++){
64  for(int j=0;j<npar;j++){cov_0(i,j)=expcov(i,j);}
65  }
66 
67  par.ResizeTo(npar);
68  par=par_0;
69  cov.ResizeTo(npar,npar);
70  cov=cov_0;
71 }
size
Write out results.
virtual double covariance(int i, int j) const
Definition: Particle.h:25
static const std::string Nu
static TVectorT< double > ComputeInitalExpPar(const TVectorT< double > &inpar)
std::vector< LorentzVectorParticle > particles_
virtual double bField() const
Definition: Particle.h:26
static TVectorT< double > ComputeExpParToPar(const TVectorT< double > &inpar)
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)
tauImpactParameter::TauA1NuConstrainedFitter::~TauA1NuConstrainedFitter ( )
inlineoverride

Definition at line 24 of file TauA1NuConstrainedFitter.h.

24 {};

Member Function Documentation

TVectorT< double > TauA1NuConstrainedFitter::ComputeA1LorentzVectorPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 113 of file TauA1NuConstrainedFitter.cc.

References a1_m, a1_px, a1_py, a1_pz, a1_vx, a1_vy, a1_vz, tauImpactParameter::LorentzVectorParticle::m, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, tauImpactParameter::LorentzVectorParticle::px, tauImpactParameter::LorentzVectorParticle::py, tauImpactParameter::LorentzVectorParticle::pz, tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, and tauImpactParameter::LorentzVectorParticle::vz.

Referenced by ComputeMotherLorentzVectorPar(), and getRefitDaughters().

113  {
114  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
115  outpar(LorentzVectorParticle::vx)=inpar(a1_vx);
116  outpar(LorentzVectorParticle::vy)=inpar(a1_vy);
117  outpar(LorentzVectorParticle::vz)=inpar(a1_vz);
118  outpar(LorentzVectorParticle::px)=inpar(a1_px);
119  outpar(LorentzVectorParticle::py)=inpar(a1_py);
120  outpar(LorentzVectorParticle::pz)=inpar(a1_pz);
121  outpar(LorentzVectorParticle::m)=inpar(a1_m);
122  return outpar;
123 }
TVectorT< double > TauA1NuConstrainedFitter::ComputeExpParToPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 95 of file TauA1NuConstrainedFitter.cc.

References mps_fire::i, and npar.

Referenced by TauA1NuConstrainedFitter().

95  {
96  TVectorT<double> outpar(npar);
97  for(int i=0;i<npar;i++){outpar(i)=inpar(i);}
98  return outpar;
99 }
TVectorT< double > TauA1NuConstrainedFitter::ComputeInitalExpPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 73 of file TauA1NuConstrainedFitter.cc.

References a1_m, a1_px, a1_py, a1_pz, a1_vx, a1_vy, a1_vz, tauImpactParameter::LorentzVectorParticle::m, nexpandedpar, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, nu_px, nu_py, nu_pz, tauImpactParameter::LorentzVectorParticle::NVertex, PFRecoTauDiscriminationByIsolation_cfi::offset, MetAnalyzer::pv(), tauImpactParameter::LorentzVectorParticle::px, tauImpactParameter::LorentzVectorParticle::py, tauImpactParameter::LorentzVectorParticle::pz, pfDeepBoostedJetPreprocessParams_cfi::sv, tau_phi, tau_theta, tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, and tauImpactParameter::LorentzVectorParticle::vz.

Referenced by TauA1NuConstrainedFitter().

73  {
74  TVectorT<double> outpar(nexpandedpar);
77  TVector3 sv(inpar(LorentzVectorParticle::vx+offset),inpar(LorentzVectorParticle::vy+offset),inpar(LorentzVectorParticle::vz+offset));
78  TVector3 TauDir=sv-pv;
79  outpar(tau_phi)=TauDir.Phi();
80  outpar(tau_theta)=TauDir.Theta();
81  outpar(a1_px)=inpar(LorentzVectorParticle::px+offset);
82  outpar(a1_py)=inpar(LorentzVectorParticle::py+offset);
83  outpar(a1_pz)=inpar(LorentzVectorParticle::pz+offset);
84  outpar(a1_m)=inpar(LorentzVectorParticle::m+offset);
85  outpar(a1_vx)=inpar(LorentzVectorParticle::vx+offset);
86  outpar(a1_vy)=inpar(LorentzVectorParticle::vy+offset);
87  outpar(a1_vz)=inpar(LorentzVectorParticle::vz+offset);
89  outpar(nu_px)=inpar(LorentzVectorParticle::px+offset);
90  outpar(nu_py)=inpar(LorentzVectorParticle::py+offset);
91  outpar(nu_pz)=inpar(LorentzVectorParticle::pz+offset);
92  return outpar;
93 }
def pv(vc)
Definition: MetAnalyzer.py:6
TVectorT< double > TauA1NuConstrainedFitter::ComputeMotherLorentzVectorPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 125 of file TauA1NuConstrainedFitter.cc.

References a1_m, a1_px, a1_py, a1_pz, ComputeA1LorentzVectorPar(), ComputeNuLorentzVectorPar(), mps_fire::i, tauImpactParameter::LorentzVectorParticle::m, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, nu_px, nu_py, nu_pz, tauImpactParameter::LorentzVectorParticle::NVertex, tauImpactParameter::LorentzVectorParticle::px, tauImpactParameter::LorentzVectorParticle::py, tauImpactParameter::LorentzVectorParticle::pz, and mathSSE::sqrt().

Referenced by getMother().

125  {
126  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
127  TVectorT<double> nupar=ComputeNuLorentzVectorPar(inpar);
128  TVectorT<double> a1par=ComputeA1LorentzVectorPar(inpar);
130  if(i<LorentzVectorParticle::NVertex){outpar(i)=a1par(i);}
131  else{outpar(i)=nupar(i)+a1par(i);}
132  //if(i==LorentzVectorParticle::m) outpar(i,0)=PDGInfo::tau_mass();
133  }
134  double nu_px = nupar(LorentzVectorParticle::px);
135  double nu_py = nupar(LorentzVectorParticle::py);
136  double nu_pz = nupar(LorentzVectorParticle::pz);
137  double Enu2 = nu_px*nu_px + nu_py*nu_py + nu_pz*nu_pz;
138  double a1_px = a1par(LorentzVectorParticle::px);
139  double a1_py = a1par(LorentzVectorParticle::py);
140  double a1_pz = a1par(LorentzVectorParticle::pz);
141  double a1_m = a1par(LorentzVectorParticle::m);
142  double Ea12 = a1_px*a1_px + a1_py*a1_py + a1_pz*a1_pz + a1_m*a1_m;
143  double outpar_px = outpar(LorentzVectorParticle::px);
144  double outpar_py = outpar(LorentzVectorParticle::py);
145  double outpar_pz = outpar(LorentzVectorParticle::pz);
146  double P2=outpar_px*outpar_px + outpar_py*outpar_py + outpar_pz*outpar_pz;
147  outpar(LorentzVectorParticle::m)=sqrt(std::fabs(Enu2 + Ea12 + 2*sqrt(Enu2*Ea12)-P2));
148  return outpar;
149 }
static TVectorT< double > ComputeA1LorentzVectorPar(const TVectorT< double > &inpar)
T sqrt(T t)
Definition: SSEVec.h:18
static TVectorT< double > ComputeNuLorentzVectorPar(const TVectorT< double > &inpar)
TVectorT< double > TauA1NuConstrainedFitter::ComputeNuLorentzVectorPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 101 of file TauA1NuConstrainedFitter.cc.

References a1_vx, a1_vy, a1_vz, tauImpactParameter::LorentzVectorParticle::m, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, nu_px, nu_py, nu_pz, tauImpactParameter::LorentzVectorParticle::px, tauImpactParameter::LorentzVectorParticle::py, tauImpactParameter::LorentzVectorParticle::pz, tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, and tauImpactParameter::LorentzVectorParticle::vz.

Referenced by ComputeMotherLorentzVectorPar(), and getRefitDaughters().

101  {
102  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
103  outpar(LorentzVectorParticle::vx)=inpar(a1_vx);
104  outpar(LorentzVectorParticle::vy)=inpar(a1_vy);
105  outpar(LorentzVectorParticle::vz)=inpar(a1_vz);
106  outpar(LorentzVectorParticle::px)=inpar(nu_px);
107  outpar(LorentzVectorParticle::py)=inpar(nu_py);
108  outpar(LorentzVectorParticle::pz)=inpar(nu_pz);
109  outpar(LorentzVectorParticle::m)=0;
110  return outpar;
111 }
void TauA1NuConstrainedFitter::CovertParToObjects ( const TVectorD &  v,
TLorentzVector &  a1,
TLorentzVector &  nu,
double &  phi,
double &  theta,
TVector3 &  TauDir 
)
staticprivate

Definition at line 184 of file TauA1NuConstrainedFitter.cc.

References a1_m, a1_px, a1_py, a1_pz, nu_px, nu_py, nu_pz, mathSSE::sqrt(), tau_phi, tau_theta, and findQualityFiles::v.

Referenced by SolveAmbiguityAnalytically(), SolveAmbiguityAnalyticallywithRot(), and TauRot().

bool TauA1NuConstrainedFitter::fit ( void  )

Definition at line 192 of file TauA1NuConstrainedFitter.cc.

References a1_m, a1_px, a1_py, a1_pz, ambiguity_, funct::cos(), cov, cov_0, mps_fire::i, tauImpactParameter::MultiProngTauSolver::minus, npar, par, tauImpactParameter::MultiProngTauSolver::plus, tauImpactParameter::ErrorMatrixPropagator::propagateError(), funct::sin(), SolveAmbiguityAnalytically(), SolveAmbiguityAnalyticallywithRot(), tauImpactParameter::MultiProngTauSolver::solveByRotation(), mathSSE::sqrt(), tau_phi, tau_theta, theta(), and tauImpactParameter::MultiProngTauSolver::zero.

Referenced by trackingPlots.Iteration::modules(), and PFTau3ProngReco::produce().

192  {
194  // Check if Tau Direction is unphysical and if nessicary set the starting point to Theta_{GJ-Max}
195  TLorentzVector a1(par(a1_px),par(a1_py),par(a1_pz),sqrt(par(a1_m)*par(a1_m)+par(a1_px)*par(a1_px)+par(a1_py)*par(a1_py)+par(a1_pz)*par(a1_pz)));
196  double phi(par(tau_phi)),theta(par(tau_theta));
197  TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
198  TVector3 TauDir(cos(phi)*sin(theta),sin(phi)*sin(theta),cos(theta));
199  bool isReal;
200  solveByRotation(TauDir,a1,Tau_plus,Tau_minus,nu_plus,nu_minus,isReal);
201 
202  //check that the do product of the a1 and tau is positive, otherwise there is no information for tau direction -> use zero solution
203  if(TauDir.Dot(a1.Vect())<0){
204  isReal=false;
205  }
206 
207  //case 1: is real then solve analytically
208  if(isReal && (ambiguity_==plus || ambiguity_==minus)){
209  // popogate errors
212  for(int i=0; i<npar;i++) par(i)=par_tmp(i);
213  return true;
214  }
215  // case 2 is in unphsyical region - rotate and substitue \theta_{GJ} with \theta_{GJ}^{Max} and then solve analytically
216  else if(!isReal && ambiguity_==zero){
219  for(int i=0; i<npar;i++) par(i)=par_tmp(i);
220  return true;
221  }
222  return false;
223 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static TVectorT< double > SolveAmbiguityAnalyticallywithRot(const TVectorT< double > &inpar, unsigned int ambiguity)
static TVectorT< double > SolveAmbiguityAnalytically(const TVectorT< double > &inpar, unsigned int ambiguity)
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)
LorentzVectorParticle TauA1NuConstrainedFitter::getMother ( )

Definition at line 174 of file TauA1NuConstrainedFitter.cc.

References funct::abs(), b, EnergyCorrector::c, ComputeMotherLorentzVectorPar(), expcov, exppar, mps_fire::i, funct::m, particles_, tauImpactParameter::ErrorMatrixPropagator::propagateError(), tauImpactParameter::PDGInfo::tau_minus, and UpdateExpandedPar().

Referenced by PFTau3ProngReco::produce().

174  {
176  double c(0),b(0);
177  for(unsigned int i=0;i<particles_.size();i++){c+=particles_[i].charge();b=particles_[i].bField();}
178  TVectorT<double> m=ComputeMotherLorentzVectorPar(exppar);
181  return mymother;
182 }
static TVectorT< double > ComputeMotherLorentzVectorPar(const TVectorT< double > &inpar)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< LorentzVectorParticle > particles_
double b
Definition: hdecay.h:120
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)
std::vector< LorentzVectorParticle > TauA1NuConstrainedFitter::getRefitDaughters ( )

Definition at line 160 of file TauA1NuConstrainedFitter.cc.

References b, EnergyCorrector::c, ComputeA1LorentzVectorPar(), ComputeNuLorentzVectorPar(), expcov, exppar, mps_fire::i, tauImpactParameter::PDGInfo::nu_tau, particles_, common_cff::pdgId, tauImpactParameter::ErrorMatrixPropagator::propagateError(), and UpdateExpandedPar().

Referenced by PFTau3ProngReco::produce().

160  {
161  std::vector<LorentzVectorParticle> refitParticles;
163  double c(0),b(0);
164  for(unsigned int i=0;i<particles_.size();i++){c+=particles_[i].charge();b=particles_[i].bField();}
165  TVectorT<double> a1=ComputeA1LorentzVectorPar(exppar);
167  refitParticles.push_back(LorentzVectorParticle(a1,a1cov,particles_[0].pdgId(),c,b));
168  TVectorT<double> nu=ComputeNuLorentzVectorPar(exppar);
170  refitParticles.push_back(LorentzVectorParticle(nu,nucov,PDGInfo::nu_tau,0.0,b));
171  return refitParticles;
172 }
static TVectorT< double > ComputeA1LorentzVectorPar(const TVectorT< double > &inpar)
std::vector< LorentzVectorParticle > particles_
double b
Definition: hdecay.h:120
static TVectorT< double > ComputeNuLorentzVectorPar(const TVectorT< double > &inpar)
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)
double TauA1NuConstrainedFitter::getTauRotationSignificance ( )

Definition at line 267 of file TauA1NuConstrainedFitter.cc.

References cov_0, par, tauImpactParameter::ErrorMatrixPropagator::propagateError(), mathSSE::sqrt(), and TauRot().

267  {
268  TVectorT<double> par_tmp=TauA1NuConstrainedFitter::TauRot(par);
270  if(!(cov_tmp(0,0)>0)) return -999; // return invalid value if the covariance is unphysical (safety flag)
271  if(par_tmp(0)>0) return par_tmp(0)/sqrt(cov_tmp(0,0)); // return the significance if the value is in the unphysical region
272  return 0; // reutrn 0 for the rotation significance if the tau is in the physical region
273 }
T sqrt(T t)
Definition: SSEVec.h:18
static TVectorT< double > TauRot(const TVectorT< double > &inpar)
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)
TVectorT< double > TauA1NuConstrainedFitter::SolveAmbiguityAnalytically ( const TVectorT< double > &  inpar,
unsigned int  ambiguity 
)
staticprivate

Definition at line 225 of file TauA1NuConstrainedFitter.cc.

References CovertParToObjects(), mps_fire::i, nu_px, nu_py, nu_pz, tauImpactParameter::MultiProngTauSolver::plus, tauImpactParameter::MultiProngTauSolver::solveByRotation(), and theta().

Referenced by fit(), and SolveAmbiguityAnalyticallywithRot().

225  {
226  // Solve equation quadratic equation
227  TVectorT<double> outpar(inpar.GetNrows());
228  TLorentzVector a1,nu;
229  double phi(0),theta(0);
230  TVector3 TauDir;
231  CovertParToObjects(inpar,a1,nu,phi,theta,TauDir);
232  TLorentzVector a1_d=a1;
233  TLorentzVector nu_d=nu;
234  TLorentzVector Tau_plus,Tau_minus,nu_plus,nu_minus;
235  bool isReal;
236  solveByRotation(TauDir,a1_d,Tau_plus,Tau_minus,nu_plus,nu_minus,isReal,true);
237  if(amb==plus)nu=nu_plus;
238  else nu=nu_minus;
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();
243  return outpar;
244 }
Geom::Theta< T > theta() const
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
double amb
Definition: hdecay.h:21
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)
TVectorT< double > TauA1NuConstrainedFitter::SolveAmbiguityAnalyticallywithRot ( const TVectorT< double > &  inpar,
unsigned int  ambiguity 
)
staticprivate

Definition at line 246 of file TauA1NuConstrainedFitter.cc.

References funct::cos(), CovertParToObjects(), mps_fire::i, funct::sin(), SolveAmbiguityAnalytically(), tau_phi, tau_theta, theta(), and tauImpactParameter::MultiProngTauSolver::thetaGJMax().

Referenced by fit().

246  {
247  // Rotate and subsitute \theta_{GJ} with \theta_{GJ}^{Max} - assumes uncertianty on thata and phi of the a1 or small compared to the tau direction.
248  TVectorT<double> outpar(inpar.GetNrows());
249  TLorentzVector a1,nu;
250  double phi(0),theta(0);
251  TVector3 TauDir;
252  CovertParToObjects(inpar,a1,nu,phi,theta,TauDir);
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);
261  outpar(tau_phi)=TauDir.Phi();
262  outpar(tau_theta)=TauDir.Theta();
263  return SolveAmbiguityAnalytically(outpar,ambiguity);
264 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
static double thetaGJMax(const TLorentzVector &a1)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
static TVectorT< double > SolveAmbiguityAnalytically(const TVectorT< double > &inpar, unsigned int ambiguity)
TVectorT< double > TauA1NuConstrainedFitter::TauRot ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 276 of file TauA1NuConstrainedFitter.cc.

References CovertParToObjects(), theta(), and tauImpactParameter::MultiProngTauSolver::thetaGJMax().

Referenced by getTauRotationSignificance().

276  {
277  TVectorT<double> outpar(1);
278  TLorentzVector a1,nu;
279  double phi(0),theta(0);
280  TVector3 TauDir;
281  CovertParToObjects(inpar,a1,nu,phi,theta,TauDir);
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);
286  return outpar;
287 }
Geom::Theta< T > theta() const
static double thetaGJMax(const TLorentzVector &a1)
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
void TauA1NuConstrainedFitter::UpdateExpandedPar ( )
private

Definition at line 151 of file TauA1NuConstrainedFitter.cc.

References cov, expcov, exppar, mps_fire::i, npar, and par.

Referenced by getMother(), and getRefitDaughters().

151  {
152  // assumes changes to a1 correlation to vertex is small
153  if(par.GetNrows()==npar && cov.GetNrows()==npar && exppar.GetNrows()==npar && expcov.GetNrows()==npar) return;
154  for(int i=0; i<npar;i++){
155  exppar(i)=par(i);
156  for(int j=0; j<npar;j++){expcov(i,j)=cov(i,j);}
157  }
158 }

Member Data Documentation

unsigned int tauImpactParameter::TauA1NuConstrainedFitter::ambiguity_
private

Definition at line 57 of file TauA1NuConstrainedFitter.h.

Referenced by fit().

TMatrixTSym<double> tauImpactParameter::TauA1NuConstrainedFitter::cov
private

Definition at line 52 of file TauA1NuConstrainedFitter.h.

Referenced by fit(), TauA1NuConstrainedFitter(), and UpdateExpandedPar().

TMatrixTSym<double> tauImpactParameter::TauA1NuConstrainedFitter::cov_0
private
TMatrixTSym<double> tauImpactParameter::TauA1NuConstrainedFitter::expcov
private
TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::exppar
private
TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::par
private
TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::par_0
private

Definition at line 49 of file TauA1NuConstrainedFitter.h.

Referenced by TauA1NuConstrainedFitter().

std::vector<LorentzVectorParticle> tauImpactParameter::TauA1NuConstrainedFitter::particles_
private