CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
IPTools Namespace Reference

Functions

std::pair< bool, Measurement1DabsoluteImpactParameter (const TrajectoryStateOnSurface &tsos, const reco::Vertex &vertex, VertexDistance &distanceComputer)
 Impact parameter without direction (internally used) More...
 
std::pair< bool, Measurement1DabsoluteImpactParameter3D (const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DabsoluteTransverseImpactParameter (const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
 
TrajectoryStateOnSurface closestApproachToJet (const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
 
std::pair< double, Measurement1DjetTrackDistance (const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
 
GlobalVector linearImpactParameter (const TrajectoryStateOnSurface &aTSOS, const GlobalPoint &point)
 
std::pair< bool, Measurement1DlinearizedSignedImpactParameter3D (const TrajectoryStateOnSurface &state, const GlobalVector &direction, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DlinearizedSignedImpactParameter3D (const reco::TransientTrack &transientTrack, const GlobalVector &direction, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DsignedDecayLength3D (const TrajectoryStateOnSurface &state, const GlobalVector &direction, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DsignedDecayLength3D (const reco::TransientTrack &transientTrack, const GlobalVector &direction, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DsignedImpactParameter3D (const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
 
std::pair< bool, Measurement1DsignedTransverseImpactParameter (const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
 
TrajectoryStateOnSurface transverseExtrapolate (const TrajectoryStateOnSurface &track, const GlobalPoint &vertexPosition, const MagneticField *field)
 

Function Documentation

std::pair< bool, Measurement1D > IPTools::absoluteImpactParameter ( const TrajectoryStateOnSurface tsos,
const reco::Vertex vertex,
VertexDistance distanceComputer 
)

Impact parameter without direction (internally used)

Definition at line 26 of file IPTools.cc.

References TrajectoryStateOnSurface::cartesianError(), RecoVertex::convertError(), RecoVertex::convertPos(), VertexDistance::distance(), reco::Vertex::error(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), CartesianTrajectoryError::position(), and reco::Vertex::position().

Referenced by absoluteImpactParameter3D(), absoluteTransverseImpactParameter(), signedImpactParameter3D(), and signedTransverseImpactParameter().

26  {
27  if(!tsos.isValid()) {
28  return pair<bool,Measurement1D>(false,Measurement1D(0.,0.)) ;
29  }
30  GlobalPoint refPoint = tsos.globalPosition();
31  GlobalError refPointErr = tsos.cartesianError().position();
32  GlobalPoint vertexPosition = RecoVertex::convertPos(vertex.position());
33  GlobalError vertexPositionErr = RecoVertex::convertError(vertex.error());
34  return pair<bool,Measurement1D>(true,distanceComputer.distance(VertexState(vertexPosition,vertexPositionErr), VertexState(refPoint, refPointErr)));
35  }
reco::Vertex::Point convertPos(const GlobalPoint &p)
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
const CartesianTrajectoryError cartesianError() const
GlobalPoint globalPosition() const
const Point & position() const
position
Definition: Vertex.h:92
Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const
const GlobalError position() const
Position error submatrix.
Error error() const
return SMatrix
Definition: Vertex.h:115
std::pair< bool, Measurement1D > IPTools::absoluteImpactParameter3D ( const reco::TransientTrack transientTrack,
const reco::Vertex vertex 
)

Returns the unsigned transverse impact parameter The track is extrapolated to the closest point to the primary vertex in transverse plane then the impact parameter and its error are computed

Definition at line 37 of file IPTools.cc.

References absoluteImpactParameter(), RecoVertex::convertPos(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), and reco::Vertex::position().

Referenced by TracksClusteringFromDisplacedSeed::clusters(), PFCand_AssoMapAlgos::CreatePFCandToVertexMap(), PF_PU_AssoMapAlgos::CreateTrackToVertexMap(), PFCand_AssoMapAlgos::CreateVertexToPFCandMap(), PF_PU_AssoMapAlgos::CreateVertexToTrackMap(), PF_PU_AssoMapAlgos::FindClosest3D(), EGammaMvaEleEstimator::IDIsoCombinedMvaValue(), EGammaMvaEleEstimator::mvaValue(), TracksClusteringFromDisplacedSeed::nearTracks(), pat::PATElectronProducer::produce(), and TrackVertexArbitration::trackVertexArbitrator().

38  {
39  AnalyticalImpactPointExtrapolator extrapolator(transientTrack.field());
40  VertexDistance3D dist;
41  return absoluteImpactParameter(extrapolator.extrapolate(transientTrack.impactPointState(), RecoVertex::convertPos(vertex.position())), vertex, dist);
42  }
reco::Vertex::Point convertPos(const GlobalPoint &p)
const MagneticField * field() const
const Point & position() const
position
Definition: Vertex.h:92
TrajectoryStateOnSurface impactPointState() const
std::pair< bool, Measurement1D > absoluteImpactParameter(const TrajectoryStateOnSurface &tsos, const reco::Vertex &vertex, VertexDistance &distanceComputer)
Impact parameter without direction (internally used)
Definition: IPTools.cc:26
std::pair< bool, Measurement1D > IPTools::absoluteTransverseImpactParameter ( const reco::TransientTrack transientTrack,
const reco::Vertex vertex 
)

Returns the unsigned 3D impact parameter The track is extrapolated to the closest point to the primary vertex in 3d space then the impact parameter and its error are computed

Definition at line 43 of file IPTools.cc.

References absoluteImpactParameter(), RecoVertex::convertPos(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), and reco::Vertex::position().

Referenced by pat::PATMuonProducer::produce(), and pat::PATElectronProducer::produce().

44  {
45  TransverseImpactPointExtrapolator extrapolator(transientTrack.field());
46  VertexDistanceXY dist;
47  return absoluteImpactParameter(extrapolator.extrapolate(transientTrack.impactPointState(), RecoVertex::convertPos(vertex.position())), vertex, dist);
48  }
reco::Vertex::Point convertPos(const GlobalPoint &p)
const MagneticField * field() const
const Point & position() const
position
Definition: Vertex.h:92
TrajectoryStateOnSurface impactPointState() const
std::pair< bool, Measurement1D > absoluteImpactParameter(const TrajectoryStateOnSurface &tsos, const reco::Vertex &vertex, VertexDistance &distanceComputer)
Impact parameter without direction (internally used)
Definition: IPTools.cc:26
TrajectoryStateOnSurface IPTools::closestApproachToJet ( const TrajectoryStateOnSurface state,
const reco::Vertex vertex,
const GlobalVector aJetDirection,
const MagneticField field 
)

Definition at line 177 of file IPTools.cc.

References dir, AnalyticalTrajectoryExtrapolatorToLine::extrapolate(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by SignedImpactParameter3D::apply(), SignedDecayLength3D::apply(), SignedImpactParameter3D::distanceWithJetAxis(), linearizedSignedImpactParameter3D(), TrackIPProducer::produce(), and signedDecayLength3D().

177  {
178 
179  Line::PositionType pos(GlobalPoint(vertex.x(),vertex.y(),vertex.z()));
180  Line::DirectionType dir(direction.unit());
181  Line jetLine(pos,dir);
182 
183  AnalyticalTrajectoryExtrapolatorToLine extrapolator(field);
184 
185  return extrapolator.extrapolate(state, jetLine);
186  }
Definition: Line.h:10
double y() const
y coordinate
Definition: Vertex.h:96
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double z() const
y coordinate
Definition: Vertex.h:98
double x() const
x coordinate
Definition: Vertex.h:94
dbl *** dir
Definition: mlp_gen.cc:35
pair< double, Measurement1D > IPTools::jetTrackDistance ( const reco::TransientTrack track,
const GlobalVector direction,
const reco::Vertex vertex 
)

Definition at line 200 of file IPTools.cc.

References Line::distance(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::impactPointState(), TrajectoryStateOnSurface::isValid(), mag(), P, Line::position(), csvLumiCalc::unit, histoStyle::weight, reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by QualityCutsAnalyzer::LoopOverJetTracksAssociation(), TrackIPProducer::produce(), and PixelJetPuId::produce().

200  {
201  double theLDist_err(0.);
202 
203  //FIXME
204  float weight=0.;//vertex.trackWeight(track);
205 
206  TrajectoryStateOnSurface stateAtOrigin = track.impactPointState();
207  if(!stateAtOrigin.isValid())
208  {
209  //TODO: throw instead?
210  return pair<bool,Measurement1D>(false,Measurement1D(0.,0.));
211  }
212 
213  //get the Track line at origin
214  Line::PositionType posTrack(stateAtOrigin.globalPosition());
215  Line::DirectionType dirTrack((stateAtOrigin.globalMomentum()).unit());
216  Line trackLine(posTrack,dirTrack);
217  // get the Jet line
218  // Vertex vertex(vertex);
219  GlobalVector jetVector = direction.unit();
220  Line::PositionType posJet(GlobalPoint(vertex.x(),vertex.y(),vertex.z()));
221  Line::DirectionType dirJet(jetVector);
222  Line jetLine(posJet,dirJet);
223 
224  // now compute the distance between the two lines
225  // If the track has been used to refit the Primary vertex then sign it positively, otherwise negative
226  double theDistanceToJetAxis = (jetLine.distance(trackLine)).mag();
227  if (weight<1) theDistanceToJetAxis= -theDistanceToJetAxis;
228 
229  // ... and the flight distance along the Jet axis.
230  GlobalPoint V = jetLine.position();
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);
234 
235  //
236  // get the covariance matrix of the vertex and compute the error on theDistanceToJetAxis
237  //
238 
240 
241  // build the vector of closest approach between lines
242 
243 
244  //FIXME: error not computed.
245  GlobalVector H((jetVector.cross(dirTrack).unit()));
246  CLHEP::HepVector Hh(3);
247  Hh[0] = H.x();
248  Hh[1] = H.y();
249  Hh[2] = H.z();
250 
251  // theLDist_err = sqrt(vertexError.similarity(Hh));
252 
253  // cout << "distance to jet axis : "<< theDistanceToJetAxis <<" and error : "<< theLDist_err<<endl;
254  // Now the impact parameter ...
255 
256  /* GlobalPoint T0 = track.position();
257  GlobalVector D = (T0-V)- (T0-V).dot(dir) * dir;
258  double IP = D.mag();
259  GlobalVector Dold = distance(aTSOS, aJet.vertex(), jetDirection);
260  double IPold = Dold.mag();
261  */
262 
263 
264 
265 
266  Measurement1D DTJA(theDistanceToJetAxis,theLDist_err);
267 
268  return pair<double,Measurement1D> (theDistanceAlongJetAxis,DTJA);
269  }
Definition: Line.h:10
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double y() const
y coordinate
Definition: Vertex.h:96
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
#define P
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
string unit
Definition: csvLumiCalc.py:46
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
double z() const
y coordinate
Definition: Vertex.h:98
Vector3DBase unit() const
Definition: Vector3DBase.h:57
double x() const
x coordinate
Definition: Vertex.h:94
GlobalVector globalMomentum() const
TrajectoryStateOnSurface impactPointState() const
int weight
Definition: histoStyle.py:50
GlobalVector IPTools::linearImpactParameter ( const TrajectoryStateOnSurface state,
const GlobalPoint point 
)

Compute the impact parameter of a track, linearized from the given state, with respect to a given point

Definition at line 191 of file IPTools.cc.

References dir, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), point, tmp, and csvLumiCalc::unit.

Referenced by linearizedSignedImpactParameter3D().

191  {
192 
193  Line::PositionType pos(state.globalPosition());
195  Line trackLine(pos,dir);
197  return trackLine.distance(tmp);
198  }
Definition: Line.h:10
GlobalPoint globalPosition() const
string unit
Definition: csvLumiCalc.py:46
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
GlobalVector globalMomentum() const
dbl *** dir
Definition: mlp_gen.cc:35
*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
Definition: invegas.h:5
pair< bool, Measurement1D > IPTools::linearizedSignedImpactParameter3D ( const TrajectoryStateOnSurface state,
const GlobalVector direction,
const reco::Vertex vertex 
)

Definition at line 133 of file IPTools.cc.

References funct::abs(), TrajectoryStateOnSurface::cartesianError(), reco::Vertex::covariance(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), linearImpactParameter(), CartesianTrajectoryError::matrix(), mathSSE::sqrt(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by linearizedSignedImpactParameter3D().

135  {
136  //Check if extrapolation has been successfull
137  if(!closestToJetState.isValid()) {
138  return pair<bool,Measurement1D>(false,Measurement1D(0.,0.));
139  }
140 
141  GlobalPoint vertexPosition(vertex.x(),vertex.y(),vertex.z());
142  GlobalVector impactParameter = linearImpactParameter(closestToJetState, vertexPosition);
143  GlobalVector jetDir = direction.unit();
144  GlobalVector flightDistance(closestToJetState.globalPosition()-vertexPosition);
145  double theDistanceAlongJetAxis = jetDir.dot(flightDistance);
146  double signedIP = impactParameter.mag()*((theDistanceAlongJetAxis!=0)?theDistanceAlongJetAxis/abs(theDistanceAlongJetAxis):1.);
147 
148 
149  GlobalVector ipDirection = impactParameter.unit();
150  //GlobalPoint closestPoint = closestToJetState.globalPosition();
151  GlobalVector momentumAtClosestPoint = closestToJetState.globalMomentum();
152  GlobalVector momentumDir = momentumAtClosestPoint.unit();
153 
154  AlgebraicVector3 deriv_v;
155  deriv_v[0] = - ipDirection.x();
156  deriv_v[1] = - ipDirection.y();
157  deriv_v[2] = - ipDirection.z();
158 
159 
160  AlgebraicVector6 deriv;
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();
167 
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);
171 
172  return pair<bool,Measurement1D>(true,Measurement1D(signedIP,ipError));
173  }
GlobalVector linearImpactParameter(const TrajectoryStateOnSurface &aTSOS, const GlobalPoint &point)
Definition: IPTools.cc:191
double y() const
y coordinate
Definition: Vertex.h:96
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:109
ROOT::Math::SVector< double, 6 > AlgebraicVector6
T mag() const
Definition: PV3DBase.h:67
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
y coordinate
Definition: Vertex.h:98
Vector3DBase unit() const
Definition: Vector3DBase.h:57
double x() const
x coordinate
Definition: Vertex.h:94
T x() const
Definition: PV3DBase.h:62
std::pair<bool,Measurement1D> IPTools::linearizedSignedImpactParameter3D ( const reco::TransientTrack transientTrack,
const GlobalVector direction,
const reco::Vertex vertex 
)
inline

Definition at line 73 of file IPTools.h.

References closestApproachToJet(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), and linearizedSignedImpactParameter3D().

75  {
76  // extrapolate to the point of closest approach to the jet axis
77  TrajectoryStateOnSurface closestToJetState = closestApproachToJet(transientTrack.impactPointState(), vertex, direction,transientTrack.field());
78  return linearizedSignedImpactParameter3D(closestToJetState,direction,vertex);
79  }
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:177
const MagneticField * field() const
std::pair< bool, Measurement1D > linearizedSignedImpactParameter3D(const TrajectoryStateOnSurface &state, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:133
TrajectoryStateOnSurface impactPointState() const
pair< bool, Measurement1D > IPTools::signedDecayLength3D ( const TrajectoryStateOnSurface state,
const GlobalVector direction,
const reco::Vertex vertex 
)

chech it!!!!!!!!!!!!!!!!!!!!!!!

chech it!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 94 of file IPTools.cc.

References TrajectoryStateOnSurface::cartesianError(), reco::Vertex::covariance(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), j, findQualityFiles::jj, CartesianTrajectoryError::matrix(), mathSSE::sqrt(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by QualityCutsAnalyzer::LoopOverJetTracksAssociation(), and signedDecayLength3D().

95  {
96 
97  //Check if extrapolation has been successfull
98  if(!closestToJetState.isValid()) {
99  return pair<bool,Measurement1D>(false,Measurement1D(0.,0.));
100  }
101 
102  GlobalVector jetDirection = direction.unit();
103  GlobalPoint vertexPosition(vertex.x(),vertex.y(),vertex.z());
104 
105  double decayLen = jetDirection.dot(closestToJetState.globalPosition()-vertexPosition);
106 
107  //error calculation
108 
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();
117  jj[3] =0.;
118  jj[4] =0.;
119  jj[5] =0.;
120 
121  //TODO: FIXME: the extrapolation uncertainty is very relevant here should be taken into account!!
122  double trackError2 = ROOT::Math::Similarity(jj,closestToJetState.cartesianError().matrix());
123  double vertexError2 = ROOT::Math::Similarity(j,vertex.covariance());
124 
125  double decayLenError = sqrt(trackError2+vertexError2);
126 
127  return pair<bool,Measurement1D>(true,Measurement1D(decayLen,decayLenError));
128 
129  }
double y() const
y coordinate
Definition: Vertex.h:96
T y() const
Definition: PV3DBase.h:63
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:109
ROOT::Math::SVector< double, 6 > AlgebraicVector6
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
ROOT::Math::SVector< double, 3 > AlgebraicVector3
int j
Definition: DBlmapReader.cc:9
double z() const
y coordinate
Definition: Vertex.h:98
Vector3DBase unit() const
Definition: Vector3DBase.h:57
double x() const
x coordinate
Definition: Vertex.h:94
T x() const
Definition: PV3DBase.h:62
std::pair<bool,Measurement1D> IPTools::signedDecayLength3D ( const reco::TransientTrack transientTrack,
const GlobalVector direction,
const reco::Vertex vertex 
)
inline

Definition at line 84 of file IPTools.h.

References closestApproachToJet(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), and signedDecayLength3D().

86  {
87  // extrapolate to the point of closest approach to the jet axis
88  TrajectoryStateOnSurface closestToJetState = closestApproachToJet(transientTrack.impactPointState(), vertex, direction,transientTrack.field());
89  return signedDecayLength3D(closestToJetState,direction,vertex);
90  }
std::pair< bool, Measurement1D > signedDecayLength3D(const TrajectoryStateOnSurface &state, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:94
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:177
const MagneticField * field() const
TrajectoryStateOnSurface impactPointState() const
pair< bool, Measurement1D > IPTools::signedImpactParameter3D ( const reco::TransientTrack track,
const GlobalVector direction,
const reco::Vertex vertex 
)

Returns life time signed 3D impact parameter The track is extrapolated to the closest point to the primary vertex in 3d space then the impact parameter and its error are computed

Definition at line 71 of file IPTools.cc.

References absoluteImpactParameter(), RecoVertex::convertPos(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), reco::Vertex::position(), parseEventContent::prod, query::result, reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by pat::PATMuonProducer::embedHighLevel(), pat::PATElectronProducer::embedHighLevel(), SoftPFElectronTagInfoProducer::fillElecProperties(), SoftPFMuonTagInfoProducer::fillMuonProperties(), QualityCutsAnalyzer::LoopOverJetTracksAssociation(), reco::tau::RecoTauImpactParameterSignificancePlugin::operator()(), TrackIPProducer::produce(), SoftPFElectronTagInfoProducer::produce(), and SoftLepton::tag().

72  {
73  //Extrapolate to closest point on transverse plane
74  AnalyticalImpactPointExtrapolator extrapolator(track.field());
75  TrajectoryStateOnSurface closestIn3DSpaceState = extrapolator.extrapolate(track.impactPointState(),RecoVertex::convertPos(vertex.position()));
76 
77  //Compute absolute value
78  VertexDistance3D dist;
79  pair<bool,Measurement1D> result = absoluteImpactParameter(closestIn3DSpaceState, vertex, dist);
80  if(!result.first) return result;
81 
82  //Compute Sign
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.;
87 
88  //Apply sign to the result
89  return pair<bool,Measurement1D>(result.first,Measurement1D(sign*result.second.value(), result.second.error()));
90  }
reco::Vertex::Point convertPos(const GlobalPoint &p)
double y() const
y coordinate
Definition: Vertex.h:96
T y() const
Definition: PV3DBase.h:63
const MagneticField * field() const
const Point & position() const
position
Definition: Vertex.h:92
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
double z() const
y coordinate
Definition: Vertex.h:98
double x() const
x coordinate
Definition: Vertex.h:94
TrajectoryStateOnSurface impactPointState() const
std::pair< bool, Measurement1D > absoluteImpactParameter(const TrajectoryStateOnSurface &tsos, const reco::Vertex &vertex, VertexDistance &distanceComputer)
Impact parameter without direction (internally used)
Definition: IPTools.cc:26
T x() const
Definition: PV3DBase.h:62
pair< bool, Measurement1D > IPTools::signedTransverseImpactParameter ( const reco::TransientTrack track,
const GlobalVector direction,
const reco::Vertex vertex 
)

Returns life time signed transverse impact parameter The track is extrapolated to the closest point to the primary vertex in transverse plane then the impact parameter and its error are computed

Definition at line 50 of file IPTools.cc.

References absoluteImpactParameter(), RecoVertex::convertPos(), reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), reco::Vertex::position(), parseEventContent::prod, query::result, reco::Vertex::x(), and reco::Vertex::y().

Referenced by PrimaryVertexValidation::analyze(), CaloRecoTauAlgorithm::buildCaloTau(), PFRecoTauAlgorithm::buildPFTau(), HPSPFRecoTauAlgorithm::buildPFTau(), PFRecoTauDiscriminationByFlight::discriminate(), pat::PATMuonProducer::embedHighLevel(), pat::PATElectronProducer::embedHighLevel(), SoftPFElectronTagInfoProducer::fillElecProperties(), SoftPFMuonTagInfoProducer::fillMuonProperties(), QualityCutsAnalyzer::LoopOverJetTracksAssociation(), TrackIPProducer::produce(), PFConversionProducer::produce(), PFTrackProducer::produce(), ConvBremPFTrackFinder::runConvBremFinder(), and SoftLepton::tag().

51  {
52  //Extrapolate to closest point on transverse plane
53  TransverseImpactPointExtrapolator extrapolator(track.field());
54  TrajectoryStateOnSurface closestOnTransversePlaneState = extrapolator.extrapolate(track.impactPointState(),RecoVertex::convertPos(vertex.position()));
55 
56  //Compute absolute value
57  VertexDistanceXY dist;
58  pair<bool,Measurement1D> result = absoluteImpactParameter(closestOnTransversePlaneState, vertex, dist);
59  if(!result.first) return result;
60 
61  //Compute Sign
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.;
66 
67  //Apply sign to the result
68  return pair<bool,Measurement1D>(result.first,Measurement1D(sign*result.second.value(), result.second.error()));
69  }
reco::Vertex::Point convertPos(const GlobalPoint &p)
double y() const
y coordinate
Definition: Vertex.h:96
T y() const
Definition: PV3DBase.h:63
const MagneticField * field() const
const Point & position() const
position
Definition: Vertex.h:92
tuple result
Definition: query.py:137
double x() const
x coordinate
Definition: Vertex.h:94
TrajectoryStateOnSurface impactPointState() const
std::pair< bool, Measurement1D > absoluteImpactParameter(const TrajectoryStateOnSurface &tsos, const reco::Vertex &vertex, VertexDistance &distanceComputer)
Impact parameter without direction (internally used)
Definition: IPTools.cc:26
T x() const
Definition: PV3DBase.h:62
TrajectoryStateOnSurface IPTools::transverseExtrapolate ( const TrajectoryStateOnSurface track,
const GlobalPoint vertexPosition,
const MagneticField field 
)
inline

Definition at line 56 of file IPTools.h.

References TransverseImpactPointExtrapolator::extrapolate().

57  {
58  TransverseImpactPointExtrapolator extrapolator(field);
59  return extrapolator.extrapolate(track, vertexPosition);
60  }