Skip to content

Commit 77de505

Browse files
authored
Merge branch 'AliceO2Group:master' into Lambda-Proton-Balance-Function-3
2 parents 479777e + 26d8ca6 commit 77de505

8 files changed

Lines changed: 218 additions & 9 deletions

File tree

‎PWGCF/Femto3D/Tasks/multEstimator.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ struct multEstimator {
172172
Nch_vs_cent_vs_eta_conditional = registry.add<TH2>("Nch_vs_cent_vs_eta_conditional", "Nch_vs_cent_vs_eta_conditional", kTH2F, {{100, 0.0, 100.0, "cent"}, {200, -1.0, 1.0, "deta"}});
173173
tmp_histo_per_event = std::make_shared<TH2F>(TH2F("tmp_histo_per_event", "tmp_histo_per_event", 100, 0.0, 100.0, 200, -1.0, 1.0));
174174

175-
Events_vs_cent = std::make_shared<TH1F>(TH1F("Events_vs_cent", "Events_vs_cent", 100, 0.0, 100.));
176-
Events_vs_cent_conditional = std::make_shared<TH1F>(TH1F("Events_vs_cent_conditional", "Events_vs_cent_conditional", 100, 0.0, 100.));
175+
Events_vs_cent = registry.add<TH1>("Events_vs_cent", "Events_vs_cent", kTH1F, {{100, 0.0, 100., "cent"}});
176+
Events_vs_cent_conditional = registry.add<TH1>("Events_vs_cent_conditional", "Events_vs_cent_conditional", kTH1F, {{100, 0.0, 100.0, "cent"}});
177177

178178
ITShisto = registry.add<TH2>(Form("nsigmaITS_PDG%i", _particlePDG.value), Form("nsigmaITS_PDG%i", _particlePDG.value), kTH2F, {{100, 0., 5.}, {100, -10., 10.}});
179179
TPChisto = registry.add<TH2>(Form("nsigmaTPC_PDG%i", _particlePDG.value), Form("nsigmaTPC_PDG%i", _particlePDG.value), kTH2F, {{100, 0., 5.}, {100, -10., 10.}});

‎PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ struct FemtoUniversePairTaskTrackD0 {
314314
{"hEtaD0D0bar", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}},
315315
{"hEtaD0", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}},
316316
{"hEtaD0bar", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}},
317+
{"hYD0D0bar", ";y ;counts", {HistType::kTH1F, {{200, -1., 1.}}}},
317318
{"hPtDaughters", ";#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {{300, 0., 12.}}}},
318319
{"hSignDaughters", ";sign ;counts", {HistType::kTH1F, {{10, -2.5, 2.5}}}}}};
319320

