Skip to content

Commit f3e4261

Browse files
ddobrigkalibuild
andauthored
PWGLF: provisions for UPC Lambdas, occupancy studies, v0 type checker (#6303)
* PWGLF: provisions for UPC Lambdas, occupancy studies, v0 type checker * Please consider the following formatting changes (#302) --------- Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 3967859 commit f3e4261

3 files changed

Lines changed: 71 additions & 5 deletions

File tree

PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ struct lambdakzeroBuilder {
337337
// Helper struct to do bookkeeping of building parameters
338338
struct {
339339
std::array<int32_t, kNV0Steps> v0stats;
340+
std::array<int32_t, kNV0Steps> v0statsUnassociated;
340341
std::array<int32_t, 10> posITSclu;
341342
std::array<int32_t, 10> negITSclu;
342343
int32_t exceptions;
@@ -408,8 +409,10 @@ struct lambdakzeroBuilder {
408409
{
409410
statisticsRegistry.exceptions = 0;
410411
statisticsRegistry.eventCounter = 0;
411-
for (Int_t ii = 0; ii < kNV0Steps; ii++)
412+
for (Int_t ii = 0; ii < kNV0Steps; ii++) {
412413
statisticsRegistry.v0stats[ii] = 0;
414+
statisticsRegistry.v0statsUnassociated[ii] = 0;
415+
}
413416
for (Int_t ii = 0; ii < 10; ii++) {
414417
statisticsRegistry.posITSclu[ii] = 0;
415418
statisticsRegistry.negITSclu[ii] = 0;
@@ -420,8 +423,10 @@ struct lambdakzeroBuilder {
420423
{
421424
registry.fill(HIST("hEventCounter"), 0.0, statisticsRegistry.eventCounter);
422425
registry.fill(HIST("hCaughtExceptions"), 0.0, statisticsRegistry.exceptions);
423-
for (Int_t ii = 0; ii < kNV0Steps; ii++)
426+
for (Int_t ii = 0; ii < kNV0Steps; ii++) {
424427
registry.fill(HIST("hV0Criteria"), ii, statisticsRegistry.v0stats[ii]);
428+
registry.fill(HIST("hV0CriteriaUnassociated"), ii, statisticsRegistry.v0statsUnassociated[ii]);
429+
}
425430
if (qaConfigurations.d_doTrackQA) {
426431
for (Int_t ii = 0; ii < 10; ii++) {
427432
registry.fill(HIST("hPositiveITSClusters"), ii, statisticsRegistry.posITSclu[ii]);
@@ -450,6 +455,17 @@ struct lambdakzeroBuilder {
450455
h->GetXaxis()->SetBinLabel(8, "Count: Standard V0");
451456
h->GetXaxis()->SetBinLabel(9, "Count: V0 exc. for casc");
452457

458+
auto h2 = registry.add<TH1>("hV0CriteriaUnassociated", "hV0CriteriaUnassociated", kTH1D, {{10, -0.5f, 9.5f}});
459+
h2->GetXaxis()->SetBinLabel(1, "All sel");
460+
h2->GetXaxis()->SetBinLabel(2, "TPC requirement");
461+
h2->GetXaxis()->SetBinLabel(3, "DCAxy Dau to PV");
462+
h2->GetXaxis()->SetBinLabel(4, "DCA V0 Dau");
463+
h2->GetXaxis()->SetBinLabel(5, "CosPA");
464+
h2->GetXaxis()->SetBinLabel(6, "Radius");
465+
h2->GetXaxis()->SetBinLabel(7, "Within momentum range");
466+
h2->GetXaxis()->SetBinLabel(8, "Count: Standard V0");
467+
h2->GetXaxis()->SetBinLabel(9, "Count: V0 exc. for casc");
468+
453469
randomSeed = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
454470

455471
// Optionally, add extra QA histograms to processing chain
@@ -801,6 +817,9 @@ struct lambdakzeroBuilder {
801817

802818
// value 0.5: any considered V0
803819
statisticsRegistry.v0stats[kV0All]++;
820+
if (!V0.has_collision())
821+
statisticsRegistry.v0statsUnassociated[kV0All]++;
822+
804823
if (tpcrefit) {
805824
if (!(posTrack.trackType() & o2::aod::track::TPCrefit)) {
806825
return false;
@@ -812,6 +831,8 @@ struct lambdakzeroBuilder {
812831

813832
// Passes TPC refit
814833
statisticsRegistry.v0stats[kV0TPCrefit]++;
834+
if (!V0.has_collision())
835+
statisticsRegistry.v0statsUnassociated[kV0TPCrefit]++;
815836

816837
// Calculate DCA with respect to the collision associated to the V0, not individual tracks
817838
gpu::gpustd::array<float, 2> dcaInfo;
@@ -834,6 +855,8 @@ struct lambdakzeroBuilder {
834855

835856
// passes DCAxy
836857
statisticsRegistry.v0stats[kV0DCAxy]++;
858+
if (!V0.has_collision())
859+
statisticsRegistry.v0statsUnassociated[kV0DCAxy]++;
837860

838861
// Change strangenessBuilder tracks
839862
lPositiveTrack = getTrackParCov(posTrack);
@@ -881,6 +904,8 @@ struct lambdakzeroBuilder {
881904

882905
// Passes DCA between daughters check
883906
statisticsRegistry.v0stats[kV0DCADau]++;
907+
if (!V0.has_collision())
908+
statisticsRegistry.v0statsUnassociated[kV0DCADau]++;
884909

885910
v0candidate.cosPA = RecoDecay::cpa(array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, array{v0candidate.pos[0], v0candidate.pos[1], v0candidate.pos[2]}, array{v0candidate.posP[0] + v0candidate.negP[0], v0candidate.posP[1] + v0candidate.negP[1], v0candidate.posP[2] + v0candidate.negP[2]});
886911
if (v0candidate.cosPA < v0cospa) {
@@ -896,6 +921,8 @@ struct lambdakzeroBuilder {
896921

897922
// Passes CosPA check
898923
statisticsRegistry.v0stats[kV0CosPA]++;
924+
if (!V0.has_collision())
925+
statisticsRegistry.v0statsUnassociated[kV0CosPA]++;
899926

900927
v0candidate.V0radius = RecoDecay::sqrtSumOfSquares(v0candidate.pos[0], v0candidate.pos[1]);
901928
if (v0candidate.V0radius < v0radius) {
@@ -904,6 +931,8 @@ struct lambdakzeroBuilder {
904931

905932
// Passes radius check
906933
statisticsRegistry.v0stats[kV0Radius]++;
934+
if (!V0.has_collision())
935+
statisticsRegistry.v0statsUnassociated[kV0Radius]++;
907936
// Return OK: passed all v0 candidate selecton criteria
908937

909938
auto px = v0candidate.posP[0] + v0candidate.negP[0];
@@ -931,6 +960,8 @@ struct lambdakzeroBuilder {
931960

932961
// Passes momentum window check
933962
statisticsRegistry.v0stats[kWithinMomentumRange]++;
963+
if (!V0.has_collision())
964+
statisticsRegistry.v0statsUnassociated[kWithinMomentumRange]++;
934965

935966
// Calculate masses
936967
auto lGammaMass = RecoDecay::m(array{array{v0candidate.posP[0], v0candidate.posP[1], v0candidate.posP[2]}, array{v0candidate.negP[0], v0candidate.negP[1], v0candidate.negP[2]}}, array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
@@ -1164,6 +1195,9 @@ struct lambdakzeroBuilder {
11641195

11651196
// populates the various tables for analysis
11661197
statisticsRegistry.v0stats[kCountStandardV0]++;
1198+
if (!V0.has_collision())
1199+
statisticsRegistry.v0statsUnassociated[kCountStandardV0]++;
1200+
11671201
v0indices(V0.posTrackId(), V0.negTrackId(),
11681202
V0.collisionId(), V0.globalIndex());
11691203
v0trackXs(v0candidate.posTrackX, v0candidate.negTrackX);

PWGLF/TableProducer/Strangeness/lambdakzeromcfinder.cxx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ struct lambdakzeromcfinder {
8383
Configurable<bool> requireTPC{"requireTPC", true, "require TPC"};
8484
Configurable<bool> skipTPConly{"skipTPConly", false, "skip tracks that are TPC-only"};
8585
Configurable<bool> storeSingleTPCOnlyProng{"storeSingleTPCOnlyProng", false, "in case a TPC-only track is found, do not allow another TPC-only for the same mcParticle. Works only in MC particle path."};
86-
Configurable<bool> doUnassociatedV0s{"doUnassociatedV0s", true, "generate also unassociated V0s (for cascades!)"};
86+
Configurable<bool> doAssociatedV0s{"doAssociatedV0s", true, "generate collision-associated V0s (for cascades!)"};
87+
Configurable<bool> doUnassociatedV0s{"doUnassociatedV0s", true, "generate also unassociated V0s (for cascades, UPC)"};
8788
Configurable<bool> doSameCollisionOnly{"doSameCollisionOnly", false, "stick to decays in which tracks are assoc to same collision"};
8889
Configurable<int> qaNbins{"qaNbins", 200, "qa plots: binning"};
8990
Configurable<float> yPreFilter{"yPreFilter", 2.5, "broad y pre-filter for speed"};
@@ -109,6 +110,9 @@ struct lambdakzeromcfinder {
109110

110111
histos.add("hNTimesCollRecoed", "hNTimesCollRecoed", kTH1F, {axisNTimesRecoed});
111112

113+
// store number of recoed V0s and number of recoed V0s with no collision association
114+
histos.add("hNCollisionAssociation", "hNCollisionAssociation", kTH1F, {axisNTimesRecoed});
115+
112116
// warning: this stores (composite) number of copies of tracks
113117
histos.add("hNTimesRecoedGamma", "hNTimesRecoedGamma", kTH2F, {axisNTimesRecoed, axisPtQA});
114118
histos.add("hNTimesRecoedK0Short", "hNTimesRecoedK0Short", kTH2F, {axisNTimesRecoed, axisPtQA});
@@ -302,7 +306,15 @@ struct lambdakzeromcfinder {
302306

303307
// V0 list established, populate
304308
for (auto ic : sortedIndices) {
305-
if (v0collisionId[ic] >= 0 || doUnassociatedV0s) {
309+
histos.fill(HIST("hNCollisionAssociation"), 0.0f); // any correctly recoed
310+
if (v0collisionId[ic] >= 0)
311+
histos.fill(HIST("hNCollisionAssociation"), 1.0f); // reconstructed with a collision associated to it
312+
313+
if (v0collisionId[ic] < 0 && doUnassociatedV0s) {
314+
v0(v0collisionId[ic], v0positiveIndex[ic], v0negativeIndex[ic], 1);
315+
fullv0labels(v0mcLabel[ic]);
316+
}
317+
if (v0collisionId[ic] >= 0 && doAssociatedV0s) {
306318
v0(v0collisionId[ic], v0positiveIndex[ic], v0negativeIndex[ic], 1);
307319
fullv0labels(v0mcLabel[ic]);
308320
}

PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ struct derivedlambdakzeroanalysis {
8181
Configurable<bool> requireIsVertexTRDmatched{"requireIsVertexTRDmatched", true, "require events with at least one of vertex contributors matched to TRD"};
8282
Configurable<bool> rejectSameBunchPileup{"rejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"};
8383

84+
Configurable<int> v0TypeSelection{"v0TypeSelection", 1, "select on a certain V0 type (leave negative if no selection desired)"};
85+
8486
// Selection criteria: acceptance
8587
Configurable<float> rapidityCut{"rapidityCut", 0.5, "rapidity"};
8688
Configurable<float> daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"};
@@ -128,6 +130,10 @@ struct derivedlambdakzeroanalysis {
128130
Configurable<bool> doMCAssociation{"doMCAssociation", true, "if MC, do MC association"};
129131
Configurable<bool> doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"};
130132

133+
// fast check on occupancy
134+
Configurable<float> minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"};
135+
Configurable<float> maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"};
136+
131137
static constexpr float defaultLifetimeCuts[1][2] = {{30., 20.}};
132138
Configurable<LabeledArray<float>> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"};
133139

@@ -295,7 +301,7 @@ struct derivedlambdakzeroanalysis {
295301
secondaryMaskSelectionAntiLambda = maskTopological | maskTrackProperties | maskAntiLambdaSpecific;
296302

297303
// Event Counters
298-
histos.add("hEventSelection", "hEventSelection", kTH1F, {{10, -0.5f, +9.5f}});
304+
histos.add("hEventSelection", "hEventSelection", kTH1F, {{12, -0.5f, +11.5f}});
299305
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions");
300306
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut");
301307
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut");
@@ -306,6 +312,8 @@ struct derivedlambdakzeroanalysis {
306312
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsVertexTOFmatched");
307313
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTRDmatched");
308314
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup");
315+
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "Below min occup.");
316+
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "Above max occup.");
309317

310318
histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, +100.0f}});
311319
histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2F, {axisCentrality, {500, 0.0f, +2000.0f}});
@@ -1066,6 +1074,15 @@ struct derivedlambdakzeroanalysis {
10661074
}
10671075
histos.fill(HIST("hEventSelection"), 9 /* Not at same bunch pile-up */);
10681076

1077+
if (minOccupancy > 0 && collision.trackOccupancyInTimeRange() < minOccupancy) {
1078+
return;
1079+
}
1080+
histos.fill(HIST("hEventSelection"), 10 /* Below min occupancy */);
1081+
if (maxOccupancy > 0 && collision.trackOccupancyInTimeRange() > maxOccupancy) {
1082+
return;
1083+
}
1084+
histos.fill(HIST("hEventSelection"), 11 /* Above max occupancy */);
1085+
10691086
float centrality = collision.centFT0C();
10701087
if (qaCentrality) {
10711088
auto hRawCentrality = histos.get<TH1>(HIST("hRawCentrality"));
@@ -1082,6 +1099,9 @@ struct derivedlambdakzeroanalysis {
10821099
if (std::abs(v0.negativeeta()) > daughterEtaCut || std::abs(v0.positiveeta()) > daughterEtaCut)
10831100
continue; // remove acceptance that's badly reproduced by MC / superfluous in future
10841101

1102+
if (v0.v0Type() != v0TypeSelection && v0TypeSelection > -1)
1103+
continue; // skip V0s that are not standard
1104+
10851105
// fill AP plot for all V0s
10861106
histos.fill(HIST("GeneralQA/h2dArmenterosAll"), v0.alpha(), v0.qtarm());
10871107

0 commit comments

Comments
 (0)