Skip to content

Commit

Permalink
[PWGLF] get centrality value (fix) (AliceO2Group#9009)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciacco authored Dec 16, 2024
1 parent 6a76087 commit a669a49
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions PWGLF/TableProducer/Nuspex/ebyeMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,23 @@ struct ebyeMaker {
}

template <class T>
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 <class T>
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);
Expand Down Expand Up @@ -562,8 +565,7 @@ struct ebyeMaker {
// antid and antip QA
histos.add<TH2>("QA/tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis});
histos.add<TH2>("QA/tpcSignalPr", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis});
// histos.add<TH2>("QA/itsSignal", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis});
// histos.add<TH2>("QA/itsSignalPr", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis});
histos.add<TH2>("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<TH3>("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<TH3>("QA/tofMass_d", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis});

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -1108,7 +1110,7 @@ struct ebyeMaker {
}
PROCESS_SWITCH(ebyeMaker, processRun2, "process (Run 2)", false);

void processMiniRun2(soa::Join<aod::Collisions, aod::EvSels> const& collisions, TracksFullPID const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, BCsWithRun2Info const&)
void processMiniRun2(soa::Join<aod::Collisions, aod::EvSels> 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) {
Expand All @@ -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)))
Expand All @@ -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());
Expand All @@ -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)
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -1300,7 +1305,7 @@ struct ebyeMaker {
}
PROCESS_SWITCH(ebyeMaker, processMcRun2, "process MC (Run 2)", false);

void processMiniMcRun2(soa::Join<aod::Collisions, aod::McCollisionLabels> 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<aod::Collisions, aod::McCollisionLabels> 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) {
Expand All @@ -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());
Expand All @@ -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)
Expand Down

0 comments on commit a669a49

Please sign in to comment.