ATLAS Offline Software
SgTEventMeta.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // xAOD include(s):
6 #ifdef XAOD_STANDALONE
8 # include "xAODRootAccess/TEvent.h"
9 #endif // XAOD_STANDALONE
10 
11 // Local include(s):
12 #include "AsgTools/SgTEventMeta.h"
13 
14 namespace asg {
15 
17  : m_type( type ), m_event( event ) {
18 
19  }
20 
29 
30  // Return right away if we already have a non-null pointer:
31  if( m_event ) {
32  return StatusCode::SUCCESS;
33  }
34 
35  // Check if there's an active event:
37  if( ! event ) {
38  std::cout << META_ERROR_SOURCE << "Couldn't find an active event in "
39  << "the job" << std::endl;
40  return StatusCode::FAILURE;
41  }
42 
43  // This should actually be a TEvent:
44  m_event = dynamic_cast< xAOD::TEvent* >( event );
45  if( ! m_event ) {
46  std::cout << META_ERROR_SOURCE << "The active event is not of type "
47  << "xAOD::TEvent?!?" << std::endl;
48  return StatusCode::FAILURE;
49  }
50 
51  // We succeeded:
52  return StatusCode::SUCCESS;
53  }
54 
55 } // namespace asg
xAOD::TVirtualEvent
Base interface for getting objects out of the input file.
Definition: TVirtualEvent.h:32
asg
Definition: DataHandleTestTool.h:28
asg::SgTEventMeta::StoreType
StoreType
Type of the store that this object implements.
Definition: SgTEventMeta.h:48
xAOD::TActiveEvent::event
static TVirtualEvent * event()
Access the currently active TVirtualEvent object.
Definition: TActiveEvent.cxx:16
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
asg::SgTEventMeta::initialize
StatusCode initialize() const
Function initialising the object.
Definition: SgTEventMeta.cxx:28
asg::SgTEventMeta::SgTEventMeta
SgTEventMeta(StoreType type, xAOD::TEvent *event=0)
Constructor with a type and an optional TEvent pointer.
Definition: SgTEventMeta.cxx:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TEvent.h
SgTEventMeta.h
asg::SgTEventMeta::m_event
xAOD::TEvent * m_event
Pointer to the xAOD::TEvent object in use.
Definition: SgTEventMeta.h:96
TActiveEvent.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:81