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 | Static Private Member Functions
tauImpactParameter::ParticleBuilder Class Reference

#include <ParticleBuilder.h>

Public Types

enum  CMSSWPerigee {
  aCurv =0, aTheta, aPhi, aTip,
  aLip
}
 

Public Member Functions

 ParticleBuilder ()
 
 ~ParticleBuilder ()
 

Static Public Member Functions

static LorentzVectorParticle createLorentzVectorParticle (const reco::TransientTrack &transTrk, const reco::Vertex &V, bool fromPerigee, bool useTrackHelixPropagation)
 
static TrackParticle createTrackParticle (const reco::TransientTrack &transTrk, const GlobalPoint &p, bool fromPerigee=true, bool useTrackHelixPropogation=true)
 
static reco::Vertex getVertex (const LorentzVectorParticle &p)
 

Static Private Member Functions

static TVectorT< double > convertCMSSWTrackParToSFTrackPar (const TVectorT< double > &inpar)
 
static TVectorT< double > convertCMSSWTrackPerigeeToSFTrackPar (const TVectorT< double > &inpar)
 

Detailed Description

Definition at line 25 of file ParticleBuilder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

tauImpactParameter::ParticleBuilder::ParticleBuilder ( )
inline

Definition at line 29 of file ParticleBuilder.h.

29 {};
tauImpactParameter::ParticleBuilder::~ParticleBuilder ( )
inline

Definition at line 30 of file ParticleBuilder.h.

30 {};

Member Function Documentation

TVectorT< double > ParticleBuilder::convertCMSSWTrackParToSFTrackPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 123 of file ParticleBuilder.cc.

References funct::cos(), tauImpactParameter::TrackParticle::dxy, tauImpactParameter::TrackParticle::dz, reco::TrackBase::i_dsz, reco::TrackBase::i_dxy, reco::TrackBase::i_lambda, reco::TrackBase::i_phi, reco::TrackBase::i_qoverp, tauImpactParameter::TrackParticle::kappa, tauImpactParameter::TrackParticle::lambda, tauImpactParameter::TrackParticle::NHelixPar, and tauImpactParameter::TrackParticle::phi.

Referenced by createTrackParticle().

TVectorT< double > ParticleBuilder::convertCMSSWTrackPerigeeToSFTrackPar ( const TVectorT< double > &  inpar)
staticprivate

Definition at line 133 of file ParticleBuilder.cc.

References aCurv, aLip, aPhi, aTheta, aTip, tauImpactParameter::TrackParticle::dxy, tauImpactParameter::TrackParticle::dz, tauImpactParameter::TrackParticle::kappa, tauImpactParameter::TrackParticle::lambda, tauImpactParameter::TrackParticle::NHelixPar, tauImpactParameter::TrackParticle::phi, and Pi.

Referenced by createTrackParticle().

LorentzVectorParticle ParticleBuilder::createLorentzVectorParticle ( const reco::TransientTrack transTrk,
const reco::Vertex V,
bool  fromPerigee,
bool  useTrackHelixPropagation 
)
static

Definition at line 19 of file ParticleBuilder.cc.

References tauImpactParameter::TrackHelixVertexFitter::BField0, tauImpactParameter::TrackHelixVertexFitter::computeLorentzVectorPar(), reco::Vertex::covariance(), createTrackParticle(), i, j, tauImpactParameter::TrackParticle::kappa, tauImpactParameter::TrackHelixVertexFitter::kappa0, tauImpactParameter::TrackParticle::lambda, tauImpactParameter::TrackHelixVertexFitter::lambda0, tauImpactParameter::TrackHelixVertexFitter::MassOffSet, N, tauImpactParameter::TrackHelixVertexFitter::NExtraPar, tauImpactParameter::TrackHelixVertexFitter::NFreeTrackPar, tauImpactParameter::TrackHelixVertexFitter::NFreeVertexPar, AlCaHLTBitMon_ParallelJobs::p, tauImpactParameter::TrackParticle::phi, tauImpactParameter::TrackHelixVertexFitter::phi0, reco::Vertex::position(), tauImpactParameter::ErrorMatrixPropagator::propagateError(), tauImpactParameter::TrackHelixVertexFitter::x0, tauImpactParameter::TrackHelixVertexFitter::y0, and tauImpactParameter::TrackHelixVertexFitter::z0.

