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
48 changes: 42 additions & 6 deletions ALICE3/Tasks/alice3-dilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
SliceCache cache_rec;

Configurable<int> pdg{"pdg", 11, "pdg code for analysis. dielectron:11, dimuon:13"};
Configurable<bool> requireHFEid{"requireHFEid", true, "Require HFE identification for both leptons"};
Configurable<float> ptMin{"pt-min", 0.f, "Lower limit in pT"};
Configurable<float> ptMax{"pt-max", 5.f, "Upper limit in pT"};
Configurable<float> etaMin{"eta-min", -5.f, "Lower limit in eta"};
Expand Down Expand Up @@ -97,7 +98,9 @@
registry.add("Generated/Particle/prodVx", "Particle Prod. Vertex X", kTH1F, {axisProdx});
registry.add("Generated/Particle/prodVy", "Particle Prod. Vertex Y", kTH1F, {axisPrody});
registry.add("Generated/Particle/prodVz", "Particle Prod. Vertex Z", kTH1F, {axisProdz});
registry.add("Generated/Particle/ParticlesPerEvent", "Particles per event", kTH1F, {{100, 0, 100}});

registry.add("Generated/Pair/ULS/Tried", "Pair tries", kTH1F, {{10, -0.5, 9.5}});
registry.add("Generated/Pair/ULS/Mass", "Pair Mass", kTH1F, {axisM});
registry.add("Generated/Pair/ULS/Pt", "Pair Pt", kTH1F, {axisPt});
registry.add("Generated/Pair/ULS/Eta", "Pair Eta", kTH1F, {axisEta});
Expand Down Expand Up @@ -305,10 +308,10 @@

const float dcaXY_t1 = t1.dcaXY();
const float dcaXY_t2 = t2.dcaXY();
const float dcaXY_res_t1 = sqrt(t1.cYY());

Check failure on line 311 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
const float dcaXY_res_t2 = sqrt(t2.cYY());

Check failure on line 312 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

pair_dca_xy = sqrt((dcaXY_t2 * dcaXY_t2 / dcaXY_res_t2 + dcaXY_t1 * dcaXY_t1 / dcaXY_res_t1) / 2.);

Check failure on line 314 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
Expand Down Expand Up @@ -355,7 +358,7 @@
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 361 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
}
Expand Down Expand Up @@ -395,7 +398,7 @@
registry.fill(HIST("Reconstructed/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("Reconstructed/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 401 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Reconstructed/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/ULS/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
} // end of unlike-sign pair loop
Expand Down Expand Up @@ -432,14 +435,14 @@
registry.fill(HIST("Reconstructed/Pair/LSpp/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSpp/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/LSpp/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSpp/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 438 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Reconstructed/Pair/LSpp/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Reconstructed/Pair/LSnn/Mass"), v12.M());
registry.fill(HIST("Reconstructed/Pair/LSnn/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSnn/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/LSnn/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSnn/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 445 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Reconstructed/Pair/LSnn/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
}
} // end of like-sign pair loop
Expand All @@ -451,24 +454,29 @@
{
if constexpr (pairtype == PairType::kULS) {
for (auto& [t1, t2] : combinations(soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
registry.fill(HIST("Generated/Pair/ULS/Tried"), 0);
if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) {
continue;
}
registry.fill(HIST("Generated/Pair/ULS/Tried"), 1);

if (!t1.isPhysicalPrimary() || !t2.isPhysicalPrimary()) {
continue;
}
registry.fill(HIST("Generated/Pair/ULS/Tried"), 2);

if (!IsInAcceptance(t1) || !IsInAcceptance(t2)) {
continue;
}
registry.fill(HIST("Generated/Pair/ULS/Tried"), 3);

int motherid = IsSameMother(t1, t2, mcParticles);
int hfee_type = IsHFULS(t1, t2, mcParticles);
const int motherid = IsSameMother(t1, t2, mcParticles);
const int hfee_type = IsHFULS(t1, t2, mcParticles);

if (motherid < 0 && hfee_type == HFllType::kUndef) {
if (requireHFEid.value && motherid < 0 && hfee_type == HFllType::kUndef) {
continue;
}
registry.fill(HIST("Generated/Pair/ULS/Tried"), 4);
// auto mother = mcparticles.iteratorAt(motherid);

ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
Expand All @@ -478,30 +486,55 @@
registry.fill(HIST("Generated/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("Generated/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("Generated/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("Generated/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 489 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Generated/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
} // end of unlike-sign pair loop

} else if constexpr (pairtype == PairType::kLSpp || pairtype == PairType::kLSnn) {
for (auto& [t1, t2] : combinations(soa::CombinationsStrictlyUpperIndexPolicy(tracks1, tracks2))) {
if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 0);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 0);
}
if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) {
continue;
}
if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 1);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 1);
}

if (!t1.isPhysicalPrimary() || !t2.isPhysicalPrimary()) {
continue;
}
if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 2);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 2);
}

