Skip to content

Commit 871aa51

Browse files
committed
Add variables to DQMLResponse and init setup
1 parent 3d049e8 commit 871aa51

File tree

3 files changed

+59
-7
lines changed

3 files changed

+59
-7
lines changed

PWGDQ/Core/DQMlResponse.h

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace o2::analysis
2828
{
2929

30-
enum class InputFeatures : uint8_t { // refer to DielectronsAll, TODO: add more features if needed
30+
enum class InputFeatures : uint8_t { // refer to DielectronsAll
3131
kMass = 0,
3232
kPt,
3333
kEta,
@@ -57,7 +57,17 @@ enum class InputFeatures : uint8_t { // refer to DielectronsAll, TODO: add more
5757
kTPCNSigmaPr2,
5858
kTOFNSigmaEl2,
5959
kTOFNSigmaPi2,
60-
kTOFNSigmaPr2
60+
kTOFNSigmaPr2,
61+
kTauz,
62+
kTauxy,
63+
kLz,
64+
kLxy,
65+
kTauzCov,
66+
kTauxyCov,
67+
kLzCov,
68+
kLxyCov,
69+
kChi2pca,
70+
kCosPointingAngle
6171
};
6272

6373
static const std::map<InputFeatures, std::string> gFeatureNameMap = {
@@ -90,7 +100,18 @@ static const std::map<InputFeatures, std::string> gFeatureNameMap = {
90100
{InputFeatures::kTPCNSigmaPr2, "kTPCNSigmaPr2"},
91101
{InputFeatures::kTOFNSigmaEl2, "kTOFNSigmaEl2"},
92102
{InputFeatures::kTOFNSigmaPi2, "kTOFNSigmaPi2"},
93-
{InputFeatures::kTOFNSigmaPr2, "kTOFNSigmaPr2"}};
103+
{InputFeatures::kTOFNSigmaPr2, "kTOFNSigmaPr2"},
104+
{InputFeatures::kTauz, "kTauz"},
105+
{InputFeatures::kTauxy, "kTauxy"},
106+
{InputFeatures::kLz, "kLz"},
107+
{InputFeatures::kLxy, "kLxy"},
108+
{InputFeatures::kTauzCov, "kTauzCov"},
109+
{InputFeatures::kTauxyCov, "kTauxyCov"},
110+
{InputFeatures::kLzCov, "kLzCov"},
111+
{InputFeatures::kLxyCov, "kLxyCov"},
112+
{InputFeatures::kChi2pca, "kChi2pca"},
113+
{InputFeatures::kCosPointingAngle, "kCosPointingAngle"}
114+
};
94115

95116
template <typename TypeOutputScore = float>
96117
class DQMlResponse : public MlResponse<TypeOutputScore>
@@ -185,6 +206,26 @@ class DQMlResponse : public MlResponse<TypeOutputScore>
185206
dqInputFeatures.push_back(t2.tofNSigmaPi());
186207
} else if (name == "kTOFNSigmaPr2") {
187208
dqInputFeatures.push_back(t2.tofNSigmaPr());
209+
} else if (name == "kTauz") {
210+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingTauzProjected"]]);
211+
} else if (name == "kTauxy") {
212+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingTauxyProjected"]]);
213+
} else if (name == "kLz") {
214+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingLzProjected"]]);
215+
} else if (name == "kLxy") {
216+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingLxyProjected"]]);
217+
} else if (name == "kTauzCov") {
218+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingTauz"]]);
219+
} else if (name == "kTauxyCov") {
220+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingTauxy"]]);
221+
} else if (name == "kLzCov") {
222+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingLz"]]);
223+
} else if (name == "kLxyCov") {
224+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingLxy"]]);
225+
} else if (name == "kChi2pca") {
226+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kVertexingChi2PCA"]]);
227+
} else if (name == "kCosPointingAngle") {
228+
dqInputFeatures.push_back(fg[VarManager::fgVarNamesMap["kCosPointingAngle"]]);
188229
} else {
189230
LOG(fatal) << "Missing accessor for feature: " << name;
190231
}
@@ -230,7 +271,18 @@ class DQMlResponse : public MlResponse<TypeOutputScore>
230271
{"kTPCNSigmaPr2", static_cast<uint8_t>(InputFeatures::kTPCNSigmaPr2)},
231272
{"kTOFNSigmaEl2", static_cast<uint8_t>(InputFeatures::kTOFNSigmaEl2)},
232273
{"kTOFNSigmaPi2", static_cast<uint8_t>(InputFeatures::kTOFNSigmaPi2)},
233-
{"kTOFNSigmaPr2", static_cast<uint8_t>(InputFeatures::kTOFNSigmaPr2)}};
274+
{"kTOFNSigmaPr2", static_cast<uint8_t>(InputFeatures::kTOFNSigmaPr2)},
275+
{"kTauz", static_cast<uint8_t>(InputFeatures::kTauz)},
276+
{"kTauxy", static_cast<uint8_t>(InputFeatures::kTauxy)},
277+
{"kLz", static_cast<uint8_t>(InputFeatures::kLz)},
278+
{"kLxy", static_cast<uint8_t>(InputFeatures::kLxy)},
279+
{"kTauzCov", static_cast<uint8_t>(InputFeatures::kTauzCov)},
280+
{"kTauxyCov", static_cast<uint8_t>(InputFeatures::kTauxyCov)},
281+
{"kLzCov", static_cast<uint8_t>(InputFeatures::kLzCov)},
282+
{"kLxyCov", static_cast<uint8_t>(InputFeatures::kLxyCov)},
283+
{"kChi2pca", static_cast<uint8_t>(InputFeatures::kChi2pca)},
284+
{"kCosPointingAngle", static_cast<uint8_t>(InputFeatures::kCosPointingAngle)}
285+
};
234286
}
235287
};
236288

