ATLAS Offline Software
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 
11 namespace Trk {
12 
13 template <typename T_res, typename T_src>
14 const 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 
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
ReweightUtils.message
message
Definition: ReweightUtils.py:15
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ErrorScalingCast
const T_res * ErrorScalingCast(const T_src *src)
Definition: ErrorScalingCast.h:14