CMS 3D CMS Logo

List of all members | Public Member Functions
SignedTransverseImpactParameter Class Reference

#include <SignedTransverseImpactParameter.h>

Public Member Functions

std::pair< bool, Measurement1Dapply (const reco::TransientTrack &, const GlobalVector &, const reco::Vertex &) const
 
 SignedTransverseImpactParameter ()
 
std::pair< bool, Measurement1DzImpactParameter (const reco::TransientTrack &, const GlobalVector &, const reco::Vertex &) const
 

Detailed Description

Transverse track impact parameter signed according to the jet direction

Definition at line 15 of file SignedTransverseImpactParameter.h.

Constructor & Destructor Documentation

◆ SignedTransverseImpactParameter()

SignedTransverseImpactParameter::SignedTransverseImpactParameter ( )
inline

Definition at line 19 of file SignedTransverseImpactParameter.h.

19 {};

Member Function Documentation

◆ apply()

pair< bool, Measurement1D > SignedTransverseImpactParameter::apply ( const reco::TransientTrack track,
const GlobalVector direction,
const reco::Vertex vertex 
) const

Definition at line 20 of file SignedTransverseImpactParameter.cc.

References A, funct::abs(), TrajectoryStateOnSurface::cartesianError(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), LogDebug, CartesianTrajectoryError::matrix(), mathSSE::sqrt(), HLT_2022v15_cff::track, Vector3DBase< T, FrameTag >::unit(), bphysicsOniaDQM_cfi::vertex, x, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by heavyIonTools.ConfigureHeavyIons::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), heavyIonTools.ProductionDefaults::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), heavyIonTools.SelectionDefaults::__call__(), heavyIonTools.DisbaleMonteCarloDeps::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), tauTools.AddTauCollection::__call__(), trackTools.MakeTrackCandidates::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.AddJetCollection::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.UpdateJetCollection::__call__(), jetTools.AddJetID::__call__(), and jetTools.SetTagInfos::__call__().

22  {
23  TrajectoryStateOnSurface stateOnSurface = track.impactPointState();
24 
25  const FreeTrajectoryState* FTS = stateOnSurface.freeState(); //aRecTrack.stateAtFirstPoint().freeTrajectoryState());
26 
27  GlobalPoint vertexPosition(vertex.x(), vertex.y(), vertex.z());
28 
29  double theValue = 0.;
30  double theError = 0.;
32  TrajectoryStateOnSurface TSOS = TIPE.extrapolate(*FTS, vertexPosition);
33 
34  if (!TSOS.isValid()) {
35  theValue = 0.;
36  theError = 0.;
37  } else {
39 
40  GlobalVector DD0(D0.x() - vertex.x(), D0.y() - vertex.y(), 0.);
41  const GlobalVector& JetDir(direction);
42  double ps = DD0.dot(JetDir);
43  theValue = DD0.mag() * (ps / abs(ps));
44 
45  //error calculation
46 
47  AlgebraicVector6 deriv;
48  AlgebraicVector3 deriv_v;
49  GlobalVector dd0 = DD0.unit(); //check
50 
51  deriv_v[0] = -dd0.x();
52  deriv_v[1] = -dd0.y();
53  deriv_v[2] = -dd0.z();
54 
55  deriv[0] = dd0.x();
56  deriv[1] = dd0.y();
57  deriv[2] = dd0.z();
58  deriv[3] = 0.;
59  deriv[4] = 0.;
60  deriv[5] = 0.;
61  //cout << TSOS.cartesianError().matrix() << endl;
62  //cout << deriv << endl;
63  double E1 = ROOT::Math::Similarity(deriv, TSOS.cartesianError().matrix());
64  double E2 = ROOT::Math::Similarity(deriv_v, vertex.covariance());
65  // (aJet.vertex().positionError().matrix()).similarity(deriv_v);
66  theError = sqrt(E1 + E2);
67  LogDebug("BTagTools") << "Tk error : " << E1 << " , Vtx error : " << E2 << " tot : " << theError;
68 
69  } //end if
70 
71  bool x = true;
72 
73  Measurement1D A(theValue, theError);
74  return pair<bool, Measurement1D>(x, A);
75 } // end constructor declaration
T z() const
Definition: PV3DBase.h:61
Divides< arg, void > D0
Definition: Factorize.h:135
const CartesianTrajectoryError cartesianError() const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ROOT::Math::SVector< double, 3 > AlgebraicVector3
const AlgebraicSymMatrix66 & matrix() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
ROOT::Math::SVector< double, 6 > AlgebraicVector6
Definition: APVGainStruct.h:7
Vector3DBase unit() const
Definition: Vector3DBase.h:54
#define LogDebug(id)

◆ zImpactParameter()

pair< bool, Measurement1D > SignedTransverseImpactParameter::zImpactParameter ( const reco::TransientTrack track,
const GlobalVector direction,
const reco::Vertex vertex 
) const

Definition at line 77 of file SignedTransverseImpactParameter.cc.

References l1tTrackerHTMiss_cfi::deltaZ, Vector3DBase< T, FrameTag >::dot(), fftjetvertexadder_cfi::errZ, TrajectoryStateOnSurface::isValid(), LogDebug, nanoDQM_cfi::PV, Validation_hcalonly_cfi::sign, mathSSE::sqrt(), HLT_2022v15_cff::track, bphysicsOniaDQM_cfi::vertex, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

79  {
81  TrajectoryStateOnSurface TSOS = track.impactPointState();
82 
83  if (!TSOS.isValid()) {
84  LogDebug("BTagTools") << "====>>>> SignedTransverseImpactParameter::zImpactParameter : TSOS not valid";
85  return pair<bool, Measurement1D>(false, Measurement1D(0.0, 0.0));
86  }
87 
88  GlobalPoint PV(vertex.x(), vertex.y(), vertex.z());
89  TrajectoryStateOnSurface statePCA = TIPE.extrapolate(TSOS, PV);
90 
91  if (!statePCA.isValid()) {
92  LogDebug("BTagTools") << "====>>>> SignedTransverseImpactParameter::zImpactParameter : statePCA not valid";
93  return pair<bool, Measurement1D>(false, Measurement1D(0.0, 0.0));
94  }
95 
96  GlobalPoint PCA = statePCA.globalPosition();
97 
98  // sign as in rphi
99  GlobalVector PVPCA(PCA.x() - PV.x(), PCA.y() - PV.y(), 0.);
100  const GlobalVector& JetDir(direction);
101  double sign = PVPCA.dot(JetDir);
102  sign /= fabs(sign);
103 
104  // z IP
105  double deltaZ = fabs(PCA.z() - PV.z()) * sign;
106 
107  // error
108  double errPvZ2 = vertex.covariance()(2, 2);
109  //CW cout << "CW number or rows and columns : " << statePCA.cartesianError().matrix().num_row() << " , "
110  //CW << statePCA.cartesianError().matrix().num_col() << endl ;
111  double errTrackZ2 = statePCA.cartesianError().matrix()(2, 2);
112  double errZ = sqrt(errPvZ2 + errTrackZ2);
113 
114  // CW alt. -> gives the same!!
115  // double errTZAlt = statePCA.localError().matrix()[4][4] ;
116  //CW
117 
118  return pair<bool, Measurement1D>(true, Measurement1D(deltaZ, errZ));
119 }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
Definition: PV.py:1
#define LogDebug(id)