From f9ced2e1b5f988fa1a22fccb62b1144a21fb579b Mon Sep 17 00:00:00 2001 From: Hadi Hassan Date: Thu, 12 Dec 2024 18:01:31 +0200 Subject: [PATCH 1/3] Addinfg histograms for data-driven methods --- PWGJE/Tasks/bjetTaggingML.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index 98b3542cc09..ec543e2fdb4 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -111,6 +111,7 @@ struct BJetTaggingML { Configurable nJetConst{"nJetConst", 10, "maximum number of jet consistuents to be used for ML evaluation"}; Configurable useQuarkDef{"useQuarkDef", true, "Flag whether to use quarks or hadrons for determining the jet flavor"}; + Configurable doDataDriven{"doDataDriven", false, "Flag whether to use fill THnSpase for data driven methods"}; Configurable svReductionFactor{"svReductionFactor", 1.0, "factor for how many SVs to keep"}; @@ -124,7 +125,7 @@ struct BJetTaggingML { Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"Users/h/hahassan"}, "Paths of models on CCDB"}; - Configurable> onnxFileNames{"onnxFileNames", std::vector{"ML_bjets/01-MVA/Models/LHC23d4_5_20_90Percent/model.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ML_bjets/Models/LHC24g4_70_200/model.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; @@ -158,6 +159,15 @@ struct BJetTaggingML { registry.add("h2_jetMass_jetpT", "Jet mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{jet} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 50.0}}}); registry.add("h2_SVMass_jetpT", "Secondary vertex mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{SV} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 10}}}); + if (doDataDriven) { + registry.add("hSparse_Incljets", "Inclusive jets Info;#it{p}_{T,jet} (GeV/#it{c});Score;#it{m}_{jet} (GeV/#it{c}^{2});#it{m}_{SV} (GeV/#it{c}^{2});SVfE;", {HistType::kTHnSparseF, {{200, 0., 200.}, {120, -0.1, 1.1}, {50, 0, 50}, {50, 0, 10}, {50, 0, 1}}}); + if (doprocessMCJets) { + registry.add("hSparse_bjets", "Tagged b-jets Info;#it{p}_{T,jet} (GeV/#it{c});Score;#it{m}_{jet} (GeV/#it{c}^{2});#it{m}_{SV} (GeV/#it{c}^{2});SVfE;", {HistType::kTHnSparseF, {{200, 0., 200.}, {120, -0.1, 1.1}, {50, 0, 50}, {50, 0, 10}, {50, 0, 1}}}); + registry.add("hSparse_cjets", "Tagged c-jets Info;#it{p}_{T,jet} (GeV/#it{c});Score;#it{m}_{jet} (GeV/#it{c}^{2});#it{m}_{SV} (GeV/#it{c}^{2});SVfE;", {HistType::kTHnSparseF, {{200, 0., 200.}, {120, -0.1, 1.1}, {50, 0, 50}, {50, 0, 10}, {50, 0, 1}}}); + registry.add("hSparse_lfjets", "Tagged lf-jets Info;#it{p}_{T,jet} (GeV/#it{c});Score;#it{m}_{jet} (GeV/#it{c}^{2});#it{m}_{SV} (GeV/#it{c}^{2});SVfE;", {HistType::kTHnSparseF, {{200, 0., 200.}, {120, -0.1, 1.1}, {50, 0, 50}, {50, 0, 10}, {50, 0, 1}}}); + } + } + if (doprocessMCJets) { registry.add("h2_score_jetpT_bjet", "ML scores for b-jets;#it{p}_{T,jet} (GeV/#it{c});Score", {HistType::kTH2F, {{200, 0., 200.}, {120, -0.1, 1.1}}}); @@ -419,6 +429,10 @@ struct BJetTaggingML { registry.fill(HIST("h2_score_jetpT"), analysisJet.pt(), output[0]); registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass()); + + if (doDataDriven) { + registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE); + } } } PROCESS_SWITCH(BJetTaggingML, processDataJets, "jet information in Data", false); @@ -496,6 +510,17 @@ struct BJetTaggingML { registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass(), eventWeight); + if (doDataDriven) { + registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + if (jetFlavor == 2) { + registry.fill(HIST("hSparse_bjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + } else if (jetFlavor == 1) { + registry.fill(HIST("hSparse_cjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + } else { + registry.fill(HIST("hSparse_lfjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + } + } + if (jetFlavor == 2) { registry.fill(HIST("h2_score_jetpT_bjet"), analysisJet.pt(), output[0], eventWeight); registry.fill(HIST("h2_jetMass_jetpT_bjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); From c5701158d77eee70ac7671ea205a1cba28899be5 Mon Sep 17 00:00:00 2001 From: Hadi Hassan Date: Thu, 12 Dec 2024 18:16:40 +0200 Subject: [PATCH 2/3] O2 Linter --- PWGJE/Tasks/bjetTaggingML.cxx | 60 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index ec543e2fdb4..a790d263466 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -83,7 +83,7 @@ struct BJetTaggingML { HistogramRegistry registry; - static constexpr double defaultCutsMl[1][2] = {{0.5, 0.5}}; + static constexpr double DefaultCutsMl[1][2] = {{0.5, 0.5}}; // event level configurables Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; @@ -119,7 +119,7 @@ struct BJetTaggingML { Configurable> binsPtMl{"binsPtMl", std::vector{5., 1000.}, "pT bin limits for ML application"}; Configurable> cutDirMl{"cutDirMl", std::vector{cuts_ml::CutSmaller, cuts_ml::CutNot}, "Whether to reject score values greater or smaller than the threshold"}; - Configurable> cutsMl{"cutsMl", {defaultCutsMl[0], 1, 2, {"pT bin 0"}, {"score for default b-jet tagging", "uncer 1"}}, "ML selections per pT bin"}; + Configurable> cutsMl{"cutsMl", {DefaultCutsMl[0], 1, 2, {"pT bin 0"}, {"score for default b-jet tagging", "uncer 1"}}, "ML selections per pT bin"}; Configurable nClassesMl{"nClassesMl", 2, "Number of classes in ML model"}; Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; @@ -333,7 +333,7 @@ struct BJetTaggingML { void analyzeJetTrackInfo(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& tracksParams, int jetFlavor = 0, double eventweight = 1.0) { - for (auto& constituent : analysisJet.template tracks_as()) { + for (const auto& constituent : analysisJet.template tracks_as()) { if (constituent.pt() < trackPtMin) { continue; @@ -343,11 +343,11 @@ struct BJetTaggingML { double dotProduct = RecoDecay::dotProd(std::array{analysisJet.px(), analysisJet.py(), analysisJet.pz()}, std::array{constituent.px(), constituent.py(), constituent.pz()}); int sign = jettaggingutilities::getGeoSign(analysisJet, constituent); - float RClosestSV = 10.; + float rClosestSV = 10.; for (const auto& candSV : analysisJet.template secondaryVertices_as()) { double deltaRTrackSV = jetutilities::deltaR(constituent, candSV); - if (deltaRTrackSV < RClosestSV) { - RClosestSV = deltaRTrackSV; + if (deltaRTrackSV < rClosestSV) { + rClosestSV = deltaRTrackSV; } } @@ -367,7 +367,7 @@ struct BJetTaggingML { } } - tracksParams.emplace_back(bjetTrackParams{constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), RClosestSV}); + tracksParams.emplace_back(bjetTrackParams{constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), rClosestSV}); } auto compare = [](bjetTrackParams& tr1, bjetTrackParams& tr2) { @@ -394,7 +394,7 @@ struct BJetTaggingML { for (const auto& analysisJet : alljets) { bool jetIncluded = false; - for (auto jetR : jetRadiiValues) { + for (const auto& jetR : jetRadiiValues) { if (analysisJet.r() == static_cast(jetR * 100)) { jetIncluded = true; break; @@ -406,9 +406,9 @@ struct BJetTaggingML { } std::vector tracksParams; - std::vector SVsParams; + std::vector svsParams; - analyzeJetSVInfo(analysisJet, allTracks, allSVs, SVsParams); + analyzeJetSVInfo(analysisJet, allTracks, allSVs, svsParams); analyzeJetTrackInfo(collision, analysisJet, allTracks, allSVs, tracksParams); int nSVs = analysisJet.template secondaryVertices_as().size(); @@ -418,9 +418,9 @@ struct BJetTaggingML { bjetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; tracksParams.resize(nJetConst); // resize to the number of inputs of the ML - SVsParams.resize(nJetConst); // resize to the number of inputs of the ML + svsParams.resize(nJetConst); // resize to the number of inputs of the ML - auto inputML = getInputsForML(jetparam, tracksParams, SVsParams); + auto inputML = getInputsForML(jetparam, tracksParams, svsParams); std::vector output; // bool isSelectedMl = bMlResponse.isSelectedMl(inputML, analysisJet.pt(), output); @@ -431,7 +431,7 @@ struct BJetTaggingML { registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass()); if (doDataDriven) { - registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE); + registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE); } } } @@ -441,8 +441,8 @@ struct BJetTaggingML { using MCPJetTable = soa::Filtered>; using FilteredCollisionMCD = soa::Filtered>; - Preslice McParticlesPerCollision = aod::jmcparticle::mcCollisionId; - Preslice McPJetsPerCollision = aod::jet::mcCollisionId; + Preslice mcParticlesPerCollision = aod::jmcparticle::mcCollisionId; + Preslice mcpJetsPerCollision = aod::jet::mcCollisionId; void processMCJets(FilteredCollisionMCD::iterator const& collision, MCDJetTable const& MCDjets, MCPJetTable const& MCPjets, JetTracksMCDwID const& allTracks, aod::JetParticles const& MCParticles, aod::MCDSecondaryVertex3Prongs const& allSVs) { @@ -452,13 +452,13 @@ struct BJetTaggingML { registry.fill(HIST("h_vertexZ"), collision.posZ()); - auto const mcParticlesPerColl = MCParticles.sliceBy(McParticlesPerCollision, collision.mcCollisionId()); - auto const mcPJetsPerColl = MCPjets.sliceBy(McPJetsPerCollision, collision.mcCollisionId()); + auto const mcParticlesPerColl = MCParticles.sliceBy(mcParticlesPerCollision, collision.mcCollisionId()); + auto const mcPJetsPerColl = MCPjets.sliceBy(mcpJetsPerCollision, collision.mcCollisionId()); for (const auto& analysisJet : MCDjets) { bool jetIncluded = false; - for (auto jetR : jetRadiiValues) { + for (const auto& jetR : jetRadiiValues) { if (analysisJet.r() == static_cast(jetR * 100)) { jetIncluded = true; break; @@ -476,11 +476,11 @@ struct BJetTaggingML { } std::vector tracksParams; - std::vector SVsParams; + std::vector svsParams; int jetFlavor = 0; - for (auto& mcpjet : analysisJet.template matchedJetGeo_as()) { + for (const auto& mcpjet : analysisJet.template matchedJetGeo_as()) { if (useQuarkDef) { jetFlavor = jettaggingutilities::getJetFlavor(mcpjet, mcParticlesPerColl); } else { @@ -488,7 +488,7 @@ struct BJetTaggingML { } } - analyzeJetSVInfo(analysisJet, allTracks, allSVs, SVsParams, jetFlavor, eventWeight); + analyzeJetSVInfo(analysisJet, allTracks, allSVs, svsParams, jetFlavor, eventWeight); analyzeJetTrackInfo(collision, analysisJet, allTracks, allSVs, tracksParams, jetFlavor, eventWeight); int nSVs = analysisJet.template secondaryVertices_as().size(); @@ -498,9 +498,9 @@ struct BJetTaggingML { bjetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; tracksParams.resize(nJetConst); // resize to the number of inputs of the ML - SVsParams.resize(nJetConst); // resize to the number of inputs of the ML + svsParams.resize(nJetConst); // resize to the number of inputs of the ML - auto inputML = getInputsForML(jetparam, tracksParams, SVsParams); + auto inputML = getInputsForML(jetparam, tracksParams, svsParams); std::vector output; // bool isSelectedMl = bMlResponse.isSelectedMl(inputML, analysisJet.pt(), output); @@ -511,13 +511,13 @@ struct BJetTaggingML { registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass(), eventWeight); if (doDataDriven) { - registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); if (jetFlavor == 2) { - registry.fill(HIST("hSparse_bjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_bjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); } else if (jetFlavor == 1) { - registry.fill(HIST("hSparse_cjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_cjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); } else { - registry.fill(HIST("hSparse_lfjets"), analysisJet.pt(), output[0], analysisJet.mass(), SVsParams[0].mSVMass, SVsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_lfjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); } } @@ -535,7 +535,7 @@ struct BJetTaggingML { registry.fill(HIST("h_jetpT_detector_lfjet"), analysisJet.pt(), eventWeight); } - for (auto& mcpjet : analysisJet.template matchedJetGeo_as()) { + for (const auto& mcpjet : analysisJet.template matchedJetGeo_as()) { if (mcpjet.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -554,7 +554,7 @@ struct BJetTaggingML { for (const auto& mcpjet : mcPJetsPerColl) { bool jetIncluded = false; - for (auto jetR : jetRadiiValues) { + for (const auto& jetR : jetRadiiValues) { if (mcpjet.r() == static_cast(jetR * 100)) { jetIncluded = true; break; @@ -601,7 +601,7 @@ struct BJetTaggingML { for (const auto& mcpjet : MCPjets) { bool jetIncluded = false; - for (auto jetR : jetRadiiValues) { + for (const auto& jetR : jetRadiiValues) { if (mcpjet.r() == static_cast(jetR * 100)) { jetIncluded = true; break; From c35118b787fbe87ecbacebdcca2747ed33ea08f3 Mon Sep 17 00:00:00 2001 From: Hadi Hassan Date: Thu, 12 Dec 2024 18:48:55 +0200 Subject: [PATCH 3/3] O2 Linter again --- PWGJE/Tasks/bjetTaggingML.cxx | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index a790d263466..d8812b6ac8d 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -43,7 +43,7 @@ using namespace o2::framework::expressions; struct BJetTaggingML { - struct bjetParams { + struct BJetParams { float mJetpT = 0.0; float mJetEta = 0.0; float mJetPhi = 0.0; @@ -52,7 +52,7 @@ struct BJetTaggingML { float mJetMass = 0.0; }; - struct bjetTrackParams { + struct BJetTrackParams { double mTrackpT = 0.0; double mTrackEta = 0.0; double mDotProdTrackJet = 0.0; @@ -66,7 +66,7 @@ struct BJetTaggingML { double mDeltaRTrackVertex = 0.0; }; - struct bjetSVParams { + struct BJetSVParams { double mSVpT = 0.0; double mDeltaRSVJet = 0.0; double mSVMass = 0.0; @@ -234,7 +234,7 @@ struct BJetTaggingML { using JetTracksMCDwID = soa::Join; using DataJets = soa::Filtered>; - std::vector> getInputsForML(bjetParams jetparams, std::vector& tracksParams, std::vector& svsParams) + std::vector> getInputsForML(BJetParams jetparams, std::vector& tracksParams, std::vector& svsParams) { std::vector jetInput = {jetparams.mJetpT, jetparams.mJetEta, jetparams.mJetPhi, static_cast(jetparams.mNTracks), static_cast(jetparams.mNSV), jetparams.mJetMass}; std::vector tracksInputFlat; @@ -278,7 +278,7 @@ struct BJetTaggingML { // Looping over the SV info and writing them to a table template - void analyzeJetSVInfo(AnalysisJet const& myJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& svsParams, int jetFlavor = 0, double eventweight = 1.0) + void analyzeJetSVInfo(AnalysisJet const& myJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& svsParams, int jetFlavor = 0, double eventweight = 1.0) { using SVType = typename SecondaryVertices::iterator; @@ -304,7 +304,7 @@ struct BJetTaggingML { double energySV = candSV.e(); if (svsParams.size() < (svReductionFactor * myJet.template tracks_as().size())) { - svsParams.emplace_back(bjetSVParams{candSV.pt(), deltaRJetSV, massSV, energySV / myJet.energy(), candSV.impactParameterXY(), candSV.cpa(), candSV.chi2PCA(), candSV.dispersion(), candSV.decayLengthXY(), candSV.errorDecayLengthXY(), candSV.decayLength(), candSV.errorDecayLength()}); + svsParams.emplace_back(BJetSVParams{candSV.pt(), deltaRJetSV, massSV, energySV / myJet.energy(), candSV.impactParameterXY(), candSV.cpa(), candSV.chi2PCA(), candSV.dispersion(), candSV.decayLengthXY(), candSV.errorDecayLengthXY(), candSV.decayLength(), candSV.errorDecayLength()}); } registry.fill(HIST("h2_LxyS_jetpT"), myJet.pt(), candSV.decayLengthXY() / candSV.errorDecayLengthXY(), eventweight); @@ -330,7 +330,7 @@ struct BJetTaggingML { } template - void analyzeJetTrackInfo(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& tracksParams, int jetFlavor = 0, double eventweight = 1.0) + void analyzeJetTrackInfo(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& tracksParams, int jetFlavor = 0, double eventweight = 1.0) { for (const auto& constituent : analysisJet.template tracks_as()) { @@ -367,10 +367,10 @@ struct BJetTaggingML { } } - tracksParams.emplace_back(bjetTrackParams{constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), rClosestSV}); + tracksParams.emplace_back(BJetTrackParams{constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), rClosestSV}); } - auto compare = [](bjetTrackParams& tr1, bjetTrackParams& tr2) { + auto compare = [](BJetTrackParams& tr1, BJetTrackParams& tr2) { return (tr1.mSignedIP2D / tr1.mSignedIP2DSign) > (tr2.mSignedIP2D / tr2.mSignedIP2DSign); }; @@ -405,8 +405,8 @@ struct BJetTaggingML { continue; } - std::vector tracksParams; - std::vector svsParams; + std::vector tracksParams; + std::vector svsParams; analyzeJetSVInfo(analysisJet, allTracks, allSVs, svsParams); analyzeJetTrackInfo(collision, analysisJet, allTracks, allSVs, tracksParams); @@ -416,7 +416,7 @@ struct BJetTaggingML { registry.fill(HIST("h2_nTracks_jetpT"), analysisJet.pt(), tracksParams.size()); registry.fill(HIST("h2_nSV_jetpT"), analysisJet.pt(), nSVs < 250 ? nSVs : 249); - bjetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; + BJetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; tracksParams.resize(nJetConst); // resize to the number of inputs of the ML svsParams.resize(nJetConst); // resize to the number of inputs of the ML @@ -475,8 +475,8 @@ struct BJetTaggingML { continue; } - std::vector tracksParams; - std::vector svsParams; + std::vector tracksParams; + std::vector svsParams; int jetFlavor = 0; @@ -496,7 +496,7 @@ struct BJetTaggingML { registry.fill(HIST("h2_nTracks_jetpT"), analysisJet.pt(), tracksParams.size()); registry.fill(HIST("h2_nSV_jetpT"), analysisJet.pt(), nSVs < 250 ? nSVs : 249); - bjetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; + BJetParams jetparam = {analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), static_cast(tracksParams.size()), static_cast(nSVs), analysisJet.mass()}; tracksParams.resize(nJetConst); // resize to the number of inputs of the ML svsParams.resize(nJetConst); // resize to the number of inputs of the ML @@ -511,13 +511,13 @@ struct BJetTaggingML { registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass(), eventWeight); if (doDataDriven) { - registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_Incljets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE); if (jetFlavor == 2) { - registry.fill(HIST("hSparse_bjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_bjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE); } else if (jetFlavor == 1) { - registry.fill(HIST("hSparse_cjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_cjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE); } else { - registry.fill(HIST("hSparse_lfjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE, tracksParams[0].mMomFraction); + registry.fill(HIST("hSparse_lfjets"), analysisJet.pt(), output[0], analysisJet.mass(), svsParams[0].mSVMass, svsParams[0].mSVfE); } } @@ -640,5 +640,5 @@ struct BJetTaggingML { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"bjet-tagging-ml"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"bjet-tagging-ml"})}; // o2-linter: disable=name/o2-task,name/workflow-file }