ATLAS Offline Software
Loading...
Searching...
No Matches
QuantileFactory.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef CP_QUANTILEFACTORY_H
5#define CP_QUANTILEFACTORY_H
6
8#include <string>
9#include <nlohmann/json.hpp>
10
17
18 public:
19 using QuantileFunc = std::pair<size_t, std::function<int(const SG::AuxElement&)>>;
21 static QuantileFunc quantileFactory(const nlohmann::json& cfg);
22
26 static std::vector<float> parseEdges(const nlohmann::json& cfg);
27
28 private:
30 static QuantileFunc makeEnumerate(const nlohmann::json& cfg);
31
34 static QuantileFunc makeCategory(const nlohmann::json& cfg);
35
38 static QuantileFunc makeNodes(const nlohmann::json& cfg);
39
42 static QuantileFunc makeDense(const nlohmann::json& cfg);
43
44};
45
46#endif // CP_QUANTILEFACTORY_H
Base class for elements of a container that can have aux data.
Builds binning and quantisation functions from a JSON configuration.
std::pair< size_t, std::function< int(const SG::AuxElement &)> > QuantileFunc
static QuantileFunc makeEnumerate(const nlohmann::json &cfg)
Maps discrete values to category indices.
static QuantileFunc makeNodes(const nlohmann::json &cfg)
Builds a tree-based lookup structure for node-based binning, primarily used for pseudo-continuous 2D ...
static QuantileFunc makeDense(const nlohmann::json &cfg)
Combines multiple binning dimensions into a single flattened global index used for scale factor looku...
static QuantileFunc quantileFactory(const nlohmann::json &cfg)
Dispatch to the appropriate binning scheme based on the JSON config.
static std::vector< float > parseEdges(const nlohmann::json &cfg)
Parse an ordered list of bin edges from the JSON config.
static QuantileFunc makeCategory(const nlohmann::json &cfg)
Converts a continuous variable into a bin index using an ordered list of bin edges.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.