CMS 3D CMS Logo

Vertexing.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_interface_Vertexing_h
2 #define DataFormats_PatCandidates_interface_Vertexing_h
3 
10 
24 namespace pat {
26  public:
35  // --- Methods to mimick VertexRef
37  bool isNull() const { return vertex_.isNull(); }
39  bool isNonnull() const { return vertex_.isNonnull(); }
41  bool isAvailable() const { return vertex_.isAvailable(); }
43  const reco::Vertex &operator*() const { return *operator->(); }
45  const reco::Vertex *operator->() const { return vertex_.isNull() ? nullptr : vertex_.get(); }
46  // --- Methods to get the Vertex and track
48  const reco::VertexRef &vertexRef() const { return vertex_; }
50  const reco::Vertex *vertex() const { return vertex_.isNull() ? nullptr : vertex_.get(); }
52  bool hasTrack() const { return !track_.isNull(); }
54  const reco::TrackBaseRef &trackRef() const { return track_; }
56  const reco::Track *track() const { return hasTrack() ? track_.get() : nullptr; }
57  // --- Methods to return distances
60  const Measurement1DFloat &dz() const { return dz_; }
62  const Measurement1DFloat &dr() const { return dr_; }
64  bool hasTransverseIP() const { return (dr_.value() != 0); }
66  bool hasErrors() const { return (dz_.error() != 0) && (!hasTransverseIP() || dr_.error() != 0); }
67  // ---- Methods to set distances
68  void setDz(const Measurement1DFloat &dz) { dz_ = dz; }
69  void setDr(const Measurement1DFloat &dr) { dr_ = dr; }
73  void setDistances(const AlgebraicVector3 &dist, const AlgebraicSymMatrix33 &err);
77  template <typename T1, typename T2>
78  void setDistances(const T1 &p1, const T2 &p2, const AlgebraicSymMatrix33 &err) {
79  AlgebraicVector3 dist(p1.x() - p2.x(), p1.y() - p2.y(), p1.z() - p2.z());
80  setDistances(dist, err);
81  }
82  // ---- 3D significance of the impact parameter
83  // float signif3d() const { return signif3d_; }
84  // bool hasSignif3d() const { return signif3d_ != 0; }
85  // void setSignif3d(float signif3d) { signif3d_ = signif3d; }
86  private:
87  // basic information
90  // float signif3d_;
91  // extended info
93  // fixme: add refitted momentum
94  };
95 } // namespace pat
96 
97 #endif
edm::RefToBase::isNull
bool isNull() const
Checks for null.
Definition: RefToBase.h:295
pat::VertexAssociation::dz
const Measurement1DFloat & dz() const
Definition: Vertexing.h:60
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
Measurement1D
Definition: Measurement1D.h:11
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
pat::VertexAssociation::dr_
Measurement1DFloat dr_
Definition: Vertexing.h:89
Measurement1DFloat::error
float error() const
Definition: Measurement1DFloat.h:25
pat::VertexAssociation::hasTransverseIP
bool hasTransverseIP() const
True if the transverse distance was computed for this VertexAssociation.
Definition: Vertexing.h:64
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
pat::VertexAssociation::setDz
void setDz(const Measurement1D &dz)
Definition: Vertexing.h:70
pat::VertexAssociation::setDr
void setDr(const Measurement1D &dr)
Definition: Vertexing.h:71
pat::VertexAssociation::setDz
void setDz(const Measurement1DFloat &dz)
Definition: Vertexing.h:68
Measurement1D.h
pat::VertexAssociation::VertexAssociation
VertexAssociation(const reco::VertexRef &vertex)
Create a vertex association given a ref to a vertex.
Definition: Vertexing.h:30
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
pat::VertexAssociation::vertexRef
const reco::VertexRef & vertexRef() const
Returns the reference to the vertex (can be a null reference)
Definition: Vertexing.h:48
pat::VertexAssociation::isAvailable
bool isAvailable() const
Return 'true' if the reco::Vertex is available in the file, false if it has been dropped.
Definition: Vertexing.h:41
Measurement1DFloat.h
pat::VertexAssociation::VertexAssociation
VertexAssociation()
Create a null vertx association.
Definition: Vertexing.h:28
pat::VertexAssociation::hasTrack
bool hasTrack() const
Returns 'true' if a reference to a track was stored in this VertexAssociation.
Definition: Vertexing.h:52
pat::VertexAssociation::dr
const Measurement1DFloat & dr() const
Distance between the object and the vertex in the transverse plane, and it's error.
Definition: Vertexing.h:62
edm::Ref< VertexCollection >
pat::VertexAssociation::track
const reco::Track * track() const
Returns a C++ pointer to the track stored in this vertex (can be a null pointer)
Definition: Vertexing.h:56
Measurement1DFloat::value
float value() const
Definition: Measurement1DFloat.h:23
Track.h
pat::VertexAssociation::VertexAssociation
VertexAssociation(const reco::VertexRef &vertex, const reco::TrackBaseRef &tk)
Definition: Vertexing.h:34
reco::Track
Definition: Track.h:27
p2
double p2[4]
Definition: TauolaWrapper.h:90
pat::VertexAssociation::setDistances
void setDistances(const AlgebraicVector3 &dist, const AlgebraicSymMatrix33 &err)
Set dz and dr given the distance and the 3x3 total covariance matrix of the distance.
Definition: Vertexing.cc:5
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
pat::VertexAssociation::setDistances
void setDistances(const T1 &p1, const T2 &p2, const AlgebraicSymMatrix33 &err)
Definition: Vertexing.h:78
pat::VertexAssociation::operator*
const reco::Vertex & operator*() const
Return the vertex (that is, you can do "const reco::Vertex &vtx = *assoc")
Definition: Vertexing.h:43
Vertex.h
pat::VertexAssociation::isNonnull
bool isNonnull() const
Return 'true' unless this is a null association (that is, no vertex)
Definition: Vertexing.h:39
runTheMatrix.err
err
Definition: runTheMatrix.py:288
pat::VertexAssociation::dz_
Measurement1DFloat dz_
Definition: Vertexing.h:89
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::VertexAssociation::setDr
void setDr(const Measurement1DFloat &dr)
Definition: Vertexing.h:69
Ptr.h
p1
double p1[4]
Definition: TauolaWrapper.h:89
Measurement1DFloat
Definition: Measurement1DFloat.h:9
pat
Definition: HeavyIon.h:7
pat::VertexAssociation
Analysis-level structure for vertex-related information.
Definition: Vertexing.h:25
VertexFwd.h
pat::VertexAssociation::trackRef
const reco::TrackBaseRef & trackRef() const
Returns a reference to the track stored in this vertex (can be null)
Definition: Vertexing.h:54
pat::VertexAssociation::track_
reco::TrackBaseRef track_
Definition: Vertexing.h:92
pat::VertexAssociation::isNull
bool isNull() const
Return 'true' if this is a null association (that is, no vertex)
Definition: Vertexing.h:37
pat::VertexAssociation::vertex_
reco::VertexRef vertex_
Definition: Vertexing.h:88
edm::RefToBase< reco::Track >
pat::VertexAssociation::vertex
const reco::Vertex * vertex() const
Returns a pointer to the vertex, or a null pointer if there is no vertex (null association)
Definition: Vertexing.h:50
pat::VertexAssociation::operator->
const reco::Vertex * operator->() const
Allows VertexAssociation to behave like a vertex ref (e.g. to do "assoc->position()")
Definition: Vertexing.h:45
pat::VertexAssociation::hasErrors
bool hasErrors() const
True if the errors on dr and dz have been set, false if they're nulls.
Definition: Vertexing.h:66
reco::Vertex
Definition: Vertex.h:35