Skip to content

Commit 27b531b

Browse files
authored
[PWGEM/PhotonMeson] update PCM tasks (AliceO2Group#10355)
1 parent 452e1eb commit 27b531b

File tree

6 files changed

+274
-306
lines changed

6 files changed

+274
-306
lines changed

PWGEM/Dilepton/Core/PhotonHBT.h

Lines changed: 142 additions & 142 deletions
Large diffs are not rendered by default.

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ struct Pi0EtaToGammaGamma {
131131
Configurable<bool> cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"};
132132
Configurable<bool> cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"};
133133
Configurable<bool> cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"};
134-
Configurable<bool> cfg_require_v0_on_wwire_ib{"cfg_require_v0_on_wwire_ib", false, "flag to select V0s on W wires ITSib"};
135134
Configurable<float> cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"};
136135
Configurable<float> cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"};
137136
Configurable<float> cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"};
@@ -246,8 +245,6 @@ struct Pi0EtaToGammaGamma {
246245
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
247246
if constexpr (pairtype == PairType::kPCMDalitzEE) {
248247
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma");
249-
} else if constexpr (pairtype == PairType::kPCMDalitzMuMu) {
250-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#mu#mu#gamma");
251248
} else {
252249
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma");
253250
}
@@ -361,38 +358,14 @@ struct Pi0EtaToGammaGamma {
361358
fV0PhotonCut.SetChi2PerClusterTPC(0.0, pcmcuts.cfg_max_chi2tpc);
362359
fV0PhotonCut.SetTPCNsigmaElRange(pcmcuts.cfg_min_TPCNsigmaEl, pcmcuts.cfg_max_TPCNsigmaEl);
363360
fV0PhotonCut.SetChi2PerClusterITS(-1e+10, pcmcuts.cfg_max_chi2its);
364-
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
365-
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
366-
367-
if (pcmcuts.cfg_reject_v0_on_itsib) {
368-
fV0PhotonCut.SetNClustersITS(2, 4);
369-
} else {
370-
fV0PhotonCut.SetNClustersITS(0, 7);
371-
}
361+
fV0PhotonCut.SetNClustersITS(0, 7);
372362
fV0PhotonCut.SetMeanClusterSizeITSob(0.0, 16.0);
373363
fV0PhotonCut.SetIsWithinBeamPipe(pcmcuts.cfg_require_v0_with_correct_xz);
374-
375-
if (pcmcuts.cfg_require_v0_with_itstpc) {
376-
fV0PhotonCut.SetRequireITSTPC(true);
377-
fV0PhotonCut.SetMaxPCA(1.0);
378-
fV0PhotonCut.SetRxyRange(4, 40);
379-
}
380-
if (pcmcuts.cfg_require_v0_with_itsonly) {
381-
fV0PhotonCut.SetRequireITSonly(true);
382-
fV0PhotonCut.SetMaxPCA(1.0);
383-
fV0PhotonCut.SetRxyRange(4, 24);
384-
}
385-
if (pcmcuts.cfg_require_v0_with_tpconly) {
386-
fV0PhotonCut.SetRequireTPConly(true);
387-
fV0PhotonCut.SetMaxPCA(3.0);
388-
fV0PhotonCut.SetRxyRange(36, 90);
389-
}
390-
if (pcmcuts.cfg_require_v0_on_wwire_ib) {
391-
fV0PhotonCut.SetMaxPCA(0.3);
392-
fV0PhotonCut.SetOnWwireIB(true);
393-
fV0PhotonCut.SetOnWwireOB(false);
394-
fV0PhotonCut.SetRxyRange(7, 14);
395-
}
364+
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
365+
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
366+
fV0PhotonCut.SetRequireITSTPC(pcmcuts.cfg_require_v0_with_itstpc);
367+
fV0PhotonCut.SetRequireITSonly(pcmcuts.cfg_require_v0_with_itsonly);
368+
fV0PhotonCut.SetRequireTPConly(pcmcuts.cfg_require_v0_with_tpconly);
396369
}
397370

398371
void DefineDileptonCut()
@@ -824,7 +797,7 @@ struct Pi0EtaToGammaGamma {
824797
for (const auto& g2 : photons2_from_event_pool) {
825798
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
826799
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
827-
if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
800+
if constexpr (pairtype == PairType::kPCMDalitzEE) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
828801
v2.SetM(g2.mass());
829802
}
830803
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
@@ -850,7 +823,7 @@ struct Pi0EtaToGammaGamma {
850823
for (const auto& g2 : photons1_from_event_pool) {
851824
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.);
852825
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.);
853-
if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
826+
if constexpr (pairtype == PairType::kPCMDalitzEE) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1]
854827
v1.SetM(g1.mass());
855828
}
856829
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct Pi0EtaToGammaGammaMC {
9191
Configurable<float> cfgCentMax{"cfgCentMax", 999, "max. centrality"};
9292
Configurable<float> maxY_rec{"maxY_rec", 0.9, "maximum rapidity for reconstructed particles"};
9393
Configurable<std::string> fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"};
94+
Configurable<bool> cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"};
9495

9596
EMPhotonEventCut fEMEventCut;
9697
struct : ConfigurableGroup {
@@ -118,7 +119,6 @@ struct Pi0EtaToGammaGammaMC {
118119
Configurable<bool> cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"};
119120
Configurable<bool> cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"};
120121
Configurable<bool> cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"};
121-
Configurable<bool> cfg_require_v0_on_wwire_ib{"cfg_require_v0_on_wwire_ib", false, "flag to select V0s on W wires ITSib"};
122122
Configurable<float> cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"};
123123
Configurable<float> cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"};
124124
Configurable<float> cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"};
@@ -216,8 +216,6 @@ struct Pi0EtaToGammaGammaMC {
216216
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
217217
if constexpr (pairtype == PairType::kPCMDalitzEE) {
218218
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma");
219-
} else if constexpr (pairtype == PairType::kPCMDalitzMuMu) {
220-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#mu#mu#gamma");
221219
} else {
222220
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma");
223221
}
@@ -322,38 +320,14 @@ struct Pi0EtaToGammaGammaMC {
322320
fV0PhotonCut.SetChi2PerClusterTPC(0.0, pcmcuts.cfg_max_chi2tpc);
323321
fV0PhotonCut.SetTPCNsigmaElRange(pcmcuts.cfg_min_TPCNsigmaEl, pcmcuts.cfg_max_TPCNsigmaEl);
324322
fV0PhotonCut.SetChi2PerClusterITS(-1e+10, pcmcuts.cfg_max_chi2its);
325-
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
326-
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
327-
328-
if (pcmcuts.cfg_reject_v0_on_itsib) {
329-
fV0PhotonCut.SetNClustersITS(2, 4);
330-
} else {
331-
fV0PhotonCut.SetNClustersITS(0, 7);
332-
}
323+
fV0PhotonCut.SetNClustersITS(0, 7);
333324
fV0PhotonCut.SetMeanClusterSizeITSob(0.0, 16.0);
334325
fV0PhotonCut.SetIsWithinBeamPipe(pcmcuts.cfg_require_v0_with_correct_xz);
335-
336-
if (pcmcuts.cfg_require_v0_with_itstpc) {
337-
fV0PhotonCut.SetRequireITSTPC(true);
338-
fV0PhotonCut.SetMaxPCA(1.0);
339-
fV0PhotonCut.SetRxyRange(4, 40);
340-
}
341-
if (pcmcuts.cfg_require_v0_with_itsonly) {
342-
fV0PhotonCut.SetRequireITSonly(true);
343-
fV0PhotonCut.SetMaxPCA(1.0);
344-
fV0PhotonCut.SetRxyRange(4, 24);
345-
}
346-
if (pcmcuts.cfg_require_v0_with_tpconly) {
347-
fV0PhotonCut.SetRequireTPConly(true);
348-
fV0PhotonCut.SetMaxPCA(3.0);
349-
fV0PhotonCut.SetRxyRange(36, 90);
350-
}
351-
if (pcmcuts.cfg_require_v0_on_wwire_ib) {
352-
fV0PhotonCut.SetMaxPCA(0.3);
353-
fV0PhotonCut.SetOnWwireIB(true);
354-
fV0PhotonCut.SetOnWwireOB(false);
355-
fV0PhotonCut.SetRxyRange(7, 14);
356-
}
326+
fV0PhotonCut.SetDisableITSonly(pcmcuts.cfg_disable_itsonly_track);
327+
fV0PhotonCut.SetDisableTPConly(pcmcuts.cfg_disable_tpconly_track);
328+
fV0PhotonCut.SetRequireITSTPC(pcmcuts.cfg_require_v0_with_itstpc);
329+
fV0PhotonCut.SetRequireITSonly(pcmcuts.cfg_require_v0_with_itsonly);
330+
fV0PhotonCut.SetRequireTPConly(pcmcuts.cfg_require_v0_with_tpconly);
357331
}
358332

359333
void DefineDileptonCut()
@@ -538,9 +512,15 @@ struct Pi0EtaToGammaGammaMC {
538512

539513
if (pi0id > 0) {
540514
auto pi0mc = mcparticles.iteratorAt(pi0id);
515+
if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) {
516+
continue;
517+
}
541518
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
542519
} else if (etaid > 0) {
543520
auto etamc = mcparticles.iteratorAt(etaid);
521+
if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) {
522+
continue;
523+
}
544524
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
545525
}
546526
} // end of pairing loop
@@ -598,9 +578,15 @@ struct Pi0EtaToGammaGammaMC {
598578
}
599579
if (pi0id > 0) {
600580
auto pi0mc = mcparticles.iteratorAt(pi0id);
581+
if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) {
582+
continue;
583+
}
601584
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
602585
} else if (etaid > 0) {
603586
auto etamc = mcparticles.iteratorAt(etaid);
587+
if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) {
588+
continue;
589+
}
604590
o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, collision.weight());
605591
}
606592
} // end of dielectron loop

