CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LeptonVertexSignificance.cc
Go to the documentation of this file.
10 
11 using namespace pat;
12 
14  return edm::InputTag("offlinePrimaryVerticesFromCTFTracks");
15 }
16 
17 // calculate the TrackIsoPt for the lepton object
20  const TransientTrackBuilder& builder) {
21  return this->calculate(*theElectron.gsfTrack(), vertices, builder);
22 }
23 
26  const TransientTrackBuilder& builder) {
27  return this->calculate(*theMuon.track(), vertices, builder);
28 }
29 
30 // calculate the TrackIsoPt for the lepton's track
33  const TransientTrackBuilder& builder) {
34  if (vertices.empty())
35  return 0;
36  reco::Vertex const& theVertex = vertices.front();
37  // calculate the track-vertex association significance
38  reco::TransientTrack theTrTrack = builder.build(&theTrack);
39  GlobalPoint theVertexPoint(theVertex.position().x(), theVertex.position().y(), theVertex.position().z());
40  FreeTrajectoryState theLeptonNearVertex = theTrTrack.trajectoryStateClosestToPoint(theVertexPoint).theState();
41  return fabs(theVertex.position().z() - theLeptonNearVertex.position().z()) /
42  sqrt(std::pow(theVertex.zError(), 2) + theLeptonNearVertex.cartesianError().position().czz());
43 }
double zError() const
error on z
Definition: Vertex.h:141
const FreeTrajectoryState & theState() const
reco::TransientTrack build(const reco::Track *p) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
const Point & position() const
position
Definition: Vertex.h:127
T sqrt(T t)
Definition: SSEVec.h:19
float calculate(const Electron &anElectron, const reco::VertexCollection &vertices, const TransientTrackBuilder &builder)
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
Analysis-level electron class.
Definition: Electron.h:51
Analysis-level muon class.
Definition: Muon.h:51
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
static edm::InputTag vertexCollectionTag()