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 16 of file SignedTransverseImpactParameter.h.

Constructor & Destructor Documentation

SignedTransverseImpactParameter::SignedTransverseImpactParameter ( )
inline

Definition at line 22 of file SignedTransverseImpactParameter.h.

References apply(), and zImpactParameter().

22 {};

Member Function Documentation

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 patCaloMETCorrections_cff::A, funct::abs(), reco::Vertex::covariance(), reco::TransientTrack::field(), TrajectoryStateOnSurface::freeState(), reco::TransientTrack::impactPointState(), LogDebug, mathSSE::sqrt(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), reco::Vertex::x(), x(), PV3DBase< T, PVType, FrameType >::y(), reco::Vertex::y(), PV3DBase< T, PVType, FrameType >::z(), and reco::Vertex::z().

Referenced by heavyIonTools.ConfigureHeavyIons::__call__(), editorTools.UserCodeTool::__call__(), HiCoreTools.RestrictInputToAOD::__call__(), coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), heavyIonTools.ProductionDefaults::__call__(), editorTools.ChangeSource::__call__(), HiCoreTools.RemoveMCMatching::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), heavyIonTools.SelectionDefaults::__call__(), HiCoreTools.RemoveAllPATObjectsBut::__call__(), heavyIonTools.DisbaleMonteCarloDeps::__call__(), HiCoreTools.RemoveSpecificPATObjects::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), trackTools.MakeTrackCandidates::__call__(), tauTools.AddTauCollection::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), HiCoreTools.RemoveCleaning::__call__(), HiCoreTools.AddCleaning::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), jetTools.AddJetCollection::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.UpdateJetCollection::__call__(), jetTools.AddJetID::__call__(), jetTools.SetTagInfos::__call__(), SignedTransverseImpactParameter(), and ImpactParameterAlgorithm::tag().

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

Definition at line 82 of file SignedTransverseImpactParameter.cc.

References reco::Vertex::covariance(), fftjetvertexadder_cfi::errZ, reco::TransientTrack::field(), reco::TransientTrack::impactPointState(), LogDebug, Validation_hcalonly_cfi::sign, mathSSE::sqrt(), funct::true, reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by SignedTransverseImpactParameter().

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