CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions
tauImpactParameter::MultiProngTauSolver Class Reference

#include <MultiProngTauSolver.h>

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

Public Types

enum  Ambiguity { zero, minus, plus, NAmbiguity }
 

Public Member Functions

 MultiProngTauSolver ()
 
virtual ~MultiProngTauSolver ()
 

Static Public Member Functions

static void analyticESolver (TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1)
 
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)
 
static void quadratic (double &x_plus, double &x_minus, double a, double b, double c)
 
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 rotateback=true)
 
static double thetaGJMax (const TLorentzVector &a1)
 

Detailed Description

Definition at line 17 of file MultiProngTauSolver.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

tauImpactParameter::MultiProngTauSolver::MultiProngTauSolver ( )
inline

Definition at line 22 of file MultiProngTauSolver.h.

22 {};
virtual tauImpactParameter::MultiProngTauSolver::~MultiProngTauSolver ( )
inlinevirtual

Definition at line 23 of file MultiProngTauSolver.h.

23 {};

Member Function Documentation

void MultiProngTauSolver::analyticESolver ( TLorentzVector &  nu_plus,
TLorentzVector &  nu_minus,
const TLorentzVector &  A1 
)
static

Definition at line 19 of file MultiProngTauSolver.cc.

References a, b, trackerHits::c, quadratic(), mathSSE::sqrt(), and tauImpactParameter::PDGInfo::tau_mass().

Referenced by solveByRotation().

19  {
20  double a=(A1.Pz()*A1.Pz())/(A1.E()*A1.E())-1.0;
21  double K=(PDGInfo::tau_mass()*PDGInfo::tau_mass()-A1.M2()-2.0*A1.Pt()*A1.Pt())/(2.0*A1.E());
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);
25  quadratic(z_plus,z_minus,a,b,c);
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()));
28 }
static void quadratic(double &x_plus, double &x_minus, double a, double b, double c)
T sqrt(T t)
Definition: SSEVec.h:48
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
static double tau_mass()
Definition: PDGInfo.h:14
LorentzVectorParticle MultiProngTauSolver::estimateNu ( const LorentzVectorParticle a1,
const TVector3 &  pv,
int  ambiguity,
TLorentzVector &  tau 
)
static

Definition at line 97 of file MultiProngTauSolver.cc.

References tauImpactParameter::Particle::bField(), i, j, tauImpactParameter::LorentzVectorParticle::m, minus, tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar, tauImpactParameter::PDGInfo::nu_tau, tauImpactParameter::LorentzVectorParticle::NVertex, tauImpactParameter::LorentzVectorParticle::p4(), tauImpactParameter::LorentzVectorParticle::parameter(), phi, plus, tauImpactParameter::LorentzVectorParticle::px, tauImpactParameter::LorentzVectorParticle::py, tauImpactParameter::LorentzVectorParticle::pz, setTauDirectionatThetaGJMax(), solveByRotation(), theta(), findQualityFiles::v, tauImpactParameter::LorentzVectorParticle::vertex(), tauImpactParameter::LorentzVectorParticle::vertexCov(), tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, tauImpactParameter::LorentzVectorParticle::vz, and zero.

Referenced by tauImpactParameter::TauA1NuConstrainedFitter::TauA1NuConstrainedFitter().

