Skip to content

Commit c308001

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 16cff23 + 7d73e3f commit c308001

File tree

94 files changed

+4730
-3183
lines changed

Some content is hidden

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

94 files changed

+4730
-3183
lines changed

Common/Tools/TrackTuner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ struct TrackTuner : o2::framework::ConfigurableGroup {
722722
double deltaDcaXYmean = dcaXYMeanData - dcaXYMeanMC;
723723

724724
// double d0rpn =d0rpmc+dd0rpn-dd0mrpn;
725-
double trackParDcaXYTuned = trackParDcaXYMC + deltaDcaXYTuned - deltaDcaXYmean;
725+
double trackParDcaXYTuned = trackParDcaXYMC + deltaDcaXYTuned + deltaDcaXYmean;
726726

727727
if (debugInfo) {
728728
LOG(info) << dcaZResMC << ", " << dcaZResData << ", diff(DcaZ - DcaZMC): " << deltaDcaZ << ", diff upgraded: " << deltaDcaZTuned << ", DcaZ Data : " << trackParDcaZTuned;

EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct HfFilterPrepareMlSamples { // Main struct
5555
Produces<aod::HFTrigTrain3P> train3P;
5656

5757
// parameters for production of training samples
58-
Configurable<bool> fillSignal{"fillSignal", true, "Flag to fill derived tables with signal for ML trainings"};
58+
Configurable<bool> fillOnlySignal{"fillOnlySignal", true, "Flag to fill derived tables with signal for ML trainings"};
5959
Configurable<bool> fillOnlyBackground{"fillOnlyBackground", true, "Flag to fill derived tables with background for ML trainings"};
6060
Configurable<float> downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"};
6161
Configurable<float> massSbLeftMin{"massSbLeftMin", 1.72, "Left Sideband Lower Minv limit 2 Prong"};
@@ -78,6 +78,10 @@ struct HfFilterPrepareMlSamples { // Main struct
7878

7979
void init(InitContext&)
8080
{
81+
if (fillOnlySignal && fillOnlyBackground) {
82+
LOGP(fatal, "fillOnlySignal and fillOnlyBackground cannot be activated simultaneously, exit");
83+
}
84+
8185
ccdb->setURL(url.value);
8286
ccdb->setCaching(true);
8387
ccdb->setLocalObjectValidityChecking();
@@ -268,7 +272,15 @@ struct HfFilterPrepareMlSamples { // Main struct
268272

269273
// D0(bar) → π± K∓
270274
bool isInCorrectColl{false};
271-
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
275+
auto indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, std::array{trackPos, trackNeg}, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
276+
277+
if (fillOnlySignal && indexRec < 0) {
278+
continue;
279+
}
280+
if (fillOnlyBackground && indexRec >= 0) {
281+
continue;
282+
}
283+
272284
if (indexRec > -1) {
273285
auto particle = mcParticles.rawIteratorAt(indexRec);
274286
flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle);
@@ -355,32 +367,39 @@ struct HfFilterPrepareMlSamples { // Main struct
355367
int8_t channel = -1;
356368

357369
// D± → π± K∓ π±
358-
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
370+
auto indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
359371
if (indexRec >= 0) {
360372
channel = kDplus;
361373
}
362374
if (indexRec < 0) {
363375
// Ds± → K± K∓ π±
364-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
376+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
365377
if (indexRec >= 0) {
366378
channel = kDs;
367379
}
368380
}
369381
if (indexRec < 0) {
370382
// Λc± → p± K∓ π±
371-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
383+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
372384
if (indexRec >= 0) {
373385
channel = kLc;
374386
}
375387
}
376388
if (indexRec < 0) {
377389
// Ξc± → p± K∓ π±
378-
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
390+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
379391
if (indexRec >= 0) {
380392
channel = kXic;
381393
}
382394
}
383395

396+
if (fillOnlySignal && indexRec < 0) {
397+
continue;
398+
}
399+
if (fillOnlyBackground && indexRec >= 0) {
400+
continue;
401+
}
402+
384403
bool isInCorrectColl{false};
385404
if (indexRec > -1) {
386405
auto particle = mcParticles.rawIteratorAt(indexRec);

PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de
1515
/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch
1616
/// \author Pritam Chakraborty, WUT Warsaw, pritam.chakraborty@cern.ch
17+
/// \author Shirajum Monira, WUT Warsaw, shirajum.monira@cern.ch
1718

1819
#ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_
1920
#define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_
@@ -102,6 +103,21 @@ class FemtoUniverseDetaDphiStar
102103
}
103104
}
104105
}
106+
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kCascade && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
107+
/// Xi-Xi and Omega-Omega combination
108+
for (int k = 0; k < 7; k++) {
109+
std::string dirName = static_cast<std::string>(DirNames[5]);
110+
histdetadpisame[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
111+
histdetadpisame[k][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
112+
histdetadpimixed[k][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
113+
histdetadpimixed[k][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
114+
if (plotForEveryRadii) {
115+
for (int l = 0; l < 9; l++) {
116+
histdetadpiRadii[k][l] = mHistogramRegistryQA->add<TH2>((dirName + static_cast<std::string>(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
117+
}
118+
}
119+
}
120+
}
105121
if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) {
106122
for (int i = 0; i < 2; i++) {
107123
std::string dirName = static_cast<std::string>(DirNames[3]);
@@ -209,7 +225,6 @@ class FemtoUniverseDetaDphiStar
209225

210226
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) {
211227
/// V0-V0 combination
212-
// check if provided particles are in agreement with the class instantiation
213228
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) {
214229
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kV0,kV0 candidates.";
215230
return false;
@@ -246,6 +261,44 @@ class FemtoUniverseDetaDphiStar
246261
}
247262
return pass;
248263

264+
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kCascade && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) {
265+
/// Xi-Xi and Omega-Omega combination
266+
if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) {
267+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kCascade,kCascade candidates.";
268+
return false;
269+
}
270+
271+
bool pass = false;
272+
static constexpr int CascChildTable[][2] = {{-1, -1}, {-1, -2}, {-1, -3}, {-2, -2}, {-3, -3}, {-2, -1}, {-3, -1}};
273+
for (int i = 0; i < 5; i++) {
274+
auto indexOfDaughterpart1 = (ChosenEventType == femto_universe_container::EventType::mixed ? part1.globalIndex() : part1.index()) + CascChildTable[i][0];
275+
auto indexOfDaughterpart2 = (ChosenEventType == femto_universe_container::EventType::mixed ? part2.globalIndex() : part2.index()) + CascChildTable[i][1];
276+
auto daughterpart1 = particles.begin() + indexOfDaughterpart1;
277+
auto daughterpart2 = particles.begin() + indexOfDaughterpart2;
278+
auto deta = daughterpart1.eta() - daughterpart2.eta();
279+
auto dphiAvg = averagePhiStar(*daughterpart1, *daughterpart2, i);
280+
if (ChosenEventType == femto_universe_container::EventType::same) {
281+
histdetadpisame[i][0]->Fill(deta, dphiAvg);
282+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
283+
histdetadpimixed[i][0]->Fill(deta, dphiAvg);
284+
} else {
285+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
286+
}
287+
288+
if ((dphiAvg > cutDeltaPhiStarMin) && (dphiAvg < cutDeltaPhiStarMax) && (deta > cutDeltaEtaMin) && (deta < cutDeltaEtaMax)) {
289+
pass = true;
290+
} else {
291+
if (ChosenEventType == femto_universe_container::EventType::same) {
292+
histdetadpisame[i][1]->Fill(deta, dphiAvg);
293+
} else if (ChosenEventType == femto_universe_container::EventType::mixed) {
294+
histdetadpimixed[i][1]->Fill(deta, dphiAvg);
295+
} else {
296+
LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed.";
297+
}
298+
}
299+
}
300+
return pass;
301+
249302
} else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) {
250303
/// Track-D0 combination
251304
// check if provided particles are in agreement with the class instantiation
@@ -354,19 +407,42 @@ class FemtoUniverseDetaDphiStar
354407
private:
355408
HistogramRegistry* mHistogramRegistry = nullptr; ///< For main output
356409
HistogramRegistry* mHistogramRegistryQA = nullptr; ///< For QA output
357-
static constexpr std::string_view DirNames[5] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/"};
358-
359-
static constexpr std::string_view HistNamesSame[2][2] = {{"detadphidetadphi0BeforeSame_0", "detadphidetadphi0BeforeSame_1"},
360-
{"detadphidetadphi0AfterSame_0", "detadphidetadphi0AfterSame_1"}};
361-
static constexpr std::string_view HistNamesMixed[2][2] = {{"detadphidetadphi0BeforeMixed_0", "detadphidetadphi0BeforeMixed_1"},
362-
{"detadphidetadphi0AfterMixed_0", "detadphidetadphi0AfterMixed_1"}};
363-
364-
static constexpr std::string_view HistNamesRadii[2][9] = {{"detadphidetadphi0Before_0_0", "detadphidetadphi0Before_0_1", "detadphidetadphi0Before_0_2",
410+
static constexpr std::string_view DirNames[6] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/", "kCascade_kCascade/"};
411+
412+
static constexpr std::string_view HistNamesSame[2][7] = {{"detadphidetadphi0BeforeSame_0", "detadphidetadphi0BeforeSame_1", "detadphidetadphi0BeforeSame_2",
413+
"detadphidetadphi0BeforeSame_3", "detadphidetadphi0BeforeSame_4", "detadphidetadphi0BeforeSame_5",
414+
"detadphidetadphi0BeforeSame_6"},
415+
{"detadphidetadphi0AfterSame_0", "detadphidetadphi0AfterSame_1", "detadphidetadphi0AfterSame_2",
416+
"detadphidetadphi0AfterSame_3", "detadphidetadphi0AfterSame_4", "detadphidetadphi0AfterSame_5",
417+
"detadphidetadphi0AfterSame_6"}};
418+
static constexpr std::string_view HistNamesMixed[2][7] = {{"detadphidetadphi0BeforeMixed_0", "detadphidetadphi0BeforeMixed_1", "detadphidetadphi0BeforeMixed_2",
419+
"detadphidetadphi0BeforeMixed_3", "detadphidetadphi0BeforeMixed_4", "detadphidetadphi0BeforeMixed_5",
420+
"detadphidetadphi0BeforeMixed_6"},
421+
{"detadphidetadphi0AfterMixed_0", "detadphidetadphi0AfterMixed_1", "detadphidetadphi0AfterMixed_2",
422+
"detadphidetadphi0AfterMixed_3", "detadphidetadphi0AfterMixed_4", "detadphidetadphi0AfterMixed_5",
423+
"detadphidetadphi0AfterMixed_6"}};
424+
425+
static constexpr std::string_view HistNamesRadii[7][9] = {{"detadphidetadphi0Before_0_0", "detadphidetadphi0Before_0_1", "detadphidetadphi0Before_0_2",
365426
"detadphidetadphi0Before_0_3", "detadphidetadphi0Before_0_4", "detadphidetadphi0Before_0_5",
366427
"detadphidetadphi0Before_0_6", "detadphidetadphi0Before_0_7", "detadphidetadphi0Before_0_8"},
367428
{"detadphidetadphi0Before_1_0", "detadphidetadphi0Before_1_1", "detadphidetadphi0Before_1_2",
368429
"detadphidetadphi0Before_1_3", "detadphidetadphi0Before_1_4", "detadphidetadphi0Before_1_5",
369-
"detadphidetadphi0Before_1_6", "detadphidetadphi0Before_1_7", "detadphidetadphi0Before_1_8"}};
430+
"detadphidetadphi0Before_1_6", "detadphidetadphi0Before_1_7", "detadphidetadphi0Before_1_8"},
431+
{"detadphidetadphi0Before_2_0", "detadphidetadphi0Before_2_1", "detadphidetadphi0Before_2_2",
432+
"detadphidetadphi0Before_2_3", "detadphidetadphi0Before_2_4", "detadphidetadphi0Before_2_5",
433+
"detadphidetadphi0Before_2_6", "detadphidetadphi0Before_2_7", "detadphidetadphi0Before_2_8"},
434+
{"detadphidetadphi0Before_3_0", "detadphidetadphi0Before_3_1", "detadphidetadphi0Before_3_2",
435+
"detadphidetadphi0Before_3_3", "detadphidetadphi0Before_3_4", "detadphidetadphi0Before_3_5",
436+
"detadphidetadphi0Before_3_6", "detadphidetadphi0Before_3_7", "detadphidetadphi0Before_3_8"},
437+
{"detadphidetadphi0Before_4_0", "detadphidetadphi0Before_4_1", "detadphidetadphi0Before_4_2",
438+
"detadphidetadphi0Before_4_3", "detadphidetadphi0Before_4_4", "detadphidetadphi0Before_4_5",
439+
"detadphidetadphi0Before_4_6", "detadphidetadphi0Before_4_7", "detadphidetadphi0Before_4_8"},
440+
{"detadphidetadphi0Before_5_0", "detadphidetadphi0Before_5_1", "detadphidetadphi0Before_5_2",
441+
"detadphidetadphi0Before_5_3", "detadphidetadphi0Before_5_4", "detadphidetadphi0Before_5_5",
442+
"detadphidetadphi0Before_5_6", "detadphidetadphi0Before_5_7", "detadphidetadphi0Before_5_8"},
443+
{"detadphidetadphi0Before_6_0", "detadphidetadphi0Before_6_1", "detadphidetadphi0Before_6_2",
444+
"detadphidetadphi0Before_6_3", "detadphidetadphi0Before_6_4", "detadphidetadphi0Before_6_5",
445+
"detadphidetadphi0Before_6_6", "detadphidetadphi0Before_6_7", "detadphidetadphi0Before_6_8"}};
370446

371447
static constexpr o2::aod::femtouniverseparticle::ParticleType kPartOneType = partOne; ///< Type of particle 1
372448
static constexpr o2::aod::femtouniverseparticle::ParticleType kPartTwoType = partTwo; ///< Type of particle 2
@@ -387,9 +463,9 @@ class FemtoUniverseDetaDphiStar
387463
float cutPhiInvMassLow;
388464
float cutPhiInvMassHigh;
389465

390-
std::array<std::array<std::shared_ptr<TH2>, 2>, 2> histdetadpisame{};
391-
std::array<std::array<std::shared_ptr<TH2>, 2>, 2> histdetadpimixed{};
392-
std::array<std::array<std::shared_ptr<TH2>, 9>, 2> histdetadpiRadii{};
466+
std::array<std::array<std::shared_ptr<TH2>, 2>, 7> histdetadpisame{};
467+
std::array<std::array<std::shared_ptr<TH2>, 2>, 7> histdetadpimixed{};
468+
std::array<std::array<std::shared_ptr<TH2>, 9>, 7> histdetadpiRadii{};
393469

394470
/// Calculate phi at all required radii stored in TmpRadiiTPC
395471
/// Magnetic field to be provided in Tesla

PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCalculator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct EfficiencyConfigurableGroup : ConfigurableGroup {
4040
Configurable<bool> confEfficiencyApplyCorrections{"confEfficiencyApplyCorrections", false, "Should apply corrections from efficiency"};
4141
Configurable<std::vector<std::string>> confEfficiencyCCDBLabels{"confEfficiencyCCDBLabels", {}, "Custom labels for efficiency objects in CCDB"};
4242
Configurable<int> confCCDBTrainNumber{"confCCDBTrainNumber", -1, "Train number for which to query CCDB objects (set to -1 to ignore)"};
43-
ConfigurableAxis confEfficiencyCCDBTimestamps{"confEfficiencyCCDBTimestamps", {-1, -1}, "Timestamps in CCDB, to query for specific objects (default: -1 for both)"};
43+
Configurable<std::vector<std::string>> confEfficiencyCCDBTimestamps{"confEfficiencyCCDBTimestamps", {"-1", "-1"}, "Timestamps in CCDB, to query for specific objects (default: -1 for both, the latest valid object)"};
4444

4545
// NOTE: in the future we might move the below configurables to a separate struct, eg. CCDBConfigurableGroup
4646
Configurable<std::string> confCCDBUrl{"confCCDBUrl", "http://alice-ccdb.cern.ch", "CCDB URL to be used"};
@@ -119,7 +119,7 @@ class EfficiencyCalculator
119119
}
120120

121121
auto timestamp = partNo - 1 < config->confEfficiencyCCDBTimestamps->size()
122-
? static_cast<int64_t>(config->confEfficiencyCCDBTimestamps.value[partNo - 1])
122+
? std::stoll(config->confEfficiencyCCDBTimestamps.value[partNo - 1])
123123
: -1;
124124

125125
auto hEff = ccdb.getSpecific<TH1>(config->confCCDBPath, timestamp, metadata);

0 commit comments

Comments
 (0)