PWGEM/PhotonMeson/DataModel/gammaTables.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,31 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float {
245245
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) -> float { return RecoDecay::phi(px, py); });
246246
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz); });
247247
DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, [](float vx, float vy) -> float { return RecoDecay::sqrtSumOfSquares(vx, vy); });
248+
DECLARE_SOA_DYNAMIC_COLUMN(CosPAXY, cosPAXY, [](float px, float py, float vx, float vy, float pvx, float pvy) -> float {
249+
float lx = vx - pvx; // flight length X
250+
float ly = vy - pvy; // flight length Y
251+
float cospaXY = RecoDecay::dotProd(std::array{lx, ly}, std::array{px, py}) / (RecoDecay::sqrtSumOfSquares(lx, ly) * RecoDecay::sqrtSumOfSquares(px, py));
252+
if (cospaXY < -1.) {
253+
return -1.;
254+
} else if (cospaXY > 1.) {
255+
return 1.;
256+
}
257+
return cospaXY;
258+
});
259+
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 {
260+
float lx = vx - pvx; // flight length X
261+
float ly = vy - pvy; // flight length Y
262+
float lz = vz - pvz; // flight length Z
263+
float lt = RecoDecay::sqrtSumOfSquares(lx, ly); // flight length R, i.e. transverse plane.
264+
float pt = RecoDecay::sqrtSumOfSquares(px, py);
265+
float cospaRZ = RecoDecay::dotProd(std::array{lt, lz}, std::array{pt, pz}) / (RecoDecay::sqrtSumOfSquares(lt, lz) * RecoDecay::sqrtSumOfSquares(pt, pz));
266+
if (cospaRZ < -1.) {
267+
return -1.;
268+
} else if (cospaRZ > 1.) {
269+
return 1.;
270+
}
271+
return cospaRZ;
272+
});
248273
} // namespace v0photonkf
249274
DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //!
250275
o2::soa::Index<>, v0photonkf::CollisionId, v0photonkf::V0Id, v0photonkf::PosTrackId, v0photonkf::NegTrackId,
@@ -262,7 +287,9 @@ DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //!
262287
v0photonkf::Eta<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz>,
263288
v0photonkf::Phi<v0photonkf::Px, v0photonkf::Py>,
264289
v0photonkf::P<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz>,
265-
v0photonkf::V0Radius<v0photonkf::Vx, v0photonkf::Vy>);
290+
v0photonkf::V0Radius<v0photonkf::Vx, v0photonkf::Vy>,
291+
v0photonkf::CosPAXY<v0photonkf::Px, v0photonkf::Py, v0photonkf::Vx, v0photonkf::Vy>,
292+
v0photonkf::CosPARZ<v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz, v0photonkf::Vx, v0photonkf::Vy, v0photonkf::Vz>);
266293
// iterators
267294
using V0PhotonKF = V0PhotonsKF::iterator;
268295

0 commit comments

Comments
 (0)