CMS 3D CMS Logo

DetID.h
Go to the documentation of this file.
1 #ifndef CondFormats_External_DETID_H
2 #define CondFormats_External_DETID_H
3 
4 #include <boost/serialization/base_object.hpp>
5 #include <boost/serialization/nvp.hpp>
6 #include <boost/serialization/split_free.hpp>
7 
8 // std::vector used in DataFormats/EcalDetId/interface/EcalContainer.h
9 #include <boost/serialization/vector.hpp>
10 #include <boost/serialization/string.hpp>
11 #include <boost/serialization/map.hpp>
12 
14 
15 
16 namespace boost {
17 namespace serialization {
18 
19 /*
20  * Note regarding object tracking: all autos used here
21  * must resolve to untracked types, since we use local
22  * variables in the stack which could end up with the same
23  * address. For the moment, all types resolved by auto here
24  * are primitive types, which are untracked by default
25  * by Boost Serialization.
26  */
27 
28 // DataFormats/DetId/interface/DetId.h
29 template<class Archive>
30 void save(Archive & ar, const DetId & obj, const unsigned int)
31 {
32  auto id_ = obj.rawId();
33  ar & BOOST_SERIALIZATION_NVP(id_);
34 }
35 
36 template<class Archive>
37 void load(Archive & ar, DetId & obj, const unsigned int)
38 {
39  decltype(obj.rawId()) id_;
40  ar & BOOST_SERIALIZATION_NVP(id_);
41  obj = DetId(id_);
42 }
43 
44 template<class Archive>
45 void serialize(Archive & ar, DetId & obj, const unsigned int v)
46 {
47  split_free(ar, obj, v);
48 }
49 
50 } // namespace serialization
51 } // namespace boost
52 
53 #endif
Definition: CLHEP.h:16
void serialize(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int v)
Definition: CLHEP.h:53
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void load(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int)
Definition: CLHEP.h:41
void save(Archive &ar, const CLHEP::Hep3Vector &obj, const unsigned int)
Definition: CLHEP.h:30
Definition: DetId.h:18