From 1c3031b05de2bfa04ed9edc9a23446e8a4f84149 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 12 Mar 2025 18:06:51 +0000 Subject: [PATCH] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/antinucleiInJets.cxx | 219 ++++++++++++------------ 1 file changed, 109 insertions(+), 110 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/antinucleiInJets.cxx b/PWGLF/Tasks/Nuspex/antinucleiInJets.cxx index 5256b98900f..3c216f3f54b 100644 --- a/PWGLF/Tasks/Nuspex/antinucleiInJets.cxx +++ b/PWGLF/Tasks/Nuspex/antinucleiInJets.cxx @@ -197,7 +197,7 @@ struct AntinucleiInJets { registryData.add("helium3_jet_tpc", "helium3_jet_tpc", HistType::kTH2F, {{nbins, min * 3, max * 3, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}}); registryData.add("helium3_ue_tpc", "helium3_ue_tpc", HistType::kTH2F, {{nbins, min * 3, max * 3, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}}); - //systematic variations + // systematic variations registryData.add("antiproton_tpc_syst", "antiproton_tpc_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}}); registryData.add("antiproton_tof_syst", "antiproton_tof_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}}); registryData.add("antideuteron_tpc_syst", "antideuteron_tpc_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}}); @@ -1179,134 +1179,133 @@ struct AntinucleiInJets { } PROCESS_SWITCH(AntinucleiInJets, processJetsMCrec, "process jets MC rec", false); + // Process Systematics + void processSystematicsData(SelectedCollisions::iterator const& collision, FullNucleiTracks const& tracks) + { + const int nSystematics = 10; + int itsNclustersSyst[nSystematics] = {5, 6, 5, 4, 5, 3, 5, 6, 3, 4}; + float tpcNcrossedRowsSyst[nSystematics] = {100, 85, 80, 110, 95, 90, 105, 95, 100, 105}; + float dcaxySyst[nSystematics] = {0.05, 0.07, 0.10, 0.03, 0.06, 0.15, 0.08, 0.04, 0.09, 0.10}; + float dcazSyst[nSystematics] = {0.1, 0.15, 0.3, 0.075, 0.12, 0.18, 0.2, 0.1, 0.15, 0.2}; -// Process Systematics -void processSystematicsData(SelectedCollisions::iterator const& collision, FullNucleiTracks const& tracks) -{ - const int nSystematics = 10; - int itsNclustersSyst[nSystematics] = {5, 6, 5, 4, 5, 3, 5, 6, 3, 4}; - float tpcNcrossedRowsSyst[nSystematics] = {100, 85, 80, 110, 95, 90, 105, 95, 100, 105}; - float dcaxySyst[nSystematics] = {0.05, 0.07, 0.10, 0.03, 0.06, 0.15, 0.08, 0.04, 0.09, 0.10}; - float dcazSyst[nSystematics] = {0.1, 0.15, 0.3, 0.075, 0.12, 0.18, 0.2, 0.1, 0.15, 0.2}; - - // event selection - if (!collision.sel8() || std::fabs(collision.posZ()) > zVtx) - return; + // event selection + if (!collision.sel8() || std::fabs(collision.posZ()) > zVtx) + return; - // loop over reconstructed tracks - int id(-1); - std::vector fjParticles; - for (auto const& track : tracks) { - id++; - if (!passedTrackSelectionForJetReconstruction(track)) - continue; - - // 4-momentum representation of a particle - fastjet::PseudoJet fourMomentum(track.px(), track.py(), track.pz(), track.energy(MassPionCharged)); - fourMomentum.set_user_index(id); - fjParticles.emplace_back(fourMomentum); - } + // loop over reconstructed tracks + int id(-1); + std::vector fjParticles; + for (auto const& track : tracks) { + id++; + if (!passedTrackSelectionForJetReconstruction(track)) + continue; - // reject empty events - if (fjParticles.size() < 1) - return; + // 4-momentum representation of a particle + fastjet::PseudoJet fourMomentum(track.px(), track.py(), track.pz(), track.energy(MassPionCharged)); + fourMomentum.set_user_index(id); + fjParticles.emplace_back(fourMomentum); + } - // cluster particles using the anti-kt algorithm - fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet); - fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0)); // active_area_explicit_ghosts - fastjet::ClusterSequenceArea cs(fjParticles, jetDef, areaDef); - std::vector jets = fastjet::sorted_by_pt(cs.inclusive_jets()); - auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone(fjParticles, jets); + // reject empty events + if (fjParticles.size() < 1) + return; - // loop over reconstructed jets - for (auto& jet : jets) { + // cluster particles using the anti-kt algorithm + fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet); + fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0)); // active_area_explicit_ghosts + fastjet::ClusterSequenceArea cs(fjParticles, jetDef, areaDef); + std::vector jets = fastjet::sorted_by_pt(cs.inclusive_jets()); + auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone(fjParticles, jets); - // jet must be fully contained in the acceptance - if ((std::fabs(jet.eta()) + rJet) > (maxEta - deltaEtaEdge)) - continue; + // loop over reconstructed jets + for (auto& jet : jets) { - // jet pt must be larger than threshold - fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub(jet, rhoPerp, rhoMPerp); - if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) - continue; + // jet must be fully contained in the acceptance + if ((std::fabs(jet.eta()) + rJet) > (maxEta - deltaEtaEdge)) + continue; - // get jet constituents - std::vector jetConstituents = jet.constituents(); - o2::aod::ITSResponse itsResponse; + // jet pt must be larger than threshold + fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub(jet, rhoPerp, rhoMPerp); + if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) + continue; - // loop over jet constituents - for (const auto& particle : jetConstituents) { - for(int i = 0; i < nSystematics; i++) { - // get corresponding track and apply track selection criteria - auto const& track = tracks.iteratorAt(particle.user_index()); + // get jet constituents + std::vector jetConstituents = jet.constituents(); + o2::aod::ITSResponse itsResponse; - // variables - double nsigmaTPCPr = track.tpcNSigmaPr(); - double nsigmaTOFPr = track.tofNSigmaPr(); - double nsigmaTPCDe = track.tpcNSigmaDe(); - double nsigmaTOFDe = track.tofNSigmaDe(); - double pt = track.pt(); - double dcaxy = track.dcaXY(); - double dcaz = track.dcaZ(); + // loop over jet constituents + for (const auto& particle : jetConstituents) { + for (int i = 0; i < nSystematics; i++) { + // get corresponding track and apply track selection criteria + auto const& track = tracks.iteratorAt(particle.user_index()); - if (requirePvContributor && !(track.isPVContributor())) - continue; - if (!track.hasITS()) - continue; - if (track.itsNCls() < itsNclustersSyst[i]) - continue; - if (!track.hasTPC()) - continue; - if (track.tpcNClsCrossedRows() < tpcNcrossedRowsSyst[i]) - continue; - if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < minTpcNcrossedRowsOverFindable) - continue; - if (track.tpcChi2NCl() > maxChiSquareTpc) - continue; - if (track.itsChi2NCl() > maxChiSquareIts) - continue; - if (track.eta() < minEta || track.eta() > maxEta) - continue; - if (track.pt() < minPt) - continue; - if (std::fabs(dcaxy) > dcaxySyst[i]) - continue; - if (std::fabs(dcaz) > dcazSyst[i]) - continue; + // variables + double nsigmaTPCPr = track.tpcNSigmaPr(); + double nsigmaTOFPr = track.tofNSigmaPr(); + double nsigmaTPCDe = track.tpcNSigmaDe(); + double nsigmaTOFDe = track.tofNSigmaDe(); + double pt = track.pt(); + double dcaxy = track.dcaXY(); + double dcaz = track.dcaZ(); - bool passedItsPidProt(false), passedItsPidDeut(false); - if (itsResponse.nSigmaITS(track) > nSigmaItsMin && itsResponse.nSigmaITS(track) < nSigmaItsMax) { - passedItsPidProt = true; - } - if (itsResponse.nSigmaITS(track) > nSigmaItsMin && itsResponse.nSigmaITS(track) < nSigmaItsMax) { - passedItsPidDeut = true; - } - if (!applyItsPid) { - passedItsPidProt = true; - passedItsPidDeut = true; - } - if (pt > ptMaxItsPidProt) - passedItsPidProt = true; - if (pt > ptMaxItsPidDeut) - passedItsPidDeut = true; + if (requirePvContributor && !(track.isPVContributor())) + continue; + if (!track.hasITS()) + continue; + if (track.itsNCls() < itsNclustersSyst[i]) + continue; + if (!track.hasTPC()) + continue; + if (track.tpcNClsCrossedRows() < tpcNcrossedRowsSyst[i]) + continue; + if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < minTpcNcrossedRowsOverFindable) + continue; + if (track.tpcChi2NCl() > maxChiSquareTpc) + continue; + if (track.itsChi2NCl() > maxChiSquareIts) + continue; + if (track.eta() < minEta || track.eta() > maxEta) + continue; + if (track.pt() < minPt) + continue; + if (std::fabs(dcaxy) > dcaxySyst[i]) + continue; + if (std::fabs(dcaz) > dcazSyst[i]) + continue; - // antimatter - if (track.sign() < 0) { - if (passedItsPidProt) { - registryData.fill(HIST("antiproton_tpc_syst"), pt, nsigmaTPCPr, i); - if (nsigmaTPCPr > minNsigmaTpc && nsigmaTPCPr < maxNsigmaTpc && track.hasTOF()) - registryData.fill(HIST("antiproton_tof_syst"), pt, nsigmaTOFPr, i); + bool passedItsPidProt(false), passedItsPidDeut(false); + if (itsResponse.nSigmaITS(track) > nSigmaItsMin && itsResponse.nSigmaITS(track) < nSigmaItsMax) { + passedItsPidProt = true; } - if (passedItsPidDeut) { - registryData.fill(HIST("antideuteron_tpc_syst"), pt, nsigmaTPCDe, i); - if (nsigmaTPCDe > minNsigmaTpc && nsigmaTPCDe < maxNsigmaTpc && track.hasTOF()) - registryData.fill(HIST("antideuteron_tof_syst"), pt, nsigmaTOFDe, i); + if (itsResponse.nSigmaITS(track) > nSigmaItsMin && itsResponse.nSigmaITS(track) < nSigmaItsMax) { + passedItsPidDeut = true; + } + if (!applyItsPid) { + passedItsPidProt = true; + passedItsPidDeut = true; + } + if (pt > ptMaxItsPidProt) + passedItsPidProt = true; + if (pt > ptMaxItsPidDeut) + passedItsPidDeut = true; + + // antimatter + if (track.sign() < 0) { + if (passedItsPidProt) { + registryData.fill(HIST("antiproton_tpc_syst"), pt, nsigmaTPCPr, i); + if (nsigmaTPCPr > minNsigmaTpc && nsigmaTPCPr < maxNsigmaTpc && track.hasTOF()) + registryData.fill(HIST("antiproton_tof_syst"), pt, nsigmaTOFPr, i); + } + if (passedItsPidDeut) { + registryData.fill(HIST("antideuteron_tpc_syst"), pt, nsigmaTPCDe, i); + if (nsigmaTPCDe > minNsigmaTpc && nsigmaTPCDe < maxNsigmaTpc && track.hasTOF()) + registryData.fill(HIST("antideuteron_tof_syst"), pt, nsigmaTOFDe, i); + } } } } } } -} PROCESS_SWITCH(AntinucleiInJets, processSystematicsData, "Process Systematics", false); };