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

◆ ExpandedPars

◆ OrignialPars

◆ Pars

Constructor & Destructor Documentation

◆ TauA1NuConstrainedFitter()

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, dqmiolumiharvest::j, 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, L1TRate_Offline_cfi::Tau, tauImpactParameter::LorentzVectorParticle::vx, tauImpactParameter::LorentzVectorParticle::vy, and tauImpactParameter::LorentzVectorParticle::vz.

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

◆ ~TauA1NuConstrainedFitter()

tauImpactParameter::TauA1NuConstrainedFitter::~TauA1NuConstrainedFitter ( )
inlineoverride

Definition at line 27 of file TauA1NuConstrainedFitter.h.

27 {};

Member Function Documentation

◆ ComputeA1LorentzVectorPar()

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

Definition at line 123 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().

123  {
124  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
125  outpar(LorentzVectorParticle::vx) = inpar(a1_vx);
126  outpar(LorentzVectorParticle::vy) = inpar(a1_vy);
127  outpar(LorentzVectorParticle::vz) = inpar(a1_vz);
128  outpar(LorentzVectorParticle::px) = inpar(a1_px);
129  outpar(LorentzVectorParticle::py) = inpar(a1_py);
130  outpar(LorentzVectorParticle::pz) = inpar(a1_pz);
131  outpar(LorentzVectorParticle::m) = inpar(a1_m);
132  return outpar;
133 }

◆ ComputeExpParToPar()

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

Definition at line 103 of file TauA1NuConstrainedFitter.cc.

References mps_fire::i, and npar.

Referenced by TauA1NuConstrainedFitter().

103  {
104  TVectorT<double> outpar(npar);
105  for (int i = 0; i < npar; i++) {
106  outpar(i) = inpar(i);
107  }
108  return outpar;
109 }

◆ ComputeInitalExpPar()

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

Definition at line 79 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, hltrates_dqm_sourceclient-live_cfg::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().

79  {
80  TVectorT<double> outpar(nexpandedpar);
81  int offset = LorentzVectorParticle::NVertex; // for A1
83  TVector3 sv(inpar(LorentzVectorParticle::vx + offset),
86  TVector3 TauDir = sv - pv;
87  outpar(tau_phi) = TauDir.Phi();
88  outpar(tau_theta) = TauDir.Theta();
89  outpar(a1_px) = inpar(LorentzVectorParticle::px + offset);
90  outpar(a1_py) = inpar(LorentzVectorParticle::py + offset);
91  outpar(a1_pz) = inpar(LorentzVectorParticle::pz + offset);
92  outpar(a1_m) = inpar(LorentzVectorParticle::m + offset);
93  outpar(a1_vx) = inpar(LorentzVectorParticle::vx + offset);
94  outpar(a1_vy) = inpar(LorentzVectorParticle::vy + offset);
95  outpar(a1_vz) = inpar(LorentzVectorParticle::vz + offset);
97  outpar(nu_px) = inpar(LorentzVectorParticle::px + offset);
98  outpar(nu_py) = inpar(LorentzVectorParticle::py + offset);
99  outpar(nu_pz) = inpar(LorentzVectorParticle::pz + offset);
100  return outpar;
101 }
def pv(vc)
Definition: MetAnalyzer.py:7

◆ ComputeMotherLorentzVectorPar()

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

Definition at line 135 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().

135  {
136  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
137  TVectorT<double> nupar = ComputeNuLorentzVectorPar(inpar);
138  TVectorT<double> a1par = ComputeA1LorentzVectorPar(inpar);
139  for (int i = 0; i < LorentzVectorParticle::NLorentzandVertexPar; i++) {
141  outpar(i) = a1par(i);
142  } else {
143  outpar(i) = nupar(i) + a1par(i);
144  }
145  //if(i==LorentzVectorParticle::m) outpar(i,0)=PDGInfo::tau_mass();
146  }
147  double nu_px = nupar(LorentzVectorParticle::px);
148  double nu_py = nupar(LorentzVectorParticle::py);
149  double nu_pz = nupar(LorentzVectorParticle::pz);
150  double Enu2 = nu_px * nu_px + nu_py * nu_py + nu_pz * nu_pz;
151  double a1_px = a1par(LorentzVectorParticle::px);
152  double a1_py = a1par(LorentzVectorParticle::py);
153  double a1_pz = a1par(LorentzVectorParticle::pz);
154  double a1_m = a1par(LorentzVectorParticle::m);
155  double Ea12 = a1_px * a1_px + a1_py * a1_py + a1_pz * a1_pz + a1_m * a1_m;
156  double outpar_px = outpar(LorentzVectorParticle::px);
157  double outpar_py = outpar(LorentzVectorParticle::py);
158  double outpar_pz = outpar(LorentzVectorParticle::pz);
159  double P2 = outpar_px * outpar_px + outpar_py * outpar_py + outpar_pz * outpar_pz;
160  outpar(LorentzVectorParticle::m) = sqrt(std::fabs(Enu2 + Ea12 + 2 * sqrt(Enu2 * Ea12) - P2));
161  return outpar;
162 }
static TVectorT< double > ComputeA1LorentzVectorPar(const TVectorT< double > &inpar)
T sqrt(T t)
Definition: SSEVec.h:19
static TVectorT< double > ComputeNuLorentzVectorPar(const TVectorT< double > &inpar)

