File indexing completed on 2025-12-15 10:29:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_NORMSET_CACHE
0017 #define ROO_NORMSET_CACHE
0018
0019 #include <RooArgSet.h>
0020
0021 #include <deque>
0022 #include <set>
0023 #include <string>
0024
0025 class RooNormSetCache {
0026
0027 public:
0028 RooNormSetCache(std::size_t max = 32) : _max(max) {}
0029
0030 inline bool contains(const RooArgSet* set1, const RooArgSet* set2 = nullptr,
0031 const TNamed* set2RangeName = nullptr)
0032 {
0033
0034 if (set2RangeName != _set2RangeName) return false;
0035 return _pairSet.find({RooFit::getUniqueId(set1), RooFit::getUniqueId(set2)}) != _pairSet.end();
0036 }
0037
0038 const std::string& nameSet1() const { return _name1; }
0039 const std::string& nameSet2() const { return _name2; }
0040
0041 bool autoCache(const RooAbsArg* self, const RooArgSet* set1,
0042 const RooArgSet* set2 = nullptr, const TNamed* set2RangeName = nullptr,
0043 bool autoRefill = true);
0044
0045 void clear();
0046
0047 private:
0048
0049 void add(const RooArgSet* set1, const RooArgSet* set2 = nullptr);
0050
0051 using Value_t = RooFit::UniqueId<RooArgSet>::Value_t;
0052 using Pair_t = std::pair<Value_t,Value_t>;
0053
0054 std::deque<Pair_t> _pairs;
0055 std::set<Pair_t> _pairSet;
0056 std::size_t _max;
0057
0058 std::string _name1;
0059 std::string _name2;
0060 TNamed* _set2RangeName = nullptr;
0061 };
0062
0063 #endif