97  {
98  TLorentzVector lorentzA1=a1.p4();
99  TVector3 sv=a1.vertex();
100  TVector3 tauFlghtDir=sv-pv;
101  TLorentzVector nuGuess;
102 
103  TVector3 startingtauFlghtDir=tauFlghtDir.Unit();
104  if(ambiguity==zero){
105  double theta=tauFlghtDir.Theta();
106  double phi=tauFlghtDir.Phi();
107  setTauDirectionatThetaGJMax(lorentzA1,theta,phi);
108  startingtauFlghtDir.SetMagThetaPhi(1.0,theta,phi);
109  }
110  TLorentzVector tau1,tau2,nu1,nu2;
111  solveByRotation(startingtauFlghtDir,lorentzA1,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; }
115  TVectorT<double> par(LorentzVectorParticle::NLorentzandVertexPar,10);
119  par(LorentzVectorParticle::px)=nuGuess.Px();
120  par(LorentzVectorParticle::py)=nuGuess.Py();
121  par(LorentzVectorParticle::pz)=nuGuess.Pz();
122  par(LorentzVectorParticle::m) =nuGuess.M();
123  TMatrixTSym<double> Cov(LorentzVectorParticle::NLorentzandVertexPar);
124  TMatrixTSym<double> pvCov=a1.vertexCov();
126  for(int j=0; j<=i; j++){
127  if(i<LorentzVectorParticle::NVertex) Cov(i,j)=pvCov(i,j);
128  else Cov(i,j)=0;
129  }
130  double v=0;
132  if(v<1000.0) v=1000.0; // try lowing to test impact
133  Cov(i,i)+=v;
134  }
135  return LorentzVectorParticle(par,Cov,PDGInfo::nu_tau,0,a1.bField());
136 }
TMatrixTSym< double > vertexCov() const
int i
Definition: DBlmapReader.cc:9
Geom::Theta< T > theta() const
static bool setTauDirectionatThetaGJMax(const TLorentzVector &a1, double &theta, double &phi, double scale=1.0)
int j
Definition: DBlmapReader.cc:9
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
Definition: Particle.h:26
Definition: DDAxes.h:10
void MultiProngTauSolver::numericalESolver ( TLorentzVector &  nu_plus,
TLorentzVector &  nu_minus,
const TLorentzVector &  A1 
)
static

Definition at line 30 of file MultiProngTauSolver.cc.

References i, bookConverter::min, mathSSE::sqrt(), relval_parameters_module::step, metsig::tau, tauImpactParameter::PDGInfo::tau_mass(), detailsBasic3DVector::z, and SiStripMonitorClusterAlca_cfi::zmin.

30  {
31  double rmin(-100), rmax(100), step(0.01), mtau2(PDGInfo::tau_mass()*PDGInfo::tau_mass()), z1(-999), z2(-999), zmin(-999), min(9999), prev(9999);
32  double z=rmin;
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()));
36  tau=A1+nu;
37  double m2=tau.M2();
38  if(m2-mtau2<0 && prev-mtau2>=0) z1=z;
39  if(m2-mtau2>0 && prev-mtau2<=0) z2=z;
40  if(min>m2){ zmin=z; min=m2;}
41  prev=m2;
42  z+=step;
43  }
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()));
47  }
48  else{
49  nu_plus.SetPxPyPzE(-A1.Px(),-A1.Py(),zmin,sqrt(zmin*zmin+A1.Pt()*A1.Pt()));
50  nu_minus.SetPxPyPzE(-A1.Px(),-A1.Py(),zmin,sqrt(zmin*zmin+A1.Pt()*A1.Pt()));
51  }
52 }
int i
Definition: DBlmapReader.cc:9
float float float z
T sqrt(T t)
Definition: SSEVec.h:48
static double tau_mass()
Definition: PDGInfo.h:14
void MultiProngTauSolver::quadratic ( double &  x_plus,
double &  x_minus,
double  a,
double  b,
double  c 
)
static

Definition at line 12 of file MultiProngTauSolver.cc.

References trackerHits::c, dttmaxenums::R, and mathSSE::sqrt().

Referenced by analyticESolver().

12  {
13  double R=b*b-4*a*c;
14  if(R<0){R=0;}
15  x_minus=(-b+sqrt(R))/(2.0*a); // opposite sign is smaller
16  x_plus=(-b-sqrt(R))/(2.0*a);
17 }
T sqrt(T t)
Definition: SSEVec.h:48
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
TVectorT< double > MultiProngTauSolver::rotateToTauFrame ( const TVectorT< double > &  inpar)
static

