CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTPrescaleTable.h
Go to the documentation of this file.
1 #ifndef CondFormats_External_HLTPRESCALETABLE_H
2 #define CondFormats_External_HLTPRESCALETABLE_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 namespace boost {
16 namespace serialization {
17 
18 /*
19  * Note regarding object tracking: all autos used here
20  * must resolve to untracked types, since we use local
21  * variables in the stack which could end up with the same
22  * address. For the moment, all types resolved by auto here
23  * are primitive types, which are untracked by default
24  * by Boost Serialization.
25  */
26 
27 // DataFormats/HLTReco/interface/HLTPrescaleTable.h
28 template<class Archive>
29 void save(Archive & ar, const trigger::HLTPrescaleTable & obj, const unsigned int)
30 {
31  auto set = obj.set();
32  auto lab = obj.labels();
33  auto tab = obj.table();
34  ar & boost::serialization::make_nvp("set_" , set );
35  ar & boost::serialization::make_nvp("labels_", lab );
36  ar & boost::serialization::make_nvp("table_" , tab );
37 }
38 
39 template<class Archive>
40 void load(Archive & ar, trigger::HLTPrescaleTable & obj, const unsigned int)
41 {
42  // FIXME: avoid copying if we are OK getting a non-const reference
43  unsigned int set_;
44  std::vector<std::string> labels_;
45  std::map<std::string,std::vector<unsigned int> > table_;
46 
47  ar & boost::serialization::make_nvp("set_" , set_ );
48  ar & boost::serialization::make_nvp("labels_", labels_ );
49  ar & boost::serialization::make_nvp("table_" , table_ );
50  trigger::HLTPrescaleTable tmp(set_, labels_, table_);
51  obj = tmp;
52 
53 }
54 
55 template<class Archive>
56 void serialize(Archive & ar, trigger::HLTPrescaleTable & obj, const unsigned int v)
57 {
58  split_free(ar, obj, v);
59 }
60 
61 } // namespace serialization
62 } // namespace boost
63 
64 #endif
unsigned int set() const
low-level const accessors for data members
void serialize(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int v)
Definition: CLHEP.h:53
The single EDProduct containing the HLT Prescale Table.
const std::map< std::string, std::vector< unsigned int > > & table() const
const std::vector< std::string > & labels() const
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
Table table_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100