CMS 3D CMS Logo

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 }
const Point & position() const
position
Definition: Vertex.h:128
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 ...
double zError() const
error on z
Definition: Vertex.h:142
Definition: HeavyIon.h:7
reco::TransientTrack build(const reco::Track *p) const
TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const GlobalPoint &point) const
Definition: Muon.py:1
T sqrt(T t)
Definition: SSEVec.h:23
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) ...
const FreeTrajectoryState & theState() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
static edm::InputTag vertexCollectionTag()