CMS 3D CMS Logo

SignedDecayLength3D.cc
Go to the documentation of this file.
1 #include <string>
2 
4 
6 
11 
12 #include "CLHEP/Vector/ThreeVector.h"
13 #include "CLHEP/Vector/LorentzVector.h"
14 #include "CLHEP/Matrix/Vector.h"
15 
16 using namespace std;
17 using namespace reco;
18 
19 pair<bool, Measurement1D> SignedDecayLength3D::apply(const TransientTrack& transientTrack,
20  const GlobalVector& direction,
21  const Vertex& vertex) {
22  double theError = 0.;
23  bool theIsValid;
24 
25  //TrajectoryStateOnSurface TSOS = (aRecTrack).impactPointStateOnSurface();
28 
29  TrajectoryStateOnSurface theTSOS = closestApproachToJet(*FTS, vertex, direction, transientTrack.field());
30  theIsValid = theTSOS.isValid();
31 
32  if (theIsValid) {
33  GlobalVector J = direction.unit();
34  GlobalPoint vertexPosition(vertex.x(), vertex.y(), vertex.z());
35 
36  double theValue = J.dot(theTSOS.globalPosition() - vertexPosition);
37 
38  //error calculation
39 
41  j[0] = J.x();
42  j[1] = J.y();
43  j[2] = J.z();
45  jj[0] = J.x();
46  jj[1] = J.y();
47  jj[2] = J.z();
48  jj[3] = 0.;
49  jj[4] = 0.;
50  jj[5] = 0.;
51  double E1 = ROOT::Math::Similarity(jj, theTSOS.cartesianError().matrix());
52  // double E2 = (aJet.vertex().positionError().matrix()).similarity(j);
53  double E2 = ROOT::Math::Similarity(j, vertex.covariance());
54 
55  theError = sqrt(E1 + E2);
56 
57  //cout<< "Error ="<< theError<<endl;
58  Measurement1D A(theValue, theError);
59  return pair<bool, Measurement1D>(theIsValid, A);
60  } else {
61  return pair<bool, Measurement1D>(theIsValid, Measurement1D(0., 0.));
62  } // endif (isValid)
63 } // end constructor declaration
64 
66  const Vertex& vertex,
67  const GlobalVector& aJetDirection,
68  const MagneticField* field) {
69  GlobalVector J = aJetDirection.unit();
70 
73  Line Jet(pos, dir);
74 
76 
77  return TETL.extrapolate(aFTS, Jet);
78 }
Vector3DBase
Definition: Vector3DBase.h:8
TrajectoryStateOnSurface.h
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
TrajectoryStateOnSurface::freeTrajectoryState
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:60
Measurement1D
Definition: Measurement1D.h:11
TrajectoryStateOnSurface::cartesianError
const CartesianTrajectoryError cartesianError() const
Definition: TrajectoryStateOnSurface.h:71
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
Measurement1D.h
SignedDecayLength3D::apply
static std::pair< bool, Measurement1D > apply(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: SignedDecayLength3D.cc:19
IPTools::closestApproachToJet
TrajectoryStateOnSurface closestApproachToJet(const TrajectoryStateOnSurface &state, const reco::Vertex &vertex, const GlobalVector &aJetDirection, const MagneticField *field)
Definition: IPTools.cc:182
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TransientTrack.h
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Jet
Definition: Jet.py:1
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SignedDecayLength3D.h
L1TRate_cfi.Jet
Jet
Definition: L1TRate_cfi.py:43
Line.h
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
reco::TransientTrack::impactPointState
TrajectoryStateOnSurface impactPointState() const
Definition: TransientTrack.h:98
Line
Definition: Line.h:10
AlgebraicVector6
ROOT::Math::SVector< double, 6 > AlgebraicVector6
Definition: AlgebraicROOTObjects.h:15
Vector3DBase::dot
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
reco::TransientTrack::field
const MagneticField * field() const
Definition: TransientTrack.h:110
CartesianTrajectoryError::matrix
const AlgebraicSymMatrix66 & matrix() const
Definition: CartesianTrajectoryError.h:28
MaterialEffects_cfi.A
A
Definition: MaterialEffects_cfi.py:11
std
Definition: JetResolutionObject.h:76
reco::TransientTrack
Definition: TransientTrack.h:19
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
SignedDecayLength3D::closestApproachToJet
static TrajectoryStateOnSurface closestApproachToJet(const FreeTrajectoryState &, const reco::Vertex &, const GlobalVector &, const MagneticField *)
Definition: SignedDecayLength3D.cc:65
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
MagneticField
Definition: MagneticField.h:19
AnalyticalTrajectoryExtrapolatorToLine
Definition: AnalyticalTrajectoryExtrapolatorToLine.h:28
A
AnalyticalTrajectoryExtrapolatorToLine::extrapolate
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const Line &L) const
extrapolation from FreeTrajectoryState
Definition: AnalyticalTrajectoryExtrapolatorToLine.cc:22
AnalyticalTrajectoryExtrapolatorToLine.h
reco::Vertex
Definition: Vertex.h:35
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23