Main Page
Namespaces
Classes
Package Documentation
Fireworks
Core
src
FWBeamSpot.cc
Go to the documentation of this file.
1
#include "
Fireworks/Core/interface/FWBeamSpot.h
"
2
#include "
DataFormats/BeamSpot/interface/BeamSpot.h
"
3
#include "
FWCore/Common/interface/EventBase.h
"
4
#include "
Fireworks/Core/interface/fwLog.h
"
5
6
void
FWBeamSpot::checkBeamSpot
(
const
edm::EventBase
*
event
)
7
{
8
try
9
{
10
edm::InputTag
tag
(
"offlineBeamSpot"
);
11
edm::Handle<reco::BeamSpot>
spot;
12
13
event
->getByLabel(tag, spot);
14
if
(spot.
isValid
())
15
{
16
m_beamspot
= spot.
product
();
17
}
18
else
19
{
20
m_beamspot
=
nullptr
;
21
}
22
}
23
catch
(
cms::Exception
& iException)
24
{
25
fwLog
(
fwlog::kWarning
) <<
"Can't get beam spot info. Setting coordintes to (0, 0, 0).\n"
;
26
m_beamspot
=
nullptr
;
27
}
28
}
29
30
double
FWBeamSpot::x0
()
const
31
{
32
return
m_beamspot
?
m_beamspot
->
x0
() : 0.0;
33
}
34
35
double
FWBeamSpot::y0
()
const
36
{
37
return
m_beamspot
?
m_beamspot
->
y0
() : 0.0;
38
}
39
40
double
FWBeamSpot::z0
()
const
41
{
42
return
m_beamspot
?
m_beamspot
->
z0
() : 0.0;
43
}
44
45
double
FWBeamSpot::x0Error
()
const
46
{
47
return
m_beamspot
?
m_beamspot
->
x0Error
() : 0.0;
48
}
49
50
double
FWBeamSpot::y0Error
()
const
51
{
52
return
m_beamspot
?
m_beamspot
->
y0Error
() : 0.0;
53
}
54
55
double
FWBeamSpot::z0Error
()
const
56
{
57
return
m_beamspot
?
m_beamspot
->
z0Error
() : 0.0;
58
}
reco::BeamSpot::z0
double z0() const
z coordinate
Definition:
BeamSpot.h:68
FWBeamSpot::z0Error
double z0Error() const
Definition:
FWBeamSpot.cc:55
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
FWBeamSpot::x0
double x0() const
Definition:
FWBeamSpot.cc:30
FWBeamSpot::z0
double z0() const
Definition:
FWBeamSpot.cc:40
FWBeamSpot::y0
double y0() const
Definition:
FWBeamSpot.cc:35
edm::Handle< reco::BeamSpot >
EventBase.h
FWBeamSpot::y0Error
double y0Error() const
Definition:
FWBeamSpot.cc:50
FWBeamSpot.h
FWBeamSpot::x0Error
double x0Error() const
Definition:
FWBeamSpot.cc:45
FWBeamSpot::checkBeamSpot
void checkBeamSpot(const edm::EventBase *event)
Definition:
FWBeamSpot.cc:6
FWBeamSpot::m_beamspot
const reco::BeamSpot * m_beamspot
Definition:
FWBeamSpot.h:32
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:74
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition:
BeamSpot.h:94
edm::EventBase
Definition:
EventBase.h:46
reco::BeamSpot::x0Error
double x0Error() const
error on x
Definition:
BeamSpot.h:90
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition:
BeamSpot.h:92
edm::Handle::product
T const * product() const
Definition:
Handle.h:81
fwLog
#define fwLog(_level_)
Definition:
fwLog.h:50
cms::Exception
Definition:
Exception.h:67
edm::InputTag
Definition:
InputTag.h:15
fwLog.h
BeamSpot.h
reco::BeamSpot::y0
double y0() const
y coordinate
Definition:
BeamSpot.h:66
event
Definition:
event.py:1
fwlog::kWarning
Definition:
fwLog.h:38
reco::BeamSpot::x0
double x0() const
x coordinate
Definition:
BeamSpot.h:64
Generated for CMSSW Reference Manual by
1.8.11