Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:35:39

0001 #ifndef CondFormats_HcalObjects_OOTPileupCorrectionColl_h
0002 #define CondFormats_HcalObjects_OOTPileupCorrectionColl_h
0003 
0004 #include <string>
0005 
0006 #include "boost/serialization/shared_ptr.hpp"
0007 #include "boost/serialization/map.hpp"
0008 
0009 #include "CondFormats/HcalObjects/interface/AbsOOTPileupCorrection.h"
0010 
0011 class OOTPileupCorrectionColl {
0012 public:
0013   inline void add(const std::string& name, const std::string& category, std::shared_ptr<AbsOOTPileupCorrection> ptr) {
0014     data_[category][name] = ptr;
0015   }
0016 
0017   inline void clear() { data_.clear(); }
0018 
0019   inline bool empty() const { return data_.empty(); }
0020 
0021   std::shared_ptr<AbsOOTPileupCorrection> get(const std::string& name, const std::string& category) const;
0022 
0023   bool exists(const std::string& name, const std::string& category) const;
0024 
0025   bool operator==(const OOTPileupCorrectionColl& r) const;
0026 
0027   inline bool operator!=(const OOTPileupCorrectionColl& r) const { return !(*this == r); }
0028 
0029 private:
0030   typedef std::map<std::string, std::shared_ptr<AbsOOTPileupCorrection> > PtrMap;
0031   typedef std::map<std::string, PtrMap> DataMap;
0032   DataMap data_;
0033 
0034   friend class boost::serialization::access;
0035 
0036   template <class Archive>
0037   inline void serialize(Archive& ar, unsigned /* version */) {
0038     ar & data_;
0039   }
0040 };
0041 
0042 #endif  // CondFormats_HcalObjects_OOTPileupCorrectionColl_h