Skip to content

Commit

Permalink
PWGEM/PhotonMeson: update photon table producer (#3756)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat authored Nov 1, 2023
1 parent a477256 commit 77de3ef
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 47 deletions.
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(1.5);
cut->SetMaxPCA(0.5);
cut->SetRxyRange(1, 180);
cut->SetAPRange(0.95, 0.02);
return cut;
Expand Down
13 changes: 8 additions & 5 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,23 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f));
list->Add(new TH2F("hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", 200, -100, 100, 200, 0.0f, 100.0f));
list->Add(new TH2F("hRadius_recalc", "V0Radius; radius in Z (cm);radius in XY (cm)", 200, -100, 100, 200, 0.0f, 100.0f));
list->Add(new TH1F("hCosPA", "V0CosPA;cosine pointing angle", 100, 0.9f, 1.0f));
list->Add(new TH1F("hPCA", "distance between 2 legs; PCA (cm)", 50, 0.0f, 5.0f));
list->Add(new TH1F("hCosPA", "V0CosPA;cosine pointing angle", 100, 0.99f, 1.0f));
list->Add(new TH1F("hPCA", "distance between 2 legs;PCA (cm)", 200, 0.0f, 2.0f));
list->Add(new TH2F("hDCAxyz", "DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)", 200, -5.f, +5.f, 200, -5.f, +5.f));
list->Add(new TH2F("hAPplot", "AP plot;#alpha;q_{T} (GeV/c)", 200, -1.0f, +1.0f, 250, 0.0f, 0.25f));
list->Add(new TH2F("hMassGamma", "hMassGamma;R_{xy} (cm);m_{ee} (GeV/c^{2})", 200, 0.0f, 100.0f, 100, 0.0f, 0.1f));
list->Add(new TH2F("hMassGamma_recalc", "recalc. hMassGamma;R_{xy} (cm);m_{ee} (GeV/c^{2})", 200, 0.0f, 100.0f, 100, 0.0f, 0.1f));
list->Add(new TH2F("hGammaRxy", "conversion point in XY;V_{x} (cm);V_{y} (cm)", 400, -100.0f, 100.0f, 400, -100.0f, 100.0f));
list->Add(new TH2F("hGammaRxy_recalc", "recalc. conversion point in XY;V_{x} (cm);V_{y} (cm)", 400, -100.0f, 100.0f, 400, -100.0f, 100.0f));
list->Add(new TH2F("hKFChi2vsR", "KF chi2 vs. recalc. conversion point in XY;R_{xy} (cm);KF chi2/NDF", 200, 0.0f, 200.0f, 100, 0.f, 100.0f));
list->Add(new TH2F("hKFChi2vsR", "KF chi2 vs. recalc. conversion point in XY;R_{xy} (cm);KF chi2/NDF", 100, 0.0f, 100.0f, 100, 0.f, 100.0f));
list->Add(new TH2F("hKFChi2vsX", "KF chi2 vs. recalc. conversion point in X;X (cm);KF chi2/NDF", 200, -100.0f, 100.0f, 100, 0.f, 100.0f));
list->Add(new TH2F("hKFChi2vsY", "KF chi2 vs. recalc. conversion point in Y;Y (cm);KF chi2/NDF", 200, -100.0f, 100.0f, 100, 0.f, 100.0f));
list->Add(new TH2F("hKFChi2vsZ", "KF chi2 vs. recalc. conversion point in Z;Z (cm);KF chi2/NDF", 200, -100.0f, 100.0f, 100, 0.f, 100.0f));
list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f));
// list->Add(new TH2F("hCorrTgl", "correlation of track tgl between e^{+} and e^{-};e^{-} track tgl;e^{+} track tgl", 300, -1.5f, 1.5f, 300, -1.5f, 1.5f));
// list->Add(new TH2F("hCorrZ", "correlation of track iu z between e^{+} and e^{-};e^{-} track iu Z (cm);e^{+} track iu Z (cm)", 400, -100.f, 100.f, 400, -100.f, 100.f));
list->Add(new TH2F("hDiffPt", "p_{T,#gamma} vs. p_{T,ee};p_{T,#gamma} (GeV/c);p_{T,ee} (GeV/c)", 1000, 0.f, 10.f, 1000, 0.f, 10.f));
list->Add(new TH2F("hDiffEta", "#eta_{#gamma} vs. #eta_{ee};p_{T,#gamma} (GeV/c);#eta_{#gamma} - #eta_{ee}", 1000, 0.f, 10.f, 400, -1.f, +1.f));
list->Add(new TH2F("hDiffPhi", "#varphi_{#gamma} vs. #varphi_{ee};p_{T,#gamma} (GeV/c);#varphi_{#gamma} - #varphi_{ee} (rad.)", 1000, 0.f, 10.f, 400, -1.f, +1.f));
list->Add(new TH2F("hRelDiffPt", "p_{T,#gamma} vs. p_{T,ee};p_{T,#gamma} (GeV/c);(p_{T,ee} - p_{T,#gamma})/p_{T,#gamma}", 1000, 0.f, 10.f, 400, -1.f, 1.f));