Definition at line 138 of file MultiProngTauSolver.cc.

138  {
139  TVectorT<double> outpar(3);
140  TVector3 res(inpar(0),inpar(1),inpar(2));
141  TVector3 Uz;Uz.SetMagThetaPhi(1,inpar(4),inpar(3));
142  res.RotateUz(Uz);
143  outpar(0)=res.X();
144  outpar(1)=res.Y();
145  outpar(2)=res.Z();
146  return outpar;
147 }
bool MultiProngTauSolver::setTauDirectionatThetaGJMax ( const TLorentzVector &  a1,
double &  theta,
double &  phi,
double  scale = 1.0 
)
static

Definition at line 80 of file MultiProngTauSolver.cc.

References Pi, mathSSE::sqrt(), and thetaGJMax().

Referenced by estimateNu(), and tauImpactParameter::TauA1NuConstrainedFitter::TauA1NuConstrainedFitter().

80  {
81  double thetaGJMax_a1 =thetaGJMax(a1);
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);
88  return true;
89  }
90  return false;
91 }
const double Pi
Geom::Theta< T > theta() const
static double thetaGJMax(const TLorentzVector &a1)
T sqrt(T t)
Definition: SSEVec.h:48
Definition: DDAxes.h:10
void MultiProngTauSolver::solveByRotation ( const TVector3 &  TauDir,
const TLorentzVector &  A1,
TLorentzVector &  Tau_plus,
TLorentzVector &  Tau_minus,
TLorentzVector &  nu_plus,
TLorentzVector &  nu_minus,
bool  rotateback = true 
)
static

Definition at line 54 of file MultiProngTauSolver.cc.

References analyticESolver(), phi, and theta().

Referenced by estimateNu(), tauImpactParameter::TauA1NuConstrainedFitter::fit(), tauImpactParameter::TauA1NuConstrainedFitter::setThetaGJMax(), tauImpactParameter::TauA1NuConstrainedFitter::TauA1NuConstrainedFitter(), and tauImpactParameter::TauA1NuConstrainedFitter::value().

55  {
56  TLorentzVector A1rot=A1;
57  double phi(TauDir.Phi()),theta(TauDir.Theta());
58  A1rot.RotateZ(-phi);
59  A1rot.RotateY(-theta);
61  // numericalESolver(nu_plus,nu_minus,A1rot); // for debugging AnalyticESolver (slow)
62  //analyticESolver(nu_plus,nu_minus,A1rot);
63  analyticESolver(nu_plus,nu_minus,A1rot);
65  if(rotateback){
66  nu_plus.RotateY(theta);
67  nu_plus.RotateZ(phi);
68  Tau_plus=A1+nu_plus;
69  //
70  nu_minus.RotateY(theta);
71  nu_minus.RotateZ(phi);
72  Tau_minus=A1+nu_minus;
73  }
74  else{
75  Tau_plus=A1rot+nu_plus;
76  Tau_minus=A1rot+nu_minus;
77  }
78 }
Geom::Theta< T > theta() const
static void analyticESolver(TLorentzVector &nu_plus, TLorentzVector &nu_minus, const TLorentzVector &A1)
Definition: DDAxes.h:10
double MultiProngTauSolver::thetaGJMax ( const TLorentzVector &  a1)
static

Definition at line 93 of file MultiProngTauSolver.cc.

References tauImpactParameter::PDGInfo::tau_mass().

Referenced by tauImpactParameter::TauA1NuConstrainedFitter::findThetaGJMax(), and setTauDirectionatThetaGJMax().

93  {
94  return asin(( PDGInfo::tau_mass()*PDGInfo::tau_mass()-a1.M2())/(2.0*PDGInfo::tau_mass()*fabs(a1.P())));
95 }
static double tau_mass()
Definition: PDGInfo.h:14