ATLAS Offline Software
Loading...
Searching...
No Matches
xAODEvent.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7// xAODEvent.h
8// Header file for classes xAODTEvent and xAODREvent
9// Author: Johannes Elmsheuser, Will Buttinger
11#ifndef ATHENAROOTCOMPS_XAODEVENT_H
12#define ATHENAROOTCOMPS_XAODEVENT_H
13
14// These classes exist purely to gain public access to the getInputObject method of
15// xAOD::Event. We need this because we cannot use the templated retrieve method.
16// xAODTEvent reads TTree and xAODREvent reads RNTuple input files.
17
18
21
22#include <string>
23#include <typeinfo>
24
25namespace xAOD {
26
28{
29 public:
31 : xAOD::TEvent (mode)
32 {
33 m_ctx = Gaudi::Hive::currentContext();
34 }
36};
37
39{
40 public:
42 {
43 m_ctx = Gaudi::Hive::currentContext();
44 }
45 using REvent::getInputObject;
46};
47
49inline const void* getInputObject(xAOD::Event& event, const std::string& key,
50 const std::type_info& ti, bool silent, bool metadata)
51{
52 if (auto* tevent = dynamic_cast<xAODTEvent*>(&event)) {
53 return tevent->getInputObject(key, ti, silent, metadata);
54 }
55 if (auto* revent = dynamic_cast<xAODREvent*>(&event)) {
56 return revent->getInputObject(key, ti, silent, metadata);
57 }
58 return nullptr;
59}
60
61} //> end namespace xAOD
62
63#endif //> !ATHENAROOTCOMPS_XAODEVENT_H
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
Definition Event.h:61
EventContext m_ctx
The event context associated with this event.
Definition Event.h:408
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent) override
Function for retrieving an input object in a non-template way.
Tool for accessing xAOD files outside of Athena, version RNTuple.
Definition REvent.h:33
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
TEvent(EAuxMode mode=kClassAccess)
Default constructor.
xAODTEvent(EAuxMode mode=kClassAccess)
Definition xAODEvent.h:30
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const void * getInputObject(xAOD::Event &event, const std::string &key, const std::type_info &ti, bool silent, bool metadata)
Retrieve an input object from an xAODTEvent or xAODREvent in a non-template way.
Definition xAODEvent.h:49