Skip to content

Commit cbc6e1f

Browse files
authored
[PWGLF] Fix isGoodCollision flag in decay3bodybuilder and add config for application of SVertexer cuts for mixing (#13460)
1 parent 4e28482 commit cbc6e1f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ struct decay3bodyBuilder {
195195
Configurable<bool> selectPVPosZ3bodyMixing{"selectPVPosZ3bodyMixing", true, "Select same pvPosZ events in case of 3body mixing"};
196196
Configurable<float> maxDeltaPVPosZ3bodyMixing{"maxDeltaPVPosZ3bodyMixing", 1., "max difference between PV z position in case of 3body mixing"};
197197
// SVertexer selections
198+
Configurable<bool> doApplySVertexerCuts{"doApplySVertexerCuts", false, "Apply SVertexer selections during event mixing"};
198199
Configurable<float> minPt2V0{"minPt2V0", 0.5, "Min Pt squared of V0"};
199200
Configurable<float> maxTgl2V0{"maxTgl2V0", 4, "Max tgl squared of V0"};
200201
Configurable<float> maxDCAXY2ToMeanVertex3bodyV0{"maxDCAXY2ToMeanVertex3bodyV0", 4, "Max DCA XY squared of V0 to mean vertex"};
@@ -737,7 +738,8 @@ struct decay3bodyBuilder {
737738
decay3bodyBuilderOpts.acceptTPCOnly,
738739
decay3bodyBuilderOpts.askOnlyITSMatch,
739740
decay3bodyBuilderOpts.calculateCovariance,
740-
false /*isEventMixing*/)) {
741+
false /*isEventMixing*/,
742+
false /*applySVertexerCuts*/)) {
741743
continue;
742744
}
743745

@@ -772,6 +774,13 @@ struct decay3bodyBuilder {
772774
resetMCInfo(this3BodyMCInfo);
773775
this3BodyMCInfo.isReco = true;
774776

777+
// set flag if selected reco collision has matched gen collision
778+
if (collision.mcCollisionId() >= 0) { // reco collision is matched to gen collision
779+
this3BodyMCInfo.survivedEventSel = isGoodCollision[collision.mcCollisionId()];
780+
} else {
781+
this3BodyMCInfo.survivedEventSel = false; // false if reco collision not matched to gen collision
782+
}
783+
775784
// check if daughters have MC particle
776785
if (!trackProton.has_mcParticle() || !trackPion.has_mcParticle() || !trackDeuteron.has_mcParticle()) {
777786
continue;
@@ -1146,7 +1155,8 @@ struct decay3bodyBuilder {
11461155
decay3bodyBuilderOpts.acceptTPCOnly,
11471156
decay3bodyBuilderOpts.askOnlyITSMatch,
11481157
decay3bodyBuilderOpts.calculateCovariance,
1149-
true /*isEventMixing*/)) {
1158+
true, /*isEventMixing*/
1159+
mixingOpts.doApplySVertexerCuts /*applySVertexerCuts*/)) {
11501160
// fill analysis tables with built candidate
11511161
fillAnalysisTables();
11521162
return;
@@ -1215,7 +1225,6 @@ struct decay3bodyBuilder {
12151225
mcInfo.motherPdgCode = -1;
12161226
mcInfo.daughterPrPdgCode = -1, mcInfo.daughterPiPdgCode = -1, mcInfo.daughterDePdgCode = -1;
12171227
mcInfo.isDeuteronPrimary = false;
1218-
mcInfo.survivedEventSel = false;
12191228
return;
12201229
}
12211230

PWGLF/Utils/decay3bodyBuilderHelper.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ class decay3bodyBuilderHelper
194194
bool acceptTPCOnly = false,
195195
bool askOnlyITSMatch = true,
196196
bool calculateCovariance = true,
197-
bool isEventMixing = false)
197+
bool isEventMixing = false,
198+
bool doApplySVertexerCuts = false)
198199
{
199200
int collisionIndex = collision.globalIndex();
200201
float pvX = collision.posX();
@@ -479,7 +480,7 @@ class decay3bodyBuilderHelper
479480

480481
//_______________________________________________________________________
481482
// SVertexer selections in case of event mixing
482-
if (isEventMixing) {
483+
if (isEventMixing && doApplySVertexerCuts) {
483484
applySVertexerCuts(collision, trackProton, trackPion, trackDeuteron, /*applyV0Cut = */ true);
484485
}
485486

0 commit comments

Comments
 (0)