20  {
21  GlobalPoint p(V.position().x(),V.position().y(),V.position().z());
22  TrackParticle tp=createTrackParticle(transTrk,p,fromPerigee,useTrackHelixPropagation);
23 
25  TVectorT<double> par(N);
32  par(TrackHelixVertexFitter::NFreeTrackPar+TrackHelixVertexFitter::MassOffSet)=tp.mass();
34 
35  TMatrixTSym<double> parcov(N);
38  parcov(i,j)=V.covariance(i,j);
39  }
40  }
44 
45  TVectorT<double> LVPar=TrackHelixVertexFitter::computeLorentzVectorPar(par);
47  return LorentzVectorParticle(LVPar,LVCov,tp.pdgId(),tp.charge(),tp.bField());
48 }
int i
Definition: DBlmapReader.cc:9
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:116
const Point & position() const
position
Definition: Vertex.h:99
static TVectorT< double > computeLorentzVectorPar(const TVectorT< double > &inpar)
int j
Definition: DBlmapReader.cc:9
#define N
Definition: blowfish.cc:9
static TrackParticle createTrackParticle(const reco::TransientTrack &transTrk, const GlobalPoint &p, bool fromPerigee=true, bool useTrackHelixPropogation=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)
TrackParticle ParticleBuilder::createTrackParticle ( const reco::TransientTrack transTrk,
const GlobalPoint p,
bool  fromPerigee = true,
bool  useTrackHelixPropogation = true 
)
static

Definition at line 50 of file ParticleBuilder.cc.

References funct::abs(), EnergyCorrector::c, reco::TransientTrack::charge(), tauImpactParameter::TrackHelixVertexFitter::computedxydz(), convertCMSSWTrackParToSFTrackPar(), convertCMSSWTrackPerigeeToSFTrackPar(), reco::TrackBase::covariance(), PerigeeTrajectoryError::covarianceMatrix(), tauImpactParameter::TrackParticle::dxy, tauImpactParameter::TrackParticle::dz, reco::TransientTrack::field(), i, reco::TrackBase::i_qoverp, reco::TransientTrack::impactPointTSCP(), MagneticField::inInverseGeV(), j, tauImpactParameter::TrackParticle::kappa, kappa, tauImpactParameter::TrackHelixVertexFitter::kappa0, tauImpactParameter::TrackParticle::lambda, tauImpactParameter::TrackHelixVertexFitter::lambda0, LogDebug, tauImpactParameter::TrackHelixVertexFitter::NFreeTrackPar, tauImpactParameter::TrackParticle::NHelixPar, reco::TrackBase::parameter(), TrajectoryStateClosestToPoint::perigeeError(), TrajectoryStateClosestToPoint::perigeeParameters(), tauImpactParameter::TrackParticle::phi, phi(), tauImpactParameter::TrackHelixVertexFitter::phi0, tauImpactParameter::PDGInfo::pi_mass(), PdtPdgMini::pi_plus, TrajectoryStateClosestToPoint::position(), tauImpactParameter::ErrorMatrixPropagator::propagateError(), alignCSCRings::s, reco::TransientTrack::track(), reco::TransientTrack::trajectoryStateClosestToPoint(), PerigeeTrajectoryParameters::vector(), PV3DBase< T, PVType, FrameType >::x(), x(), tauImpactParameter::TrackHelixVertexFitter::x0, PV3DBase< T, PVType, FrameType >::y(), tauImpactParameter::TrackHelixVertexFitter::y0, PV3DBase< T, PVType, FrameType >::z(), and tauImpactParameter::TrackHelixVertexFitter::z0.

Referenced by createLorentzVectorParticle().

