Skip to content
Merged
Show file tree
Hide file tree
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
65 changes: 55 additions & 10 deletions PWGLF/Tasks/Resonances/kstar892LightIon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ struct Kstar892LightIon {
struct : ConfigurableGroup {
// Configurables for event selections
Configurable<float> cfgVrtxZCut{"cfgVrtxZCut", 10.0f, "Accepted z-vertex range (cm)"};
Configurable<bool> isApplycutVzLoss{"isApplycutVzLoss", true, "Apply Vertex-z cut in processAllLossMC"};
Configurable<bool> isApplysel8{"isApplysel8", true, "Apply sel8 event selection"};
Configurable<bool> isApplyINELgt0{"isApplyINELgt0", true, "INEL>0 selection"};
Configurable<bool> isTriggerTVX{"isTriggerTVX", true, "TriggerTVX"};
Expand All @@ -99,7 +98,9 @@ struct Kstar892LightIon {
Configurable<bool> isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"};

// check
Configurable<bool> isApplyEvSelFactors{"isApplyEvSelFactors", false, "Apply event selection cut in processCorrFactors"};
Configurable<bool> isApplyMCGenInelgt0{"isApplyMCGenInelgt0", true, "Apply INEL>0 cut in MC Gen Collisions"};
Configurable<bool> isApplyMCGenTVX{"isApplyMCGenTVX", true, "Apply TVX cut in MC Gen Collisions"};
Configurable<bool> isApplyMCGenVz{"isApplyMCGenVz", true, "Apply Vz cut in MC Gen Collisions"};

// Configurables for track selections
Configurable<bool> isPVContributor{"isPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor
Expand Down Expand Up @@ -817,7 +818,7 @@ struct Kstar892LightIon {
using EventCandidates = soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::MultZeqs, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::PVMults>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs
using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTOFbeta, aod::TrackSelectionExtension>;

using EventMCGenerated = soa::Join<aod::McCollisions, aod::MultsExtraMC>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs
using EventMCGenerated = soa::Join<aod::McCollisions, aod::MultMCExtras>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs
using EventCandidatesMC = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::MultZeqs, aod::FT0Mults, aod::PVMults, aod::CentFV0As>;
using TrackCandidatesMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::McTrackLabels, aod::pidTOFbeta, aod::TrackSelectionExtension>;

Expand Down Expand Up @@ -1272,6 +1273,19 @@ struct Kstar892LightIon {

void processGen(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
{

if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}

if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) {
return;
}

std::vector<int64_t> selectedEvents(collisions.size());
int nevts = 0;
centrality = -1.0;
Expand Down Expand Up @@ -1590,8 +1604,20 @@ struct Kstar892LightIon {
}
PROCESS_SWITCH(Kstar892LightIon, processRec, "Process Reconstructed", false);

void processEvtLossSigLossMC(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
void processEvtLossSigLossMC(EventMCGenerated::iterator const& mcCollision, const soa::SmallGroups<EventCandidatesMC>& recCollisions, aod::McParticles const& mcParticles)
{
if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}

if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) {
return;
}

auto impactPar = mcCollision.impactParameter();
hMC.fill(HIST("ImpactCorr/hImpactParameterGen"), impactPar);

Expand Down Expand Up @@ -1639,11 +1665,21 @@ struct Kstar892LightIon {
}
PROCESS_SWITCH(Kstar892LightIon, processEvtLossSigLossMC, "Process Signal Loss, Event Loss using impact parameter", false);

using McCollisionMults = soa::Join<aod::McCollisions, aod::MultMCExtras>;
using LabeledTracks = soa::Join<aod::Tracks, aod::McTrackLabels>;

void processLossMCMultiplicity(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups<EventCandidatesMC> const& recCollisions)
void processLossMCMultiplicity(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups<EventCandidatesMC> const& recCollisions)
{

if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}

if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) {
return;
}

const int multMC = mcCollision.multMCNParticlesEta05();
hMC.fill(HIST("LossMult/hMultMC"), multMC);

Expand Down Expand Up @@ -1697,10 +1733,19 @@ struct Kstar892LightIon {
}
PROCESS_SWITCH(Kstar892LightIon, processLossMCMultiplicity, "Signal + Event loss (using MC multiplicity)", false);

void processAllLossMC(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
void processAllLossMC(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
{
if (selectionConfig.isApplycutVzLoss && std::abs(mcCollision.posZ()) > selectionConfig.cfgVrtxZCut)
if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}

if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) {
return;
}

// Event loss estimation
auto impactPar = mcCollision.impactParameter();
Expand Down
70 changes: 52 additions & 18 deletions PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ struct phianalysisrun3_PbPb {
Configurable<bool> additionalEvSel5{"additionalEvSel5", true, "Additional evsel5"};
Configurable<bool> additionalEvSel6{"additionalEvSel6", true, "Additional evsel6"};
Configurable<bool> cutvz{"cutvz", true, "Vz cut"};
Configurable<bool> cutvzgen{"cutvzgen", true, "Vz cut"};
Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
} selectionConfig;
Configurable<bool> cfgMultFT0{"cfgMultFT0", true, "cfgMultFT0"};
Expand Down Expand Up @@ -134,7 +135,8 @@ struct phianalysisrun3_PbPb {
ConfigurableAxis binsMult{"binsMult", {500, 0.0f, +500.0f}, ""};
Configurable<bool> isApplyCentFT0C{"isApplyCentFT0C", true, "Centrality based on FT0C"};
Configurable<bool> isApplyCentFT0M{"isApplyCentFV0M", false, "Centrality based on FT0M"};

Configurable<bool> isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"};
Configurable<bool> isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"};
Configurable<bool> genacceptancecut{"genacceptancecut", true, "use acceptance cut for generated"};
// MC
Configurable<bool> isMC{"isMC", false, "Run MC"};
Expand Down Expand Up @@ -1693,59 +1695,77 @@ struct phianalysisrun3_PbPb {
}
}
PROCESS_SWITCH(phianalysisrun3_PbPb, processMixedEventMC, "Process Mixed event MC", true);
void processGen1(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
void processGen1(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
{
// all events
histos.fill(HIST("hMC1"), 0.5);
if (!selectionConfig.cutvz || std::abs(mcCollision.posZ()) < selectionConfig.cfgCutVertex) {

// vertex QA (not selection)
if (!selectionConfig.cutvzgen ||
std::abs(mcCollision.posZ()) < selectionConfig.cfgCutVertex) {
histos.fill(HIST("hMC1"), 1.5);
}

// INEL>0 selection
if (isApplyInelgt0 && !mcCollision.isInelGt0())
return;

histos.fill(HIST("hMC1"), 2.5);

// TVX selection
if (isApplyTVX &&
!(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0))
return;

histos.fill(HIST("hMC1"), 3.5);
std::vector<int64_t> selectedEvents(collisions.size());
int nevts = 0;
auto multiplicity = -1.0;
for (const auto& collision : collisions) {
histos.fill(HIST("hMC1"), 2.5);
histos.fill(HIST("hMC1"), 4.5);
if (cfgDoSel8 && !collision.sel8()) {
continue;
}
histos.fill(HIST("hMC1"), 5.5);
if (selectionConfig.cutvz &&
std::abs(collision.mcCollision().posZ()) > selectionConfig.cfgCutVertex) {
continue;
}

histos.fill(HIST("hMC1"), 3.5);
histos.fill(HIST("hMC1"), 6.5);
if (selectionConfig.additionalEvSel1 && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
continue;
}
histos.fill(HIST("hMC1"), 4.5);
histos.fill(HIST("hMC1"), 7.5);
if (selectionConfig.additionalEvSel2 && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) {
continue;
}
histos.fill(HIST("hMC1"), 5.5);
histos.fill(HIST("hMC1"), 8.5);
if (selectionConfig.additionalEvSel3 && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) {
continue;
}
histos.fill(HIST("hMC1"), 6.5);
histos.fill(HIST("hMC1"), 9.5);
if (selectionConfig.additionalEvSel4 && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
continue;
}
histos.fill(HIST("hMC1"), 7.5);
histos.fill(HIST("hMC1"), 10.5);
if (selectionConfig.additionalEvSel5 && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
continue;
}
histos.fill(HIST("hMC1"), 8.5);
histos.fill(HIST("hMC1"), 11.5);
if (selectionConfig.additionalEvSel6 && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
continue;
}
histos.fill(HIST("hMC1"), 9.5);
histos.fill(HIST("hMC1"), 12.5);
if (selectionConfig.isINELgt0 && !collision.isInelGt0()) {
continue;
}
histos.fill(HIST("hMC1"), 10.5);
histos.fill(HIST("hMC1"), 13.5);
int occupancy = collision.trackOccupancyInTimeRange();
if (selectionConfig.fillOccupancy && (occupancy < cfgMinOccupancy || occupancy > cfgMaxOccupancy)) {
continue;
}
histos.fill(HIST("hMC1"), 11.5);
histos.fill(HIST("hMC1"), 14.5);
const int kCentFT0C = 0;
const int kCentFT0A = 1;
const int kCentFT0M = 2;
Expand All @@ -1765,11 +1785,11 @@ struct phianalysisrun3_PbPb {
}
selectedEvents.resize(nevts);
const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end();
histos.fill(HIST("hMC1"), 12.5);
histos.fill(HIST("hMC1"), 15.5);
if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
return;
}
histos.fill(HIST("hMC1"), 13.5);
histos.fill(HIST("hMC1"), 16.5);
for (const auto& mcParticle : mcParticles) {

if (mcParticle.y() < rapiditycut1 || mcParticle.y() > rapiditycut2) {
Expand Down Expand Up @@ -1861,7 +1881,7 @@ struct phianalysisrun3_PbPb {
multiplicity = collision.centFV0A();
}
histos.fill(HIST("Centrec1"), multiplicity);
histos.fill(HIST("hMC1"), 14.5);
histos.fill(HIST("hMC1"), 17.5);
auto oldindex = -999;
for (const auto& track1 : tracks) {
if (!selectionTrack(track1)) {
Expand Down Expand Up @@ -1958,10 +1978,17 @@ struct phianalysisrun3_PbPb {
void processEvtLossSigLossMC(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
{

if (selectionConfig.cutvz &&
if (selectionConfig.cutvzgen &&
std::abs(mcCollision.posZ()) > selectionConfig.cfgCutVertex) {
return;
}
if (isApplyInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}
// Event loss estimation
auto impactPar = mcCollision.impactParameter();
histos.fill(HIST("QAevent/hImpactParameterGen"), impactPar);
Expand Down Expand Up @@ -2026,10 +2053,17 @@ struct phianalysisrun3_PbPb {
PROCESS_SWITCH(phianalysisrun3_PbPb, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false);
void processEvtLossSigLossMC1(McCollisionMults::iterator const& mcCollision, soa::SmallGroups<EventCandidatesMC> const& collisions, aod::McParticles const& GenParticles)
{
if (selectionConfig.cutvz &&
if (selectionConfig.cutvzgen &&
std::abs(mcCollision.posZ()) > selectionConfig.cfgCutVertex) {
return;
}
if (isApplyInelgt0 && !mcCollision.isInelGt0()) {
return;
}

if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) {
return;
}
// All generated events
histos.fill(HIST("MCEventHist"), 1);
histos.fill(HIST("hImpactParameterGen1"), mcCollision.impactParameter());
Expand Down
Loading