Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Tools/PIDML/simpleApplyPidOnnxInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ struct SimpleApplyOnnxInterface {
Configurable<bool> cfgUseCCDB{"useCCDB", true, "Whether to autofetch ML model from CCDB. If false, local file will be used."};
Configurable<std::string> cfgPathLocal{"local-path", "/home/mkabus/PIDML/", "base path to the local directory with ONNX models"};

Configurable<bool> cfgUseFixedTimestamp{"use-fixed-timestamp", false, "Whether to use fixed timestamp from configurable instead of timestamp calculated from the data"};
Configurable<uint64_t> cfgTimestamp{"timestamp", 1524176895000, "Hardcoded timestamp for tests"};

o2::ccdb::CcdbApi ccdbApi;
int currentRunNumber = -1;

Expand All @@ -75,7 +78,8 @@ struct SimpleApplyOnnxInterface {
{
auto bc = collisions.iteratorAt(0).bc_as<aod::BCsWithTimestamps>();
if (cfgUseCCDB && bc.runNumber() != currentRunNumber) {
pidInterface = PidONNXInterface(cfgPathLocal.value, cfgPathCCDB.value, cfgUseCCDB.value, ccdbApi, bc.timestamp(), cfgPids.value, cfgPTCuts.value, cfgCertainties.value, cfgAutoMode.value);
uint64_t timestamp = cfgUseFixedTimestamp ? cfgTimestamp.value : bc.timestamp();
pidInterface = PidONNXInterface(cfgPathLocal.value, cfgPathCCDB.value, cfgUseCCDB.value, ccdbApi, timestamp, cfgPids.value, cfgPTCuts.value, cfgCertainties.value, cfgAutoMode.value);
}

for (auto& track : tracks) {
Expand Down
6 changes: 5 additions & 1 deletion Tools/PIDML/simpleApplyPidOnnxModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct SimpleApplyOnnxModel {
Configurable<bool> cfgUseCCDB{"useCCDB", true, "Whether to autofetch ML model from CCDB. If false, local file will be used."};
Configurable<std::string> cfgPathLocal{"local-path", "/home/mkabus/PIDML", "base path to the local directory with ONNX models"};

Configurable<bool> cfgUseFixedTimestamp{"use-fixed-timestamp", false, "Whether to use fixed timestamp from configurable instead of timestamp calculated from the data"};
Configurable<uint64_t> cfgTimestamp{"timestamp", 1524176895000, "Hardcoded timestamp for tests"};

o2::ccdb::CcdbApi ccdbApi;
int currentRunNumber = -1;

Expand All @@ -73,7 +76,8 @@ struct SimpleApplyOnnxModel {
{
auto bc = collisions.iteratorAt(0).bc_as<aod::BCsWithTimestamps>();
if (cfgUseCCDB && bc.runNumber() != currentRunNumber) {
pidModel = PidONNXModel(cfgPathLocal.value, cfgPathCCDB.value, cfgUseCCDB.value, ccdbApi, bc.timestamp(), cfgPid.value, static_cast<PidMLDetector>(cfgDetector.value), cfgCertainty.value);
uint64_t timestamp = cfgUseFixedTimestamp ? cfgTimestamp.value : bc.timestamp();
pidModel = PidONNXModel(cfgPathLocal.value, cfgPathCCDB.value, cfgUseCCDB.value, ccdbApi, timestamp, cfgPid.value, static_cast<PidMLDetector>(cfgDetector.value), cfgCertainty.value);
}

for (auto& track : tracks) {
Expand Down