Skip to content

Commit fac7e44

Browse files
Merge branch 'AliceO2Group:master' into fix-mlscore-eta-hist-name
2 parents 465b75d + cfc23d1 commit fac7e44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4468
-956
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
7676
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
7777
// Add CCDB handling logic here if needed
7878
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
79+
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
80+
bool status = loadTable(pdg, filename, forceReload);
81+
if (std::remove(filename) != 0) {
82+
LOG(warn) << " --- Could not remove temporary LUT file: " << filename;
83+
} else {
84+
LOG(info) << " --- Removed temporary LUT file: " << filename;
85+
}
86+
return status;
87+
}
7988
} else { // File exists, proceed to load
8089
LOG(info) << " --- LUT file already exists: " << filename << ". Skipping download.";
8190
checkFile.close();

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class TrackSmearer
250250
}
251251
void setdNdEta(float val) { mdNdEta = val; } //;
252252
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
253+
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
253254

254255
protected:
255256
static constexpr unsigned int nLUTs = 9; // Number of LUT available
@@ -263,6 +264,7 @@ class TrackSmearer
263264

264265
private:
265266
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
267+
bool mCleanupDownloadedFile = true;
266268
};
267269

268270
} // namespace delphes

ALICE3/Tasks/alice3-dilepton.cxx

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct Alice3Dilepton {
5555
SliceCache cache_rec;
5656

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

103+
registry.add("Generated/Pair/ULS/Tried", "Pair tries", kTH1F, {{10, -0.5, 9.5}});
101104
registry.add("Generated/Pair/ULS/Mass", "Pair Mass", kTH1F, {axisM});
102105
registry.add("Generated/Pair/ULS/Pt", "Pair Pt", kTH1F, {axisPt});
103106
registry.add("Generated/Pair/ULS/Eta", "Pair Eta", kTH1F, {axisEta});
@@ -451,24 +454,29 @@ struct Alice3Dilepton {
451454
{
452455
if constexpr (pairtype == PairType::kULS) {
453456
for (auto& [t1, t2] : combinations(soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
457+
registry.fill(HIST("Generated/Pair/ULS/Tried"), 0);
454458
if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) {
455459
continue;
456460
}
461+
registry.fill(HIST("Generated/Pair/ULS/Tried"), 1);
457462

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

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

466-
int motherid = IsSameMother(t1, t2, mcParticles);
467-
int hfee_type = IsHFULS(t1, t2, mcParticles);
473+
const int motherid = IsSameMother(t1, t2, mcParticles);
474+
const int hfee_type = IsHFULS(t1, t2, mcParticles);
468475

469-
if (motherid < 0 && hfee_type == HFllType::kUndef) {
476+
if (requireHFEid.value && motherid < 0 && hfee_type == HFllType::kUndef) {
470477
continue;
471478
}
479+
registry.fill(HIST("Generated/Pair/ULS/Tried"), 4);
472480
// auto mother = mcparticles.iteratorAt(motherid);
473481

474482
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
@@ -484,24 +492,49 @@ struct Alice3Dilepton {
484492

485493
} else if constexpr (pairtype == PairType::kLSpp || pairtype == PairType::kLSnn) {
486494
for (auto& [t1, t2] : combinations(soa::CombinationsStrictlyUpperIndexPolicy(tracks1, tracks2))) {
495+
if constexpr (pairtype == PairType::kLSpp) {
496+
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 0);
497+
} else if constexpr (pairtype == PairType::kLSnn) {
498+
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 0);
499+
}
487500
if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) {
488501
continue;
489502
}
503+
if constexpr (pairtype == PairType::kLSpp) {
504+
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 1);
505+
} else if constexpr (pairtype == PairType::kLSnn) {
506+
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 1);
507+
}
490508

491509
if (!t1.isPhysicalPrimary() || !t2.isPhysicalPrimary()) {
492510
continue;
493511
}
512+
if constexpr (pairtype == PairType::kLSpp) {
513+
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 2);
514+
} else if constexpr (pairtype == PairType::kLSnn) {
515+
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 2);
516+
}
494517

495518
if (!IsInAcceptance(t1) || !IsInAcceptance(t2)) {
496519
continue;
497520
}
521+
if constexpr (pairtype == PairType::kLSpp) {
522+
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 3);
523+
} else if constexpr (pairtype == PairType::kLSnn) {
524+
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 3);
525+
}
498526

