Skip to content

Commit

Permalink
PWGEM/PhotonMeson: update PCM tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat committed Mar 6, 2025
1 parent 3cd7dc0 commit a09df5b
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 306 deletions.
284 changes: 142 additions & 142 deletions PWGEM/Dilepton/Core/PhotonHBT.h

Large diffs are not rendered by default.

43 changes: 8 additions & 35 deletions PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ struct Pi0EtaToGammaGamma {
Configurable<bool> cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"};
Configurable<bool> cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"};
Configurable<bool> cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"};
Configurable<bool> cfg_require_v0_on_wwire_ib{"cfg_require_v0_on_wwire_ib", false, "flag to select V0s on W wires ITSib"};
Configurable<float> cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"};
Configurable<float> cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"};
Configurable<float> cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"};
Expand Down Expand Up @@ -246,8 +245,6 @@ struct Pi0EtaToGammaGamma {
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
if constexpr (pairtype == PairType::kPCMDalitzEE) {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma");
} else if constexpr (pairtype == PairType::kPCMDalitzMuMu) {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#mu#mu#gamma");
} else {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma");
}
Expand Down Expand Up @@ -361,38 +358,14 @@ struct Pi0EtaToGammaGamma {
fV0PhotonCut.SetChi2PerClusterTPC(0.0, pcmcuts.cfg_max_chi2tpc);
fV0PhotonCut.SetTPCNsigmaElRange(pcmcuts.cfg_min_TPCNsigmaEl, pcmcuts.cfg_max_TPCNsigmaEl);
fV0PhotonCut.SetChi2PerClusterITS(-1e+10, pcmcuts.cfg_max_chi2its);
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);

if (pcmcuts.cfg_reject_v0_on_itsib) {
fV0PhotonCut.SetNClustersITS(2, 4);
} else {
fV0PhotonCut.SetNClustersITS(0, 7);
}
fV0PhotonCut.SetNClustersITS(0, 7);
fV0PhotonCut.SetMeanClusterSizeITSob(0.0, 16.0);
fV0PhotonCut.SetIsWithinBeamPipe(pcmcuts.cfg_require_v0_with_correct_xz);

if (pcmcuts.cfg_require_v0_with_itstpc) {
fV0PhotonCut.SetRequireITSTPC(true);
fV0PhotonCut.SetMaxPCA(1.0);
fV0PhotonCut.SetRxyRange(4, 40);
}
if (pcmcuts.cfg_require_v0_with_itsonly) {
fV0PhotonCut.SetRequireITSonly(true);
fV0PhotonCut.SetMaxPCA(1.0);
fV0PhotonCut.SetRxyRange(4, 24);
}
if (pcmcuts.cfg_require_v0_with_tpconly) {
fV0PhotonCut.SetRequireTPConly(true);
fV0PhotonCut.SetMaxPCA(3.0);
fV0PhotonCut.SetRxyRange(36, 90);
}
if (pcmcuts.cfg_require_v0_on_wwire_ib) {
fV0PhotonCut.SetMaxPCA(0.3);
fV0PhotonCut.SetOnWwireIB(true);
fV0PhotonCut.SetOnWwireOB(false);
fV0PhotonCut.SetRxyRange(7, 14);
}
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
fV0PhotonCut.SetRequireITSTPC(pcmcuts.cfg_require_v0_with_itstpc);
fV0PhotonCut.SetRequireITSonly(pcmcuts.cfg_require_v0_with_itsonly);
fV0PhotonCut.SetRequireTPConly(pcmcuts.cfg_require_v0_with_tpconly);
}

void DefineDileptonCut()
Expand Down Expand Up @@ -824,7 +797,7 @@ struct Pi0EtaToGammaGamma {
for (const auto& g2 : photons2_from_event_pool) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
if constexpr (pairtype == PairType::kPCMDalitzEE) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
v2.SetM(g2.mass());
}
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
Expand All @@ -850,7 +823,7 @@ struct Pi0EtaToGammaGamma {
for (const auto& g2 : photons1_from_event_pool) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
if constexpr (pairtype == PairType::kPCMDalitzEE) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
v1.SetM(g1.mass());
}
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
Expand Down
52 changes: 19 additions & 33 deletions PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct Pi0EtaToGammaGammaMC {
Configurable<float> cfgCentMax{"cfgCentMax", 999, "max. centrality"};
Configurable<float> maxY_rec{"maxY_rec", 0.9, "maximum rapidity for reconstructed particles"};
Configurable<std::string> fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"};
Configurable<bool> cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"};

EMPhotonEventCut fEMEventCut;
struct : ConfigurableGroup {
Expand Down Expand Up @@ -118,7 +119,6 @@ struct Pi0EtaToGammaGammaMC {
Configurable<bool> cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"};
Configurable<bool> cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"};
Configurable<bool> cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"};
Configurable<bool> cfg_require_v0_on_wwire_ib{"cfg_require_v0_on_wwire_ib", false, "flag to select V0s on W wires ITSib"};
Configurable<float> cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"};
Configurable<float> cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"};
Configurable<float> cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"};
Expand Down Expand Up @@ -216,8 +216,6 @@ struct Pi0EtaToGammaGammaMC {
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
if constexpr (pairtype == PairType::kPCMDalitzEE) {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma");
} else if constexpr (pairtype == PairType::kPCMDalitzMuMu) {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#mu#mu#gamma");
} else {
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma");
}
Expand Down Expand Up @@ -322,38 +320,14 @@ struct Pi0EtaToGammaGammaMC {
fV0PhotonCut.SetChi2PerClusterTPC(0.0, pcmcuts.cfg_max_chi2tpc);
fV0PhotonCut.SetTPCNsigmaElRange(pcmcuts.cfg_min_TPCNsigmaEl, pcmcuts.cfg_max_TPCNsigmaEl);
fV0PhotonCut.SetChi2PerClusterITS(-1e+10, pcmcuts.cfg_max_chi2its);
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);

if (pcmcuts.cfg_reject_v0_on_itsib) {
fV0PhotonCut.SetNClustersITS(2, 4);
} else {
fV0PhotonCut.SetNClustersITS(0, 7);
}
fV0PhotonCut.SetNClustersITS(0, 7);
fV0PhotonCut.SetMeanClusterSizeITSob(0.0, 16.0);
fV0PhotonCut.SetIsWithinBeamPipe(pcmcuts.cfg_require_v0_with_correct_xz);

if (pcmcuts.cfg_require_v0_with_itstpc) {
fV0PhotonCut.SetRequireITSTPC(true);
fV0PhotonCut.SetMaxPCA(1.0);
fV0PhotonCut.SetRxyRange(4, 40);
}
if (pcmcuts.cfg_require_v0_with_itsonly) {
fV0PhotonCut.SetRequireITSonly(true);
fV0PhotonCut.SetMaxPCA(1.0);
fV0PhotonCut.SetRxyRange(4, 24);
}
if (pcmcuts.cfg_require_v0_with_tpconly) {
fV0PhotonCut.SetRequireTPConly(true);
fV0PhotonCut.SetMaxPCA(3.0);
fV0PhotonCut.SetRxyRange(36, 90);
}
if (pcmcuts.cfg_require_v0_on_wwire_ib) {
fV0PhotonCut.SetMaxPCA(0.3);
fV0PhotonCut.SetOnWwireIB(true);
fV0PhotonCut.SetOnWwireOB(false);
fV0PhotonCut.SetRxyRange(7, 14);
}
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
fV0PhotonCut.SetRequireITSTPC(pcmcuts.cfg_require_v0_with_itstpc);
fV0PhotonCut.SetRequireITSonly(pcmcuts.cfg_require_v0_with_itsonly);
fV0PhotonCut.SetRequireTPConly(pcmcuts.cfg_require_v0_with_tpconly);
}

void DefineDileptonCut()
Expand Down Expand Up @@ -538,9 +512,15 @@ struct Pi0EtaToGammaGammaMC {

if (pi0id > 0) {
auto pi0mc = mcparticles.iteratorAt(pi0id);
if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) {
continue;
}
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
} else if (etaid > 0) {
auto etamc = mcparticles.iteratorAt(etaid);
if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) {
continue;
}
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
}
} // end of pairing loop
Expand Down Expand Up @@ -598,9 +578,15 @@ struct Pi0EtaToGammaGammaMC {
}
if (pi0id > 0) {
auto pi0mc = mcparticles.iteratorAt(pi0id);
if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) {
continue;
}
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
} else if (etaid > 0) {
auto etamc = mcparticles.iteratorAt(etaid);
if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) {
continue;
}
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
}
} // end of dielectron loop
Expand Down
29 changes: 28 additions & 1 deletion PWGEM/PhotonMeson/DataModel/gammaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,31 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float {
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) -> float { return RecoDecay::phi(px, py); });
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz); });
DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, [](float vx, float vy) -> float { return RecoDecay::sqrtSumOfSquares(vx, vy); });
DECLARE_SOA_DYNAMIC_COLUMN(CosPAXY, cosPAXY, [](float px, float py, float vx, float vy, float pvx, float pvy) -> float {
float lx = vx - pvx; // flight length X
float ly = vy - pvy; // flight length Y
float cospaXY = RecoDecay::dotProd(std::array{lx, ly}, std::array{px, py}) / (RecoDecay::sqrtSumOfSquares(lx, ly) * RecoDecay::sqrtSumOfSquares(px, py));
if (cospaXY < -1.) {
return -1.;
} else if (cospaXY > 1.) {
return 1.;
}
return cospaXY;
});
DECLARE_SOA_DYNAMIC_COLUMN(CosPARZ, cosPARZ, [](float px, float py, float pz, float vx, float vy, float vz, float pvx, float pvy, float pvz) -> float {
float lx = vx - pvx; // flight length X
float ly = vy - pvy; // flight length Y
float lz = vz - pvz; // flight length Z
float lt = RecoDecay::sqrtSumOfSquares(lx, ly); // flight length R, i.e. transverse plane.
float pt = RecoDecay::sqrtSumOfSquares(px, py);
float cospaRZ = RecoDecay::dotProd(std::array{lt, lz}, std::array{pt, pz}) / (RecoDecay::sqrtSumOfSquares(lt, lz) * RecoDecay::sqrtSumOfSquares(pt, pz));
if (cospaRZ < -1.) {
return -1.;
} else if (cospaRZ > 1.) {
return 1.;
}
return cospaRZ;
});
} // namespace v0photonkf
DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //!
o2::soa::Index<>, v0photonkf::CollisionId, v0photonkf::V0Id, v0photonkf::PosTrackId, v0photonkf::NegTrackId,
Expand All @@ -262,7 +287,9 @@ DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //!
v0photonkf::Eta<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz>,
v0photonkf::Phi<v0photonkf::Px, v0photonkf::Py>,
v0photonkf::P<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz>,
v0photonkf::V0Radius<v0photonkf::Vx, v0photonkf::Vy>);
v0photonkf::V0Radius<v0photonkf::Vx, v0photonkf::Vy>,
v0photonkf::CosPAXY<v0photonkf::Px, v0photonkf::Py, v0photonkf::Vx, v0photonkf::Vy>,
v0photonkf::CosPARZ<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz, v0photonkf::Vx, v0photonkf::Vy, v0photonkf::Vz>);
// iterators
using V0PhotonKF = V0PhotonsKF::iterator;

Expand Down
Loading

0 comments on commit a09df5b

Please sign in to comment.