ATLAS Offline Software
Loading...
Searching...
No Matches
TVirtualEvent.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef XAODROOTACCESSINTERFACES_TVIRTUALEVENT_H
6#define XAODROOTACCESSINTERFACES_TVIRTUALEVENT_H
7
8// Project include(s).
9#include "SGCore/sgkey_t.h"
10
11// Forward declaration(s):
12namespace std {
13 class type_info;
14}
15
16namespace xAOD {
17
27
28 public:
30
32 virtual ~TVirtualEvent() = default;
33
35 static constexpr sgkey_t DEFAULT_KEY = ~static_cast<sgkey_t>(0);
37 static constexpr sgkey_t KEY_MASK = DEFAULT_KEY >> 2;
38
40 template< typename T >
41 bool retrieve( const T*& obj, sgkey_t key = DEFAULT_KEY,
42 bool silent = false );
44 template< typename T >
45 bool retrieve( const T*& obj, const std::string& key,
46 bool silent = false );
47
49 virtual sgkey_t getHash( const std::string& key ) const = 0;
51 virtual sgkey_t getKey( const void* obj ) const = 0;
53 virtual const std::string& getName( const void* obj ) const = 0;
55 virtual const std::string& getName( sgkey_t hash ) const = 0;
56
57 protected:
59 virtual void* getOutputObject( sgkey_t key,
60 const std::type_info& ti ) = 0;
62 virtual const void* getInputObject( sgkey_t key,
63 const std::type_info& ti,
64 bool silent = false ) = 0;
65
66 }; // class TVirtualEvent
67
68} // namespace xAOD
69
70// Include the template implementation:
71#include "TVirtualEvent.icc"
72
73#endif // XAODROOTACCESSINTERFACES_TVIRTUALEVENT_H
Base interface for getting objects out of the input file.
virtual const std::string & getName(sgkey_t hash) const =0
Function returning the key describing a known object.
virtual sgkey_t getKey(const void *obj) const =0
Function returning the hash describing a known object.
bool retrieve(const T *&obj, sgkey_t key=DEFAULT_KEY, bool silent=false)
Function retrieving an object from the event (constant version)
bool retrieve(const T *&obj, const std::string &key, bool silent=false)
Function retrieving an object from the event (constant version)
virtual const void * getInputObject(sgkey_t key, const std::type_info &ti, bool silent=false)=0
Function for retrieving an input object in a non-template way.
virtual void * getOutputObject(sgkey_t key, const std::type_info &ti)=0
Function for retrieving an output object in a non-template way.
virtual sgkey_t getHash(const std::string &key) const =0
Function returning the hash describing an object's name/key.
virtual ~TVirtualEvent()=default
Virtual destructor to make vtable happy.
static constexpr sgkey_t DEFAULT_KEY
Key for retrieving the "default" object of a given type.
virtual const std::string & getName(const void *obj) const =0
Function returning the key describing a known object.
static constexpr sgkey_t KEY_MASK
Mask for the keys, used mostly internally.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.