@@ -1380,6 +1380,9 @@ struct lambdakzeroPreselector {
13801380 Configurable<bool > forceITSOnlyMesons{" forceITSOnlyMesons" , false , " force meson-like daughters to be ITS-only to pass Lambda/AntiLambda selections (yes/no)" };
13811381 Configurable<int > minITSCluITSOnly{" minITSCluITSOnly" , 0 , " minimum number of ITS clusters to ask for if daughter track does not have TPC" };
13821382
1383+ // qa coll assoc directly from AO2D (MC mode exclusive)
1384+ Configurable<bool > qaCollisionAssociation{" qaCollisionAssociation" , false , " QA collision association" };
1385+
13831386 // for bit-packed maps
13841387 std::vector<uint32_t > selectionMask;
13851388 enum v0bit { bitInteresting = 0 ,
@@ -1419,6 +1422,30 @@ struct lambdakzeroPreselector {
14191422 h->GetXaxis ()->SetBinLabel (4 , " dEdx OK" );
14201423 h->GetXaxis ()->SetBinLabel (5 , " Used in Casc" );
14211424 h->GetXaxis ()->SetBinLabel (6 , " Used in Tra-Casc" );
1425+
1426+ if (qaCollisionAssociation) {
1427+ auto hCollAssocQA = histos.add <TH2>(" hCollAssocQA" , " hCollAssocQA" , kTH2D , {{6 , -0 .5f , 5 .5f }, {2 , -0 .5f , 1 .5f }});
1428+ hCollAssocQA->GetXaxis ()->SetBinLabel (1 , " K0" );
1429+ hCollAssocQA->GetXaxis ()->SetBinLabel (2 , " Lambda" );
1430+ hCollAssocQA->GetXaxis ()->SetBinLabel (3 , " AntiLambda" );
1431+ hCollAssocQA->GetXaxis ()->SetBinLabel (4 , " Gamma" );
1432+ hCollAssocQA->GetYaxis ()->SetBinLabel (1 , " Wrong collision" );
1433+ hCollAssocQA->GetYaxis ()->SetBinLabel (2 , " Correct collision" );
1434+
1435+ auto h2dPtVsCollAssocK0Short = histos.add <TH2>(" h2dPtVsCollAssocK0Short" , " h2dPtVsCollAssocK0Short" , kTH2D , {{100 , 0 .0f , 10 .0f }, {2 , -0 .5f , 1 .5f }});
1436+ auto h2dPtVsCollAssocLambda = histos.add <TH2>(" h2dPtVsCollAssocLambda" , " h2dPtVsCollAssocLambda" , kTH2D , {{100 , 0 .0f , 10 .0f }, {2 , -0 .5f , 1 .5f }});
1437+ auto h2dPtVsCollAssocAntiLambda = histos.add <TH2>(" h2dPtVsCollAssocAntiLambda" , " h2dPtVsCollAssocAntiLambda" , kTH2D , {{100 , 0 .0f , 10 .0f }, {2 , -0 .5f , 1 .5f }});
1438+ auto h2dPtVsCollAssocGamma = histos.add <TH2>(" h2dPtVsCollAssocGamma" , " h2dPtVsCollAssocGamma" , kTH2D , {{100 , 0 .0f , 10 .0f }, {2 , -0 .5f , 1 .5f }});
1439+
1440+ h2dPtVsCollAssocK0Short->GetYaxis ()->SetBinLabel (1 , " Wrong collision" );
1441+ h2dPtVsCollAssocK0Short->GetYaxis ()->SetBinLabel (2 , " Correct collision" );
1442+ h2dPtVsCollAssocLambda->GetYaxis ()->SetBinLabel (1 , " Wrong collision" );
1443+ h2dPtVsCollAssocLambda->GetYaxis ()->SetBinLabel (2 , " Correct collision" );
1444+ h2dPtVsCollAssocAntiLambda->GetYaxis ()->SetBinLabel (1 , " Wrong collision" );
1445+ h2dPtVsCollAssocAntiLambda->GetYaxis ()->SetBinLabel (2 , " Correct collision" );
1446+ h2dPtVsCollAssocGamma->GetYaxis ()->SetBinLabel (1 , " Wrong collision" );
1447+ h2dPtVsCollAssocGamma->GetYaxis ()->SetBinLabel (2 , " Correct collision" );
1448+ }
14221449 }
14231450
14241451 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
@@ -1467,9 +1494,11 @@ struct lambdakzeroPreselector {
14671494 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
14681495 // / function to check PDG association
14691496 template <class TTrackTo , typename TV0Object>
1470- void checkPDG (TV0Object const & lV0Candidate, uint32_t & maskElement)
1497+ void checkPDG (TV0Object const & lV0Candidate, uint32_t & maskElement, int mcCollisionId )
14711498 {
14721499 int lPDG = -1 ;
1500+ int correctMcCollisionIndex = -1 ;
1501+ float mcpt = -1.0 ;
14731502 bool physicalPrimary = false ;
14741503 auto lNegTrack = lV0Candidate.template negTrack_as <TTrackTo>();
14751504 auto lPosTrack = lV0Candidate.template posTrack_as <TTrackTo>();
@@ -1484,7 +1513,9 @@ struct lambdakzeroPreselector {
14841513 for (auto & lPosMother : lMCPosTrack.template mothers_as <aod::McParticles>()) {
14851514 if (lNegMother.globalIndex () == lPosMother.globalIndex () && (!dIfMCselectPhysicalPrimary || lNegMother.isPhysicalPrimary ())) {
14861515 lPDG = lNegMother.pdgCode ();
1516+ correctMcCollisionIndex = lNegMother.mcCollisionId ();
14871517 physicalPrimary = lNegMother.isPhysicalPrimary ();
1518+ mcpt = lNegMother.pt ();
14881519
14891520 // additionally check PDG of the mother particle if requested
14901521 if (dIfMCselectV0MotherPDG != 0 ) {
@@ -1502,14 +1533,40 @@ struct lambdakzeroPreselector {
15021533 }
15031534 }
15041535 } // end association check
1505- if (lPDG == 310 )
1536+
1537+ bool collisionAssociationOK = false ;
1538+ if (correctMcCollisionIndex > -1 && correctMcCollisionIndex == mcCollisionId) {
1539+ collisionAssociationOK = true ;
1540+ }
1541+
1542+ if (lPDG == 310 ) {
15061543 bitset (maskElement, bitTrueK0Short);
1507- if (lPDG == 3122 )
1544+ if (qaCollisionAssociation) {
1545+ histos.fill (HIST (" hCollAssocQA" ), 0 .0f , collisionAssociationOK);
1546+ histos.fill (HIST (" h2dPtVsCollAssocK0Short" ), mcpt, collisionAssociationOK);
1547+ }
1548+ }
1549+ if (lPDG == 3122 ) {
15081550 bitset (maskElement, bitTrueLambda);
1509- if (lPDG == -3122 )
1551+ if (qaCollisionAssociation) {
1552+ histos.fill (HIST (" hCollAssocQA" ), 1 .0f , collisionAssociationOK);
1553+ histos.fill (HIST (" h2dPtVsCollAssocLambda" ), mcpt, collisionAssociationOK);
1554+ }
1555+ }
1556+ if (lPDG == -3122 ) {
15101557 bitset (maskElement, bitTrueAntiLambda);
1511- if (lPDG == 22 )
1558+ if (qaCollisionAssociation) {
1559+ histos.fill (HIST (" hCollAssocQA" ), 2 .0f , collisionAssociationOK);
1560+ histos.fill (HIST (" h2dPtVsCollAssocAntiLambda" ), mcpt, collisionAssociationOK);
1561+ }
1562+ }
1563+ if (lPDG == 22 ) {
15121564 bitset (maskElement, bitTrueGamma);
1565+ if (qaCollisionAssociation) {
1566+ histos.fill (HIST (" hCollAssocQA" ), 3 .0f , collisionAssociationOK);
1567+ histos.fill (HIST (" h2dPtVsCollAssocGamma" ), mcpt, collisionAssociationOK);
1568+ }
1569+ }
15131570 if (lPDG == 1010010030 )
15141571 bitset (maskElement, bitTrueHypertriton);
15151572 if (lPDG == -1010010030 )
@@ -1622,11 +1679,12 @@ struct lambdakzeroPreselector {
16221679 checkAndFinalize ();
16231680 }
16241681 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
1625- void processBuildMCAssociated (aod::Collisions const & /* collisions*/ , aod::V0s const & v0table, LabeledTracksExtra const &, aod::McParticles const & /* particlesMC*/ )
1682+ void processBuildMCAssociated (soa::Join< aod::Collisions, aod::McCollisionLabels> const & /* collisions*/ , aod::V0s const & v0table, LabeledTracksExtra const &, aod::McParticles const & /* particlesMC*/ )
16261683 {
16271684 initializeMasks (v0table.size ());
16281685 for (auto const & v0 : v0table) {
1629- checkPDG<LabeledTracksExtra>(v0, selectionMask[v0.globalIndex ()]);
1686+ auto collision = v0.collision_as <soa::Join<aod::Collisions, aod::McCollisionLabels>>();
1687+ checkPDG<LabeledTracksExtra>(v0, selectionMask[v0.globalIndex ()], collision.mcCollisionId ());
16301688 checkTrackQuality<LabeledTracksExtra>(v0, selectionMask[v0.globalIndex ()], true );
16311689 }
16321690 if (!doprocessSkipV0sNotUsedInCascades && !doprocessSkipV0sNotUsedInTrackedCascades)
@@ -1644,11 +1702,12 @@ struct lambdakzeroPreselector {
16441702 checkAndFinalize ();
16451703 }
16461704 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
1647- void processBuildValiddEdxMCAssociated (aod::Collisions const & /* collisions*/ , aod::V0s const & v0table, TracksExtraWithPIDandLabels const &, aod::McParticles const &)
1705+ void processBuildValiddEdxMCAssociated (soa::Join< aod::Collisions, aod::McCollisionLabels> const & /* collisions*/ , aod::V0s const & v0table, TracksExtraWithPIDandLabels const &, aod::McParticles const &)
16481706 {
16491707 initializeMasks (v0table.size ());
16501708 for (auto const & v0 : v0table) {
1651- checkPDG<TracksExtraWithPIDandLabels>(v0, selectionMask[v0.globalIndex ()]);
1709+ auto collision = v0.collision_as <soa::Join<aod::Collisions, aod::McCollisionLabels>>();
1710+ checkPDG<TracksExtraWithPIDandLabels>(v0, selectionMask[v0.globalIndex ()], collision.mcCollisionId ());
16521711 checkdEdx<TracksExtraWithPIDandLabels>(v0, selectionMask[v0.globalIndex ()]);
16531712 checkTrackQuality<TracksExtraWithPIDandLabels>(v0, selectionMask[v0.globalIndex ()]);
16541713 }
0 commit comments