Skip to content

Commit

Permalink
PWGEM/PhotonMeson: fix for e pt resolution (AliceO2Group#4050)
Browse files Browse the repository at this point in the history
* PWGEM/PhotonMeson: add histograms for muon

* PWGEM/PhotonMeson: fix for e pt resolution
  • Loading branch information
dsekihat authored Dec 4, 2023
1 parent 76d5a68 commit 4257a09
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 46 deletions.
22 changes: 11 additions & 11 deletions PWGEM/PhotonMeson/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetTPCNsigmaElRange(-3, +3);
cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.995);
cut->SetMaxPCA(0.5);
Expand All @@ -45,7 +45,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetTPCNsigmaElRange(-3, +3);
cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -63,7 +63,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetIsWithinBeamPipe(true);
cut->SetRequireITSTPC(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -78,7 +78,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetIsWithinBeamPipe(true);
cut->SetRequireITSonly(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -97,7 +97,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetIsWithinBeamPipe(true);
cut->SetRequireTPConly(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(1.5);
Expand All @@ -115,7 +115,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetNClustersITS(2, 4);
// cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -135,7 +135,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetNClustersITS(2, 4);
// cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -155,7 +155,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetNClustersITS(0, 2);
// cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(0.5);
Expand All @@ -173,7 +173,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetChi2PerClusterTPC(0.0, 4.0);
cut->SetIsWithinBeamPipe(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(1.5);
Expand All @@ -190,7 +190,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetTPCNsigmaElRange(-3, +3);
cut->SetIsWithinBeamPipe(false);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.99);
cut->SetMaxPCA(1.5);
Expand All @@ -208,7 +208,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName)
cut->SetIsWithinBeamPipe(true);
cut->SetRequireITSTPC(true);
// for v0
cut->SetV0PtRange(0.05f, 1e10f);
cut->SetV0PtRange(0.1f, 1e10f);
cut->SetV0EtaRange(-0.9, +0.9);
cut->SetMinCosPA(0.995);
cut->SetMaxPCA(0.5);
Expand Down
60 changes: 33 additions & 27 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH2F("hDCAxyZ", "DCAxy vs. Z;Z (cm);DCA_{xy} (cm)", 200, -100, +100, 100, -50, 50));
list->Add(new TH2F("hXZ_tgl", "correlation of tgl vs. z/x;tgl;z/x", 300, -1.5, 1.5, 300, -1.5, 1.5));
if (TString(subGroup) == "mc") {
list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 400, -1.0f, 1.0f));
}
}
if (TString(histClass) == "V0") {
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
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));
Expand All @@ -93,30 +93,31 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f));

if (TString(subGroup) == "mc") {
list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for denominator of purity
list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for denominator of purity
list->Add(new TH2F("hEtaPhi_Photon_Candidate", "#eta vs. #varphi of photon candidate ;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for denominator of purity

list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH2F("hEtaPhi_Photon_Primary", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC feed down correction
list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC feed down correction

list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC feed down correction
list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC feed down correction

list->Add(new TH2F("hRZ_Photon_hs", "R vs. Z of photon from hadronic shower in materials;Z (cm);R_{xy} (cm)", 200, -100.0f, +100, 100, 0, 100));
list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hEta_Photon_hs", "rapidity of photon from hadronic shower in materials;y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_Photon_hs", "#varphi of photon from hadronic shower in materials;#varphi (rad.);", 180, 0, TMath::TwoPi()));

list->Add(new TH2F("hConvPoint_diffX", "conversion point diff X MC;X_{MC} (cm);X_{rec} - X_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffY", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec} - Y_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffZ", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec} - Z_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffX", "conversion point diff X MC;X_{MC} (cm);X_{rec} - X_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffY", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec} - Y_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffZ", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec} - Z_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));

list->Add(new TH2F("hConvPoint_diffX_recalc", "conversion point diff X MC;X_{MC} (cm);X_{rec}^{recalc} - X_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffY_recalc", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec}^{recalc} - Y_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffZ_recalc", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec}^{recalc} - Z_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffX_recalc", "conversion point diff X MC;X_{MC} (cm);X_{rec}^{recalc} - X_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffY_recalc", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec}^{recalc} - Y_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));
list->Add(new TH2F("hConvPoint_diffZ_recalc", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec}^{recalc} - Z_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f));

list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "photon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "photon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPhi", "photon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 1000, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "photon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "photon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPhi", "photon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 400, -1.0f, 1.0f));
} // end of mc
} // end of V0

