@@ -637,7 +637,7 @@ struct Pi0EtaToGammaGammaMC {
637637 fRegistry .fill (HIST (" Event/after/hCollisionCounter" ), 12.0 , weight); // accepted
638638
639639 int photonid1 = -1 , photonid2 = -1 , pi0id = -1 , etaid = -1 ;
640- if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kEMCEMC ) { // same kinds pairing
640+ if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kEMCEMC || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType:: kPCMEMC ) { // same kinds pairing and PCM-EMC
641641
642642 auto photons1_per_collision = photons1.sliceByCached (TDetectorTag1::perCollision (), collision.globalIndex (), cache);
643643 auto photons2_per_collision = photons2.sliceByCached (TDetectorTag2::perCollision (), collision.globalIndex (), cache);
@@ -652,7 +652,7 @@ struct Pi0EtaToGammaGammaMC {
652652 continue ;
653653 }
654654 } else {
655- if (!TDetectorTag1::applyCut (*this , g1) || ! TDetectorTag2::applyCut (* this , g2)) {
655+ if (!TDetectorTag1::applyCut (*this , g1)) { // g2 is checked below with its own tag (and matched tracks for EMC)
656656 continue ;
657657 }
658658 }
@@ -696,6 +696,20 @@ struct Pi0EtaToGammaGammaMC {
696696
697697 photonid1 = o2::aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain (cluster1mcparticle, mcparticles, std::vector<int >{111 , 221 });
698698 photonid2 = o2::aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain (cluster2mcparticle, mcparticles, std::vector<int >{111 , 221 });
699+ } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC ) {
700+ // PCM: true conversion as for PCM-PCM
701+ auto pos1 = g1.template posTrack_as <TLegs>();
702+ auto ele1 = g1.template negTrack_as <TLegs>();
703+ auto pos1mc = pos1.template emmcparticle_as <TMCParticles>();
704+ auto ele1mc = ele1.template emmcparticle_as <TMCParticles>();
705+ photonid1 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs (pos1mc, ele1mc, -11 , 11 , 22 , mcparticles);
706+
707+ // EMC: photon below the pi0/eta of the leading contributor as for EMC-EMC
708+ if (g2.emmcparticleIds ().empty ()) {
709+ continue ; // noise cluster without MC label
710+ }
711+ auto cluster2mcparticle = mcparticles.iteratorAt (g2.emmcparticleIds ()[0 ]);
712+ photonid2 = o2::aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain (cluster2mcparticle, mcparticles, std::vector<int >{111 , 221 });
699713 } else {
700714 photonid1 = -1 ;
701715 photonid2 = -1 ;
@@ -711,6 +725,10 @@ struct Pi0EtaToGammaGammaMC {
711725 if (!o2::aod::pwgem::photonmeson::utils::mcutil::IsConversionPointInAcceptance (g1mc, maxRgen, maxY_gen, margin_z_mc, mcparticles) || !o2::aod::pwgem::photonmeson::utils::mcutil::IsConversionPointInAcceptance (g2mc, maxRgen, maxY_gen, margin_z_mc, mcparticles)) {
712726 continue ;
713727 }
728+ } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC ) {
729+ if (!o2::aod::pwgem::photonmeson::utils::mcutil::IsConversionPointInAcceptance (g1mc, maxRgen, maxY_gen, margin_z_mc, mcparticles)) {
730+ continue ;
731+ }
714732 }
715733
716734 pi0id = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs (g1mc, g2mc, 22 , 22 , 111 , mcparticles);
@@ -1024,19 +1042,17 @@ struct Pi0EtaToGammaGammaMC {
10241042 auto && [emcclusters, emcMatchedTracks, emcMatchedSecondaries] = std::forward_as_tuple (args...);
10251043 runTruePairing<EMCTag, EMCTag, o2::soa::CombinationsStrictlyUpperIndexPolicy>(collisions, emcclusters, emcclusters, mccollisions, mcparticles, nullptr , emcMatchedTracks, emcMatchedSecondaries);
10261044 runGenInfo (collisions, mccollisions, mcparticles);
1045+ } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC ) {
1046+ auto && [v0photons, emcclusters, v0legs, emcMatchedTracks, emcMatchedSecondaries] = std::forward_as_tuple (args...);
1047+ runTruePairing<PCMTag, EMCTag, o2::soa::CombinationsFullIndexPolicy>(collisions, v0photons, emcclusters, mccollisions, mcparticles, v0legs, emcMatchedTracks, emcMatchedSecondaries);
1048+ runGenInfo (collisions, mccollisions, mcparticles);
10271049 }
10281050
10291051 // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS) {
10301052 // auto phosclusters = std::get<0>(std::tie(args...));
10311053 // runPairing(collisions, phosclusters, phosclusters, nullptr, nullptr, perCollision_phos, perCollision_phos, fPHOSCut, fPHOSCut, nullptr, nullptr);
10321054 // }
1033- // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) {
1034- // auto v0photons = std::get<0>(std::tie(args...));
1035- // auto v0legs = std::get<1>(std::tie(args...));
1036- // auto emcclusters = std::get<2>(std::tie(args...));
1037- // auto emcmatchedtracks = std::get<3>(std::tie(args...));
1038- // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr);
1039- // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) {
1055+ // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) {
10401056 // auto v0photons = std::get<0>(std::tie(args...));
10411057 // auto v0legs = std::get<1>(std::tie(args...));
10421058 // auto phosclusters = std::get<2>(std::tie(args...));
@@ -1070,19 +1086,17 @@ struct Pi0EtaToGammaGammaMC {
10701086 // runTruePairing(collisions, emcclusters, emcclusters, nullptr, nullptr, perCollision_emc, perCollision_emc, fEMCCut, fEMCCut, mccollisions, mcparticles);
10711087 runTruePairing<EMCTag, EMCTag, o2::soa::CombinationsStrictlyUpperIndexPolicy>(collisions, emcclusters, emcclusters, mccollisions, mcparticles, nullptr , emcMatchedTracks, emcMatchedSecondaries);
10721088 runGenInfo (collisions, mccollisions, mcparticles);
1089+ } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC ) {
1090+ auto && [v0photons, emcclusters, v0legs, emcMatchedTracks, emcMatchedSecondaries] = std::forward_as_tuple (args...);
1091+ runTruePairing<PCMTag, EMCTag, o2::soa::CombinationsFullIndexPolicy>(collisions, v0photons, emcclusters, mccollisions, mcparticles, v0legs, emcMatchedTracks, emcMatchedSecondaries);
1092+ runGenInfo (collisions, mccollisions, mcparticles);
10731093 }
10741094
10751095 // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS) {
10761096 // auto phosclusters = std::get<0>(std::tie(args...));
10771097 // runPairing(collisions, phosclusters, phosclusters, nullptr, nullptr, perCollision_phos, perCollision_phos, fPHOSCut, fPHOSCut, nullptr, nullptr);
10781098 // }
1079- // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) {
1080- // auto v0photons = std::get<0>(std::tie(args...));
1081- // auto v0legs = std::get<1>(std::tie(args...));
1082- // auto emcclusters = std::get<2>(std::tie(args...));
1083- // auto emcmatchedtracks = std::get<3>(std::tie(args...));
1084- // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr);
1085- // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) {
1099+ // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) {
10861100 // auto v0photons = std::get<0>(std::tie(args...));
10871101 // auto v0legs = std::get<1>(std::tie(args...));
10881102 // auto phosclusters = std::get<2>(std::tie(args...));
0 commit comments