CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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; }
double z0() const
z coordinate
Definition: BeamSpot.h:65
double z0Error() const
Definition: FWBeamSpot.cc:33
double x0() const
Definition: FWBeamSpot.cc:23
double z0() const
Definition: FWBeamSpot.cc:27
double y0() const
Definition: FWBeamSpot.cc:25
double y0Error() const
Definition: FWBeamSpot.cc:31
double x0Error() const
Definition: FWBeamSpot.cc:29
void checkBeamSpot(const edm::EventBase *event)
Definition: FWBeamSpot.cc:6
const reco::BeamSpot * m_beamspot
Definition: FWBeamSpot.h:28
bool isValid() const
Definition: HandleBase.h:70
double z0Error() const
error on z
Definition: BeamSpot.h:90
double x0Error() const
error on x
Definition: BeamSpot.h:86
double y0Error() const
error on y
Definition: BeamSpot.h:88
T const * product() const
Definition: Handle.h:70
#define fwLog(_level_)
Definition: fwLog.h:45
double y0() const
y coordinate
Definition: BeamSpot.h:63
double x0() const
x coordinate
Definition: BeamSpot.h:61