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
84 changes: 80 additions & 4 deletions PWGLF/Tasks/Nuspex/piKpRAA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ using namespace o2::framework;
using namespace o2::aod::evsel;
using namespace o2::constants::math;
using namespace o2::framework::expressions;
using namespace o2::aod::rctsel;

using ColEvSels = soa::Join<aod::Collisions, aod::EvSels, aod::FT0MultZeqs, o2::aod::CentFT0Cs, o2::aod::CentFT0Ms, aod::TPCMults, o2::aod::BarrelMults>;
using BCsRun3 = soa::Join<aod::BCsWithTimestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
Expand Down Expand Up @@ -121,6 +122,10 @@ struct PiKpRAA {
static constexpr float kMaxdEdxMIP{60.0f};
static constexpr float kMindEdxMIPPlateau{70.0f};
static constexpr float kMaxdEdxMIPPlateau{90.0f};
static constexpr float kMinFT0A{3.5f};
static constexpr float kMaxFT0A{4.9f};
static constexpr float kMinFT0C{-3.3f};
static constexpr float kMaxFT0C{-2.1f};

static constexpr float kLowEta[kNEtaHists] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6};
static constexpr float kHighEta[kNEtaHists] = {-0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8};
Expand Down Expand Up @@ -203,6 +208,7 @@ struct PiKpRAA {
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> selTVXMC{"selTVXMC", true, "apply TVX selection in MC?"};
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"};
Expand Down Expand Up @@ -247,6 +253,14 @@ struct PiKpRAA {
Configurable<std::string> pathPhiCutHigh{"pathPhiCutHigh", "Users/o/omvazque/PhiCut/OO/Global/High", "base path to the ccdb object"};
Configurable<std::string> pathPhiCutLow{"pathPhiCutLow", "Users/o/omvazque/PhiCut/OO/Global/Low", "base path to the ccdb object"};
Configurable<int64_t> ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "RCT selection flag (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"};
Configurable<bool> rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"};
Configurable<bool> rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"};
Configurable<bool> requireGoodRct{"requireGoodRct", true, "RCT flag to reject events with limited acceptance for selected detectors"};
Configurable<bool> requireGoodPIDRct{"requireGoodPIDRct", true, "RCT flag to reject events with limited acceptance for selected detectors"};

// RCT Checker instance
RCTFlagsChecker rctChecker;

enum EvCutLabel {
All = 1,
Expand Down Expand Up @@ -344,6 +358,12 @@ struct PiKpRAA {
int currentRunNumberPhiSel;
void init(InitContext const&)
{

// Initialize the rct checker
if (requireGoodRct) {
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
}

currentRunNumberNchSel = -1;
currentRunNumberPhiSel = -1;
trkSelGlobalOpenDCAxy = trkSelOpenDCAxy();
Expand All @@ -366,7 +386,7 @@ 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("T0CcentVsFoundFT0", "Found(=1.5) NOT Found(=0.5);;Status;", 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});
Expand All @@ -393,6 +413,7 @@ struct PiKpRAA {
x->SetBinLabel(16, "INEL > 0");

if (doprocessCalibrationAndV0s) {
registry.add("T0CcentVsRCTSel", "Bad RCT(=0.5) Good RCT(=1.5) Good RCT & Good PID RCT(=2.5);;RCT Status;", kTH2F, {{{axisCent}, {3, 0, 3}}});
registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}});
registry.add("ExcludedEvtVsNch", ";Nch;Entries;", kTH1F, {{nBinsNch, minNch, maxNch}});
registry.add("ExcludedEvtVsNPV", ";NPV;Entries;", kTH1F, {{nBinsNPV, minNpv, maxNpv}});
Expand Down Expand Up @@ -523,6 +544,9 @@ struct PiKpRAA {

if (doprocessSim) {

// MC events passing the TVX requirement
registry.add("NchMCcentVsTVX", ";Passed(=1.5) NOT Passed(=0.5);", kTH2F, {{{nBinsNch, minNch, maxNch}, {2, 0, 2}}});

registry.add("NumberOfRecoCollisions", "Number of times Gen. Coll.are reconstructed;N;Entries", kTH1F, {{10, -0.5, 9.5}});

// Pt resolution
Expand Down Expand Up @@ -569,6 +593,7 @@ struct PiKpRAA {
registry.add("MCclosure_PtPrVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch;", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}});
}

LOG(info) << "\trequireGoodRct=" << requireGoodRct.value;
LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value;
LOG(info) << "\tapplyNchSel=" << applyNchSel.value;
LOG(info) << "\tselINELgt0=" << selINELgt0.value;
Expand Down Expand Up @@ -632,6 +657,7 @@ struct PiKpRAA {
// LOG(info) << " Collisions size: " << collisions.size() << "
// Table's size: " << collisions.tableSize() << "\n";
// LOG(info) << "Run number: " << foundBC.runNumber() << "\n";

if (!isEventSelected(collision)) {
return;
}
Expand All @@ -642,6 +668,31 @@ struct PiKpRAA {
const double nPV{collision.multNTracksPVeta1() / 1.};
const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()};

//---------------------------
// Control histogram
//---------------------------
if (selHasFT0 && !collision.has_foundFT0()) {
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 0.5);
}
registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 1.5);

// Apply RCT selection?
if (requireGoodRct) {

// Checks if collisions passes RCT selection
if (!rctChecker(*collision)) {
registry.fill(HIST("T0CcentVsRCTSel"), centrality, 0.5);
return;
}

registry.fill(HIST("T0CcentVsRCTSel"), centrality, 1.5);
// Checks if collisions passes good PID RCT status
if (requireGoodPIDRct && collision.rct_bit(kTPCBadPID)) {
return;
}
registry.fill(HIST("T0CcentVsRCTSel"), centrality, 2.5);
}

if (applyNchSel) {
const int nextRunNumber{foundBC.runNumber()};
if (currentRunNumberNchSel != nextRunNumber) {
Expand Down Expand Up @@ -1390,11 +1441,10 @@ struct PiKpRAA {
// By counting number of primary charged particles in |eta| < 1
//---------------------------
int nChMC{0};
int nChFT0A{0};
int nChFT0C{0};
for (const auto& particle : mcParticles) {

if (std::abs(particle.eta()) > kOne)
continue;

auto charge{0.};
// Get the MC particle
const auto* pdgParticle = pdg->GetParticle(particle.pdgCode());
Expand All @@ -1412,9 +1462,35 @@ struct PiKpRAA {
if (!particle.isPhysicalPrimary())
continue;

const float eta{particle.eta()};

// TVX requirement
if (eta > kMinFT0A && eta < kMaxFT0A) {
nChFT0A++;
}

if (eta > kMinFT0C && eta < kMaxFT0C) {
nChFT0C++;
}

// INEL > 0
if (std::abs(eta) > kOne)
continue;

nChMC++;
}

//---------------------------
// Only events with at least one charged particle in the FT0A and FT0C acceptances
//---------------------------
if (selTVXMC) {
if (!(nChFT0A > kZeroInt && nChFT0C > kZeroInt)) {
registry.fill(HIST("NchMCcentVsTVX"), nChMC, 0.5);
return;
}
registry.fill(HIST("NchMCcentVsTVX"), nChMC, 1.5);
}

//---------------------------
// Only MC events with |Vtx Z| < 10 cm
//---------------------------
Expand Down
Loading