if (TString(subGroup) == "mc") {
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency
Expand Down
1 change: 1 addition & 0 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void FillHistClass(THashList* list, const char* subGroup, T const& obj)
reinterpret_cast<TH2F*>(list->FindObject("hRadius_recalc"))->Fill(obj.recalculatedVtxZ(), obj.recalculatedVtxR());
reinterpret_cast<TH1F*>(list->FindObject("hCosPA"))->Fill(obj.cospa());
reinterpret_cast<TH1F*>(list->FindObject("hPCA"))->Fill(obj.pca());
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyz"))->Fill(obj.dcaXYv0topv(), obj.dcaZv0topv());
reinterpret_cast<TH2F*>(list->FindObject("hAPplot"))->Fill(obj.alpha(), obj.qtarm());
reinterpret_cast<TH2F*>(list->FindObject("hMassGamma"))->Fill(obj.v0radius(), obj.mGamma());
reinterpret_cast<TH2F*>(list->FindObject("hMassGamma_recalc"))->Fill(obj.recalculatedVtxR(), obj.mGamma());
Expand Down
7 changes: 6 additions & 1 deletion PWGEM/PhotonMeson/Core/V0PhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@ class V0PhotonCut : public TNamed
auto pos = v0.template posTrack_as<TLeg>();
auto ele = v0.template negTrack_as<TLeg>();

float ptee = std::sqrt(std::pow(pos.px() + ele.px(), 2) + std::pow(pos.py() + ele.py(), 2));
if (abs(ptee - v0.pt()) / v0.pt() > 0.3) {
return false;
}

// if (pos.hasITS() && ele.hasITS()) {
// if (v0.mGammaKFSV() > 0.06 && v0.recalculatedVtxR() < 12.f) {
// if (v0.recalculatedVtxR() > std::min(pos.x(), ele.x()) + 0.2) {
// return false;
// }
// }
Expand Down
14 changes: 8 additions & 6 deletions PWGEM/PhotonMeson/DataModel/gammaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ DECLARE_SOA_COLUMN(Px, px, float); //! px f
DECLARE_SOA_COLUMN(Py, py, float); //! py for photon kf
DECLARE_SOA_COLUMN(Pz, pz, float); //! pz for photon kf
DECLARE_SOA_COLUMN(MGamma, mGamma, float); //! invariant mass of dielectron

DECLARE_SOA_COLUMN(CosPA, cospa, float); //!
DECLARE_SOA_COLUMN(PCA, pca, float); //!
DECLARE_SOA_COLUMN(Alpha, alpha, float); //!
DECLARE_SOA_COLUMN(QtArm, qtarm, float); //!
DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); // Chi2 / NDF of the reconstructed V0
DECLARE_SOA_COLUMN(DCAxyV0ToPV, dcaXYv0topv, float); //! DCAxy of V0 to PV
DECLARE_SOA_COLUMN(DCAzV0ToPV, dcaZv0topv, float); //! DCAz of V0 to PV
DECLARE_SOA_COLUMN(CosPA, cospa, float); //!
DECLARE_SOA_COLUMN(PCA, pca, float); //!
DECLARE_SOA_COLUMN(Alpha, alpha, float); //!
DECLARE_SOA_COLUMN(QtArm, qtarm, float); //!
DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); // Chi2 / NDF of the reconstructed V0

DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](float px, float py, float pz, float m = 0) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz, m); }); //! energy of v0 photn, mass to be given as argument when getter is called!
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); });
Expand All @@ -218,6 +219,7 @@ DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //!
v0photonkf::Vx, v0photonkf::Vy, v0photonkf::Vz,
v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz,
v0photonkf::MGamma,
v0photonkf::DCAxyV0ToPV, v0photonkf::DCAzV0ToPV,
v0photonkf::CosPA, v0photonkf::PCA,
v0photonkf::Alpha, v0photonkf::QtArm,
v0photonkf::ChiSquareNDF,
Expand Down
29 changes: 17 additions & 12 deletions PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ struct PhotonConversionBuilder {
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, TMath::TwoPi()}, {400, -2, +2}}}},
{"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.9f, 1.f}}}},
{"V0/hPCA", "distance between 2 legs at SV;PCA (cm)", {HistType::kTH1F, {{500, 0.0f, 5.f}}}},
{"V0/hDCAxyz", "DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -5.f, +5.f}, {200, -5.f, +5.f}}}},
{"V0/hMee_SVPV", "mee at PV and SV;m_{ee} at PV (GeV/c^{2});m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{100, 0.0f, 0.1f}, {100, 0, 0.1f}}}},
{"V0/hMeeSV_Rxy", "mee at SV vs. R_{xy};R_{xy} (cm);m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{200, 0.0f, 100.f}, {100, 0, 0.1f}}}},
{"V0/hKFChi2", "V0 KF chi2;p_{T,#gamma} (GeV/c);KF #chi^{2}/ndf", {HistType::kTH2F, {{100, 0.0f, 10.f}, {100, 0, 100}}}},
{"V0/hKPtDiff", "V0 KF pt leg sum vs. gamma pt;p_{T,#gamma} (GeV/c);p_{T,ee} (GeV/c)", {HistType::kTH2F, {{1000, 0.0f, 10.f}, {1000, 0, 10}}}},
{"V0/hPtDiff", "V0 KF pt leg sum vs. gamma pt;p_{T,#gamma} (GeV/c);p_{T,ee} (GeV/c)", {HistType::kTH2F, {{1000, 0.0f, 10.f}, {1000, 0, 10}}}},
{"V0Leg/hPt", "pT of leg at SV;p_{T,e} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}},
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, TMath::TwoPi()}, {400, -2, +2}}}},
{"V0Leg/hDCAxyz", "DCA xy vs. z to PV;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -10.f, +10.f}}}},
Expand Down Expand Up @@ -359,15 +359,15 @@ struct PhotonConversionBuilder {
return;
}

float chi2kf = -1.f;
if (gammaKF_DecayVtx.GetNDF() > 0) {
chi2kf = gammaKF_DecayVtx.GetChi2() / gammaKF_DecayVtx.GetNDF();
}

KFParticle kfp_pos_DecayVtx = kfp_pos; // Don't set Primary Vertex
KFParticle kfp_ele_DecayVtx = kfp_ele; // Don't set Primary Vertex
kfp_pos_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex
kfp_ele_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex
float ptee = RecoDecay::sqrtSumOfSquares(kfp_pos_DecayVtx.GetPx() + kfp_ele_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy() + kfp_ele_DecayVtx.GetPy());

if (abs(ptee - v0pt) / v0pt > 0.3) {
return;
}

KFParticle kfp_pos_PV = kfp_pos_DecayVtx;
KFParticle kfp_ele_PV = kfp_ele_DecayVtx;
Expand Down Expand Up @@ -415,11 +415,16 @@ struct PhotonConversionBuilder {
registry.fill(HIST("V0/hEtaPhi"), v0phi, v0eta);
registry.fill(HIST("V0/hCosPA"), cospa_kf);
registry.fill(HIST("V0/hPCA"), pca_kf);
registry.fill(HIST("V0/hKFChi2"), v0pt, chi2kf);
registry.fill(HIST("V0/hPtDiff"), v0pt, ptee);

float v0mom = RecoDecay::sqrtSumOfSquares(gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz());
float sign_tmp = (collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPx() - (collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPz() > 0 ? +1 : -1;

float dca_xy_v0_to_pv = std::sqrt(std::pow((collision.posY() - gammaKF_DecayVtx.GetY()) * gammaKF_DecayVtx.GetPz() - (collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPy(), 2) + std::pow((collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPx() - (collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPz(), 2)) / v0mom * sign_tmp;
float dca_z_v0_to_pv = ((collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPy() - (collision.posY() - gammaKF_DecayVtx.GetY()) * gammaKF_DecayVtx.GetPx()) / v0mom;
registry.fill(HIST("V0/hDCAxyz"), dca_xy_v0_to_pv, dca_z_v0_to_pv);

float v0pt_sv = RecoDecay::sqrtSumOfSquares(gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy());
float eept_sv = RecoDecay::sqrtSumOfSquares(kfp_pos_DecayVtx.GetPx() + kfp_ele_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy() + kfp_ele_DecayVtx.GetPy());
registry.fill(HIST("V0/hKPtDiff"), v0pt_sv, eept_sv);
float chi2kf = gammaKF_DecayVtx.GetChi2() / gammaKF_DecayVtx.GetNDF();

for (auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
float legpt = RecoDecay::sqrtSumOfSquares(leg.GetPx(), leg.GetPy());
Expand Down Expand Up @@ -448,7 +453,7 @@ struct PhotonConversionBuilder {
v0photonskf(collision.globalIndex(), v0legs.lastIndex() + 1, v0legs.lastIndex() + 2,
gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY(), gammaKF_DecayVtx.GetZ(),
gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz(),
v0_sv.M(),
v0_sv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv,
cospa_kf, pca_kf, alpha, qt, chi2kf);

fFuncTableV0Recalculated(xyz[0], xyz[1], xyz[2]);
Expand Down
24 changes: 9 additions & 15 deletions PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,9 @@ struct skimmerGammaConversion {
KFParticle gammaKF_DecayVtx = gammaKF; // with respect to (0,0,0)
gammaKF_DecayVtx.TransportToPoint(xyz);

// Apply a topological constraint of the gamma to the PV. Parameters will be given at the primary vertex.
KFParticle gammaKF_PV = gammaKF_DecayVtx;
gammaKF_PV.SetProductionVertex(KFPV);

KFParticle gammaKF_DecayVtx2 = gammaKF_PV; // with respect to the PV
gammaKF_DecayVtx2.TransportToPoint(xyz);
// LOGF(info, "px = %f (KF at SV1) , %f (KF at PV) , %f (KF at SV2)", gammaKF_DecayVtx.GetPx(), gammaKF_PV.GetPx(), gammaKF_DecayVtx2.GetPx());
// LOGF(info, "py = %f (KF at SV1) , %f (KF at PV) , %f (KF at SV2)", gammaKF_DecayVtx.GetPy(), gammaKF_PV.GetPy(), gammaKF_DecayVtx2.GetPy());
// LOGF(info, "pz = %f (KF at SV1) , %f (KF at PV) , %f (KF at SV2)", gammaKF_DecayVtx.GetPz(), gammaKF_PV.GetPz(), gammaKF_DecayVtx2.GetPz());

// LOGF(info, "cpaFromKF(gammaKF_DecayVtx, KFPV) = %f", cpaFromKF(gammaKF_DecayVtx, KFPV));
// LOGF(info, "cpaFromKF(gammaKF_DecayVtx2, KFPV) = %f", cpaFromKF(gammaKF_DecayVtx2, KFPV));
// LOGF(info, "gammaKF_DecayVtx.GetMass() = %f" , gammaKF_DecayVtx.GetMass());
// LOGF(info, "gammaKF_DecayVtx2.GetMass() = %f", gammaKF_DecayVtx2.GetMass());
//// Apply a topological constraint of the gamma to the PV. Parameters will be given at the primary vertex.
// KFParticle gammaKF_PV = gammaKF_DecayVtx;
// gammaKF_PV.SetProductionVertex(KFPV);

float chi2kf = -1.f;
if (gammaKF_DecayVtx.GetNDF() > 0) {
Expand Down Expand Up @@ -324,10 +313,15 @@ struct skimmerGammaConversion {
float alpha = v0_alpha(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy(), kfp_pos_DecayVtx.GetPz(), kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy(), kfp_ele_DecayVtx.GetPz());
float qt = v0_qt(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy(), kfp_pos_DecayVtx.GetPz(), kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy(), kfp_ele_DecayVtx.GetPz());

float v0mom = RecoDecay::sqrtSumOfSquares(gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz());
float sign_tmp = (collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPx() - (collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPz() > 0 ? +1 : -1;
float dca_xy_v0_to_pv = std::sqrt(std::pow((collision.posY() - gammaKF_DecayVtx.GetY()) * gammaKF_DecayVtx.GetPz() - (collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPy(), 2) + std::pow((collision.posZ() - gammaKF_DecayVtx.GetZ()) * gammaKF_DecayVtx.GetPx() - (collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPz(), 2)) / v0mom * sign_tmp;
float dca_z_v0_to_pv = ((collision.posX() - gammaKF_DecayVtx.GetX()) * gammaKF_DecayVtx.GetPy() - (collision.posY() - gammaKF_DecayVtx.GetY()) * gammaKF_DecayVtx.GetPx()) / v0mom;

v0photonskf(collision.globalIndex(), v0legs.lastIndex() + 1, v0legs.lastIndex() + 2,
gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY(), gammaKF_DecayVtx.GetZ(),
gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz(),
v0_sv.M(),
v0_sv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv,
cospa_kf, pca_kf, alpha, qt, chi2kf);

fillTrackTable(pos, kfp_pos_DecayVtx);
Expand Down
11 changes: 9 additions & 2 deletions PWGEM/PhotonMeson/Tasks/pcmQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,15 @@ struct PCMQC {
if (cut.IsSelected<aod::V0Legs>(v0)) {
o2::aod::emphotonhistograms::FillHistClass<EMHistType::kV0>(list_v0_cut, "", v0);
nv0++;
// reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hCorrTgl"))->Fill(ele.tgl(), pos.tgl());
// reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hCorrZ"))->Fill(ele.z(), pos.z());

float ptee = RecoDecay::sqrtSumOfSquares(pos.px() + ele.px(), pos.py() + ele.py());
float etaee = RecoDecay::eta(std::array{pos.px() + ele.px(), pos.py() + ele.py(), pos.pz() + ele.pz()});
float phiee = RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) > 0.f ? RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) : RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) + TMath::TwoPi();
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffPt"))->Fill(v0.pt(), ptee);
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffEta"))->Fill(v0.pt(), etaee - v0.eta());
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffPhi"))->Fill(v0.pt(), phiee - v0.phi());
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hRelDiffPt"))->Fill(v0.pt(), (ptee - v0.pt()) / v0.pt());

for (auto& leg : {pos, ele}) {
o2::aod::emphotonhistograms::FillHistClass<EMHistType::kV0Leg>(list_v0leg_cut, "", leg);
}
Expand Down
15 changes: 10 additions & 5 deletions PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ struct PCMQCMC {
auto elemc = ele.template emmcparticle_as<aod::EMMCParticles>();

int photonid = FindCommonMotherFrom2Prongs(posmc, elemc, -11, 11, 22, mcparticles);
if (photonid < 0) { // check swap, true electron is reconstructed as positron and vice versa.
photonid = FindCommonMotherFrom2Prongs(posmc, elemc, 11, -11, 22, mcparticles);
}
// if (photonid < 0) { // check swap, true electron is reconstructed as positron and vice versa.
// photonid = FindCommonMotherFrom2Prongs(posmc, elemc, 11, -11, 22, mcparticles);
// }

if (photonid < 0) {
continue;
Expand Down Expand Up @@ -213,8 +213,13 @@ struct PCMQCMC {
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hConvPoint_diffZ_recalc"))->Fill(elemc.vz(), v0.recalculatedVtxZ() - elemc.vz());

nv0++;
// reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hCorrTgl"))->Fill(ele.tgl(), pos.tgl());
// reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hCorrZ"))->Fill(ele.z(), pos.z());
float ptee = RecoDecay::sqrtSumOfSquares(pos.px() + ele.px(), pos.py() + ele.py());
float etaee = RecoDecay::eta(std::array{pos.px() + ele.px(), pos.py() + ele.py(), pos.pz() + ele.pz()});
float phiee = RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) > 0.f ? RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) : RecoDecay::phi(pos.px() + ele.px(), pos.py() + ele.py()) + TMath::TwoPi();
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffPt"))->Fill(v0.pt(), ptee);
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffEta"))->Fill(v0.pt(), etaee - v0.eta());
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hDiffPhi"))->Fill(v0.pt(), phiee - v0.phi());
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hRelDiffPt"))->Fill(v0.pt(), (ptee - v0.pt()) / v0.pt());
for (auto& leg : {pos, ele}) {
o2::aod::emphotonhistograms::FillHistClass<EMHistType::kV0Leg>(list_v0leg_cut, "", leg);
}
Expand Down

0 comments on commit 77de3ef

Please sign in to comment.