#include "Event.h" #include pool_tutorial::Event::Event(): m_eventNumber( 0 ), m_ecalDataRef(), m_hcalDataRef() {} pool_tutorial::Event::Event( int eventNumber ): m_eventNumber( eventNumber ), m_ecalDataRef(), m_hcalDataRef() {} pool_tutorial::Event::~Event() {} pool_tutorial::Event::Event( const Event& rhs ): m_eventNumber( rhs.m_eventNumber ), m_ecalDataRef( rhs.m_ecalDataRef ), // Note that these do not copy m_hcalDataRef( rhs.m_hcalDataRef ) // the actual Sector objects {} pool_tutorial::Event& pool_tutorial::Event::operator=( const pool_tutorial::Event& rhs ) { m_eventNumber = rhs.m_eventNumber; m_ecalDataRef = rhs.m_ecalDataRef; // Note that these do not copy m_hcalDataRef = rhs.m_hcalDataRef; // the actual Sector objects return *this; } void pool_tutorial::Event::setECalData( const pool::Ref< pool_tutorial::Sector >& ecalData ) { m_ecalDataRef = ecalData; } const pool_tutorial::Sector& pool_tutorial::Event::ecalData() const { if ( ! m_ecalDataRef ) { throw std::runtime_error( "Could not dereference non existing ECAL data reference" ); } return *m_ecalDataRef; } pool_tutorial::Sector& pool_tutorial::Event::ecalData() { if ( ! m_ecalDataRef ) { throw std::runtime_error( "Could not dereference non existing ECAL data reference" ); } return *m_ecalDataRef; } void pool_tutorial::Event::setHCalData( const pool::Ref< pool_tutorial::Sector >& hcalData ) { m_hcalDataRef = hcalData; } const pool_tutorial::Sector& pool_tutorial::Event::hcalData() const { if ( ! m_hcalDataRef ) { throw std::runtime_error( "Could not dereference non existing HCAL data reference" ); } return *m_hcalDataRef; } pool_tutorial::Sector& pool_tutorial::Event::hcalData() { if ( ! m_hcalDataRef ) { throw std::runtime_error( "Could not dereference non existing HCAL data reference" ); } return *m_hcalDataRef; } int pool_tutorial::Event::eventNumber() const { return m_eventNumber; }