You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LOG(fatal) << "2D ML selection called on a class not configured for 2D bins";
251
+
}
252
+
int nModel = findBin2D(candVar1, candVar2);
253
+
output = getModelOutput(input, nModel);
254
+
uint8_t iClass{0};
255
+
for (constauto& outputValue : output) {
256
+
uint8_t dir = mCutDir.at(iClass);
257
+
if (dir != o2::cuts_ml::CutDirection::CutNot) {
258
+
if (dir == o2::cuts_ml::CutDirection::CutGreater && outputValue > mCuts.get(nModel, iClass)) {
259
+
returnfalse;
260
+
}
261
+
if (dir == o2::cuts_ml::CutDirection::CutSmaller && outputValue < mCuts.get(nModel, iClass)) {
262
+
returnfalse;
263
+
}
264
+
}
265
+
++iClass;
266
+
}
267
+
returntrue;
268
+
}
269
+
213
270
protected:
214
271
std::vector<o2::ml::OnnxModel> mModels; // OnnxModel objects, one for each bin
215
272
uint8_tmNModels = 1; // number of bins
216
273
uint8_tmNClasses = 3; // number of model classes
217
274
std::vector<double> mBinsLimits = {}; // bin limits of the variable (e.g. pT) used to select which model to use
275
+
std::vector<double> mBinsLimitsVar2 = {}; // bin limits of a second variable (e.g. multiplicity) used to select which model to use (not used in this base class)
218
276
std::vector<std::string> mPaths = {""}; // paths to the models, one for each bin
219
277
std::vector<int> mCutDir = {}; // direction of the cuts on the model scores (no cut is also supported)
220
278
o2::framework::LabeledArray<double> mCuts = {}; // array of cut values to apply on the model scores
221
279
std::map<std::string, uint8_t> mAvailableInputFeatures; // map of available input features
222
280
std::vector<uint8_t> mCachedIndices; // vector of index correspondance between configurables and available input features
281
+
uint8_tmNVar1Bins = 1; // number of bins of the first variable (e.g. pT) used to select which model to use
282
+
uint8_tmNVar2Bins = 1; // number of bins of the second variable (e.g. multiplicity) used to select which model to use
283
+
boolmUse2DBinning = false; // switch to enable/disable 2D binning
223
284
224
285
virtualvoidsetAvailableInputFeatures() { return; } // method to fill the map of available input features
0 commit comments