1 #ifndef CondFormats_External_CLHEP_H 2 #define CondFormats_External_CLHEP_H 4 #include <boost/serialization/base_object.hpp> 5 #include <boost/serialization/nvp.hpp> 6 #include <boost/serialization/split_free.hpp> 9 #include <boost/serialization/vector.hpp> 10 #include <boost/serialization/string.hpp> 11 #include <boost/serialization/map.hpp> 13 #include "CLHEP/Vector/EulerAngles.h" 14 #include "CLHEP/Vector/ThreeVector.h" 17 namespace serialization {
29 template<
class Archive>
30 void save(Archive & ar,
const CLHEP::Hep3Vector &
obj,
const unsigned int)
35 ar & BOOST_SERIALIZATION_NVP(dx);
36 ar & BOOST_SERIALIZATION_NVP(dy);
37 ar & BOOST_SERIALIZATION_NVP(
dz);
40 template<
class Archive>
41 void load(Archive & ar, CLHEP::Hep3Vector &
obj,
const unsigned int)
46 ar & BOOST_SERIALIZATION_NVP(dx);
47 ar & BOOST_SERIALIZATION_NVP(dy);
48 ar & BOOST_SERIALIZATION_NVP(
dz);
52 template<
class Archive>
53 void serialize(Archive & ar, CLHEP::Hep3Vector &
obj,
const unsigned int v)
55 split_free(ar, obj, v);
60 template<
class Archive>
61 void save(Archive & ar,
const CLHEP::HepEulerAngles &
obj,
const unsigned int)
63 auto phi_ = obj.phi();
64 auto theta_ = obj.theta();
65 auto psi_ = obj.psi();
66 ar & BOOST_SERIALIZATION_NVP(phi_);
67 ar & BOOST_SERIALIZATION_NVP(theta_);
68 ar & BOOST_SERIALIZATION_NVP(psi_);
71 template<
class Archive>
72 void load(Archive & ar, CLHEP::HepEulerAngles &
obj,
const unsigned int)
74 decltype(obj.phi()) phi_;
75 decltype(obj.theta()) theta_;
76 decltype(obj.psi()) psi_;
77 ar & BOOST_SERIALIZATION_NVP(phi_);
78 ar & BOOST_SERIALIZATION_NVP(theta_);
79 ar & BOOST_SERIALIZATION_NVP(psi_);
80 obj.set(phi_, theta_, psi_);
83 template<
class Archive>
84 void serialize(Archive & ar, CLHEP::HepEulerAngles &
obj,
const unsigned int v)
86 split_free(ar, obj, v);
void serialize(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int v)
void load(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int)
void save(Archive &ar, const CLHEP::Hep3Vector &obj, const unsigned int)