Skip to content

Commit 5eb36c1

Browse files
author
Changhwan Choi
committed
Codechecker
1 parent ba59bea commit 5eb36c1

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎PWGJE/DataModel/JetTagging.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ DECLARE_SOA_COLUMN(ScoreML, scoreML, float); //! GNN discriminant: one track-ori
220220
DECLARE_SOA_TABLE(_jet_type_##GnnTrackIds, "AOD", _description_ "I", \
221221
_jet_type_##gnntrackindices::_jet_type_##GnnTrackIds);
222222

223-
// #define DECLARE_JET_GNNEDGEINDEX_TABLE(_jet_type_, _description_) \
223+
/*
224+
#define DECLARE_JET_GNNEDGEINDEX_TABLE(_jet_type_, _description_) \
224225
namespace _jet_type_##gnnedgeindextable \
225226
{ \
226227
DECLARE_SOA_INDEX_COLUMN(_jet_type_, jet); \
@@ -236,6 +237,7 @@ DECLARE_SOA_COLUMN(ScoreML, scoreML, float); //! GNN discriminant: one track-ori
236237
} \
237238
DECLARE_SOA_TABLE(_jet_type_##GnnEdgeIds, "AOD", _description_ "I", \
238239
_jet_type_##gnnedgeindices::_jet_type_##GnnEdgeIds);
240+
*/
239241

240242
// In-jet track/edge index backbone tables (own the in-jet ordering + the back-reference to the original track)
241243
DECLARE_JET_GNNTRACKINDEX_TABLE(ChargedJet, "CJGNT");

‎PWGJE/TableProducer/jetGnnInference.cxx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#include <onnxruntime_cxx_api.h>
4343

44+
#include <array>
4445
#include <cmath>
4546
#include <cstddef>
4647
#include <cstdint>
@@ -64,7 +65,7 @@ struct OptionalProduces<void> {
6465

6566
template <bool isMCD, typename JetTable, typename JetTaggingTable, typename JetGnnTrackIdsTable, typename JetGnnTracksTable, typename JetGnnInfTrackTable = void, typename JetGnnInfVertexTable = void>
6667
struct JetGnnInferenceTask {
67-
static constexpr double DefaultCutsMl[1][3] = {{0.5, 0.5, 0.5}};
68+
static constexpr std::array<double, 3> defaultCutsMl = {0.5, 0.5, 0.5};
6869
static constexpr float invalidGnnScore = -999.f;
6970
static constexpr float largeNegativeNumber = -98.f;
7071
static constexpr float largePositiveNumber = 9999.f;
@@ -96,7 +97,7 @@ struct JetGnnInferenceTask {
9697

9798
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{5., 1000.}, "pT bin limits for ML application"};
9899
Configurable<std::vector<int>> cutDirMl{"cutDirMl", std::vector<int>{cuts_ml::CutSmaller, cuts_ml::CutNot, cuts_ml::CutNot}, "Whether to reject score values greater or smaller than the threshold"};
99-
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {DefaultCutsMl[0], 1, 3, {"pT bin 0"}, {"b", "c", "lf"}}, "ML selections per pT bin"};
100+
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {defaultCutsMl.data(), 1, 3, {"pT bin 0"}, {"b", "c", "lf"}}, "ML selections per pT bin"};
100101
Configurable<int> nClassesMl{"nClassesMl", 3, "Number of classes in ML model"};
101102

102103
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -198,7 +199,7 @@ struct JetGnnInferenceTask {
198199
if (jet.pt() < jetpTMin) {
199200
return;
200201
}
201-
float dbRange;
202+
float dbRange = -0.5;
202203
if (db < dbMin) {
203204
dbRange = 0.5; // underflow
204205
} else if (db < dbMax) {
@@ -378,7 +379,7 @@ struct JetGnnInferenceTask {
378379
std::vector<Ort::Value> gnnInput;
379380
tensorAlloc.getGNNInput(jetFeat, trkFeat, feat, gnnInput);
380381

381-
float db;
382+
float db = invalidGnnScore;
382383
if (trackScores) {
383384
// Exported head order: edge_outputs, node_outputs, flav_preds.
384385
// Retrieve jet and track logits in one model evaluation; leave edges unused.

‎PWGJE/Tasks/bjetTaggingGnn.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ struct BjetTaggingGnn {
19001900
return;
19011901
}
19021902
// Uses only collisionId % trainingDatasetRatioParam != 0 for evaluation.
1903-
if (trainingDatasetRatioParam && collision.collisionId() % trainingDatasetRatioParam == 0) {
1903+
if (trainingDatasetRatioParam != 0 && collision.collisionId() % trainingDatasetRatioParam == 0) {
19041904
return;
19051905
}
19061906
bool matchedMcColl = collision.has_mcCollision();

‎PWGJE/Tasks/bjetTreeCreator.cxx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
#include <unordered_set>
5151
#include <vector>
5252

53-
#include <math.h>
54-
5553
using namespace o2;
5654
using namespace o2::framework;
5755
using namespace o2::framework::expressions;

0 commit comments

Comments
 (0)