Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 65 additions & 17 deletions PWGLF/Tasks/Nuspex/piKpRAA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <string>
Expand Down Expand Up @@ -189,20 +190,23 @@ struct PiKpRAA {

// Configurables Event Selection
Configurable<bool> isNoCollInTimeRangeStrict{"isNoCollInTimeRangeStrict", true, "use isNoCollInTimeRangeStrict?"};
Configurable<bool> selNoSameBunchPileup{"selNoSameBunchPileup", true, "selNoSameBunchPileup?"};
Configurable<bool> selIsGoodZvtxFT0vsPV{"selIsGoodZvtxFT0vsPV", true, "selIsGoodZvtxFT0vsPV?"};
Configurable<bool> isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "use isNoCollInTimeRangeStandard?"};
Configurable<bool> isNoCollInRofStrict{"isNoCollInRofStrict", true, "use isNoCollInRofStrict?"};
Configurable<bool> isNoCollInRofStandard{"isNoCollInRofStandard", false, "use isNoCollInRofStandard?"};
Configurable<bool> isNoHighMultCollInPrevRof{"isNoHighMultCollInPrevRof", true, "use isNoHighMultCollInPrevRof?"};
Configurable<bool> isNoCollInTimeRangeNarrow{"isNoCollInTimeRangeNarrow", false, "use isNoCollInTimeRangeNarrow?"};
Configurable<bool> isOccupancyCut{"isOccupancyCut", true, "Occupancy cut?"};
Configurable<bool> isCentSel{"isCentSel", true, "Centrality selection?"};
Configurable<bool> selHasFT0{"selHasFT0", true, "Has FT0?"};
Configurable<bool> isT0Ccent{"isT0Ccent", true, "Use T0C-based centrality?"};
Configurable<bool> isZvtxPosSel{"isZvtxPosSel", true, "Zvtx position selection?"};
Configurable<bool> isZvtxPosSelMC{"isZvtxPosSelMC", true, "Zvtx position selection for MC events?"};
Configurable<bool> selINELgt0{"selINELgt0", true, "Select INEL > 0?"};
Configurable<bool> isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "T0C Occu cut"};
Configurable<bool> applyNchSel{"applyNchSel", false, "Use mid-rapidity-based Nch selection"};
Configurable<bool> skipRecoColGTOne{"skipRecoColGTOne", true, "Remove collisions if reconstructed more than once"};
Configurable<std::string> detector4Calibration{"detector4Calibration", "T0M", "Detector for nSigma-Nch rejection"};

