9 #include "CLHEP/Vector/ThreeVector.h"
10 #include "CLHEP/Vector/LorentzVector.h"
11 #include "CLHEP/Matrix/Vector.h"
27 return pair<bool, Measurement1D>(
false,
Measurement1D(0., 0.));
33 return pair<bool, Measurement1D>(
72 GlobalPoint impactPoint = closestOnTransversePlaneState.globalPosition();
74 double prod = IPVec.dot(direction);
75 double sign = (
prod >= 0) ? 1. : -1.;
96 GlobalPoint impactPoint = closestIn3DSpaceState.globalPosition();
98 double prod = IPVec.dot(direction);
99 double sign = (
prod >= 0) ? 1. : -1.;
109 if (!closestToJetState.
isValid()) {
110 return pair<bool, Measurement1D>(
false,
Measurement1D(0., 0.));
116 double decayLen = jetDirection.dot(closestToJetState.
globalPosition() - vertexPosition);
121 j[0] = jetDirection.x();
122 j[1] = jetDirection.y();
123 j[2] = jetDirection.z();
125 jj[0] = jetDirection.x();
126 jj[1] = jetDirection.y();
127 jj[2] = jetDirection.z();
134 double vertexError2 = ROOT::Math::Similarity(
j,
vertex.covariance());
136 double decayLenError =
sqrt(trackError2 + vertexError2);
138 return pair<bool, Measurement1D>(
true,
Measurement1D(decayLen, decayLenError));
145 if (!closestToJetState.
isValid()) {
146 return pair<bool, Measurement1D>(
false,
Measurement1D(0., 0.));
153 double theDistanceAlongJetAxis = jetDir.dot(flightDistance);
154 double signedIP = impactParameter.mag() *
155 ((theDistanceAlongJetAxis != 0) ? theDistanceAlongJetAxis /
abs(theDistanceAlongJetAxis) : 1.);
163 deriv_v[0] = -ipDirection.
x();
164 deriv_v[1] = -ipDirection.y();
165 deriv_v[2] = -ipDirection.z();
168 deriv[0] = ipDirection.x();
169 deriv[1] = ipDirection.y();
170 deriv[2] = ipDirection.z();
171 deriv[3] = -(momentumDir.dot(flightDistance) * ipDirection.x()) / momentumAtClosestPoint.mag();
172 deriv[4] = -(momentumDir.dot(flightDistance) * ipDirection.y()) / momentumAtClosestPoint.mag();
173 deriv[5] = -(momentumDir.dot(flightDistance) * ipDirection.z()) / momentumAtClosestPoint.mag();
175 double trackError2 = ROOT::Math::Similarity(deriv, closestToJetState.
cartesianError().
matrix());
176 double vertexError2 = ROOT::Math::Similarity(deriv_v,
vertex.covariance());
177 double ipError =
sqrt(trackError2 + vertexError2);
179 return pair<bool, Measurement1D>(
true,
Measurement1D(signedIP, ipError));
203 return trackLine.distance(
tmp);
209 double theLDist_err(0.);
215 if (!stateAtOrigin.
isValid()) {
217 return pair<bool, Measurement1D>(
false,
Measurement1D(0., 0.));
223 Line trackLine(posTrack, dirTrack);
229 Line jetLine(posJet, dirJet);
233 double theDistanceToJetAxis = (jetLine.
distance(trackLine)).
mag();
235 theDistanceToJetAxis = -theDistanceToJetAxis;
239 GlobalVector Q = dirTrack - jetVector.dot(dirTrack) * jetVector;
240 GlobalVector P = jetVector - jetVector.dot(dirTrack) * dirTrack;
241 double theDistanceAlongJetAxis =
P.dot(
V - posTrack) /
Q.dot(dirTrack);
253 CLHEP::HepVector Hh(3);
272 return pair<double, Measurement1D>(theDistanceAlongJetAxis, DTJA);