@@ -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
0 commit comments