CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexCompatibleWithBeam.cc
Go to the documentation of this file.
5 
6 using namespace reco;
7 
9  float cut)
10  : theDistance(d.clone()), theCut(cut)
11 {
13  theBeam = VertexState(beamSpot);
14 }
15 
17  float cut, const BeamSpot & beamSpot)
18  : theDistance(d.clone()), theCut(cut), theBeam(beamSpot){}
19 
20 
22  const VertexCompatibleWithBeam & other) :
23  theDistance((*other.theDistance).clone()),
24  theCut(other.theCut), theBeam(other.theBeam) {}
25 
26 
28  delete theDistance;
29 }
30 
31 
34 {
35  if (this == &other) return *this;
36 
37  theDistance = (*other.theDistance).clone();
38  theCut = other.theCut;
39  theBeam = other.theBeam;
40  return *this;
41 }
42 
44  theBeam = VertexState(beamSpot);
45 }
46 
48 {
50  VertexState vs(p, GlobalError(v.covariance()));
51  return (theDistance->distance(vs, theBeam).value() < theCut);
52 }
53 
54 
56 {
58  VertexState vs(p, GlobalError(v.covariance()));
59  return theDistance->distance(vs, theBeam).value();
60 }
61 
62 
63 float VertexCompatibleWithBeam::distanceToBeam(const reco::Vertex & v, const VertexState & bs) const
64 {
66  VertexState vs(p, GlobalError(v.covariance()));
67  return theDistance->distance(vs, bs).value();
68 }
69 
70 
71 bool VertexCompatibleWithBeam::operator()(const reco::Vertex & v, const VertexState & bs) const
72 {
74  VertexState vs(p, GlobalError(v.covariance()));
75  return (theDistance->distance(vs, bs).value() < theCut);
76 }
77 
78 
virtual bool operator()(const reco::Vertex &) const
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:109
const Point & position() const
position
Definition: Vertex.h:92
VertexCompatibleWithBeam(const VertexDistance &dist, float cut)
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:11
void setBeamSpot(const reco::BeamSpot &beamSpot)
Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const
double value() const
Definition: Measurement1D.h:28
tuple clone
Definition: statics.py:58
float distanceToBeam(const reco::Vertex &) const
VertexCompatibleWithBeam & operator=(const VertexCompatibleWithBeam &other)