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
,
float
cut
)
9
: theDistance(d.
clone
()), theCut(cut) {
10
BeamSpot
beamSpot
;
11
theBeam
=
VertexState
(beamSpot);
12
}
13
14
VertexCompatibleWithBeam::VertexCompatibleWithBeam
(
const
VertexDistance
&
d
,
float
cut
,
const
BeamSpot
&
beamSpot
)
15
:
theDistance
(d.
clone
()),
theCut
(cut),
theBeam
(beamSpot) {}
16
17
VertexCompatibleWithBeam::VertexCompatibleWithBeam
(
const
VertexCompatibleWithBeam
&
other
)
18
:
theDistance
((*other.
theDistance
).
clone
()),
theCut
(other.
theCut
),
theBeam
(other.
theBeam
) {}
19
20
VertexCompatibleWithBeam::~VertexCompatibleWithBeam
() {
delete
theDistance
; }
21
22
VertexCompatibleWithBeam
&
VertexCompatibleWithBeam::operator=
(
const
VertexCompatibleWithBeam
&
other
) {
23
if
(
this
== &other)
24
return
*
this
;
25
26
theDistance
= (*other.
theDistance
).
clone
();
27
theCut
= other.
theCut
;
28
theBeam
= other.
theBeam
;
29
return
*
this
;
30
}
31
32
void
VertexCompatibleWithBeam::setBeamSpot
(
const
BeamSpot
&
beamSpot
) {
theBeam
=
VertexState
(beamSpot); }
33
34
bool
VertexCompatibleWithBeam::operator()
(
const
reco::Vertex
&
v
)
const
{
35
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
36
VertexState
vs(p,
GlobalError
(v.
covariance
()));
37
return
(
theDistance
->
distance
(vs,
theBeam
).
value
() <
theCut
);
38
}
39
40
float
VertexCompatibleWithBeam::distanceToBeam
(
const
reco::Vertex
&
v
)
const
{
41
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
42
VertexState
vs(p,
GlobalError
(v.
covariance
()));
43
return
theDistance
->
distance
(vs,
theBeam
).
value
();
44
}
45
46
float
VertexCompatibleWithBeam::distanceToBeam
(
const
reco::Vertex
&
v
,
const
VertexState
& bs)
const
{
47
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
48
VertexState
vs(p,
GlobalError
(v.
covariance
()));
49
return
theDistance
->
distance
(vs, bs).
value
();
50
}
51
52
bool
VertexCompatibleWithBeam::operator()
(
const
reco::Vertex
&
v
,
const
VertexState
& bs)
const
{
53
GlobalPoint
p
(
Basic3DVector<float>
(v.
position
()));
54
VertexState
vs(p,
GlobalError
(v.
covariance
()));
55
return
(
theDistance
->
distance
(vs, bs).
value
() <
theCut
);
56
}
VertexCompatibleWithBeam::theBeam
VertexState theBeam
Definition:
VertexCompatibleWithBeam.h:35
VertexCompatibleWithBeam::theDistance
VertexDistance * theDistance
Definition:
VertexCompatibleWithBeam.h:33
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
GlobalError.h
VertexCompatibleWithBeam.h
GlobalError
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition:
GlobalError.h:13
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition:
pwdgSkimBPark_cfi.py:5
VertexCompatibleWithBeam::operator()
virtual bool operator()(const reco::Vertex &) const
Definition:
VertexCompatibleWithBeam.cc:34
reco::Vertex::covariance
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition:
Vertex.h:134
VertexCompatibleWithBeam::~VertexCompatibleWithBeam
virtual ~VertexCompatibleWithBeam()
Definition:
VertexCompatibleWithBeam.cc:20
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
VertexCompatibleWithBeam::theCut
float theCut
Definition:
VertexCompatibleWithBeam.h:34
reco::Vertex::position
const Point & position() const
position
Definition:
Vertex.h:113
VertexCompatibleWithBeam::VertexCompatibleWithBeam
VertexCompatibleWithBeam(const VertexDistance &dist, float cut)
Definition:
VertexCompatibleWithBeam.cc:8
VertexDistance.h
reco::Vertex
Definition:
Vertex.h:34
Basic3DVector< float >
VertexCompatibleWithBeam::setBeamSpot
void setBeamSpot(const reco::BeamSpot &beamSpot)
Definition:
VertexCompatibleWithBeam.cc:32
trackingPlots.other
other
Definition:
trackingPlots.py:1455
ztail.d
d
Definition:
ztail.py:151
VertexDistance::distance
Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const
Definition:
VertexDistance.cc:26
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:25
Point3DBase< float, GlobalTag >
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
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:40
VertexState
Definition:
VertexState.h:13
reco::BeamSpot
Definition:
BeamSpot.h:21
GlobalPoint.h
VertexCompatibleWithBeam::operator=
VertexCompatibleWithBeam & operator=(const VertexCompatibleWithBeam &other)
Definition:
VertexCompatibleWithBeam.cc:22
Generated for CMSSW Reference Manual by
1.8.11