Skip to content
Open
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
4 changes: 2 additions & 2 deletions PWGLF/DataModel/LFResonanceTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
DECLARE_SOA_COLUMN(IsInSel8, isInSel8, bool); //! InSel8
DECLARE_SOA_COLUMN(IsInAfterAllCuts, isInAfterAllCuts, bool); //! InAfterAllCuts
DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float); //! ImpactParameter
DECLARE_SOA_COLUMN(MCMultiplicity, mcMultiplicity, float); //! MC Multiplicity

Check failure on line 82 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

} // namespace resocollision
DECLARE_SOA_TABLE(ResoCollisions, "AOD", "RESOCOLLISION",
Expand Down Expand Up @@ -174,7 +174,7 @@
#define requireSign() requireTrackFlag(ResoTrackFlags::kSign)

#define DECLARE_DYN_TRKSEL_COLUMN(name, getter, mask) \
DECLARE_SOA_DYNAMIC_COLUMN(name, getter, [](ResoTrackFlags::flagtype flags) -> bool { return ResoTrackFlags::checkFlag(flags, mask); });

Check failure on line 177 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_INDEX_COLUMN(ResoCollision, resoCollision);
DECLARE_SOA_INDEX_COLUMN(ResoCollisionDF, resoCollisionDF);
Expand Down Expand Up @@ -214,8 +214,8 @@
DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float); //! Y position of the decay vertex
DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex
DECLARE_SOA_COLUMN(Alpha, alpha, float); //! Alpha of the decay vertex
DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! Armenteros Qt of the decay vertex

Check failure on line 217 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TpcSignal10, tpcSignal10, int8_t); //! TPC signal of the track x10
DECLARE_SOA_COLUMN(TpcSignal10, tpcSignal10, int16_t); //! TPC signal of the track x10
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosPi10, daughterTPCNSigmaPosPi10, int8_t); //! TPC PID x10 of the positive daughter as Pion
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosKa10, daughterTPCNSigmaPosKa10, int8_t); //! TPC PID x10 of the positive daughter as Kaon
DECLARE_SOA_COLUMN(DaughterTPCNSigmaPosPr10, daughterTPCNSigmaPosPr10, int8_t); //! TPC PID x10 of the positive daughter as Proton
Expand Down Expand Up @@ -310,7 +310,7 @@
[](int8_t daughterTOFNSigmaBachPr10) { return (float)daughterTOFNSigmaBachPr10 / 10.f; });
// TPC signal x10
DECLARE_SOA_DYNAMIC_COLUMN(TpcSignal, tpcSignal,
[](int8_t tpcSignal10) { return (float)tpcSignal10 / 10.f; });
[](int16_t tpcSignal10) { return (float)tpcSignal10 / 100.f; });
// pT, Eta, Phi
// DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); });
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); });
Expand Down Expand Up @@ -371,13 +371,13 @@
static uint8_t encodeNSigma(float nSigma)
{
const float x = std::abs(nSigma);
if (x <= 1.5)

Check failure on line 374 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return 0; // Return 0 when absolute nSigma is smaller than 1.5
float t = (x - 1.5) / 0.2;
int encoded = static_cast<int>(std::ceil(t)); // (1.5,1.7]->1, ..., (3.3,3.5]->10
if (encoded < 1)
encoded = 1;
if (encoded > 10)

Check failure on line 380 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 10;
return static_cast<uint8_t>(encoded);
}
Expand All @@ -387,7 +387,7 @@
{
if (encoded == 0)
return 1.5;
if (encoded > 10)

Check failure on line 390 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 10;
return 1.5 + static_cast<float>(encoded) * 0.2;
}
Expand Down Expand Up @@ -449,12 +449,12 @@
static uint8_t encodeDCA(float DCA)
{
float x = std::fabs(DCA);
if (x < 0.1)

Check failure on line 452 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return 0;
int encoded = static_cast<int>(std::ceil((x - 0.1) / 0.1)); // (0.1, 0.2] -> 1, ..., (1.4, 1.5] -> 14
if (encoded < 1)
encoded = 1;
if (encoded > 14)

Check failure on line 457 in PWGLF/DataModel/LFResonanceTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
encoded = 15;
return static_cast<uint8_t>(encoded);
}
Expand Down
19 changes: 15 additions & 4 deletions PWGLF/TableProducer/Resonances/resonanceInitializer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
Configurable<double> dBzInput{"dBzInput", -999, "bz field, -999 is automatic"};
Configurable<bool> cfgFillQA{"cfgFillQA", false, "Fill QA histograms"};
Configurable<bool> cfgBypassCCDB{"cfgBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value.

// Track filter from tpcSkimsTableCreator
Configurable<int> trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"};
Configurable<int> trackSphDef{"trackSphDef", 0, "Spherocity Definition: |pT| = 1 -> 0, otherwise -> 1"};
Expand Down Expand Up @@ -237,6 +236,7 @@
Configurable<int> pdgTruthMother{"pdgTruthMother", 3324, "pdgcode for the truth mother e.g. Xi(1530) (3324)"};
Configurable<int> pdgTruthDaughter1{"pdgTruthDaughter1", 3312, "pdgcode for the daughter 1, e.g. Xi- 3312"};
Configurable<int> pdgTruthDaughter2{"pdgTruthDaughter2", 211, "pdgcode for the daughter 2, e.g. pi+ 211"};
Configurable<bool> cfgDoSignalLoss{"cfgDoSignalLoss", false, "Save reference particles for mT scaling signal loss"};
} GenCuts;
Configurable<bool> checkIsRecINELgt0{"checkIsRecINELgt0", true, "Check rec INEL>0 for the Rec. Collision"};

