9 #include "CLHEP/Vector/ThreeVector.h"
10 #include "CLHEP/Vector/LorentzVector.h"
11 #include "CLHEP/Matrix/Vector.h"
34 return pair<bool,Measurement1D>(
true,distanceComputer.
distance(
VertexState(vertexPosition,vertexPositionErr),
VertexState(refPoint, refPointErr)));
59 if(!result.first)
return result;
62 GlobalPoint impactPoint = closestOnTransversePlaneState.globalPosition();
63 GlobalVector IPVec(impactPoint.x()-vertex.
x(),impactPoint.y()-vertex.
y(),0.);
64 double prod = IPVec.dot(direction);
65 double sign = (prod>=0) ? 1. : -1.;
68 return pair<bool,Measurement1D>(result.first,
Measurement1D(sign*result.second.value(), result.second.error()));
80 if(!result.first)
return result;
83 GlobalPoint impactPoint = closestIn3DSpaceState.globalPosition();
84 GlobalVector IPVec(impactPoint.x()-vertex.
x(),impactPoint.y()-vertex.
y(),impactPoint.z()-vertex.
z());
85 double prod = IPVec.dot(direction);
86 double sign = (prod>=0) ? 1. : -1.;
89 return pair<bool,Measurement1D>(result.first,
Measurement1D(sign*result.second.value(), result.second.error()));
98 if(!closestToJetState.
isValid()) {
105 double decayLen = jetDirection.dot(closestToJetState.
globalPosition()-vertexPosition);
110 j[0] = jetDirection.x();
111 j[1] = jetDirection.y();
112 j[2] = jetDirection.z();
114 jj[0] = jetDirection.x();
115 jj[1] = jetDirection.y();
116 jj[2] = jetDirection.z();
123 double vertexError2 = ROOT::Math::Similarity(j,vertex.
covariance());
125 double decayLenError =
sqrt(trackError2+vertexError2);
127 return pair<bool,Measurement1D>(
true,
Measurement1D(decayLen,decayLenError));
137 if(!closestToJetState.
isValid()) {
145 double theDistanceAlongJetAxis = jetDir.dot(flightDistance);
146 double signedIP = impactParameter.mag()*((theDistanceAlongJetAxis!=0)?theDistanceAlongJetAxis/
abs(theDistanceAlongJetAxis):1.);
155 deriv_v[0] = - ipDirection.
x();
156 deriv_v[1] = - ipDirection.y();
157 deriv_v[2] = - ipDirection.z();
161 deriv[0] = ipDirection.x();
162 deriv[1] = ipDirection.y();
163 deriv[2] = ipDirection.z();
164 deriv[3] = - (momentumDir.dot(flightDistance)*ipDirection.x())/momentumAtClosestPoint.mag();
165 deriv[4] = - (momentumDir.dot(flightDistance)*ipDirection.y())/momentumAtClosestPoint.mag();
166 deriv[5] = - (momentumDir.dot(flightDistance)*ipDirection.z())/momentumAtClosestPoint.mag();
168 double trackError2 = ROOT::Math::Similarity(deriv , closestToJetState.
cartesianError().
matrix());
169 double vertexError2 = ROOT::Math::Similarity(deriv_v , vertex.
covariance());
170 double ipError =
sqrt(trackError2+vertexError2);
172 return pair<bool,Measurement1D>(
true,
Measurement1D(signedIP,ipError));
197 return trackLine.distance(tmp);
201 double theLDist_err(0.);
216 Line trackLine(posTrack,dirTrack);
222 Line jetLine(posJet,dirJet);
226 double theDistanceToJetAxis = (jetLine.
distance(trackLine)).
mag();
227 if (weight<1) theDistanceToJetAxis= -theDistanceToJetAxis;
231 GlobalVector Q = dirTrack - jetVector.dot(dirTrack) * jetVector;
232 GlobalVector P = jetVector - jetVector.dot(dirTrack) * dirTrack;
233 double theDistanceAlongJetAxis = P.dot(V-posTrack)/Q.dot(dirTrack);
246 CLHEP::HepVector Hh(3);
268 return pair<double,Measurement1D> (theDistanceAlongJetAxis,DTJA);
reco::Vertex::Point convertPos(const GlobalPoint &p)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double y() const
y coordinate
reco::Vertex::Error convertError(const GlobalError &ge)
Global3DPoint GlobalPoint
const CartesianTrajectoryError cartesianError() const
GlobalPoint globalPosition() const
const MagneticField * field() const
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
const Point & position() const
position
ROOT::Math::SVector< double, 6 > AlgebraicVector6
GlobalVector distance(const Line &aLine) const
PositionType position() const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Abs< T >::type abs(const T &t)
double z() const
z coordinate
const AlgebraicSymMatrix66 & matrix() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Vector3DBase unit() const
double x() const
x coordinate
Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const
const GlobalError position() const
Position error submatrix.
Error error() const
return SMatrix
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
std::vector< std::vector< double > > tmp
GlobalVector globalMomentum() const
TrajectoryStateOnSurface impactPointState() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point