@@ -675,6 +676,7 @@ struct FemtoUniversePairTaskTrackD0 {
675676
registry.fill(HIST("hPtD0D0bar"), d0d0bar.pt());
676677
registry.fill(HIST("hPhiD0D0bar"), d0d0bar.phi());
677678
registry.fill(HIST("hEtaD0D0bar"), d0d0bar.eta());
679+
registry.fill(HIST("hYD0D0bar"), d0d0bar.transRadius());
678680
// BDT score classes
679681
registry.fill(HIST("DebugBdt/hBdtScore0"), d0d0bar.decayVtxX());
680682
registry.fill(HIST("DebugBdt/hBdtScore1"), d0d0bar.decayVtxY());
@@ -1388,7 +1390,7 @@ struct FemtoUniversePairTaskTrackD0 {
13881390
{
13891391
for (auto const& part : recoParts) {
13901392
// filling the histograms for identified hadrons
1391-
if ((part.partType() == aod::femtouniverseparticle::ParticleType::kD0) && (part.pt() > ConfDmesons.confMinPtD0D0barReco) && (part.pt() < ConfDmesons.confMaxPtD0D0barReco)) {
1393+
if ((part.partType() == aod::femtouniverseparticle::ParticleType::kD0) && (part.pt() > ConfDmesons.confMinPtD0D0barReco) && (part.pt() < ConfDmesons.confMaxPtD0D0barReco) && (part.decayVtxZ() < ConfMlProb.confMlProbNonPromptMax)) {
13921394
// getting the efficiency value
13931395
if (doEfficiencyCorr) {
13941396
weight = efficiencyCalculator.getWeight(ParticleNo::TWO, part.pt());

‎PWGCF/Flow/Tasks/flowZdcTask.cxx‎

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ using namespace o2::aod::evsel;
5454

5555
struct FlowZdcTask {
5656
SliceCache cache;
57+
Configurable<bool> useFT0M{"useFT0M", true, "FT0M for centrality"};
58+
Configurable<bool> useFT0C{"useFT0C", false, "FT0C for centrality"};
59+
Configurable<bool> useGlbTracks{"useGlbTracks", false, "GlbTracks for centrality"};
5760
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0, "Accepted z-vertex range"};
5861
Configurable<float> maxZem{"maxZem", 3099.5, "Max ZEM signal"};
5962
// for ZDC info and analysis
@@ -65,6 +68,8 @@ struct FlowZdcTask {
6568
Configurable<float> maxAmpFT0{"maxAmpFT0", 2500, "Max FT0 amp"};
6669
Configurable<float> maxAmpFT0M{"maxAmpFT0M", 2500, "Max FT0M amp"};
6770
Configurable<int> nBinsAmpFT0M{"nBinsAmpFT0M", 100, "N bins FT0M amp"};
71+
Configurable<int> nBinsAmpFT0C{"nBinsAmpFT0C", 100, "N bins FT0C amp"};
72+
Configurable<int> nBinsGlbTracks{"nBinsGlbTracks", 100, "N bins global tracks"};
6873
Configurable<int> nBinsZDC{"nBinsZDC", 400, "nBinsZDC"};
6974
Configurable<int> nBinsZP{"nBinsZP", 50, "nBinsZP"};
7075
Configurable<int> nBinsZN{"nBinsZN", 50, "nBinsZN"};
@@ -199,6 +204,18 @@ struct FlowZdcTask {
199204
xAxis->SetBinLabel(16, "Within TDC cut?");
200205

201206
if (doprocessQA) {
207+
if (useFT0M) {
208+
histos.add("ZPAZNAVsFT0M", ";T0A+T0C (#times 1/100);ZPA Amplitude;ZNA Amplitude;", kTH3F, {{{nBinsAmpFT0M, 0., maxAmpFT0M}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
209+
histos.add("ZPCZNCVsFT0M", ";T0A+T0C (#times 1/100);ZPC Amplitude;ZNC Amplitude;", kTH3F, {{{nBinsAmpFT0M, 0., maxAmpFT0M}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
210+
}
211+
if (useFT0C) {
212+
histos.add("ZPAZNAVsFT0C", ";T0C (#times 1/100);ZPA Amplitude;ZNA Amplitude;", kTH3F, {{{nBinsAmpFT0C, 0., maxAmpFT0}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
213+
histos.add("ZPCZNCVsFT0C", ";T0C (#times 1/100);ZPC Amplitude;ZNC Amplitude;", kTH3F, {{{nBinsAmpFT0C, 0., maxAmpFT0}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
214+
}
215+
if (useGlbTracks) {
216+
histos.add("ZPAZNAVsGlbTracks", ";N_{global tracks} (|#eta|<0.8);ZPA Amplitude;ZNA Amplitude;", kTH3F, {{{nBinsGlbTracks, minNch, maxNch}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
217+
histos.add("ZPCZNCVsGlbTracks", ";N_{global tracks} (|#eta|<0.8);ZPC Amplitude;ZNC Amplitude;", kTH3F, {{{nBinsGlbTracks, minNch, maxNch}, {nBinsZP, -0.5, maxZp}, {nBinsZN, -0.5, maxZn}}});
218+
}
202219
histos.add("ZNAVsFT0C", ";T0C (#times 1/100);ZNA Amplitude;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZDC, -0.5, maxZn}}});
203220
histos.add("ZNAVsFT0M", ";T0A+T0C (#times 1/100);ZNA Amplitude;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0M}, {nBinsZDC, -0.5, maxZn}}});
204221
histos.add("ZNCVsFT0C", ";T0C (#times 1/100);ZNC Amplitude;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZDC, -0.5, maxZn}}});
@@ -545,12 +562,28 @@ struct FlowZdcTask {
545562
if (((tZNA >= minTdcZn) && (tZNA <= maxTdcZn)) && ((tZPA >= minTdcZp) && (tZPA <= maxTdcZp))) {
546563
histos.fill(HIST("ZNAVsZPA"), zpA, znA);
547564
histos.fill(HIST("CommonZNAVsZPA"), commonSumZpa, commonSumZna);
548-
histos.fill(HIST("ZPAZNAVsFT0M"), (aT0A + aT0C) / 100., zpA, znA);
565+
if (useFT0M) {
566+
histos.fill(HIST("ZPAZNAVsFT0M"), (aT0A + aT0C) / 100., zpA, znA);
567+
}
568+
if (useFT0C) {
569+
histos.fill(HIST("ZPAZNAVsFT0C"), aT0C / 100., zpA, znA);
570+
}
571+
if (useGlbTracks) {
572+
histos.fill(HIST("ZPAZNAVsGlbTracks"), glbTracks, zpA, znA);
573+
}
549574
}
550575
if (((tZNC >= minTdcZn) && (tZNC <= maxTdcZn)) && ((tZPC >= minTdcZp) && (tZPC <= maxTdcZp))) {
551576
histos.fill(HIST("ZNCVsZPC"), zpC, znC);
552577
histos.fill(HIST("CommonZNCVsZPC"), commonSumZpc, commonSumZnc);
553-
histos.fill(HIST("ZPCZNCVsFT0M"), (aT0A + aT0C) / 100., zpC, znC);
578+
if (useFT0M) {
579+
histos.fill(HIST("ZPCZNCVsFT0M"), (aT0A + aT0C) / 100., zpC, znC);
580+
}
581+
if (useFT0C) {
582+
histos.fill(HIST("ZPCZNCVsFT0C"), aT0C / 100., zpC, znC);
583+
}
584+
if (useGlbTracks) {
585+
histos.fill(HIST("ZPCZNCVsGlbTracks"), glbTracks, zpC, znC);
586+
}
554587
}
555588
} else {
556589
histos.fill(HIST("ZNA"), znA);
@@ -583,8 +616,18 @@ struct FlowZdcTask {
583616
histos.fill(HIST("ZPCVsNch"), glbTracks, zpC);
584617
histos.fill(HIST("ZNCVsNch"), glbTracks, znC);
585618
histos.fill(HIST("ZNAVsNch"), glbTracks, znA);
586-
histos.fill(HIST("ZPAZNAVsFT0M"), (aT0A + aT0C) / 100., zpA, znA);
587-
histos.fill(HIST("ZPCZNCVsFT0M"), (aT0A + aT0C) / 100., zpC, znC);
619+
if (useFT0M) {
620+
histos.fill(HIST("ZPAZNAVsFT0M"), (aT0A + aT0C) / 100., zpA, znA);
621+
histos.fill(HIST("ZPCZNCVsFT0M"), (aT0A + aT0C) / 100., zpC, znC);
622+
}
623+
if (useFT0C) {
624+
histos.fill(HIST("ZPAZNAVsFT0C"), aT0C / 100., zpA, znA);
625+
histos.fill(HIST("ZPCZNCVsFT0C"), aT0C / 100., zpC, znC);
626+
}
627+
if (useGlbTracks) {
628+
histos.fill(HIST("ZPAZNAVsGlbTracks"), glbTracks, zpA, znA);
629+
histos.fill(HIST("ZPCZNCVsGlbTracks"), glbTracks, zpC, znC);
630+
}
588631
}
589632
histos.fill(HIST("ZEM1"), aZEM1);
590633
histos.fill(HIST("ZEM2"), aZEM2);

‎PWGDQ/Core/VarManager.cxx‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <cmath>
4242
#include <cstddef>
4343
#include <cstdint>
44+
#include <cstdlib>
4445
#include <map>
4546
#include <numeric>
4647
#include <tuple>
@@ -1041,6 +1042,12 @@ void VarManager::SetDefaultVarNames()
10411042
fgVariableUnits[kTrackTimeRes] = "ns";
10421043
fgVariableNames[kTrackTimeResRelative] = "Relative resolution of the track time";
10431044
fgVariableUnits[kTrackTimeResRelative] = "";
1045+
fgVariableNames[kTrackAssocDeltaTime] = "Track-collision association #Deltat";
1046+
fgVariableUnits[kTrackAssocDeltaTime] = "ns";
1047+
fgVariableNames[kTrackAssocTimeThreshold] = "Track-collision association time threshold";
1048+
fgVariableUnits[kTrackAssocTimeThreshold] = "ns";
1049+
fgVariableNames[kTrackAssocDeltaTimeNorm] = "|#Deltat| / threshold";
1050+
fgVariableUnits[kTrackAssocDeltaTimeNorm] = "";
10441051
fgVariableNames[kDetectorMap] = "DetectorMap";
10451052
fgVariableUnits[kDetectorMap] = "";
10461053
fgVariableNames[kHasITS] = "HasITS";
@@ -2369,6 +2376,9 @@ void VarManager::SetDefaultVarNames()
23692376
fgVarNamesMap["kTrackTime"] = kTrackTime;
23702377
fgVarNamesMap["kTrackTimeRes"] = kTrackTimeRes;
23712378
fgVarNamesMap["kTrackTimeResRelative"] = kTrackTimeResRelative;
2379+
fgVarNamesMap["kTrackAssocDeltaTime"] = kTrackAssocDeltaTime;
2380+
fgVarNamesMap["kTrackAssocTimeThreshold"] = kTrackAssocTimeThreshold;
2381+
fgVarNamesMap["kTrackAssocDeltaTimeNorm"] = kTrackAssocDeltaTimeNorm;
23722382
fgVarNamesMap["kDetectorMap"] = kDetectorMap;
23732383
fgVarNamesMap["kHasITS"] = kHasITS;
23742384
fgVarNamesMap["kHasTRD"] = kHasTRD;
@@ -2918,3 +2928,64 @@ void VarManager::SetDefaultVarNames()
29182928
fgVarNamesMap["kInnerTOFnSigmaHe3"] = kInnerTOFnSigmaHe3;
29192929
fgVarNamesMap["kInnerTOFnSigmaAl"] = kInnerTOFnSigmaAl;
29202930
}
2931+
2932+
//__________________________________________________________________
2933+
bool VarManager::computeBarrelAssocTimeCompat(float trackTime, float trackTimeRes, bool timeResIsRange, bool isPVContributor,
2934+
int64_t origBC, float origCollTime, int origNumContrib,
2935+
int64_t collBC, float collTime, float collTimeRes,
2936+
float nSigma, float timeMargin, int bcWindowForOneSigma,
2937+
int usePVAssociation, int maxPvContribLowMult, float* values)
2938+
{
2939+
//
2940+
// Mirrors the time-based association of Common/Core/CollisionAssociation.h::runAssocWithTime for central barrel tracks.
2941+
// Every arithmetic step is kept identical to the associator (including the double->int64 truncations),
2942+
// so that re-applying it on skimmed associations with a smaller timeMargin reproduces a skim produced directly with that margin.
2943+
// Only tracks assigned to a collision in the AO2D are handled (this is always the case for tracks written by the DQ table makers).
2944+
//
2945+
if (!values) {
2946+
values = fgValues;
2947+
}
2948+
values[kTrackAssocDeltaTime] = -9999.f;
2949+
values[kTrackAssocTimeThreshold] = 0.f;
2950+
values[kTrackAssocDeltaTimeNorm] = 9999.f;
2951+
2952+
constexpr double BunchSpacingNS = o2::constants::lhc::LHCBunchSpacingNS;
2953+
2954+
// (1) BC pre-window (CollisionAssociation.h: trackBCCache, bcOffsetMax, bcOffsetWindow)
2955+
// NOTE: the associator uses the raw trackTime here also for PV contributors
2956+
const int64_t bcOffsetMax = static_cast<int64_t>(bcWindowForOneSigma * nSigma + timeMargin / BunchSpacingNS);
2957+
const int64_t trackBCCache = static_cast<int64_t>(static_cast<double>(origBC) + static_cast<double>(trackTime) / BunchSpacingNS);
2958+
if (std::abs(trackBCCache - collBC) > bcOffsetMax) {
2959+
return false;
2960+
}
2961+
2962+
// (2) PV-contributor handling (usePVAssociation: 0 off, 1 OnlySameBc, 2 SameBcAndLowMult)
2963+
constexpr int OnlySameBc = 1;
2964+
constexpr int SameBcAndLowMult = 2;
2965+
const bool pvMode = (usePVAssociation == OnlySameBc && isPVContributor) ||
2966+
(usePVAssociation == SameBcAndLowMult && isPVContributor && origNumContrib > maxPvContribLowMult);
2967+
float tTrack = trackTime;
2968+
float tTrackRes = trackTimeRes;
2969+
if (pvMode) {
2970+
tTrack = origCollTime; // time of the ORIGINAL collision
2971+
tTrackRes = static_cast<float>(BunchSpacingNS); // 1 BC
2972+
}
2973+
2974+
// (3) time difference and threshold
2975+
const int64_t bcOffset = origBC - collBC;
2976+
const float collTimeRes2 = collTimeRes * collTimeRes;
2977+
const float deltaTime = tTrack - collTime + bcOffset * static_cast<float>(BunchSpacingNS);
2978+
float threshold = 0.f;
2979+
if (pvMode) {
2980+
threshold = tTrackRes; // margin NOT applied
2981+
} else if (timeResIsRange) {
2982+
threshold = tTrackRes + nSigma * std::sqrt(collTimeRes2) + timeMargin;
2983+
} else {
2984+
threshold = nSigma * std::sqrt(collTimeRes2 + tTrackRes * tTrackRes) + timeMargin;
2985+
}
2986+
2987+
values[kTrackAssocDeltaTime] = deltaTime;
2988+
values[kTrackAssocTimeThreshold] = threshold;
2989+
values[kTrackAssocDeltaTimeNorm] = (threshold > 0.f) ? std::abs(deltaTime) / threshold : 9999.f;
2990+
return std::abs(deltaTime) < threshold;
2991+
}

‎PWGDQ/Core/VarManager.h‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ class VarManager : public TObject
578578
kTrackTime,
579579
kTrackTimeRes,
580580
kTrackTimeResRelative,
581+
kTrackAssocDeltaTime, // track time - time of the associated collision (BC offset included), ns
582+
kTrackAssocTimeThreshold, // time-compatibility threshold of the track-to-collision associator (margin included), ns
583+
kTrackAssocDeltaTimeNorm, // |kTrackAssocDeltaTime| / kTrackAssocTimeThreshold; < 1 means the association is time compatible
581584
kDetectorMap,
582585
kHasITS,
583586
kHasTRD,
@@ -1474,6 +1477,22 @@ class VarManager : public TObject
14741477
static void FillTrackEMCal(T const& cluster, float trackP = -1.0f, float deltaEta = -999.0f, float deltaPhi = -999.0f, float* values = nullptr);
14751478
template <uint32_t fillMap, typename T, typename C>
14761479
static void FillTrackCollision(T const& track, C const& collision, float* values = nullptr);
1480+
// Re-evaluation of the time compatibility of a (barrel track, collision) association, mirroring
1481+
// Common/Core/CollisionAssociation.h::runAssocWithTime. Fills kTrackAssocDeltaTime, kTrackAssocTimeThreshold, kTrackAssocDeltaTimeNorm.
1482+
// orig* : collision originally assigned to the track in the AO2D (reference of trackTime)
1483+
// coll* : collision of the association under test
1484+
// The last 5 parameters must match the configuration of track-to-collision-associator used at skimming time
1485+
// (timeMargin and nSigma may be smaller in order to tighten the association at analysis level).
1486+
static bool computeBarrelAssocTimeCompat(float trackTime, float trackTimeRes, bool timeResIsRange, bool isPVContributor,
1487+
int64_t origBC, float origCollTime, int origNumContrib,
1488+
int64_t collBC, float collTime, float collTimeRes,
1489+
float nSigma, float timeMargin, int bcWindowForOneSigma,
1490+
int usePVAssociation, int maxPvContribLowMult, float* values = nullptr);
1491+
// Same as above for DQ skimmed tables: track = ReducedTracks+ReducedTracksBarrel, collision/origCollision = ReducedEvents+ReducedEventsExtended
1492+
template <typename T, typename C>
1493+
static bool isBarrelAssocTimeCompatible(T const& track, C const& collision, C const& origCollision,
1494+
float nSigma, float timeMargin, int bcWindowForOneSigma,
1495+
int usePVAssociation, int maxPvContribLowMult, float* values = nullptr);
14771496
template <int candidateType, uint32_t fillMap, typename T1, typename T2, typename C>
14781497
static void FillTrackCollisionMC(T1 const& track, T2 const& MotherTrack, C const& collision, float* values = nullptr);
14791498
template <int candidateType, typename T1>
@@ -3471,6 +3490,18 @@ void VarManager::FillTrackCollision(T const& track, C const& collision, float* v
34713490
}
34723491
}
34733492

3493+
template <typename T, typename C>
3494+
bool VarManager::isBarrelAssocTimeCompatible(T const& track, C const& collision, C const& origCollision,
3495+
float nSigma, float timeMargin, int bcWindowForOneSigma,
3496+
int usePVAssociation, int maxPvContribLowMult, float* values)
3497+
{
3498+
return computeBarrelAssocTimeCompat(track.trackTime(), track.trackTimeRes(),
3499+
(track.flags() & o2::aod::track::TrackTimeResIsRange) > 0, track.isPVContributor(),
3500+
static_cast<int64_t>(origCollision.globalBC()), origCollision.collisionTime(), origCollision.numContrib(),
3501+
static_cast<int64_t>(collision.globalBC()), collision.collisionTime(), collision.collisionTimeRes(),
3502+
nSigma, timeMargin, bcWindowForOneSigma, usePVAssociation, maxPvContribLowMult, values);
3503+
}
3504+
34743505
template <uint32_t fillMap, typename T, typename C, typename M, typename P>
34753506
void VarManager::FillTrackCollisionMatCorr(T const& track, C const& collision, M const& materialCorr, P const& propagator, float* values)
34763507
{

0 commit comments

Comments
 (0)