ATLAS Offline Software
Loading...
Searching...
No Matches
ErrorScalingCast.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef _ERRORSCALING_CAST_H_
5#define _ERRORSCALING_CAST_H_
6
7#include <sstream>
8#include <stdexcept>
9#include <typeinfo>
10
11namespace Trk {
12
13template <typename T_res, typename T_src>
14const T_res* ErrorScalingCast(const T_src* src) {
15
16 if (T_res::s_type != src->type()) {
17 std::stringstream message;
18 message << "Invalid RIO_OnTrackErrorScaling type. Expected "
19 << T_res::s_type << " But Received " << src->type();
20
21 throw std::runtime_error(message.str());
22 }
23 return static_cast<const T_res*>(src);
24}
25
26} // namespace Trk
27
28#endif
29
Ensure that the ATLAS eigen extensions are properly loaded.
const T_res * ErrorScalingCast(const T_src *src)