if (!IsInAcceptance(t1) || !IsInAcceptance(t2)) {
continue;
}
if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 3);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 3);
}

int motherid = -1;
int hfee_type = IsHFLS(t1, t2, mcParticles);
const int motherid = -1;
const int hfee_type = IsHFLS(t1, t2, mcParticles);

if (motherid < 0 && hfee_type == HFllType::kUndef) {
if (requireHFEid.value && motherid < 0 && hfee_type == HFllType::kUndef) {
continue;
}
if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 4);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 4);
}
// auto mother = mcparticles.iteratorAt(motherid);

ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
Expand All @@ -512,13 +545,13 @@
registry.fill(HIST("Generated/Pair/LSpp/Mass"), v12.M());
registry.fill(HIST("Generated/Pair/LSpp/Pt"), v12.Pt());
registry.fill(HIST("Generated/Pair/LSpp/Eta"), v12.Eta());
registry.fill(HIST("Generated/Pair/LSpp/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 548 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Generated/Pair/LSpp/Mass_Pt"), v12.M(), v12.Pt());
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Mass"), v12.M());
registry.fill(HIST("Generated/Pair/LSnn/Pt"), v12.Pt());
registry.fill(HIST("Generated/Pair/LSnn/Eta"), v12.Eta());
registry.fill(HIST("Generated/Pair/LSnn/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 554 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
registry.fill(HIST("Generated/Pair/LSnn/Mass_Pt"), v12.M(), v12.Pt());
}

Expand Down Expand Up @@ -563,6 +596,7 @@
registry.fill(HIST("Generated/Event/VtxZ"), mccollision.posZ());

auto mcParticles_per_coll = mcParticles.sliceBy(perMCCollision, mccollision.globalIndex());
int nParticlesInEvent = 0;
for (const auto& mcParticle : mcParticles_per_coll) {
if (std::abs(mcParticle.pdgCode()) != pdg) {
continue;
Expand All @@ -573,6 +607,7 @@
if (!IsInAcceptance(mcParticle)) {
continue;
}
nParticlesInEvent++;

registry.fill(HIST("Generated/Particle/Pt"), mcParticle.pt());
registry.fill(HIST("Generated/Particle/Eta"), mcParticle.eta());
Expand All @@ -584,6 +619,7 @@
registry.fill(HIST("Generated/Particle/prodVz"), mcParticle.vz());

} // end of mc particle loop
registry.fill(HIST("Generated/Particle/ParticlesPerEvent"), nParticlesInEvent);

auto neg_mcParticles_coll = neg_mcParticles->sliceByCached(o2::aod::mcparticle::mcCollisionId, mccollision.globalIndex(), cache_mc);
auto pos_mcParticles_coll = pos_mcParticles->sliceByCached(o2::aod::mcparticle::mcCollisionId, mccollision.globalIndex(), cache_mc);
Expand Down
Loading