ATLAS Offline Software
Loading...
Searching...
No Matches
EventDataBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef _InDet_EventDataBase_H_
5#define _InDet_EventDataBase_H_
6
7#include <stdexcept>
8#include <string>
9#include <typeinfo>
10
11namespace Trk {
12
15 template <class T_Derived, class T_Base>
16 class EventDataBase : public T_Base
17 {
18 protected:
19 inline static T_Derived &getPrivateEventData(T_Base &virt_event_data)
20 {
21 T_Derived *event_data = dynamic_cast<T_Derived *>(&virt_event_data);
22 if (!event_data) { throwMismtach(); }
23 return *event_data;
24 }
25
26 static void throwMismtach() {
27 throw std::logic_error(std::string("EventData mismatch, expecting ")
28 +typeid(T_Derived).name() + "::EventData.");
29 }
30
31 };
32}
33#endif
Base for a helper class to pass mutable storage to tools.
static T_Derived & getPrivateEventData(T_Base &virt_event_data)
static void throwMismtach()
Ensure that the ATLAS eigen extensions are properly loaded.