From a669a492bad068f1ecdce96746b84b67796f8d1f Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 16 Dec 2024 19:08:10 +0100 Subject: [PATCH] [PWGLF] get centrality value (fix) (#9009) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 44 ++++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index ac4836d204d..8b3e2b5532d 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -447,20 +447,23 @@ struct ebyeMaker { } template - float getOuterPID(T const& track) + float getITSSignal(T const& track, aod::Run2TrackExtras const& trackExtraRun2) { - if (doprocessMiniRun2 || doprocessMiniMcRun2) { - if (track.hasTOF() && track.pt() > antipPtTof) - return track.tofNSigmaPr(); - // else if (track.pt() < antipPtTof && track.pt() > antipPtMin) { - // return track.tpcNSigmaPr() > -4.f ? track.tpcNSigmaPr() : -999.f; - // } - else - return -999.f; + if ((doprocessMiniRun2 || doprocessMiniMcRun2) && track.hasITS()) { + auto extra = trackExtraRun2.rawIteratorAt(track.globalIndex()); + return extra.itsSignal(); } return -999.f; } + template + float getOuterPID(T const& track) + { + if ((doprocessMiniRun2 || doprocessMiniMcRun2) && track.hasTOF() && track.pt() > antipPtTof) + return track.tofNSigmaPr(); + return -999.f; + } + float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) { auto fv0a = fv0as.rawIteratorAt(id); @@ -562,8 +565,7 @@ struct ebyeMaker { // antid and antip QA histos.add("QA/tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); histos.add("QA/tpcSignalPr", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); - // histos.add("QA/itsSignal", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); - // histos.add("QA/itsSignalPr", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); + histos.add("QA/itsSignal", ";#it{p}_{glo} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); tofMass[0] = histos.add("QA/tofMass_p", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); tofMass[1] = histos.add("QA/tofMass_d", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); @@ -1041,7 +1043,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) continue; } @@ -1108,7 +1110,7 @@ struct ebyeMaker { } PROCESS_SWITCH(ebyeMaker, processRun2, "process (Run 2)", false); - void processMiniRun2(soa::Join const& collisions, TracksFullPID const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, BCsWithRun2Info const&) + void processMiniRun2(soa::Join const& collisions, TracksFullPID const& tracks, aod::Run2TrackExtras const& trackExtraRun2, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -1118,7 +1120,7 @@ struct ebyeMaker { if (std::abs(collision.posZ()) > zVtxMax) continue; - if (!collision.alias_bit(kINT7)) + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) continue; if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) @@ -1127,7 +1129,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1144,6 +1146,9 @@ struct ebyeMaker { for (auto& candidateTrack : candidateTracks[0]) { // protons auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); + float itsSignal = getITSSignal(tk, trackExtraRun2); + histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); + candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; int selMask = getTrackSelMask(candidateTrack); if (candidateTrack.outerPID < outerPIDMin) @@ -1244,7 +1249,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1300,7 +1305,7 @@ struct ebyeMaker { } PROCESS_SWITCH(ebyeMaker, processMcRun2, "process MC (Run 2)", false); - void processMiniMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullPID const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) + void processMiniMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullPID const& tracks, aod::Run2TrackExtras const& trackExtraRun2, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -1316,7 +1321,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1335,6 +1340,9 @@ struct ebyeMaker { if (candidateTrack.isreco) { auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); + float itsSignal = getITSSignal(tk, trackExtraRun2); + histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); + candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; selMask = getTrackSelMask(candidateTrack); // if (candidateTrack.outerPID < -4)