Skip to content

Commit d1fabd8

Browse files
committed
[PWGEM,PWGEM-36] PhotonMeson: two-photon MC truth task, pair background QA and PCM-EMC MC
Add tools to find out which parts of the same-event photon-pair spectrum the mixed event cannot describe, and add PCM-EMC to the MC pi0/eta task. twoPhotonMcTask (new): - Classify same-event PCM-PCM, EMC-EMC and PCM-EMC pairs by the closest common MC ancestor of the two candidates: none, same particle, pi0/eta direct, pi0/eta cross, omega, K0S, eta', other hadron, parton/string. Output THn (m_inv, pT, cent, pair truth, bucket). - Per-photon truth flag (true photon / non-photon / fake) and ancestor chains cached once per DF. EMC chains of a conversion e+- start at the photon. The colliding beam nuclei are never part of a chain. - Ancestor chain QA: length, why the chain ended, kind and PDG of the last element. - PCM-EMC same-particle diagnostics: what made the EMC cluster (V0 leg e+-, bremsstrahlung of a leg, other), and for leg clusters whether and where the leg appears among the matched primary/secondary tracks, with residuals and E/p. - Mixed-event process functions (z-vertex and centrality mixing, same event and photon selection as taskPi0FlowEMC), filling (m_inv, pT, cent, pair truth) to compare with the "none" component. MCUtilities.h: - Add isPartonLike, isNucleus, getAncestorChain and getFirstCommonAncestor. taskPi0FlowEMC: - Replace hEtaPhiAngleMassCent(Mixed) with hPairBkgSE/ME: THnF in (m_inv, pT, cent, alpha, atan2(deta, dphi)), with dphi folded to [0, pi] identically for SE and ME. Alpha is signed (PCM - EMC) for PCM-EMC. Filled after all pair cuts. - Fix processPCMMixed filling the same-event direction histogram. Pi0EtaToGammaGammaMC: - Add PCM-EMC: true conversion on the PCM side, photon below the pi0/eta on the EMC side, sharing the existing truth logic; new task pi0eta-to-gammagamma-mc-pcmemc. - Cut only the first photon in the generic cut block. The second photon is cut afterwards with its own tag (with matched tracks for EMC). NMHistograms.h: - Move pairname to the third parameter of addNMHistograms. The MC calls passed the name in that position, where it was silently converted to the sparseFullAxes bool, so PCM-Dalitz MC axes were labelled gamma-gamma. Build the occupancy/EP/vertex axes only where they are used.
1 parent 095b31d commit d1fabd8

8 files changed

Lines changed: 1293 additions & 35 deletions

File tree

‎PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ struct Pi0EtaToGammaGamma {
428428
std::vector<double> epBinsForHs(ep_bin_edges.begin(), ep_bin_edges.end());
429429
std::vector<double> vtxBinsForHs(zvtx_bin_edges.begin(), zvtx_bin_edges.end());
430430
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) {
431-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, "ee#gamma");
431+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs);
432432
} else {
433-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, "#gamma#gamma");
433+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs);
434434
}
435435
DefineEMEventCut();
436436
DefinePCMCut();

‎PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h‎

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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...));

‎PWGEM/PhotonMeson/Tasks/CMakeLists.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ o2physics_add_dpl_workflow(pi0eta-to-gammagamma-mc-emcemc
116116
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
117117
COMPONENT_NAME Analysis)
118118

119+
o2physics_add_dpl_workflow(pi0eta-to-gammagamma-mc-pcmemc
120+
SOURCES Pi0EtaToGammaGammaMCPCMEMC.cxx
121+
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
122+
COMPONENT_NAME Analysis)
123+
119124
o2physics_add_dpl_workflow(tag-and-probe
120125
SOURCES TagAndProbe.cxx
121126
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore O2Physics::MLCore
@@ -205,3 +210,7 @@ o2physics_add_dpl_workflow(pair-qc-task
205210
SOURCES pairQcTask.cxx
206211
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
207212
COMPONENT_NAME Analysis)
213+
o2physics_add_dpl_workflow(two-photon-mc-task
214+
SOURCES twoPhotonMcTask.cxx
215+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore
216+
COMPONENT_NAME Analysis)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
//
12+
/// \file Pi0EtaToGammaGammaMCPCMEMC.cxx
13+
/// \brief This code loops over photons and makes pairs for neutral mesons analyses in MC for PCM-EMC.
14+
/// \author M. Hemmer, marvin.hemmer@cern.ch
15+
16+
#include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h"
17+
#include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h"
18+
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
19+
#include "PWGEM/PhotonMeson/Utils/PairUtilities.h"
20+
21+
#include <Framework/AnalysisDataModel.h>
22+
#include <Framework/AnalysisTask.h>
23+
#include <Framework/runDataProcessing.h>
24+
25+
using namespace o2;
26+
using namespace o2::aod;
27+
using namespace o2::framework;
28+
using namespace o2::aod::pwgem::photonmeson::photonpair;
29+
30+
using MyV0Photons = o2::soa::Filtered<o2::soa::Join<o2::aod::V0PhotonsKF, o2::aod::V0KFEMEventIds, o2::aod::V0PhotonsKFPrefilterBitDerived, o2::aod::V0PhotonOmegaMBWeights>>;
31+
using MyMCV0Legs = soa::Join<aod::V0Legs, aod::V0LegMCLabels>;
32+
using MyEMCClusters = soa::Join<aod::MinClusters, aod::EMEMCClusterMCLabels_001, aod::EMCEMEventIds>;
33+
34+
WorkflowSpec defineDataProcessing(ConfigContext const& context)
35+
{
36+
return WorkflowSpec{
37+
adaptAnalysisTask<Pi0EtaToGammaGammaMC<PairType::kPCMEMC, MyV0Photons, MyEMCClusters, MyMCV0Legs, MinMTracks, MinMSTracks>>(context, TaskName{"pi0eta-to-gammagamma-mc-pcmemc"}),
38+
};
39+
}

0 commit comments

Comments
 (0)