◆ ComputeNuLorentzVectorPar()

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

Definition at line 111 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().

111  {
112  TVectorT<double> outpar(LorentzVectorParticle::NLorentzandVertexPar);
113  outpar(LorentzVectorParticle::vx) = inpar(a1_vx);
114  outpar(LorentzVectorParticle::vy) = inpar(a1_vy);
115  outpar(LorentzVectorParticle::vz) = inpar(a1_vz);
116  outpar(LorentzVectorParticle::px) = inpar(nu_px);
117  outpar(LorentzVectorParticle::py) = inpar(nu_py);
118  outpar(LorentzVectorParticle::pz) = inpar(nu_pz);
119  outpar(LorentzVectorParticle::m) = 0;
120  return outpar;
121 }

◆ CovertParToObjects()

void TauA1NuConstrainedFitter::CovertParToObjects ( const TVectorD &  v,
TLorentzVector &  a1,
TLorentzVector &  nu,
double &  phi,
double &  theta,
TVector3 &  TauDir 
)
staticprivate

Definition at line 209 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, theta(), and findQualityFiles::v.

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

◆ fit()

bool TauA1NuConstrainedFitter::fit ( void  )

Definition at line 222 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().

222  {
224  // Check if Tau Direction is unphysical and if nessicary set the starting point to Theta_{GJ-Max}
225  TLorentzVector a1(
226  par(a1_px),
227  par(a1_py),
228  par(a1_pz),
229  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)));
230  double phi(par(tau_phi)), theta(par(tau_theta));
231  TLorentzVector Tau_plus, Tau_minus, nu_plus, nu_minus;
232  TVector3 TauDir(cos(phi) * sin(theta), sin(phi) * sin(theta), cos(theta));
233  bool isReal;
234  solveByRotation(TauDir, a1, Tau_plus, Tau_minus, nu_plus, nu_minus, isReal);
235 
236  //check that the do product of the a1 and tau is positive, otherwise there is no information for tau direction -> use zero solution
237  if (TauDir.Dot(a1.Vect()) < 0) {
238  isReal = false;
239  }
240 
241  //case 1: is real then solve analytically
242  if (isReal && (ambiguity_ == plus || ambiguity_ == minus)) {
243  // popogate errors
246  std::bind(TauA1NuConstrainedFitter::SolveAmbiguityAnalytically, std::placeholders::_1, ambiguity_), par, cov_0);
247  for (int i = 0; i < npar; i++)
248  par(i) = par_tmp(i);
249  return true;
250  }
251  // case 2 is in unphsyical region - rotate and substitue \theta_{GJ} with \theta_{GJ}^{Max} and then solve analytically
252  else if (!isReal && ambiguity_ == zero) {
256  par,
257  cov_0);
258  for (int i = 0; i < npar; i++)
259  par(i) = par_tmp(i);
260  return true;
261  }
262  return false;
263 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:19
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)
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)
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)

◆ getMother()

LorentzVectorParticle TauA1NuConstrainedFitter::getMother ( )

Definition at line 195 of file TauA1NuConstrainedFitter.cc.

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

Referenced by PFTau3ProngReco::produce().

195  {
197  double c(0), b(0);
198  for (unsigned int i = 0; i < particles_.size(); i++) {
199  c += particles_[i].charge();
200  b = particles_[i].bField();
201  }
202  TVectorT<double> m = ComputeMotherLorentzVectorPar(exppar);
203  TMatrixTSym<double> mcov =
205  LorentzVectorParticle mymother = LorentzVectorParticle(m, mcov, (int)(-1.0 * std::abs(PDGInfo::tau_minus) * c), c, b);
206  return mymother;
207 }
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:118
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)

◆ getRefitDaughters()

std::vector< LorentzVectorParticle > TauA1NuConstrainedFitter::getRefitDaughters ( )

Definition at line 176 of file TauA1NuConstrainedFitter.cc.

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

Referenced by PFTau3ProngReco::produce().

176  {
177  std::vector<LorentzVectorParticle> refitParticles;
179  double c(0), b(0);
180  for (unsigned int i = 0; i < particles_.size(); i++) {
181  c += particles_[i].charge();
182  b = particles_[i].bField();
183  }
184  TVectorT<double> a1 = ComputeA1LorentzVectorPar(exppar);
185  TMatrixTSym<double> a1cov =
187  refitParticles.push_back(LorentzVectorParticle(a1, a1cov, particles_[0].pdgId(), c, b));
188  TVectorT<double> nu = ComputeNuLorentzVectorPar(exppar);
189  TMatrixTSym<double> nucov =
191  refitParticles.push_back(LorentzVectorParticle(nu, nucov, PDGInfo::nu_tau, 0.0, b));
192  return refitParticles;
193 }
static TVectorT< double > ComputeA1LorentzVectorPar(const TVectorT< double > &inpar)
std::vector< LorentzVectorParticle > particles_
double b
Definition: hdecay.h:118
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)