Expand Down Expand Up @@ -239,6 +240,11 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH1F("hNclsITS", "number of ITS clusters", 8, -0.5, 7.5));
list->Add(new TH1F("hChi2ITS", "chi2/number of ITS clusters", 100, 0, 10));
list->Add(new TH1F("hITSClusterMap", "ITS cluster map", 128, -0.5, 127.5));
if (TString(subGroup).Contains("mc")) {
list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, maxP, 400, -1.0f, 1.0f));
}
}

if (TString(histClass) == "Cluster") {
Expand All @@ -260,17 +266,17 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
}

if (TString(histClass) == "singlephoton") {
list->Add(new TH1F("hPt", "pT of photon candidates;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hPt", "pT of photon candidates;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY", "rapidity of photon candidates;y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi", "azimuthal angle of photon candidates;#varphi (rad.)", 180, 0, TMath::TwoPi()));
if (TString(subGroup) == "mc") {
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH1F("hY_Photon_Primary", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPhi_Photon_Primary", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for MC efficiency
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency
list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for MC efficiency
list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for Feed down correction
list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for Feed down correction
list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for Feed down correction
list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY_Photon_hs", "rapidity from hadronic shower in materials;y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_Photon_hs", "#varphi from hadronic shower in materials;#varphi (rad.);", 180, 0, TMath::TwoPi()));
}
Expand Down Expand Up @@ -387,25 +393,25 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
}

if (TString(subGroup) == "Photon") {
list->Add(new TH1F("hPt_Photon", "photon pT;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hPt_Photon", "photon pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY_Photon", "photon y;rapidity y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_Photon", "photon #varphi;#varphi (rad.)", 180, 0, TMath::TwoPi()));
}

if (TString(subGroup) == "Pi0Eta") {
static constexpr std::string_view parnames[2] = {"Pi0", "Eta"};
for (int i = 0; i < 2; i++) {
list->Add(new TH1F(Form("hPt_%s", parnames[i].data()), Form("%s pT;p_{T} (GeV/c)", parnames[i].data()), 1000, 0.0f, 10));
list->Add(new TH1F(Form("hPt_%s", parnames[i].data()), Form("%s pT;p_{T} (GeV/c)", parnames[i].data()), 2000, 0.0f, 20));
list->Add(new TH1F(Form("hY_%s", parnames[i].data()), Form("%s y;rapidity y", parnames[i].data()), 40, -2.0f, 2.0f));
list->Add(new TH1F(Form("hPhi_%s", parnames[i].data()), Form("%s #varphi;#varphi (rad.)", parnames[i].data()), 180, 0, TMath::TwoPi()));
}
}
if (TString(subGroup) == "dielectron") {
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 110, 0, 1.1f, 100, 0, 10.f);
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 110, 0, 1.1f, 1000, 0, 10.f);
hMvsPt->Sumw2();
list->Add(hMvsPt);
} else if (TString(subGroup) == "dimuon") {
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{#mu#mu} vs. p_{T,#mu#mu};m_{#mu#mu} (GeV/c^{2});p_{T,#mu#mu} (GeV/c)", 90, 0.2, 1.1f, 20, 0, 2.f);
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{#mu#mu} vs. p_{T,#mu#mu};m_{#mu#mu} (GeV/c^{2});p_{T,#mu#mu} (GeV/c)", 90, 0.2, 1.1f, 200, 0, 2.f);
hMvsPt->Sumw2();
list->Add(hMvsPt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct PhotonConversionBuilder {
float xyz[3] = {0.f, 0.f, 0.f};
Vtx_recalculation(o2::base::Propagator::Instance(), pos, ele, xyz, matCorr);
float rxy_tmp = RecoDecay::sqrtSumOfSquares(xyz[0], xyz[1]);
if (rxy_tmp > std::min(pos.x(), ele.x()) + margin_r * 2.f) {
if (rxy_tmp > std::min(pos.x(), ele.x()) + margin_r) {
return;
}

Expand Down
Loading

0 comments on commit 4257a09

Please sign in to comment.