499-
int motherid = -1;
500-
int hfee_type = IsHFLS(t1, t2, mcParticles);
527+
const int motherid = -1;
528+
const int hfee_type = IsHFLS(t1, t2, mcParticles);
501529

502-
if (motherid < 0 && hfee_type == HFllType::kUndef) {
530+
if (requireHFEid.value && motherid < 0 && hfee_type == HFllType::kUndef) {
503531
continue;
504532
}
533+
if constexpr (pairtype == PairType::kLSpp) {
534+
registry.fill(HIST("Generated/Pair/LSpp/Tried"), 4);
535+
} else if constexpr (pairtype == PairType::kLSnn) {
536+
registry.fill(HIST("Generated/Pair/LSnn/Tried"), 4);
537+
}
505538
// auto mother = mcparticles.iteratorAt(motherid);
506539

507540
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon);
@@ -563,6 +596,7 @@ struct Alice3Dilepton {
563596
registry.fill(HIST("Generated/Event/VtxZ"), mccollision.posZ());
564597

565598
auto mcParticles_per_coll = mcParticles.sliceBy(perMCCollision, mccollision.globalIndex());
599+
int nParticlesInEvent = 0;
566600
for (const auto& mcParticle : mcParticles_per_coll) {
567601
if (std::abs(mcParticle.pdgCode()) != pdg) {
568602
continue;
@@ -573,6 +607,7 @@ struct Alice3Dilepton {
573607
if (!IsInAcceptance(mcParticle)) {
574608
continue;
575609
}
610+
nParticlesInEvent++;
576611

577612
registry.fill(HIST("Generated/Particle/Pt"), mcParticle.pt());
578613
registry.fill(HIST("Generated/Particle/Eta"), mcParticle.eta());
@@ -584,6 +619,7 @@ struct Alice3Dilepton {
584619
registry.fill(HIST("Generated/Particle/prodVz"), mcParticle.vz());
585620

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

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

PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,15 @@ class FemtoDreamDetaDphiStar
258258
} else if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kReso) {
259259
/// V0-Reso combination
260260
// check if provided particles are in agreement with the class instantiation
261-
if (part1.partType() != o2::aod::femtodreamparticle::ParticleType::kV0 || (part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTOF &&
262-
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTPC &&
263-
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTOF &&
264-
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTPC)) {
261+
if ((part1.partType() != o2::aod::femtodreamparticle::ParticleType::kV0 && part1.partType() != o2::aod::femtodreamparticle::ParticleType::kV0K0Short) ||
262+
(part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTOF &&
263+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTOF_NegdaughTPC &&
264+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTOF &&
265+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoPosdaughTPC_NegdaughTPC &&
266+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoKStarPosdaughTOF_NegdaughTOF &&
267+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoKStarPosdaughTOF_NegdaughTPC &&
268+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoKStarPosdaughTPC_NegdaughTOF &&
269+
part2.partType() != o2::aod::femtodreamparticle::ParticleType::kResoKStarPosdaughTPC_NegdaughTPC)) {
265270
LOG(fatal) << "FemtoDreamDetaDphiStar: passed arguments don't agree with FemtoDreamDetaDphiStar instantiation! Please provide kV0, kResoPosdaughTOF_NegdaughTOF, kResoPosdaughTOF_NegdaughTPC, kResoPosdaughTPC_NegdaughTOF, kResoPosdaughTPC_NegdaughTPC candidates.";
266271
return false;
267272
}

0 commit comments

Comments
 (0)