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
virtual const TVectorT< double > & parameter() const
Definition: Particle.h:35
T sqrt(T t)
Definition: SSEVec.h:19
virtual const TMatrixTSym< double > & covariance() const
Definition: Particle.h:36
double b
Definition: hdecay.h:118
virtual double charge() const
Definition: Particle.h:32