CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
26 namespace pat {
28  public:
37  // --- Methods to mimick VertexRef
39  bool isNull() const { return vertex_.isNull(); }
41  bool isNonnull() const { return vertex_.isNonnull(); }
43  bool isAvailable() const { return vertex_.isAvailable(); }
45  const reco::Vertex & operator*() const { return * operator->(); }
47  const reco::Vertex * operator->() const { return vertex_.isNull() ? 0 : vertex_.get(); }
48  // --- Methods to get the Vertex and track
50  const reco::VertexRef & vertexRef() const { return vertex_; }
52  const reco::Vertex * vertex() const { return vertex_.isNull() ? 0 : vertex_.get(); }
54  bool hasTrack() const { return !track_.isNull(); }
56  const reco::TrackBaseRef & trackRef() const { return track_; }
58  const reco::Track * track() const { return hasTrack() ? track_.get() : 0; }
59  // --- Methods to return distances
62  const Measurement1DFloat & dz() const { return dz_; }
64  const Measurement1DFloat & dr() const { return dr_; }
66  bool hasTransverseIP() const { return (dr_.value() != 0); }
68  bool hasErrors() const { return (dz_.error() != 0) && ( !hasTransverseIP() || dr_.error() != 0 ); }
69  // ---- Methods to set distances
70  void setDz(const Measurement1DFloat & dz) { dz_ = dz; }
71  void setDr(const Measurement1DFloat & dr) { dr_ = dr; }
72  void setDz(const Measurement1D & dz) { dz_ = Measurement1DFloat(dz.value(), dz.error()); }
73  void setDr(const Measurement1D & dr) { dr_ = Measurement1DFloat(dr.value(), dr.error()); }
75  void setDistances(const AlgebraicVector3 & dist, const AlgebraicSymMatrix33 &err) ;
79  template<typename T1, typename T2>
80  void setDistances(const T1 & p1, const T2 &p2, const AlgebraicSymMatrix33 &err) {
81  AlgebraicVector3 dist(p1.x() - p2.x(), p1.y() - p2.y(), p1.z() - p2.z());
82  setDistances(dist, err);
83  }
84  // ---- 3D significance of the impact parameter
85  // float signif3d() const { return signif3d_; }
86  // bool hasSignif3d() const { return signif3d_ != 0; }
87  // void setSignif3d(float signif3d) { signif3d_ = signif3d; }
88  private:
89  // basic information
92  // float signif3d_;
93  // extended info
95  // fixme: add refitted momentum
96  };
97 }
98 
99 #endif
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
VertexAssociation()
Create a null vertx association.
Definition: Vertexing.h:30
bool isAvailable() const
Return &#39;true&#39; if the reco::Vertex is available in the file, false if it has been dropped.
Definition: Vertexing.h:43
bool isNonnull() const
Return &#39;true&#39; unless this is a null association (that is, no vertex)
Definition: Vertexing.h:41
void setDr(const Measurement1DFloat &dr)
Definition: Vertexing.h:71
bool isNull() const
Return &#39;true&#39; if this is a null association (that is, no vertex)
Definition: Vertexing.h:39
float error() const
double error() const
Definition: Measurement1D.h:30
bool isNull() const
Checks for null.
Definition: RefToBase.h:270
const reco::TrackBaseRef & trackRef() const
Returns a reference to the track stored in this vertex (can be null)
Definition: Vertexing.h:56
reco::VertexRef vertex_
Definition: Vertexing.h:90
VertexAssociation(const reco::VertexRef &vertex, const reco::TrackBaseRef &tk)
Definition: Vertexing.h:36
const Measurement1DFloat & dz() const
Definition: Vertexing.h:62
bool isAvailable() const
Definition: Ref.h:276
void setDz(const Measurement1D &dz)
Definition: Vertexing.h:72
bool hasTransverseIP() const
True if the transverse distance was computed for this VertexAssociation.
Definition: Vertexing.h:66
void setDz(const Measurement1DFloat &dz)
Definition: Vertexing.h:70
bool hasErrors() const
True if the errors on dr and dz have been set, false if they&#39;re nulls.
Definition: Vertexing.h:68
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const reco::Track * track() const
Returns a C++ pointer to the track stored in this vertex (can be a null pointer)
Definition: Vertexing.h:58
bool hasTrack() const
Returns &#39;true&#39; if a reference to a track was stored in this VertexAssociation.
Definition: Vertexing.h:54
bool isNull() const
Checks for null.
Definition: Ref.h:247
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
ROOT::Math::SVector< double, 3 > AlgebraicVector3
const reco::VertexRef & vertexRef() const
Returns the reference to the vertex (can be a null reference)
Definition: Vertexing.h:50
double p2[4]
Definition: TauolaWrapper.h:90
const reco::Vertex * operator->() const
Allows VertexAssociation to behave like a vertex ref (e.g. to do &quot;assoc-&gt;position()&quot;) ...
Definition: Vertexing.h:47
void setDr(const Measurement1D &dr)
Definition: Vertexing.h:73
const Measurement1DFloat & dr() const
Distance between the object and the vertex in the transverse plane, and it&#39;s error.
Definition: Vertexing.h:64
VertexAssociation(const reco::VertexRef &vertex)
Create a vertex association given a ref to a vertex.
Definition: Vertexing.h:32
float value() const
double value() const
Definition: Measurement1D.h:28
double p1[4]
Definition: TauolaWrapper.h:89
Measurement1DFloat dr_
Definition: Vertexing.h:91
Analysis-level structure for vertex-related information.
Definition: Vertexing.h:27
const reco::Vertex & operator*() const
Return the vertex (that is, you can do &quot;const reco::Vertex &amp;vtx = *assoc&quot;)
Definition: Vertexing.h:45
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:52
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
value_type const * get() const
Definition: RefToBase.h:212
void setDistances(const T1 &p1, const T2 &p2, const AlgebraicSymMatrix33 &err)
Definition: Vertexing.h:80
reco::TrackBaseRef track_
Definition: Vertexing.h:94
Measurement1DFloat dz_
Definition: Vertexing.h:91