51  {
52  // Configured for CMSSW Tracks only
53  TVectorT<double> par(TrackParticle::NHelixPar+1);
54  TMatrixTSym<double> cov(TrackParticle::NHelixPar+1);
55  TVectorT<double> SFpar(TrackParticle::NHelixPar);
56  TMatrixTSym<double> SFcov(TrackParticle::NHelixPar);
57  if(!fromPerigee){
58  for(int i=0;i<TrackParticle::NHelixPar;i++){
59  par(i)=transTrk.track().parameter(i);
60  for(int j=0;j<TrackParticle::NHelixPar;j++){
61  cov(i,j)=transTrk.track().covariance(i,j);
62  }
63  }
64  par(TrackParticle::NHelixPar)=transTrk.field()->inInverseGeV(p).z();
67  }
68  else{
69  GlobalPoint TrackIPPos=transTrk.impactPointTSCP().position();
70  //GlobalPoint TrackIPOrigin=transTrk.impactPointTSCP().referencePoint();
71  GlobalPoint origin(0.0,0.0,0.0);
72  for(int i=0;i<TrackParticle::NHelixPar;i++){
73  par(i)=transTrk.trajectoryStateClosestToPoint(origin).perigeeParameters().vector()(i);
74  for(int j=0;j<TrackParticle::NHelixPar;j++){
76  }
77  }
78  par(TrackParticle::NHelixPar)=transTrk.field()->inInverseGeV(p).z();
81  if(useTrackHelixPropagation){
83  // correct dxy dz neglecting material and radiative corrections
84 
85  LogDebug("RecoTauImpactParameterParticleBuilder") << "Offical CMS dxy - " << par(TrackParticle::dxy) << " dz " << par(TrackParticle::dz)
86  << " kappa " << par(reco::TrackBase::i_qoverp) ;
87  LogDebug("RecoTauImpactParameterParticleBuilder") << "Offical CMS dxy - SimpleFits Format" << SFpar(TrackParticle::dxy) << " dz " << SFpar(TrackParticle::dz)
88  << " kappa " << SFpar(reco::TrackBase::i_qoverp) ;
89 
90  double x,y,z,dxy,dz,s,kappa,lambda,phi;
91  TVectorT<double> freehelix(TrackHelixVertexFitter::NFreeTrackPar);
92  freehelix(TrackHelixVertexFitter::x0)=TrackIPPos.x();
93  freehelix(TrackHelixVertexFitter::y0)=TrackIPPos.y();
94  freehelix(TrackHelixVertexFitter::z0)=TrackIPPos.z();
98  TrackHelixVertexFitter::computedxydz(freehelix,0,kappa,lambda,phi,x,y,z,s,dxy,dz);
99  SFpar(TrackParticle::dxy) = dxy;
100  SFpar(TrackParticle::dz) = dz;
101  LogDebug("RecoTauImpactParameterParticleBuilder") << "Found values dxy " << dxy << " dz " << dz;
102  //exit(0);
104  }
105  }
106 
107  PDGInfo pdgInfo;
108  double c=transTrk.charge();
109  return TrackParticle(SFpar,SFcov,abs(PdtPdgMini::pi_plus)*c,pdgInfo.pi_mass(),c,transTrk.field()->inInverseGeV(p).z());
110 }
#define LogDebug(id)
const AlgebraicVector5 & vector() const
int i
Definition: DBlmapReader.cc:9
const PerigeeTrajectoryError & perigeeError() const
TrajectoryStateClosestToPoint impactPointTSCP() const
T y() const
Definition: PV3DBase.h:63
const MagneticField * field() const
static TVectorT< double > convertCMSSWTrackPerigeeToSFTrackPar(const TVectorT< double > &inpar)
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:39
TrackCharge charge() const
const PerigeeTrajectoryParameters & perigeeParameters() const
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:726
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
static double pi_mass()
Definition: PDGInfo.h:13
const AlgebraicSymMatrix55 & covarianceMatrix() const
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
Definition: TrackBase.h:734
const Track & track() const
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
static TVectorT< double > convertCMSSWTrackParToSFTrackPar(const TVectorT< double > &inpar)
static void computedxydz(const TVectorT< double > &inpar, int particle, double &kappa, double &lam, double &phi, double &x, double &y, double &z, double &s, double &dxy, double &dz)
static const G4double kappa
T x() const
Definition: PV3DBase.h:62
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)
reco::Vertex ParticleBuilder::getVertex ( const LorentzVectorParticle p)
static

Definition at line 112 of file ParticleBuilder.cc.

References i, j, findQualityFiles::v, tauImpactParameter::LorentzVectorParticle::vertex(), and tauImpactParameter::LorentzVectorParticle::vertexCov().

112  {
113  TVector3 v=p.vertex();
114  TMatrixTSym<double> vcov=p.vertexCov();
115  reco::Vertex::Point vp(v.X(),v.Y(),v.Z());
117  for(int i=0;i<vcov.GetNrows();i++){
118  for(int j=0;j<vcov.GetNrows();j++){ve(i,j)=vcov(i,j);}
119  }
120  return reco::Vertex(vp,ve);
121 }
TMatrixTSym< double > vertexCov() const
int i
Definition: DBlmapReader.cc:9
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: Vertex.h:39