CMS 3D CMS Logo

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

◆ CMSSWPerigee

Constructor & Destructor Documentation

◆ ParticleBuilder()

tauImpactParameter::ParticleBuilder::ParticleBuilder ( )
inline

Definition at line 29 of file ParticleBuilder.h.

29 {};

◆ ~ParticleBuilder()

tauImpactParameter::ParticleBuilder::~ParticleBuilder ( )
inline

Definition at line 30 of file ParticleBuilder.h.

30 {};

Member Function Documentation

◆ convertCMSSWTrackParToSFTrackPar()

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

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

◆ convertCMSSWTrackPerigeeToSFTrackPar()

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

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

◆ createLorentzVectorParticle()

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(), createTrackParticle(), mps_fire::i, dqmiolumiharvest::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, tauImpactParameter::ErrorMatrixPropagator::propagateError(), cmsswSequenceInfo::tp, cms::cuda::V, tauImpactParameter::TrackHelixVertexFitter::x0, tauImpactParameter::TrackHelixVertexFitter::y0, and tauImpactParameter::TrackHelixVertexFitter::z0.

22  {
23  GlobalPoint p(V.position().x(), V.position().y(), V.position().z());
24  TrackParticle tp = createTrackParticle(transTrk, p, fromPerigee, useTrackHelixPropagation);
25 
26  int N =
28  TVectorT<double> par(N);
29  par(TrackHelixVertexFitter::x0) = V.position().x();
30  par(TrackHelixVertexFitter::y0) = V.position().y();
31  par(TrackHelixVertexFitter::z0) = V.position().z();
37 
38  TMatrixTSym<double> parcov(N);
39  for (int i = 0; i < TrackHelixVertexFitter::NFreeVertexPar; i++) {
40  for (int j = 0; j < TrackHelixVertexFitter::NFreeVertexPar; j++) {
41  parcov(i, j) = V.covariance(i, j);
42  }
43  }
50 
51  TVectorT<double> LVPar = TrackHelixVertexFitter::computeLorentzVectorPar(par);
52  TMatrixTSym<double> LVCov =
54  return LorentzVectorParticle(LVPar, LVCov, tp.pdgId(), tp.charge(), tp.bField());
55 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
static TVectorT< double > computeLorentzVectorPar(const TVectorT< double > &inpar)
#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)

◆ createTrackParticle()

TrackParticle ParticleBuilder::createTrackParticle ( const reco::TransientTrack transTrk,
const GlobalPoint p,
bool  fromPerigee = true,
bool  useTrackHelixPropogation = true 
)
static

Definition at line 57 of file ParticleBuilder.cc.

References funct::abs(), c, reco::TransientTrack::charge(), tauImpactParameter::TrackHelixVertexFitter::computedxydz(), convertCMSSWTrackParToSFTrackPar(), convertCMSSWTrackPerigeeToSFTrackPar(), reco::TrackBase::covariance(), PerigeeTrajectoryError::covarianceMatrix(), tauImpactParameter::TrackParticle::dxy, PVValHelper::dxy, tauImpactParameter::TrackParticle::dz, PVValHelper::dz, reco::TransientTrack::field(), mps_fire::i, reco::TrackBase::i_qoverp, reco::TransientTrack::impactPointTSCP(), MagneticField::inInverseGeV(), dqmiolumiharvest::j, tauImpactParameter::TrackParticle::kappa, hgcalLayerClusters_cfi::kappa, tauImpactParameter::TrackHelixVertexFitter::kappa0, tauImpactParameter::TrackParticle::lambda, tauImpactParameter::TrackHelixVertexFitter::lambda0, LogDebug, tauImpactParameter::TrackHelixVertexFitter::NFreeTrackPar, tauImpactParameter::TrackParticle::NHelixPar, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::parameter(), TrajectoryStateClosestToPoint::perigeeError(), TrajectoryStateClosestToPoint::perigeeParameters(), tauImpactParameter::TrackParticle::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(), x, PV3DBase< T, PVType, FrameType >::x(), tauImpactParameter::TrackHelixVertexFitter::x0, PV3DBase< T, PVType, FrameType >::y(), tauImpactParameter::TrackHelixVertexFitter::y0, PV3DBase< T, PVType, FrameType >::z(), and tauImpactParameter::TrackHelixVertexFitter::z0.

Referenced by createLorentzVectorParticle().

60  {
61  // Configured for CMSSW Tracks only
62  TVectorT<double> par(TrackParticle::NHelixPar + 1);
63  TMatrixTSym<double> cov(TrackParticle::NHelixPar + 1);
64  TVectorT<double> SFpar(TrackParticle::NHelixPar);
65  TMatrixTSym<double> SFcov(TrackParticle::NHelixPar);
66  if (!fromPerigee) {
67  for (int i = 0; i < TrackParticle::NHelixPar; i++) {
68  par(i) = transTrk.track().parameter(i);
69  for (int j = 0; j < TrackParticle::NHelixPar; j++) {
70  cov(i, j) = transTrk.track().covariance(i, j);
71  }
72  }
73  par(TrackParticle::NHelixPar) = transTrk.field()->inInverseGeV(p).z();
76  } else {
77  GlobalPoint TrackIPPos = transTrk.impactPointTSCP().position();
78  //GlobalPoint TrackIPOrigin=transTrk.impactPointTSCP().referencePoint();
79  GlobalPoint origin(0.0, 0.0, 0.0);
80  for (int i = 0; i < TrackParticle::NHelixPar; i++) {
81  par(i) = transTrk.trajectoryStateClosestToPoint(origin).perigeeParameters().vector()(i);
82  for (int j = 0; j < TrackParticle::NHelixPar; j++) {
83  cov(i, j) = transTrk.trajectoryStateClosestToPoint(origin).perigeeError().covarianceMatrix()(i, j);
84  }
85  }
86  par(TrackParticle::NHelixPar) = transTrk.field()->inInverseGeV(p).z();
89  if (useTrackHelixPropagation) {
91  // correct dxy dz neglecting material and radiative corrections
92 
93  LogDebug("RecoTauImpactParameterParticleBuilder")
94  << "Offical CMS dxy - " << par(TrackParticle::dxy) << " dz " << par(TrackParticle::dz) << " kappa "
96  LogDebug("RecoTauImpactParameterParticleBuilder")
97  << "Offical CMS dxy - SimpleFits Format" << SFpar(TrackParticle::dxy) << " dz " << SFpar(TrackParticle::dz)
98  << " kappa " << SFpar(reco::TrackBase::i_qoverp);
99 
100  double x, y, z, dxy, dz, s, kappa, lambda, phi;
101  TVectorT<double> freehelix(TrackHelixVertexFitter::NFreeTrackPar);
102  freehelix(TrackHelixVertexFitter::x0) = TrackIPPos.x();
103  freehelix(TrackHelixVertexFitter::y0) = TrackIPPos.y();
104  freehelix(TrackHelixVertexFitter::z0) = TrackIPPos.z();
108  TrackHelixVertexFitter::computedxydz(freehelix, 0, kappa, lambda, phi, x, y, z, s, dxy, dz);
109  SFpar(TrackParticle::dxy) = dxy;
110  SFpar(TrackParticle::dz) = dz;
111  LogDebug("RecoTauImpactParameterParticleBuilder") << "Found values dxy " << dxy << " dz " << dz;
112  //exit(0);
114  }
115  }
116 
117  PDGInfo pdgInfo;
118  double c = transTrk.charge();
119  return TrackParticle(
120  SFpar, SFcov, abs(PdtPdgMini::pi_plus) * c, pdgInfo.pi_mass(), c, transTrk.field()->inInverseGeV(p).z());
121 }
const AlgebraicVector5 & vector() const
const Track & track() const
const AlgebraicSymMatrix55 & covarianceMatrix() const
T z() const
Definition: PV3DBase.h:61
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
static TVectorT< double > convertCMSSWTrackPerigeeToSFTrackPar(const TVectorT< double > &inpar)
const PerigeeTrajectoryError & perigeeError() const
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
Definition: TrackBase.h:723
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
TrajectoryStateClosestToPoint impactPointTSCP() const
const MagneticField * field() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static double pi_mass()
Definition: PDGInfo.h:13
const PerigeeTrajectoryParameters & perigeeParameters() const
TrackCharge charge() 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 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)
#define LogDebug(id)

◆ getVertex()

reco::Vertex ParticleBuilder::getVertex ( const LorentzVectorParticle p)
static

Definition at line 123 of file ParticleBuilder.cc.

References mps_fire::i, dqmiolumiharvest::j, AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::v, and HltBtagValidation_cff::Vertex.

123  {
124  TVector3 v = p.vertex();
125  TMatrixTSym<double> vcov = p.vertexCov();
126  reco::Vertex::Point vp(v.X(), v.Y(), v.Z());
128  for (int i = 0; i < vcov.GetNrows(); i++) {
129  for (int j = 0; j < vcov.GetNrows(); j++) {
130  ve(i, j) = vcov(i, j);
131  }
132  }
133  return reco::Vertex(vp, ve);
134 }
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
math::XYZPoint Point
point in the space
Definition: Vertex.h:40