Expand All @@ -260,8 +260,8 @@
int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100;

// MC Resonance parent filter
Partition<aod::McParticles> selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 313) // K*

Check failure on line 263 in PWGLF/TableProducer/Resonances/resonanceInitializer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
|| (nabs(aod::mcparticle::pdgCode) == 323) // K*pm

Check failure on line 264 in PWGLF/TableProducer/Resonances/resonanceInitializer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
|| (nabs(aod::mcparticle::pdgCode) == 333) // phi
|| (nabs(aod::mcparticle::pdgCode) == 9010221) // f_0(980)
|| (nabs(aod::mcparticle::pdgCode) == 10221) // f_0(1370)
Expand All @@ -277,8 +277,13 @@
|| (nabs(aod::mcparticle::pdgCode) == 3324) // Xi(1530)0
|| (nabs(aod::mcparticle::pdgCode) == 10323) // K1(1270)+
|| (nabs(aod::mcparticle::pdgCode) == 123314) // Xi(1820)0
|| (nabs(aod::mcparticle::pdgCode) == 123324); // Xi(1820)-0

|| (nabs(aod::mcparticle::pdgCode) == 123324) // Xi(1820)-0
|| (nabs(aod::mcparticle::pdgCode) == 2212) // Proton
|| (nabs(aod::mcparticle::pdgCode) == 3122) // Lambda0
|| (nabs(aod::mcparticle::pdgCode) == 3312) // Xi-
|| (nabs(aod::mcparticle::pdgCode) == 3322) // Xi0
|| (nabs(aod::mcparticle::pdgCode) == 3334); // Omega-
//
using ResoEvents = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::Mults>;
using ResoEvents001 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::Mults, aod::MultsExtra, aod::PVMults>;
using ResoRun2Events = soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms>;
Expand Down Expand Up @@ -759,7 +764,7 @@
static_cast<int8_t>(std::round(track.tofNSigmaPi() * 10)),
static_cast<int8_t>(std::round(track.tofNSigmaKa() * 10)),
static_cast<int8_t>(std::round(track.tofNSigmaPr() * 10)),
static_cast<int8_t>(std::round(track.tpcSignal() * 10)),
static_cast<int16_t>(std::round(track.tpcSignal() * 100)),
trackFlags);
if (!cfgBypassTrackIndexFill) {
resoTrackTracks(track.globalIndex());
Expand Down Expand Up @@ -1182,6 +1187,12 @@
void fillMCParticles(SelectedMCPartType const& mcParts, TotalMCParts const& mcParticles)
{
for (auto const& mcPart : mcParts) {
if (!GenCuts.cfgDoSignalLoss) {
int absPdg = std::abs(mcPart.pdgCode());
if (absPdg == 2212 || absPdg == 3122 || absPdg == 3312 || absPdg == 3322 || absPdg == 3334) {
continue;
}
}
std::vector<int> daughterPDGs;
if (mcPart.has_daughters()) {
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());
Expand Down
8 changes: 4 additions & 4 deletions PWGLF/TableProducer/Resonances/resonanceMergeDF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct ResonanceMergeDF {
(int8_t)(track.tofNSigmaPi() * 10),
(int8_t)(track.tofNSigmaKa() * 10),
(int8_t)(track.tofNSigmaPr() * 10),
(int8_t)(track.tpcSignal() * 10),
static_cast<int16_t>(track.tpcSignal() * 100),
track.trackFlags()));
}

Expand Down Expand Up @@ -271,7 +271,7 @@ struct ResonanceMergeDF {
(int8_t)(track.tofNSigmaPi() * 10),
(int8_t)(track.tofNSigmaKa() * 10),
(int8_t)(track.tofNSigmaPr() * 10),
(int8_t)(track.tpcSignal() * 10),
static_cast<int16_t>(track.tpcSignal() * 100),
track.trackFlags()));
}

