CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FWBeamSpot Class Reference

#include <FWBeamSpot.h>

Public Member Functions

void checkBeamSpot (const edm::EventBase *event)
 
 FWBeamSpot ()
 
const reco::BeamSpotgetBeamSpot () const
 
double x0 () const
 
double x0Error () const
 
double y0 () const
 
double y0Error () const
 
double z0 () const
 
double z0Error () const
 
 ~FWBeamSpot ()
 

Private Attributes

const reco::BeamSpotm_beamspot
 

Detailed Description

Definition at line 11 of file FWBeamSpot.h.

Constructor & Destructor Documentation

◆ FWBeamSpot()

FWBeamSpot::FWBeamSpot ( )
inline

Definition at line 13 of file FWBeamSpot.h.

13 : m_beamspot(nullptr) {}

◆ ~FWBeamSpot()

FWBeamSpot::~FWBeamSpot ( )
inline

Definition at line 14 of file FWBeamSpot.h.

14 {}

Member Function Documentation

◆ checkBeamSpot()

void FWBeamSpot::checkBeamSpot ( const edm::EventBase event)

Definition at line 6 of file FWBeamSpot.cc.

6  {
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 }

References fwLog, edm::HandleBase::isValid(), fwlog::kWarning, m_beamspot, edm::Handle< T >::product(), and makeGlobalPositionRcd_cfg::tag.

Referenced by CmsShowMainBase::draw().

◆ getBeamSpot()

const reco::BeamSpot* FWBeamSpot::getBeamSpot ( ) const
inline

Definition at line 25 of file FWBeamSpot.h.

25 { return m_beamspot; }

References m_beamspot.

◆ x0()

double FWBeamSpot::x0 ( ) const

Definition at line 23 of file FWBeamSpot.cc.

23 { return m_beamspot ? m_beamspot->x0() : 0.0; }

References m_beamspot, and reco::BeamSpot::x0().

◆ x0Error()

double FWBeamSpot::x0Error ( ) const

Definition at line 29 of file FWBeamSpot.cc.

29 { return m_beamspot ? m_beamspot->x0Error() : 0.0; }

References m_beamspot, and reco::BeamSpot::x0Error().

◆ y0()

double FWBeamSpot::y0 ( ) const

Definition at line 25 of file FWBeamSpot.cc.

25 { return m_beamspot ? m_beamspot->y0() : 0.0; }

References m_beamspot, and reco::BeamSpot::y0().

◆ y0Error()

double FWBeamSpot::y0Error ( ) const

Definition at line 31 of file FWBeamSpot.cc.

31 { return m_beamspot ? m_beamspot->y0Error() : 0.0; }

References m_beamspot, and reco::BeamSpot::y0Error().

◆ z0()

double FWBeamSpot::z0 ( ) const

Definition at line 27 of file FWBeamSpot.cc.

27 { return m_beamspot ? m_beamspot->z0() : 0.0; }

References m_beamspot, and reco::BeamSpot::z0().

◆ z0Error()

double FWBeamSpot::z0Error ( ) const

Definition at line 33 of file FWBeamSpot.cc.

33 { return m_beamspot ? m_beamspot->z0Error() : 0.0; }

References m_beamspot, and reco::BeamSpot::z0Error().

Member Data Documentation

◆ m_beamspot

const reco::BeamSpot* FWBeamSpot::m_beamspot
private

Definition at line 28 of file FWBeamSpot.h.

Referenced by checkBeamSpot(), getBeamSpot(), x0(), x0Error(), y0(), y0Error(), z0(), and z0Error().

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
reco::BeamSpot::z0
double z0() const
z coordinate
Definition: BeamSpot.h:65
edm::Handle< reco::BeamSpot >
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition: BeamSpot.h:88
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition: BeamSpot.h:90
fwlog::kWarning
Definition: fwLog.h:35
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
cms::Exception
Definition: Exception.h:70
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
edm::InputTag
Definition: InputTag.h:15