Main Page
Namespaces
Classes
Package Documentation
RecoVertex
VertexTools
src
VertexCompatibleWithBeam.cc
Go to the documentation of this file.
1
#include "
RecoVertex/VertexTools/interface/VertexCompatibleWithBeam.h
"
2
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
3
#include "
DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h
"
4
#include "
RecoVertex/VertexTools/interface/VertexDistance.h
"
5
6
using namespace
reco
;
7
8
VertexCompatibleWithBeam::VertexCompatibleWithBeam
(
const
VertexDistance
&
d
,
9
float
cut
)
10
: theDistance(d.
clone
()), theCut(cut)
11
{
12
BeamSpot
beamSpot
;
13
theBeam
=
VertexState
(beamSpot);
14
}
15
16
VertexCompatibleWithBeam::VertexCompatibleWithBeam
(
const
VertexDistance
&
d
,
17
float
cut
,
const
BeamSpot
&
beamSpot
)
18
:
theDistance
(d.
clone
()),
theCut
(cut),
theBeam
(beamSpot){}
19
20
21
VertexCompatibleWithBeam::VertexCompatibleWithBeam
(
22
const
VertexCompatibleWithBeam
&
other
) :
23
theDistance
((*other.
theDistance
).
clone
()),
24
theCut
(other.
theCut
),
theBeam
(other.
theBeam
) {}
25
26
27
VertexCompatibleWithBeam::~VertexCompatibleWithBeam
() {
28
delete
theDistance
;
29
}
30
31
32
VertexCompatibleWithBeam
&
33
VertexCompatibleWithBeam::operator=
(
const
VertexCompatibleWithBeam
&
other
)
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
43
void
VertexCompatibleWithBeam::setBeamSpot
(
const
BeamSpot
&
beamSpot
){
44
theBeam
=
VertexState
(beamSpot);
45
}
46
47
bool
VertexCompatibleWithBeam::operator()
(
const
reco::Vertex
&
v
)
const
48
{
49
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
50
VertexState
vs(p,
GlobalError
(v.
covariance
()));
51
return
(
theDistance
->
distance
(vs,
theBeam
).
value
() <
theCut
);
52
}
53
54
55
float
VertexCompatibleWithBeam::distanceToBeam
(
const
reco::Vertex
&
v
)
const
56
{
57
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
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
{
65
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
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
{
73
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
74
VertexState
vs(p,
GlobalError
(v.
covariance
()));
75
return
(
theDistance
->
distance
(vs, bs).
value
() <
theCut
);
76
}
77
78
VertexCompatibleWithBeam::theBeam
VertexState theBeam
Definition:
VertexCompatibleWithBeam.h:39
VertexCompatibleWithBeam::theDistance
VertexDistance * theDistance
Definition:
VertexCompatibleWithBeam.h:37
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
GlobalError.h
VertexCompatibleWithBeam.h
VertexCompatibleWithBeam::operator()
virtual bool operator()(const reco::Vertex &) const
Definition:
VertexCompatibleWithBeam.cc:47
reco::Vertex::covariance
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition:
Vertex.h:130
VertexCompatibleWithBeam::~VertexCompatibleWithBeam
virtual ~VertexCompatibleWithBeam()
Definition:
VertexCompatibleWithBeam.cc:27
findQualityFiles.v
v
Definition:
findQualityFiles.py:178
VertexCompatibleWithBeam::theCut
float theCut
Definition:
VertexCompatibleWithBeam.h:38
reco::Vertex::position
const Point & position() const
position
Definition:
Vertex.h:109
VertexCompatibleWithBeam::VertexCompatibleWithBeam
VertexCompatibleWithBeam(const VertexDistance &dist, float cut)
Definition:
VertexCompatibleWithBeam.cc:8
ecalDrivenElectronSeedsParameters_cff.beamSpot
beamSpot
Definition:
ecalDrivenElectronSeedsParameters_cff.py:15
GlobalError
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition:
GlobalError.h:13
VertexDistance.h
reco::Vertex
Definition:
Vertex.h:34
Basic3DVector< float >
VertexCompatibleWithBeam::setBeamSpot
void setBeamSpot(const reco::BeamSpot &beamSpot)
Definition:
VertexCompatibleWithBeam.cc:43
trackingPlots.other
other
Definition:
trackingPlots.py:1436
edmIntegrityCheck.d
d
Definition:
edmIntegrityCheck.py:66
VertexDistance::distance
Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const
Definition:
VertexDistance.cc:35
VertexCompatibleWithBeam
Definition:
VertexCompatibleWithBeam.h:15
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition:
eve_macros.cc:135
Measurement1D::value
double value() const
Definition:
Measurement1D.h:28
Point3DBase< float, GlobalTag >
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
TkAlMuonSelectors_cfi.cut
cut
Definition:
TkAlMuonSelectors_cfi.py:5
VertexDistance
Definition:
VertexDistance.h:16
VertexCompatibleWithBeam::distanceToBeam
float distanceToBeam(const reco::Vertex &) const
Definition:
VertexCompatibleWithBeam.cc:55
VertexState
Definition:
VertexState.h:13
reco::BeamSpot
Definition:
BeamSpot.h:22
GlobalPoint.h
VertexCompatibleWithBeam::operator=
VertexCompatibleWithBeam & operator=(const VertexCompatibleWithBeam &other)
Definition:
VertexCompatibleWithBeam.cc:33
Generated for CMSSW Reference Manual by
1.8.11