CMS 3D CMS Logo

FWBeamSpot.cc
Go to the documentation of this file.
5 
7  try {
8  edm::InputTag tag("offlineBeamSpot");
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::m_beamspot
const reco::BeamSpot * m_beamspot
Definition: FWBeamSpot.h:28
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
edm::Handle::product
T const * product() const
Definition: Handle.h:70
FWBeamSpot::x0Error
double x0Error() const
Definition: FWBeamSpot.cc:29
reco::BeamSpot::z0
double z0() const
z coordinate
Definition: BeamSpot.h:65
EventBase.h
edm::Handle< reco::BeamSpot >
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition: BeamSpot.h:88
FWBeamSpot::x0
double x0() const
Definition: FWBeamSpot.cc:23
FWBeamSpot::z0
double z0() const
Definition: FWBeamSpot.cc:27
BeamSpot.h
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
FWBeamSpot::y0
double y0() const
Definition: FWBeamSpot.cc:25
FWBeamSpot::z0Error
double z0Error() const
Definition: FWBeamSpot.cc:33
FWBeamSpot::y0Error
double y0Error() const
Definition: FWBeamSpot.cc:31
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition: BeamSpot.h:90
fwlog::kWarning
Definition: fwLog.h:35
fwLog.h
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
reco::BeamSpot::x0Error
double x0Error() const
error on x
Definition: BeamSpot.h:86
edm::EventBase
Definition: EventBase.h:46
FWBeamSpot.h
cms::Exception
Definition: Exception.h:70
FWBeamSpot::checkBeamSpot
void checkBeamSpot(const edm::EventBase *event)
Definition: FWBeamSpot.cc:6
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
edm::InputTag
Definition: InputTag.h:15