39 ClassImp(RooAICRegistry);
44 RooAICRegistry::RooAICRegistry(UInt_t size)
45 : _clArr(0), _asArr1(0), _asArr2(0), _asArr3(0), _asArr4(0)
48 _asArr1.reserve(size);
49 _asArr2.reserve(size);
50 _asArr3.reserve(size);
51 _asArr4.reserve(size);
57 RooAICRegistry::RooAICRegistry(
const RooAICRegistry& other)
58 : _clArr(other._clArr), _asArr1(other._clArr.size(), 0), _asArr2(other._clArr.size(), 0),
59 _asArr3(other._clArr.size(), 0), _asArr4(other._clArr.size(), 0)
62 UInt_t size = other._clArr.size();
64 _asArr1.resize(size, 0);
65 _asArr2.resize(size, 0);
66 _asArr3.resize(size, 0);
67 _asArr4.resize(size, 0);
68 for(UInt_t i = 0; i < size; ++i) {
69 _asArr1[i] = other._asArr1[i] ? ((RooArgSet*)other._asArr1[i]->snapshot(kFALSE)) : 0;
70 _asArr2[i] = other._asArr2[i] ? ((RooArgSet*)other._asArr2[i]->snapshot(kFALSE)) : 0;
71 _asArr3[i] = other._asArr3[i] ? ((RooArgSet*)other._asArr3[i]->snapshot(kFALSE)) : 0;
72 _asArr4[i] = other._asArr4[i] ? ((RooArgSet*)other._asArr4[i]->snapshot(kFALSE)) : 0;
80 RooAICRegistry::~RooAICRegistry()
83 for (
unsigned int i = 0; i < _clArr.size(); ++i) {
84 if (_asArr1[i])
delete _asArr1[i];
85 if (_asArr2[i])
delete _asArr2[i];
86 if (_asArr3[i])
delete _asArr3[i];
87 if (_asArr4[i])
delete _asArr4[i];
101 Int_t RooAICRegistry::store(
const std::vector<Int_t>& codeList, RooArgSet* set1,
102 RooArgSet* set2, RooArgSet* set3, RooArgSet* set4)
105 for (UInt_t i = 0; i < _clArr.size(); ++i) {
107 Bool_t match(kTRUE) ;
110 match &= _clArr[i] == codeList;
113 if (_asArr1[i] && !set1) match=kFALSE ;
114 if (!_asArr1[i] && set1) match=kFALSE ;
115 if (_asArr2[i] && !set2) match=kFALSE ;
116 if (!_asArr2[i] && set2) match=kFALSE ;
117 if (_asArr3[i] && !set3) match=kFALSE ;
118 if (!_asArr3[i] && set3) match=kFALSE ;
119 if (_asArr4[i] && !set4) match=kFALSE ;
120 if (!_asArr4[i] && set4) match=kFALSE ;
123 if (_asArr1[i] && set1 && !set1->equals(*_asArr1[i])) match=kFALSE ;
124 if (_asArr2[i] && set2 && !set2->equals(*_asArr2[i])) match=kFALSE ;
125 if (_asArr3[i] && set3 && !set3->equals(*_asArr3[i])) match=kFALSE ;
126 if (_asArr4[i] && set4 && !set4->equals(*_asArr4[i])) match=kFALSE ;
129 if (set1)
delete set1 ;
130 if (set2)
delete set2 ;
131 if (set3)
delete set3 ;
132 if (set4)
delete set4 ;
138 _clArr.push_back(codeList);
139 _asArr1.push_back(set1 ? (RooArgSet*)set1->snapshot(kFALSE) : 0);
140 _asArr2.push_back(set2 ? (RooArgSet*)set2->snapshot(kFALSE) : 0);
141 _asArr3.push_back(set3 ? (RooArgSet*)set3->snapshot(kFALSE) : 0);
142 _asArr4.push_back(set4 ? (RooArgSet*)set4->snapshot(kFALSE) : 0);
144 if (set1)
delete set1 ;
145 if (set2)
delete set2 ;
146 if (set3)
delete set3 ;
147 if (set4)
delete set4 ;
148 return _clArr.size() - 1;
154 const std::vector<Int_t>& RooAICRegistry::retrieve(Int_t masterCode)
const
156 return _clArr[masterCode] ;
163 const std::vector<Int_t>& RooAICRegistry::retrieve(Int_t masterCode, pRooArgSet& set1)
const
165 set1 = _asArr1[masterCode] ;
166 return _clArr[masterCode] ;
174 const std::vector<Int_t>& RooAICRegistry::retrieve
175 (Int_t masterCode, pRooArgSet& set1, pRooArgSet& set2)
const
177 set1 = _asArr1[masterCode] ;
178 set2 = _asArr2[masterCode] ;
179 return _clArr[masterCode] ;
187 const std::vector<Int_t>& RooAICRegistry::retrieve
188 (Int_t masterCode, pRooArgSet& set1, pRooArgSet& set2, pRooArgSet& set3, pRooArgSet& set4)
const
190 set1 = _asArr1[masterCode] ;
191 set2 = _asArr2[masterCode] ;
192 set3 = _asArr3[masterCode] ;
193 set4 = _asArr4[masterCode] ;
194 return _clArr[masterCode] ;