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
try
{
8
edm::InputTag
tag
(
"offlineBeamSpot"
);
9
edm::Handle<reco::BeamSpot>
spot;
10
11
event
->getByLabel(
tag
, spot);
12
if
(spot.
isValid
()) {
13
m_beamspot
= spot.
product
();
14
}
else
{
15
m_beamspot
=
nullptr
;
16
}
17
}
catch
(
cms::Exception
& iException) {
18
fwLog
(
fwlog::kWarning
) <<
"Can't get beam spot info. Setting coordintes to (0, 0, 0).\n"
;
19
m_beamspot
=
nullptr
;
20
}
21
}
22
23
double
FWBeamSpot::x0
()
const
{
return
m_beamspot
?
m_beamspot
->
x0
() : 0.0; }
24
25
double
FWBeamSpot::y0
()
const
{
return
m_beamspot
?
m_beamspot
->
y0
() : 0.0; }
26
27
double
FWBeamSpot::z0
()
const
{
return
m_beamspot
?
m_beamspot
->
z0
() : 0.0; }
28
29
double
FWBeamSpot::x0Error
()
const
{
return
m_beamspot
?
m_beamspot
->
x0Error
() : 0.0; }
30
31
double
FWBeamSpot::y0Error
()
const
{
return
m_beamspot
?
m_beamspot
->
y0Error
() : 0.0; }
32
33
double
FWBeamSpot::z0Error
()
const
{
return
m_beamspot
?
m_beamspot
->
z0Error
() : 0.0; }
FWBeamSpot::y0Error
double y0Error() const
Definition:
FWBeamSpot.cc:31
FWBeamSpot::z0Error
double z0Error() const
Definition:
FWBeamSpot.cc:33
FWBeamSpot::y0
double y0() const
Definition:
FWBeamSpot.cc:25
edm::Handle< reco::BeamSpot >
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
reco::BeamSpot::x0Error
double x0Error() const
error on x
Definition:
BeamSpot.h:86
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition:
BeamSpot.h:90
EventBase.h
FWBeamSpot.h
FWBeamSpot::checkBeamSpot
void checkBeamSpot(const edm::EventBase *event)
Definition:
FWBeamSpot.cc:6
reco::BeamSpot::x0
double x0() const
x coordinate
Definition:
BeamSpot.h:61
makeGlobalPositionRcd_cfg.tag
tag
Definition:
makeGlobalPositionRcd_cfg.py:6
FWBeamSpot::m_beamspot
const reco::BeamSpot * m_beamspot
Definition:
FWBeamSpot.h:28
FWBeamSpot::x0Error
double x0Error() const
Definition:
FWBeamSpot.cc:29
reco::BeamSpot::y0
double y0() const
y coordinate
Definition:
BeamSpot.h:63
edm::EventBase
Definition:
EventBase.h:47
fwLog
#define fwLog(_level_)
Definition:
fwLog.h:45
cms::Exception
Definition:
Exception.h:70
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
reco::BeamSpot::z0
double z0() const
z coordinate
Definition:
BeamSpot.h:65
edm::InputTag
Definition:
InputTag.h:15
fwLog.h
BeamSpot.h
event
Definition:
event.py:1
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition:
BeamSpot.h:88
FWBeamSpot::z0
double z0() const
Definition:
FWBeamSpot.cc:27
FWBeamSpot::x0
double x0() const
Definition:
FWBeamSpot.cc:23
fwlog::kWarning
Definition:
fwLog.h:35
Generated for CMSSW Reference Manual by
1.8.14