◆ getTauRotationSignificance()

double TauA1NuConstrainedFitter::getTauRotationSignificance ( )

Definition at line 313 of file TauA1NuConstrainedFitter.cc.

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

313  {
314  TVectorT<double> par_tmp = TauA1NuConstrainedFitter::TauRot(par);
316  if (!(cov_tmp(0, 0) > 0))
317  return -999; // return invalid value if the covariance is unphysical (safety flag)
318  if (par_tmp(0) > 0)
319  return par_tmp(0) / sqrt(cov_tmp(0, 0)); // return the significance if the value is in the unphysical region
320  return 0; // reutrn 0 for the rotation significance if the tau is in the physical region
321 }
T sqrt(T t)
Definition: SSEVec.h:19
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)

◆ SolveAmbiguityAnalytically()

TVectorT< double > TauA1NuConstrainedFitter::SolveAmbiguityAnalytically ( const TVectorT< double > &  inpar,
unsigned int  ambiguity 
)
staticprivate

Definition at line 265 of file TauA1NuConstrainedFitter.cc.

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

Referenced by fit(), and SolveAmbiguityAnalyticallywithRot().

265  {
266  // Solve equation quadratic equation
267  TVectorT<double> outpar(inpar.GetNrows());
268  TLorentzVector a1, nu;
269  double phi(0), theta(0);
270  TVector3 TauDir;
271  CovertParToObjects(inpar, a1, nu, phi, theta, TauDir);
272  TLorentzVector a1_d = a1;
273  TLorentzVector nu_d = nu;
274  TLorentzVector Tau_plus, Tau_minus, nu_plus, nu_minus;
275  bool isReal;
276  solveByRotation(TauDir, a1_d, Tau_plus, Tau_minus, nu_plus, nu_minus, isReal, true);
277  if (amb == plus)
278  nu = nu_plus;
279  else
280  nu = nu_minus;
281  for (int i = 0; i < outpar.GetNrows(); i++) {
282  outpar(i) = inpar(i);
283  }
284  outpar(nu_px) = nu.Px();
285  outpar(nu_py) = nu.Py();
286  outpar(nu_pz) = nu.Pz();
287  return outpar;
288 }
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
double amb
Definition: hdecay.h:21
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)

◆ SolveAmbiguityAnalyticallywithRot()

TVectorT< double > TauA1NuConstrainedFitter::SolveAmbiguityAnalyticallywithRot ( const TVectorT< double > &  inpar,
unsigned int  ambiguity 
)
staticprivate

Definition at line 290 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().

291  {
292  // 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.
293  TVectorT<double> outpar(inpar.GetNrows());
294  TLorentzVector a1, nu;
295  double phi(0), theta(0);
296  TVector3 TauDir;
297  CovertParToObjects(inpar, a1, nu, phi, theta, TauDir);
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();
308  outpar(tau_theta) = TauDir.Theta();
309  return SolveAmbiguityAnalytically(outpar, ambiguity);
310 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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)
Geom::Theta< T > theta() const

◆ TauRot()

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

Definition at line 323 of file TauA1NuConstrainedFitter.cc.

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

Referenced by getTauRotationSignificance().

323  {
324  TVectorT<double> outpar(1);
325  TLorentzVector a1, nu;
326  double phi(0), theta(0);
327  TVector3 TauDir;
328  CovertParToObjects(inpar, a1, nu, phi, theta, TauDir);
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);
333  return outpar;
334 }
static double thetaGJMax(const TLorentzVector &a1)
static void CovertParToObjects(const TVectorD &v, TLorentzVector &a1, TLorentzVector &nu, double &phi, double &theta, TVector3 &TauDir)
Geom::Theta< T > theta() const

◆ UpdateExpandedPar()

void TauA1NuConstrainedFitter::UpdateExpandedPar ( )
private

Definition at line 164 of file TauA1NuConstrainedFitter.cc.

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

Referenced by getMother(), and getRefitDaughters().

164  {
165  // assumes changes to a1 correlation to vertex is small
166  if (par.GetNrows() == npar && cov.GetNrows() == npar && exppar.GetNrows() == npar && expcov.GetNrows() == npar)
167  return;
168  for (int i = 0; i < npar; i++) {
169  exppar(i) = par(i);
170  for (int j = 0; j < npar; j++) {
171  expcov(i, j) = cov(i, j);
172  }
173  }
174 }

Member Data Documentation

◆ ambiguity_

unsigned int tauImpactParameter::TauA1NuConstrainedFitter::ambiguity_
private

Definition at line 61 of file TauA1NuConstrainedFitter.h.

Referenced by fit().

◆ cov

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

Definition at line 56 of file TauA1NuConstrainedFitter.h.

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

◆ cov_0

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

◆ expcov

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

◆ exppar

TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::exppar
private

◆ par

TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::par
private

◆ par_0

TVectorT<double> tauImpactParameter::TauA1NuConstrainedFitter::par_0
private

Definition at line 53 of file TauA1NuConstrainedFitter.h.

Referenced by TauA1NuConstrainedFitter().

◆ particles_

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