test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
19  enum LorentzandVectorPar{vx=0,vy,vz,px,py,pz,m,NLorentzandVertexPar,E=-1,p=-2,pt=-3};// Lorentez+vertex parameters
22  LorentzVectorParticle(const TVectorT<double>& par, const TMatrixTSym<double>& cov, int pdgid, double charge, double b);
24 
25  static TString name(int i);
26  virtual int nParameters() const { return NLorentzandVertexPar; }
27  virtual double parameter(int i) const {
28  double particle_px = Particle::parameter(px);
29  double particle_py = Particle::parameter(py);
30  double particle_pz = Particle::parameter(pz);
31  double particle_m = Particle::parameter(m);
32  if(i==E) return sqrt(particle_px*particle_px + particle_py*particle_py + particle_pz*particle_pz + particle_m*particle_m);
33  if(i==p) return sqrt(particle_px*particle_px + particle_py*particle_py + particle_pz*particle_pz);
34  if(i==pt) return sqrt(particle_px*particle_px + particle_py*particle_py);
35  return Particle::parameter(i);
36  }
37  virtual double mass() const { return parameter(m); }
38  TLorentzVector p4() const { return TLorentzVector(parameter(px),parameter(py),parameter(pz),parameter(E)); }
39  TVector3 vertex() const { return TVector3(parameter(vx),parameter(vy),parameter(vz)); }
40  TMatrixTSym<double> vertexCov() const {
41  TMatrixTSym<double> vcov(NVertex);
42  for(int i=0;i<NVertex;i++){
43  for(int j=0;j<NVertex;j++){vcov(i,j)=covariance(i,j);}
44  }
45  return vcov;
46  }
47 };
48 
49 }
50 #endif
51 
52 
TMatrixTSym< double > vertexCov() const
int i
Definition: DBlmapReader.cc:9
virtual double charge() const
Definition: Particle.h:29
T sqrt(T t)
Definition: SSEVec.h:18
virtual const TVectorT< double > & parameter() const
Definition: Particle.h:32
int j
Definition: DBlmapReader.cc:9
double b
Definition: hdecay.h:120
virtual const TMatrixTSym< double > & covariance() const
Definition: Particle.h:33