Expand Down Expand Up @@ -458,7 +458,7 @@ struct ResonanceMergeDF {
(int8_t)(track.tofNSigmaPi() * 10),
(int8_t)(track.tofNSigmaKa() * 10),
(int8_t)(track.tofNSigmaPr() * 10),
(int8_t)(track.tpcSignal() * 10),
static_cast<int16_t>(track.tpcSignal() * 100),
track.trackFlags());
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@ struct ResonanceMergeDF {
(int8_t)(track.tofNSigmaPi() * 10),
(int8_t)(track.tofNSigmaKa() * 10),
(int8_t)(track.tofNSigmaPr() * 10),
(int8_t)(track.tpcSignal() * 10),
static_cast<int16_t>(track.tpcSignal() * 100),
track.trackFlags());
}
// Cascade candidate
Expand Down
117 changes: 114 additions & 3 deletions PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,24 @@ struct lambdaAnalysis_pb {
histos.add("Analysis/h3d_reso_lstar_PM", "Resolution #Lambda(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent});
histos.add("Analysis/h3d_reso_lstar_MP", "Resolution #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent});
}

if (doprocessMCGen) {
histos.add("SignalLoss/hMCEventCutflow", "MC Event Cutflow", kTH1F, {{7, 0, 7}});
histos.add("SignalLoss/hGen_mT_scaled_Proton", "mT Scaled #Lambda(1520) from Proton", kTHnSparseF, {axisPt, axisCent});
histos.add("SignalLoss/hGen_mT_scaled_AntiProton", "mT Scaled #bar{#Lambda}(1520) from AntiProton", kTHnSparseF, {axisPt, axisCent});

histos.add("SignalLoss/hGen_mT_scaled_Lambda0", "mT Scaled #Lambda(1520) from Lambda0", kTHnSparseF, {axisPt, axisCent});
histos.add("SignalLoss/hGen_mT_scaled_AntiLambda0", "mT Scaled #bar{#Lambda}(1520) from AntiLambda0", kTHnSparseF, {axisPt, axisCent});

histos.add("SignalLoss/hGen_mT_scaled_XiMinus", "mT Scaled #Lambda(1520) from Xi-", kTHnSparseF, {axisPt, axisCent});
histos.add("SignalLoss/hGen_mT_scaled_XiPlus", "mT Scaled #bar{#Lambda}(1520) from Xi+", kTHnSparseF, {axisPt, axisCent});

histos.add("SignalLoss/hGen_mT_scaled_Xi0", "mT Scaled #Lambda(1520) from Xi0", kTHnSparseF, {axisPt, axisCent});
histos.add("SignalLoss/hGen_mT_scaled_AntiXi0", "mT Scaled #bar{#Lambda}(1520) from AntiXi0", kTHnSparseF, {axisPt, axisCent});

histos.add("SignalLoss/hGen_mT_scaled_OmegaMinus", "mT Scaled #Lambda(1520) from Omega-", kTHnSparseF, {axisPt, axisCent});
histos.add("SignalLoss/hGen_mT_scaled_OmegaPlus", "mT Scaled #bar{#Lambda}(1520) from Omega+", kTHnSparseF, {axisPt, axisCent});
}
}

template <typename T>
Expand Down Expand Up @@ -771,10 +789,11 @@ struct lambdaAnalysis_pb {
for (auto const& part : resoParents) {
if (std::abs(part.pdgCode()) != lambda1520id) // // L* pdg_code = 3124
continue;
// if (std::abs(part.y()) > 0.5) { // rapidity cut
// continue;
// }

float yshift = std::abs(part.y()) - cfgRapidityShift;

if (std::abs(yshift) > cfgRapidityCut)
continue;
bool pass1 = false;
bool pass2 = false;

Expand All @@ -797,6 +816,98 @@ struct lambdaAnalysis_pb {
}
PROCESS_SWITCH(lambdaAnalysis_pb, processMC, "Process Event for MC", false);

void processMCGen(resoMCCols::iterator const& collision,
aod::ResoMCParents const& resoParents)
{

float centrality = collision.cent();

histos.fill(HIST("SignalLoss/hMCEventCutflow"), 0); // All collisions

if (cEvtMCTriggerTVX && !collision.isTriggerTVX())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 1); // After TriggerTVX

if (cEvtMCVtxIn10 && !collision.isVtxIn10())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 2); // After VtxIn10

if (cEvtMCINELgt0 && !collision.isINELgt0())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 3); // After INELgt0

if (cEvtMCSel8 && !collision.isInSel8())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 4); // After Sel8

