From f73ec0b47e33ec66208526a8f712c4790378b1c0 Mon Sep 17 00:00:00 2001 From: Chiara De Martin Date: Thu, 11 Dec 2025 14:33:11 +0100 Subject: [PATCH 1/3] apply resolution correction in the task --- .../TableProducer/Strangeness/cascadeflow.cxx | 47 ++++++++++++++++--- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 1a076783d13..c2bab5310bc 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -291,6 +291,8 @@ struct cascadeFlow { Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; + Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; @@ -301,6 +303,7 @@ struct cascadeFlow { // acceptance crrection Configurable applyAcceptanceCorrection{"applyAcceptanceCorrection", false, "apply acceptance correction"}; + Configurable applyResoCorrection{"applyResoCorrection", false, "apply resolution correction"}; o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -571,6 +574,9 @@ struct cascadeFlow { TH2F* hAcceptanceLambda; TH2F* hAcceptancePrimaryLambda; + //objects to use for resolution correction + TH1F* hReso; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry resolution{"resolution", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -745,6 +751,20 @@ struct cascadeFlow { hAcceptancePrimaryLambda->SetName("hAcceptancePrimaryLambda"); LOG(info) << "Acceptance now loaded"; } + void initResoFromCCDB() + { + LOG(info) << "Loading resolution from CCDB "; + TList* listReso = ccdb->get(resoPaths); + if (!listReso) + LOG(fatal) << "Problem getting TList object with resolution!"; + + hReso = static_cast(listReso->FindObject(Form("%s", resoHistoName->data()))); + if (!hReso) { + LOG(fatal) << "The histogram for resolution is not there"; + } + hReso->SetName("hReso"); + LOG(info) << "Resolution now loaded"; + } void init(InitContext const&) { @@ -1007,6 +1027,13 @@ struct cascadeFlow { ccdb->setFatalWhenNull(false); initAcceptanceFromCCDB(); } + if (applyResoCorrection) { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + initResoFromCCDB(); + } } void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) @@ -1868,6 +1895,12 @@ struct cascadeFlow { resolution.fill(HIST("QVectorsNormT0ATPCC"), eventplaneVecT0A.Dot(eventplaneVecTPCC) / (coll.qTPCL() * coll.sumAmplFT0A()), collisionCentrality); resolution.fill(HIST("QVectorsNormT0ATPCA"), eventplaneVecT0A.Dot(eventplaneVecTPCA) / (coll.qTPCR() * coll.sumAmplFT0A()), collisionCentrality); + double EPresolution = 1; + if (applyResoCorrection){ + int centBin = hReso->FindBin(collisionCentrality); + EPresolution = hReso->GetBinContent(centBin); + } + std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { @@ -1952,7 +1985,7 @@ struct cascadeFlow { // acceptance values if requested double meanCos2ThetaProtonFromLambda = 1; if (applyAcceptanceCorrection) { - int bin2DLambda = hAcceptanceLambda->FindBin(v0.pt(), v0.eta()); + int bin2DLambda = hAcceptancePrimaryLambda->FindBin(v0.pt(), v0.eta()); meanCos2ThetaProtonFromLambda = hAcceptancePrimaryLambda->GetBinContent(bin2DLambda); } @@ -1960,17 +1993,17 @@ struct cascadeFlow { double cos2ThetaLambda = 0; double cosThetaLambda = 0; if (chargeIndex == 0) { - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; } else if (chargeIndex == 1) { - pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; } else { // I treat these bkg candidates as Lambdas for the purpose of calculating Pz - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; } histos.fill(HIST("hv2CEPvsFT0C"), collisionCentrality, v2CEP); From 06d97400e26b1755c166c918d57a6c98658dd0b2 Mon Sep 17 00:00:00 2001 From: Chiara De Martin Date: Thu, 11 Dec 2025 15:32:26 +0100 Subject: [PATCH 2/3] add centrality weight on the fly --- .../TableProducer/Strangeness/cascadeflow.cxx | 80 ++++++++++++++----- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index c2bab5310bc..19b29d6544b 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -277,6 +277,7 @@ struct cascadeFlow { Configurable etaCascMCGen{"etaCascMCGen", 0.8, "etaCascMCGen"}; Configurable yCascMCGen{"yCascMCGen", 0.5, "yCascMCGen"}; + struct : ConfigurableGroup { Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; @@ -293,7 +294,10 @@ struct cascadeFlow { Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; - + Configurable centWeightPaths{"centWeightPath", "Users/c/chdemart/CentralityWeight/", "Paths of centrality weight"}; + Configurable centWeightHistoName{"centWeightHistoName", "hCentWeight", "Histo name of centrality weight"}; + } ccdbConfigs; + // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; Configurable> binsPtMl{"binsPtMl", std::vector{cascade_flow_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; @@ -304,6 +308,7 @@ struct cascadeFlow { // acceptance crrection Configurable applyAcceptanceCorrection{"applyAcceptanceCorrection", false, "apply acceptance correction"}; Configurable applyResoCorrection{"applyResoCorrection", false, "apply resolution correction"}; + Configurable applyCentWeightCorrection{"applyCentWeightCorrection", false, "apply centrality weight correction"}; o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -577,6 +582,9 @@ struct cascadeFlow { //objects to use for resolution correction TH1F* hReso; + //objects to use for centrality weight + TH1F* hCentWeight; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry resolution{"resolution", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -716,35 +724,35 @@ struct cascadeFlow { void initAcceptanceFromCCDB() { LOG(info) << "Loading acceptance from CCDB "; - TList* listAcceptanceXi = ccdb->get(acceptancePathsCCDBXi); + TList* listAcceptanceXi = ccdb->get(ccdbConfigs.acceptancePathsCCDBXi); if (!listAcceptanceXi) LOG(fatal) << "Problem getting TList object with acceptance for Xi!"; - TList* listAcceptanceOmega = ccdb->get(acceptancePathsCCDBOmega); + TList* listAcceptanceOmega = ccdb->get(ccdbConfigs.acceptancePathsCCDBOmega); if (!listAcceptanceOmega) LOG(fatal) << "Problem getting TList object with acceptance for Omega!"; - TList* listAcceptanceLambda = ccdb->get(acceptancePathsCCDBLambda); + TList* listAcceptanceLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBLambda); if (!listAcceptanceLambda) LOG(fatal) << "Problem getting TList object with acceptance for Lambda!"; - TList* listAcceptancePrimaryLambda = ccdb->get(acceptancePathsCCDBPrimaryLambda); + TList* listAcceptancePrimaryLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBPrimaryLambda); if (!listAcceptancePrimaryLambda) LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!"; - hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); + hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); if (!hAcceptanceXi) { LOG(fatal) << "The histogram for Xi is not there!"; } hAcceptanceXi->SetName("hAcceptanceXi"); - hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); + hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); if (!hAcceptanceOmega) { LOG(fatal) << "The histogram for omega is not there!"; } hAcceptanceOmega->SetName("hAcceptanceOmega"); - hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", acceptanceHistoNameLambda->data()))); + hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameLambda->data()))); if (!hAcceptanceLambda) { LOG(fatal) << "The histogram for Lambda is not there!"; } hAcceptanceLambda->SetName("hAcceptanceLambda"); - hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", acceptanceHistoNamePrimaryLambda->data()))); + hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNamePrimaryLambda->data()))); if (!hAcceptancePrimaryLambda) { LOG(fatal) << "The histogram for Primary Lambda is not there!"; } @@ -754,11 +762,11 @@ struct cascadeFlow { void initResoFromCCDB() { LOG(info) << "Loading resolution from CCDB "; - TList* listReso = ccdb->get(resoPaths); + TList* listReso = ccdb->get(ccdbConfigs.resoPaths); if (!listReso) LOG(fatal) << "Problem getting TList object with resolution!"; - hReso = static_cast(listReso->FindObject(Form("%s", resoHistoName->data()))); + hReso = static_cast(listReso->FindObject(Form("%s", ccdbConfigs.resoHistoName->data()))); if (!hReso) { LOG(fatal) << "The histogram for resolution is not there"; } @@ -766,6 +774,21 @@ struct cascadeFlow { LOG(info) << "Resolution now loaded"; } + void initCentWeightFromCCDB() + { + LOG(info) << "Loading resolution from CCDB "; + TList* listCentWeight = ccdb->get(ccdbConfigs.centWeightPaths); + if (!listCentWeight) + LOG(fatal) << "Problem getting TList object with resolution!"; + + hCentWeight = static_cast(listCentWeight->FindObject(Form("%s", ccdbConfigs.centWeightHistoName->data()))); + if (!hCentWeight) { + LOG(fatal) << "The histogram for resolution is not there"; + } + hCentWeight->SetName("hCentWeight"); + LOG(info) << "Centrality weight now loaded"; + } + void init(InitContext const&) { @@ -1009,31 +1032,38 @@ struct cascadeFlow { mlResponseXi.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); mlResponseOmega.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); // Bonus: retrieve the model from CCDB (needed for ML application on the GRID) - if (loadModelsFromCCDB) { - ccdbApi.init(ccdbUrl); - mlResponseXi.setModelPathsCCDB(onnxFileNamesXi, ccdbApi, modelPathsCCDBXi, timestampCCDB); - mlResponseOmega.setModelPathsCCDB(onnxFileNamesOmega, ccdbApi, modelPathsCCDBOmega, timestampCCDB); // TODO: use different model for Xi and Omega + if (ccdbConfigs.loadModelsFromCCDB) { + ccdbApi.init(ccdbConfigs.ccdbUrl); + mlResponseXi.setModelPathsCCDB(ccdbConfigs.onnxFileNamesXi, ccdbApi, ccdbConfigs.modelPathsCCDBXi, ccdbConfigs.timestampCCDB); + mlResponseOmega.setModelPathsCCDB(ccdbConfigs.onnxFileNamesOmega, ccdbApi, ccdbConfigs.modelPathsCCDBOmega, ccdbConfigs.timestampCCDB); // TODO: use different model for Xi and Omega } else { - mlResponseXi.setModelPathsLocal(onnxFileNamesXi); - mlResponseOmega.setModelPathsLocal(onnxFileNamesOmega); + mlResponseXi.setModelPathsLocal(ccdbConfigs.onnxFileNamesXi); + mlResponseOmega.setModelPathsLocal(ccdbConfigs.onnxFileNamesOmega); } mlResponseXi.init(); mlResponseOmega.init(); } if (applyAcceptanceCorrection) { - ccdb->setURL(ccdbUrl); + ccdb->setURL(ccdbConfigs.ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); initAcceptanceFromCCDB(); } if (applyResoCorrection) { - ccdb->setURL(ccdbUrl); + ccdb->setURL(ccdbConfigs.ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); initResoFromCCDB(); } + if (applyCentWeightCorrection) { + ccdb->setURL(ccdbConfigs.ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + initCentWeightFromCCDB(); + } } void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) @@ -1900,7 +1930,12 @@ struct cascadeFlow { int centBin = hReso->FindBin(collisionCentrality); EPresolution = hReso->GetBinContent(centBin); } - + double centWeight = 1; + if (applyCentWeightCorrection){ + int centBin = hCentWeight->FindBin(collisionCentrality); + centWeight = hCentWeight->GetBinContent(centBin); + } + std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { @@ -2015,14 +2050,15 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_V2) histos.get(HIST("hLambdaV2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), v2CEP); if (fillingConfigs.isFillTHN_Pz) { - histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + // histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda, centWeight); } if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2Theta"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); + histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C, centWeight); if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); } From 04bc4aed25c8fe06b3c2d7dcff9df7b4fb925e14 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 11 Dec 2025 14:33:47 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- .../TableProducer/Strangeness/cascadeflow.cxx | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 19b29d6544b..ac3de656a2b 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -278,26 +278,26 @@ struct cascadeFlow { Configurable yCascMCGen{"yCascMCGen", 0.5, "yCascMCGen"}; struct : ConfigurableGroup { - Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.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", true, "Flag to enable or disable the loading of models from CCDB"}; - Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; - Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; - Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; - Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; - Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; - Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; - Configurable centWeightPaths{"centWeightPath", "Users/c/chdemart/CentralityWeight/", "Paths of centrality weight"}; - Configurable centWeightHistoName{"centWeightHistoName", "hCentWeight", "Histo name of centrality weight"}; - } ccdbConfigs; - + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.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", true, "Flag to enable or disable the loading of models from CCDB"}; + Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; + Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; + Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; + Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; + Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; + Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; + Configurable centWeightPaths{"centWeightPath", "Users/c/chdemart/CentralityWeight/", "Paths of centrality weight"}; + Configurable centWeightHistoName{"centWeightHistoName", "hCentWeight", "Histo name of centrality weight"}; + } ccdbConfigs; + // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; Configurable> binsPtMl{"binsPtMl", std::vector{cascade_flow_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; @@ -579,12 +579,12 @@ struct cascadeFlow { TH2F* hAcceptanceLambda; TH2F* hAcceptancePrimaryLambda; - //objects to use for resolution correction + // objects to use for resolution correction TH1F* hReso; - //objects to use for centrality weight + // objects to use for centrality weight TH1F* hCentWeight; - + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry resolution{"resolution", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -1926,16 +1926,16 @@ struct cascadeFlow { resolution.fill(HIST("QVectorsNormT0ATPCA"), eventplaneVecT0A.Dot(eventplaneVecTPCA) / (coll.qTPCR() * coll.sumAmplFT0A()), collisionCentrality); double EPresolution = 1; - if (applyResoCorrection){ + if (applyResoCorrection) { int centBin = hReso->FindBin(collisionCentrality); EPresolution = hReso->GetBinContent(centBin); } double centWeight = 1; - if (applyCentWeightCorrection){ + if (applyCentWeightCorrection) { int centBin = hCentWeight->FindBin(collisionCentrality); centWeight = hCentWeight->GetBinContent(centBin); } - + std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { @@ -2050,8 +2050,8 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_V2) histos.get(HIST("hLambdaV2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), v2CEP); if (fillingConfigs.isFillTHN_Pz) { - // histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); - histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda, centWeight); + // histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda, centWeight); } if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2Theta"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda);