Skip to content

Commit 883e4a8

Browse files
authored
[PWGLF] Fix daughter and candidate vectors in KFParticle decay3bodybuilder (#9691)
1 parent ae4a2fa commit 883e4a8

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ struct decay3bodyBuilder {
458458
registry.add("QA/Tracks/hTrackProtonPt", "hTrackProtonPt", HistType::kTH1F, {{100, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}});
459459
registry.add("QA/Tracks/hTrackPionPt", "hTrackPionPt", HistType::kTH1F, {{100, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}});
460460
registry.add("QA/Tracks/hTrackBachPt", "hTrackBachPt", HistType::kTH1F, {{100, 0.0f, 10.0f, "#it{p}_{T} (GeV/c)"}});
461+
registry.add("QA/Event/hAllSelEventsVtxZ", "hAllSelEventsVtxZ", HistType::kTH1F, {{500, -15.0f, 15.0f, "PV Z (cm)"}});
461462
registry.add("QA/Event/hVtxXKF", "hVtxXKF", HistType::kTH1F, {{500, -0.1f, 0.1f, "PV X (cm)"}});
462463
registry.add("QA/Event/hVtxYKF", "hVtxYKF", HistType::kTH1F, {{500, -0.1f, 0.1f, "PV Y (cm)"}});
463464
registry.add("QA/Event/hVtxZKF", "hVtxZKF", HistType::kTH1F, {{500, -15.0f, 15.0f, "PV Z (cm)"}});
@@ -918,6 +919,11 @@ struct decay3bodyBuilder {
918919
gROOT->SetBatch(true);
919920
gRandom->SetSeed(42);
920921

922+
kf3bodyVtxCandidates.clear();
923+
kfProtonDaughters.clear();
924+
kfPionDaughters.clear();
925+
kfDeuteronDaughters.clear();
926+
921927
LOG(debug) << "buildVtx3BodyDataTableKFParticle called.";
922928

923929
bool isEventMixing = false;
@@ -930,7 +936,7 @@ struct decay3bodyBuilder {
930936
KFParticle kfpv(kfpVertex);
931937
LOG(debug) << "Created KF PV.";
932938

933-
// fill event QA histograms
939+
// fill event QA histograms --> only for events with a decay3body!
934940
if (kfparticleConfigurations.doVertexQA) {
935941
registry.fill(HIST("QA/Event/hVtxXKF"), kfpv.GetX());
936942
registry.fill(HIST("QA/Event/hVtxYKF"), kfpv.GetY());
@@ -1424,7 +1430,6 @@ struct decay3bodyBuilder {
14241430
candidate.tofNsigmaDeuteron = tofNSigmaDeuteron;
14251431
candidate.averageClusterSizeDeuteron = averageClusterSizeDeuteron;
14261432
candidate.pidForTrackingDeuteron = trackBach.pidForTracking();
1427-
/// TODO: push back candidate to candidate array?? --> only if I want table filling happening separately in process function
14281433

14291434
//------------------------------------------------------------------
14301435
// table filling
@@ -1577,8 +1582,6 @@ struct decay3bodyBuilder {
15771582

15781583
void processRun3withKFParticle(ColwithEvTimes const& collisions, TrackExtPIDIUwithEvTimes const&, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&)
15791584
{
1580-
kf3bodyVtxCandidates.clear();
1581-
15821585
for (const auto& collision : collisions) {
15831586

15841587
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
@@ -1600,20 +1603,19 @@ struct decay3bodyBuilder {
16001603
continue;
16011604
}
16021605
registry.fill(HIST("Counters/hEventCounterKFParticle"), 1.5);
1603-
if (kfparticleConfigurations.doPosZselection && abs(collision.posZ()) > 10.f) {
1606+
if (kfparticleConfigurations.doPosZselection && (collision.posZ() >= 10.0f || collision.posZ() <= -10.0f)) {
16041607
continue;
16051608
}
16061609
registry.fill(HIST("Counters/hEventCounterKFParticle"), 2.5);
1610+
registry.fill(HIST("QA/Event/hAllSelEventsVtxZ"), collision.posZ());
16071611

16081612
if (isZorroSelected) {
16091613
registry.fill(HIST("Counters/hEventCounterZorro"), 1.);
16101614
}
16111615

16121616
// slice Decay3Body table by collision
16131617
const uint64_t collIdx = collision.globalIndex();
1614-
// LOG(debug) << "Collision index: " << collIdx;
16151618
auto Decay3BodyTable_thisCollision = decay3bodys.sliceBy(perCollision, collIdx);
1616-
// LOG(debug) << "Decay3Body tables sliced per collision. Calling buildVtx3BodyDataTableKFParticle function...";
16171619
for (auto& vtx3body : Decay3BodyTable_thisCollision) {
16181620
auto trackPos = vtx3body.template track0_as<TrackExtPIDIUwithEvTimes>();
16191621
auto trackNeg = vtx3body.template track1_as<TrackExtPIDIUwithEvTimes>();
@@ -1694,20 +1696,19 @@ struct decay3bodyBuilder {
16941696
continue;
16951697
}
16961698
registry.fill(HIST("Counters/hEventCounterKFParticle"), 1.5);
1697-
if (kfparticleConfigurations.doPosZselection && abs(collision.posZ()) > 10.f) {
1699+
if (kfparticleConfigurations.doPosZselection && (collision.posZ() >= 10.0f || collision.posZ() <= -10.0f)) {
16981700
continue;
16991701
}
17001702
registry.fill(HIST("Counters/hEventCounterKFParticle"), 2.5);
1703+
registry.fill(HIST("QA/Event/hAllSelEventsVtxZ"), collision.posZ());
17011704

17021705
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
17031706
initCCDB(bc);
17041707
LOG(debug) << "CCDB initialised.";
17051708

17061709
// slice Decay3Body table by collision
17071710
const uint64_t collIdx = collision.globalIndex();
1708-
// LOG(debug) << "Collision index: " << collIdx;
17091711
auto Decay3BodyTable_thisCollision = decay3bodys.sliceBy(perCollision, collIdx);
1710-
// LOG(debug) << "Decay3Body tables sliced per collision. Calling buildVtx3BodyDataTableKFParticle function...";
17111712
for (auto& vtx3body : Decay3BodyTable_thisCollision) {
17121713
auto trackPos = vtx3body.template track0_as<TrackExtPIDIUwithEvTimes>();
17131714
auto trackNeg = vtx3body.template track1_as<TrackExtPIDIUwithEvTimes>();

PWGLF/TableProducer/Nuspex/threebodyKFTask.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "Common/Core/trackUtilities.h"
2929
#include "PWGLF/DataModel/LFStrangenessTables.h"
3030
#include "PWGLF/DataModel/Vtx3BodyTables.h"
31-
#include "Common/Core/TrackSelection.h"
32-
#include "Common/DataModel/TrackSelectionTables.h"
3331
#include "Common/DataModel/EventSelection.h"
3432
#include "Common/DataModel/Centrality.h"
3533
#include "Common/DataModel/PIDResponse.h"

0 commit comments

Comments
 (0)