if (cEvtMCRecINELgt0 && !collision.isRecINELgt0())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 5); // After RecINELgt0

if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts())
return;
histos.fill(HIST("SignalLoss/hMCEventCutflow"), 6); // After AfterAllCuts

for (auto const& part : resoParents) {

float yshift = std::abs(part.y()) - cfgRapidityShift;

if (std::abs(yshift) > cfgRapidityCut)
continue;

int pdg = part.pdgCode();
float ptRef = part.pt();
double ptSq = -1.0;

std::array<float, 3> pvec = {part.px(), part.py(), part.pz()};
float mass = RecoDecay::m(pvec, part.e());

if (pdg == 2212) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Proton"), std::sqrt(ptSq), centrality);
} else if (pdg == -2212) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiProton"), std::sqrt(ptSq), centrality);
} else if (pdg == 3122) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Lambda0"), std::sqrt(ptSq), centrality);
} else if (pdg == -3122) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiLambda0"), std::sqrt(ptSq), centrality);
} else if (pdg == 3312) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_XiMinus"), std::sqrt(ptSq), centrality);
} else if (pdg == -3312) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_XiPlus"), std::sqrt(ptSq), centrality);
} else if (pdg == 3322) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_Xi0"), std::sqrt(ptSq), centrality);
} else if (pdg == -3322) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_AntiXi0"), std::sqrt(ptSq), centrality);
} else if (pdg == 3334) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_OmegaMinus"), std::sqrt(ptSq), centrality);
} else if (pdg == -3334) {
ptSq = (ptRef * ptRef) + (mass * mass) - (o2::constants::physics::MassLambda1520 * o2::constants::physics::MassLambda1520);
if (ptSq > 0)
histos.fill(HIST("SignalLoss/hGen_mT_scaled_OmegaPlus"), std::sqrt(ptSq), centrality);
}
}
}

PROCESS_SWITCH(lambdaAnalysis_pb, processMCGen, "Process Event for MC", false);

using BinningType2 = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent>;

void processMix(resoCols& collisions, resoTracks const& tracks)
Expand Down
Loading