CMS 3D CMS Logo

LorentzVectorParticle.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_ImpactParameter_LorentzVectorParticle_h
2 #define RecoTauTag_ImpactParameter_LorentzVectorParticle_h
3 
4 /* From SimpleFits Package
5  * Designed an written by
6  * author: Ian M. Nugent
7  * Humboldt Foundations
8  */
9 
11 #include "TString.h"
12 #include "TMath.h"
13 #include "TLorentzVector.h"
14 
15 namespace tauImpactParameter {
16 
18  public:
20  vx = 0,
21  vy,
22  vz,
23  px,
24  py,
25  pz,
26  m,
28  E = -1,
29  p = -2,
30  pt = -3
31  }; // Lorentez+vertex parameters
32  enum VertexInfo { NVertex = 3 };
35  const TVectorT<double>& par, const TMatrixTSym<double>& cov, int pdgid, double charge, double b);
36  ~LorentzVectorParticle() override{};
37 
38  static TString name(int i);
39  int nParameters() const override { return NLorentzandVertexPar; }
40  double parameter(int i) const override {
41  double particle_px = Particle::parameter(px);
42  double particle_py = Particle::parameter(py);
43  double particle_pz = Particle::parameter(pz);
44  double particle_m = Particle::parameter(m);
45  if (i == E)
46  return sqrt(particle_px * particle_px + particle_py * particle_py + particle_pz * particle_pz +
47  particle_m * particle_m);
48  if (i == p)
49  return sqrt(particle_px * particle_px + particle_py * particle_py + particle_pz * particle_pz);
50  if (i == pt)
51  return sqrt(particle_px * particle_px + particle_py * particle_py);
52  return Particle::parameter(i);
53  }
54  double mass() const override { return parameter(m); }
55  TLorentzVector p4() const { return TLorentzVector(parameter(px), parameter(py), parameter(pz), parameter(E)); }
56  TVector3 vertex() const { return TVector3(parameter(vx), parameter(vy), parameter(vz)); }
57  TMatrixTSym<double> vertexCov() const {
58  TMatrixTSym<double> vcov(NVertex);
59  for (int i = 0; i < NVertex; i++) {
60  for (int j = 0; j < NVertex; j++) {
61  vcov(i, j) = covariance(i, j);
62  }
63  }
64  return vcov;
65  }
66  };
67 
68 } // namespace tauImpactParameter
69 #endif
mps_fire.i
i
Definition: mps_fire.py:428
tauImpactParameter::LorentzVectorParticle::name
static TString name(int i)
Definition: LorentzVectorParticle.cc:12
tauImpactParameter::LorentzVectorParticle
Definition: LorentzVectorParticle.h:17
tauImpactParameter::LorentzVectorParticle::vertex
TVector3 vertex() const
Definition: LorentzVectorParticle.h:56
tauImpactParameter::LorentzVectorParticle::py
Definition: LorentzVectorParticle.h:24
tauImpactParameter
Definition: Chi2VertexFitter.h:14
tauImpactParameter::Particle::parameter
virtual const TVectorT< double > & parameter() const
Definition: Particle.h:35
Particle.h
tauImpactParameter::LorentzVectorParticle::LorentzandVectorPar
LorentzandVectorPar
Definition: LorentzVectorParticle.h:19
tauImpactParameter::LorentzVectorParticle::p
Definition: LorentzVectorParticle.h:29
tauImpactParameter::Particle::covariance
virtual const TMatrixTSym< double > & covariance() const
Definition: Particle.h:36
tauImpactParameter::LorentzVectorParticle::~LorentzVectorParticle
~LorentzVectorParticle() override
Definition: LorentzVectorParticle.h:36
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
tauImpactParameter::LorentzVectorParticle::p4
TLorentzVector p4() const
Definition: LorentzVectorParticle.h:55
b
double b
Definition: hdecay.h:118
tauImpactParameter::LorentzVectorParticle::pt
Definition: LorentzVectorParticle.h:30
tauImpactParameter::LorentzVectorParticle::LorentzVectorParticle
LorentzVectorParticle()
Definition: LorentzVectorParticle.cc:5
tauImpactParameter::LorentzVectorParticle::m
Definition: LorentzVectorParticle.h:26
tauImpactParameter::LorentzVectorParticle::NLorentzandVertexPar
Definition: LorentzVectorParticle.h:27
tauImpactParameter::LorentzVectorParticle::pz
Definition: LorentzVectorParticle.h:25
tauImpactParameter::Particle::charge
virtual double charge() const
Definition: Particle.h:32
tauImpactParameter::LorentzVectorParticle::VertexInfo
VertexInfo
Definition: LorentzVectorParticle.h:32
tauImpactParameter::LorentzVectorParticle::NVertex
Definition: LorentzVectorParticle.h:32
tauImpactParameter::LorentzVectorParticle::px
Definition: LorentzVectorParticle.h:23
tauImpactParameter::LorentzVectorParticle::parameter
double parameter(int i) const override
Definition: LorentzVectorParticle.h:40
tauImpactParameter::LorentzVectorParticle::mass
double mass() const override
Definition: LorentzVectorParticle.h:54
tauImpactParameter::LorentzVectorParticle::vx
Definition: LorentzVectorParticle.h:20
tauImpactParameter::LorentzVectorParticle::E
Definition: LorentzVectorParticle.h:28
tauImpactParameter::LorentzVectorParticle::vy
Definition: LorentzVectorParticle.h:21
Particle
Definition: Particle.py:1
tauImpactParameter::LorentzVectorParticle::nParameters
int nParameters() const override
Definition: LorentzVectorParticle.h:39
tauImpactParameter::LorentzVectorParticle::vertexCov
TMatrixTSym< double > vertexCov() const
Definition: LorentzVectorParticle.h:57
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:30
tauImpactParameter::LorentzVectorParticle::vz
Definition: LorentzVectorParticle.h:22