PWGDQ/Tasks/tableReader.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ struct AnalysisSameEventPairing {
11771177
fDQMlResponse.setModelPathsLocal(onnxFileNames);
11781178
}
11791179
fDQMlResponse.cacheInputFeaturesIndices(namesInputFeatures);
1180-
fDQMlResponse.init();
1180+
fDQMlResponse.init(false, 1);
11811181
}
11821182

11831183
if (context.mOptions.get<bool>("processDecayToEESkimmed") || context.mOptions.get<bool>("processDecayToEESkimmedNoTwoProngFitter") || context.mOptions.get<bool>("processDecayToEESkimmedWithCov") || context.mOptions.get<bool>("processDecayToEESkimmedWithCovNoTwoProngFitter") || context.mOptions.get<bool>("processDecayToEEVertexingSkimmed") || context.mOptions.get<bool>("processVnDecayToEESkimmed") || context.mOptions.get<bool>("processDecayToEEPrefilterSkimmed") || context.mOptions.get<bool>("processDecayToEEPrefilterSkimmedNoTwoProngFitter") || context.mOptions.get<bool>("processDecayToEESkimmedWithColl") || context.mOptions.get<bool>("processDecayToEESkimmedWithCollNoTwoProngFitter") || context.mOptions.get<bool>("processDecayToPiPiSkimmed") || context.mOptions.get<bool>("processAllSkimmed")) {

PWGDQ/Tasks/tableReader_withAssoc.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ struct AnalysisSameEventPairing {
13961396
fDQMlResponse.setModelPathsLocal(onnxFileNames);
13971397
}
13981398
fDQMlResponse.cacheInputFeaturesIndices(namesInputFeatures);
1399-
fDQMlResponse.init();
1399+
fDQMlResponse.init(false, 1);
14001400
}
14011401

14021402
// get the barrel track selection cuts
@@ -1811,7 +1811,7 @@ struct AnalysisSameEventPairing {
18111811
continue;
18121812
}
18131813

1814-
LOG(debug) << "Model index: " << modelIndex << ", pT: " << VarManager::fgValues[VarManager::kPt] << ", centrality (kCentFT0C): " << VarManager::fgValues[VarManager::kCentFT0C];
1814+
//LOG(info) << "Model index: " << modelIndex << ", pT: " << VarManager::fgValues[VarManager::kPt] << ", centrality (kCentFT0C): " << VarManager::fgValues[VarManager::kCentFT0C];
18151815
isSelectedBDT = fDQMlResponse.isSelectedMl(dqInputFeatures, modelIndex, fOutputMlPsi2ee);
18161816
VarManager::FillBdtScore(fOutputMlPsi2ee); // TODO: check if this is needed or not
18171817
}

0 commit comments

Comments
 (0)