// Event selection
Configurable<float> posZcut{"posZcut", +10.0, "z-vertex position cut"};
Expand Down Expand Up @@ -256,6 +260,7 @@ struct PiKpRAA {
NoHighMultCollInPrevRof,
NoCollInTimeRangeNarrow,
OccuCut,
HasFT0,
Centrality,
VtxZ,
NchSel,
Expand Down Expand Up @@ -361,6 +366,8 @@ struct PiKpRAA {
registry.add("EventCounter", ";;Events", kTH1F, {axisEvent});
registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos});
registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent});
registry.add("T0CcentVsFoundFT0", ";Found(=1.5) NOT Found(=0.5);", kTH2F, {{{axisCent}, {2, 0, 2}}});
registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}});
registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}});
registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta});
registry.add("dcaVsPtPi", "Primary pions;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent});
Expand All @@ -379,10 +386,11 @@ struct PiKpRAA {
x->SetBinLabel(9, "NoHighMultCollInPrevRof");
x->SetBinLabel(10, "NoCollInTimeRangeNarrow");
x->SetBinLabel(11, "Occupancy Cut");
x->SetBinLabel(12, "Cent. Sel.");
x->SetBinLabel(13, "VtxZ Sel.");
x->SetBinLabel(14, "Nch Sel.");
x->SetBinLabel(15, "INEL > 0");
x->SetBinLabel(12, "Has FT0?");
x->SetBinLabel(13, "Cent. Sel.");
x->SetBinLabel(14, "VtxZ Sel.");
x->SetBinLabel(15, "Nch Sel.");
x->SetBinLabel(16, "INEL > 0");

if (doprocessCalibrationAndV0s) {
registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}});
Expand Down Expand Up @@ -564,7 +572,6 @@ struct PiKpRAA {
LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value;
LOG(info) << "\tapplyNchSel=" << applyNchSel.value;
LOG(info) << "\tselINELgt0=" << selINELgt0.value;
LOG(info) << "\tdetector4Calibration=" << detector4Calibration.value;
LOG(info) << "\tv0TypeSelection=" << static_cast<int>(v0Selections.v0TypeSelection);
LOG(info) << "\tselElecFromGammas=" << v0Selections.selElecFromGammas;
LOG(info) << "\trequireITShit=" << v0Selections.requireITShit;
Expand Down Expand Up @@ -633,6 +640,7 @@ struct PiKpRAA {
const uint64_t timeStamp{foundBC.timestamp()};
const int magField{getMagneticField(timeStamp)};
const double nPV{collision.multNTracksPVeta1() / 1.};
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};

if (applyNchSel) {
const int nextRunNumber{foundBC.runNumber()};
Expand Down Expand Up @@ -687,7 +695,7 @@ struct PiKpRAA {

registry.fill(HIST("NchVsNPV"), nPV, nch);
registry.fill(HIST("zPos"), collision.posZ());
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
registry.fill(HIST("NchVsCent"), centrality, nch);

if (v0Selections.applyPhiCut) {
const int nextRunNumber{foundBC.runNumber()};
Expand Down Expand Up @@ -1407,34 +1415,48 @@ struct PiKpRAA {
nChMC++;
}

//---------------------------
// Only MC events with |Vtx Z| < 10 cm
//---------------------------
if (isZvtxPosSelMC && (std::fabs(mccollision.posZ()) > posZcut)) {
return;
}

//---------------------------
// Only INEL > 0 generated events
//---------------------------
if (selINELgt0) {
if (!(nChMC > kZeroInt)) {
return;
}
} // selINELgt0 condition: Rejects all NON-INEL > 0
}

const auto& nRecColls{collisions.size()};
registry.fill(HIST("NumberOfRecoCollisions"), nRecColls);

//---------------------------
// Only Generated evets with at least one reconstrued collision
//---------------------------
if (nRecColls > kZeroInt) {

// Finds the collisions with the largest number of contributors
// in case nRecColls is larger than One
int biggestNContribs{-1};
int bestCollisionIndex{-1};
for (const auto& collision : collisions) {

const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
if (selHasFT0 && !collision.has_foundFT0()) {
continue;
}

if (biggestNContribs < collision.numContrib()) {
biggestNContribs = collision.numContrib();
bestCollisionIndex = collision.globalIndex();
}

// Needed to calculate denominator of the Event Splitting correction
if (isEventSelected(collision)) {
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
registry.fill(HIST("Centrality_AllRecoEvt"), centrality);
}
}
Expand All @@ -1445,7 +1467,20 @@ struct PiKpRAA {
//---------------------------
for (const auto& collision : collisions) {

// Choose the collisions with the largest number of contributors
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};

//---------------------------
// Reject collisions if has_foundFT0() returns false
//---------------------------
if (selHasFT0 && !collision.has_foundFT0()) {
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 0.5);
continue;
}
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 1.5);

//---------------------------
// Pick the collisions with the largest number of contributors
//---------------------------
if (bestCollisionIndex != collision.globalIndex()) {
continue;
}
Expand All @@ -1472,7 +1507,6 @@ struct PiKpRAA {
// Needed to construct the correlation between MC Nch v.s. centrality
//---------------------------

const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};
registry.fill(HIST("Centrality_WRecoEvt"), centrality);
registry.fill(HIST("zPosMC"), mccollision.posZ());

Expand Down Expand Up @@ -1634,6 +1668,7 @@ struct PiKpRAA {
// This is needed for the number of the Tracking Efficiency
// and the spectra to be corrected
//---------------------------
int nCh{0};
for (const auto& track : groupedTracks) {
// Track Selection
if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter)
Expand Down Expand Up @@ -1693,6 +1728,7 @@ struct PiKpRAA {
registry.fill(HIST("NclVsPhip"), pOrPt, phiPrime, ncl);
registry.fill(HIST("NclVsEtaPID"), eta, ncl);
registry.fill(HIST("NclVsEtaPIDp"), eta, ncl);
nCh++;

bool isPrimary{false};
if (particle.isPhysicalPrimary())
Expand Down Expand Up @@ -1729,6 +1765,7 @@ struct PiKpRAA {
}
registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt());
} // Loop over reconstructed tracks
registry.fill(HIST("NchVsCent"), centrality, nCh);
} // Loop over Reco. Collisions: Only the collisions with the largest number of contributors
} // If condition: Only simulated evets with at least one reconstrued collision

Expand Down Expand Up @@ -2093,15 +2130,19 @@ struct PiKpRAA {
}
registry.fill(HIST("EventCounter"), EvCutLabel::SelEigth);

if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
return false;
if (selNoSameBunchPileup) {
if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
return false;
}
registry.fill(HIST("EventCounter"), EvCutLabel::NoSameBunchPileup);
}
registry.fill(HIST("EventCounter"), EvCutLabel::NoSameBunchPileup);

if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
return false;
if (selIsGoodZvtxFT0vsPV) {
if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
return false;
}
registry.fill(HIST("EventCounter"), EvCutLabel::IsGoodZvtxFT0vsPV);
}
registry.fill(HIST("EventCounter"), EvCutLabel::IsGoodZvtxFT0vsPV);

if (isNoCollInTimeRangeStrict) {
if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) {
Expand Down Expand Up @@ -2155,6 +2196,13 @@ struct PiKpRAA {
registry.fill(HIST("EventCounter"), EvCutLabel::OccuCut);
}

if (selHasFT0) {
if (!col.has_foundFT0()) {
return false;
}
registry.fill(HIST("EventCounter"), EvCutLabel::HasFT0);
}

if (isCentSel) {
if (col.centFT0C() < minT0CcentCut || col.centFT0C() > maxT0CcentCut) {
return false;
Expand Down
Loading