CMS 3D CMS Logo

FWBeamSpot.cc
Go to the documentation of this file.
5 
7 {
8  try
9  {
10  edm::InputTag tag("offlineBeamSpot");
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 }
double z0() const
z coordinate
Definition: BeamSpot.h:68
double z0Error() const
Definition: FWBeamSpot.cc:55
double x0() const
Definition: FWBeamSpot.cc:30
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
double y0Error() const
Definition: FWBeamSpot.cc:50
double x0Error() const
Definition: FWBeamSpot.cc:45
void checkBeamSpot(const edm::EventBase *event)
Definition: FWBeamSpot.cc:6
const reco::BeamSpot * m_beamspot
Definition: FWBeamSpot.h:32
bool isValid() const
Definition: HandleBase.h:74
double z0Error() const
error on z
Definition: BeamSpot.h:94
double x0Error() const
error on x
Definition: BeamSpot.h:90
double y0Error() const
error on y
Definition: BeamSpot.h:92
T const * product() const
Definition: Handle.h:81
#define fwLog(_level_)
Definition: fwLog.h:50
double y0() const
y coordinate
Definition: BeamSpot.h:66
Definition: event.py:1
double x0() const
x coordinate
Definition: BeamSpot.h:64