Skip to content

Commit 93788b4

Browse files
authored
PWGEM/PhotonMeson: move pcm QC histograms to fillhistoclass (#2829)
1 parent df3f211 commit 93788b4

6 files changed

Lines changed: 127 additions & 148 deletions

File tree

PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
4444
list->Add(new TH1F("hCentFT0M", "hCentFT0M;centrality FT0M (%)", 110, 0, 110));
4545
list->Add(new TH2F("hCentFT0MvsMultNTracksPV", "hCentFT0MvsMultNTracksPV;centrality FT0M (%);N_{track} to PV", 110, 0, 110, 1001, -0.5, 1000.5));
4646
}
47-
if (TString(histClass) == "Track") {
47+
if (TString(histClass) == "V0Leg") {
4848
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10));
4949
list->Add(new TH1F("hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", 1000, -50, 50));
5050
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f));
@@ -78,11 +78,27 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
7878
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));
7979
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));
8080
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));
81-
list->Add(new TH2F("hKFChi2vsR_recalc", "KF chi2 vs. recalc. conversion point in XY;R_{xy} (cm);KF chi2/NDF", 250, 0.0f, 250.0f, 100, 0.f, 100.0f));
82-
list->Add(new TH2F("hKFChi2vsZ_recalc", "KF chi2 vs. recalc. conversion point in Z;Z (cm);KF chi2/NDF", 500, -250.0f, 250.0f, 100, 0.f, 100.0f));
81+
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));
82+
list->Add(new TH2F("hKFChi2vsZ", "KF chi2 vs. recalc. conversion point in Z;Z (cm);KF chi2/NDF", 500, -250.0f, 250.0f, 100, 0.f, 100.0f));
8383
list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f));
84-
list->Add(new TH2F("hGammaRPhi", "conversion point of #varphi vs. R_{xy} MC;#varphi (rad.);R_{xy} (cm);N_{e}", 360, 0.0f, TMath::TwoPi(), 200, 0, 200));
85-
list->Add(new TH2F("hGammaRPhi_recalc", "conversion point of #varphi vs. R_{xy} MC;#varphi (rad.);R_{xy} (cm);N_{e}", 360, 0.0f, TMath::TwoPi(), 200, 0, 200));
84+
85+
const int nrxy = 102;
86+
double rxy[nrxy] = {0.f};
87+
for (int i = 0; i < 90; i++) {
88+
rxy[i] = 1.0 * i;
89+
}
90+
for (int i = 90; i < nrxy; i++) {
91+
rxy[i] = 10.0 * (i - 90) + 90.0;
92+
}
93+
94+
const int ndim = 3; // r, phi, eta
95+
const int nbins[ndim] = {nrxy - 1, 72, 40};
96+
const double xmin[ndim] = {0.0, 0.0, -2.0};
97+
const double xmax[ndim] = {200.0, TMath::TwoPi(), +2.0};
98+
99+
THnSparseF* hs_conv_point = new THnSparseF("hs_conv_point", "hs_conv_point;R_{xy} (cm);#varphi (rad.);#eta;", ndim, nbins, xmin, xmax);
100+
hs_conv_point->SetBinEdges(0, rxy);
101+
list->Add(hs_conv_point);
86102

87103
if (TString(subGroup) == "mc") {
88104
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency

PWGEM/PhotonMeson/Core/HistogramsLibrary.h

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define PWGEM_PHOTONMESON_CORE_HISTOGRAMSLIBRARY_H_
1717

1818
#include <iostream>
19+
#include <array>
1920
using namespace std;
2021
#include <TString.h>
2122
#include <THashList.h>
@@ -37,7 +38,7 @@ using namespace std;
3738
enum EMHistType {
3839
kEvent = 0,
3940
kV0 = 1,
40-
kTrack = 2,
41+
kV0Leg = 2,
4142
kPHOSCluster = 3,
4243
kEMCCluster = 4,
4344
kPhoton = 5, // photon candidates
@@ -59,13 +60,53 @@ void FillHistClass(THashList* list, const char* subGroup, T const& obj)
5960
reinterpret_cast<TH2F*>(list->FindObject("hMultFT0"))->Fill(obj.multFT0A(), obj.multFT0C());
6061
reinterpret_cast<TH1F*>(list->FindObject("hCentFT0M"))->Fill(obj.centFT0M());
6162
reinterpret_cast<TH2F*>(list->FindObject("hCentFT0MvsMultNTracksPV"))->Fill(obj.centFT0M(), obj.multNTracksPV());
62-
6363
} else if constexpr (htype == EMHistType::kPhoton) { // ROOT::Math::PtEtaPhiMVector
6464
reinterpret_cast<TH1F*>(list->FindObject("hPt"))->Fill(obj.Pt());
6565
reinterpret_cast<TH1F*>(list->FindObject("hY"))->Fill(obj.Rapidity());
6666
reinterpret_cast<TH1F*>(list->FindObject("hPhi"))->Fill(obj.Phi() < 0.f ? obj.Phi() + TMath::TwoPi() : obj.Phi());
6767
} else if constexpr (htype == EMHistType::kV0) {
6868
reinterpret_cast<TH1F*>(list->FindObject("hPt"))->Fill(obj.pt());
69+
reinterpret_cast<TH2F*>(list->FindObject("hEtaPhi"))->Fill(obj.phi(), obj.eta());
70+
reinterpret_cast<TH2F*>(list->FindObject("hRadius"))->Fill(obj.vz(), obj.v0radius());
71+
reinterpret_cast<TH2F*>(list->FindObject("hRadius_recalc"))->Fill(obj.recalculatedVtxZ(), obj.recalculatedVtxR());
72+
reinterpret_cast<TH1F*>(list->FindObject("hCosPA"))->Fill(abs(obj.cospa()));
73+
reinterpret_cast<TH1F*>(list->FindObject("hPCA"))->Fill(obj.pca());
74+
reinterpret_cast<TH2F*>(list->FindObject("hAPplot"))->Fill(obj.alpha(), obj.qtarm());
75+
reinterpret_cast<TH2F*>(list->FindObject("hMassGamma"))->Fill(obj.v0radius(), obj.mGamma());
76+
reinterpret_cast<TH2F*>(list->FindObject("hMassGamma_recalc"))->Fill(obj.recalculatedVtxR(), obj.mGamma());
77+
reinterpret_cast<TH2F*>(list->FindObject("hGammaPsiPair"))->Fill(obj.psipair(), obj.mGamma());
78+
reinterpret_cast<TH2F*>(list->FindObject("hGammaRxy"))->Fill(obj.vx(), obj.vy());
79+
reinterpret_cast<TH2F*>(list->FindObject("hGammaRxy_recalc"))->Fill(obj.recalculatedVtxX(), obj.recalculatedVtxY());
80+
reinterpret_cast<TH2F*>(list->FindObject("hKFChi2vsR"))->Fill(obj.recalculatedVtxR(), obj.chiSquareNDF());
81+
reinterpret_cast<TH2F*>(list->FindObject("hKFChi2vsZ"))->Fill(obj.recalculatedVtxZ(), obj.chiSquareNDF());
82+
83+
float phi_recalc = atan2(obj.recalculatedVtxY(), obj.recalculatedVtxX());
84+
float r3d = sqrt(pow(obj.recalculatedVtxX(), 2) + pow(obj.recalculatedVtxY(), 2) + pow(obj.recalculatedVtxZ(), 2));
85+
float eta_cp = std::atanh(obj.recalculatedVtxZ() / r3d);
86+
double value_cp[3] = {obj.recalculatedVtxR(), phi_recalc < 0 ? phi_recalc + TMath::TwoPi() : phi_recalc, eta_cp}; // r, phi, eta
87+
reinterpret_cast<THnSparseF*>(list->FindObject("hs_conv_point"))->Fill(value_cp);
88+
} else if constexpr (htype == EMHistType::kV0Leg) {
89+
90+
reinterpret_cast<TH1F*>(list->FindObject("hPt"))->Fill(obj.pt());
91+
reinterpret_cast<TH1F*>(list->FindObject("hQoverPt"))->Fill(obj.sign() / obj.pt());
92+
reinterpret_cast<TH2F*>(list->FindObject("hEtaPhi"))->Fill(obj.phi(), obj.eta());
93+
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyz"))->Fill(obj.dcaXY(), obj.dcaZ());
94+
reinterpret_cast<TH1F*>(list->FindObject("hNclsTPC"))->Fill(obj.tpcNClsFound());
95+
reinterpret_cast<TH1F*>(list->FindObject("hNclsITS"))->Fill(obj.itsNCls());
96+
reinterpret_cast<TH1F*>(list->FindObject("hNcrTPC"))->Fill(obj.tpcNClsCrossedRows());
97+
reinterpret_cast<TH1F*>(list->FindObject("hTPCNcr2Nf"))->Fill(obj.tpcCrossedRowsOverFindableCls());
98+
reinterpret_cast<TH1F*>(list->FindObject("hTPCNcls2Nf"))->Fill(obj.tpcFoundOverFindableCls());
99+
reinterpret_cast<TH1F*>(list->FindObject("hChi2TPC"))->Fill(obj.tpcChi2NCl());
100+
reinterpret_cast<TH1F*>(list->FindObject("hChi2ITS"))->Fill(obj.itsChi2NCl());
101+
reinterpret_cast<TH2F*>(list->FindObject("hTPCdEdx"))->Fill(obj.tpcInnerParam(), obj.tpcSignal());
102+
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaEl"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaEl());
103+
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaPi"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaPi());
104+
reinterpret_cast<TH2F*>(list->FindObject("hXY"))->Fill(obj.x(), obj.y());
105+
reinterpret_cast<TH2F*>(list->FindObject("hZX"))->Fill(obj.z(), obj.x());
106+
reinterpret_cast<TH2F*>(list->FindObject("hZY"))->Fill(obj.z(), obj.y());
107+
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyEta"))->Fill(obj.eta(), obj.dcaXY());
108+
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyZ"))->Fill(obj.z(), obj.dcaXY());
109+
69110
} else if constexpr (htype == EMHistType::kPHOSCluster) {
70111
reinterpret_cast<TH1F*>(list->FindObject("hPt"))->Fill(obj.pt());
71112
reinterpret_cast<TH2F*>(list->FindObject("hEtaPhi"))->Fill(obj.phi(), obj.eta());

PWGEM/PhotonMeson/Core/V0PhotonCut.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ void V0PhotonCut::SetMaxPCA(float max)
6565
mMaxPCA = max;
6666
LOG(info) << "V0 Photon Cut, set max distance between 2 legs: " << mMaxPCA;
6767
}
68+
void V0PhotonCut::SetMaxMarginZ(float max)
69+
{
70+
mMaxMarginZ = max;
71+
LOG(info) << "V0 Photon Cut, set max margin z: " << mMaxMarginZ;
72+
}
6873
void V0PhotonCut::SetOnWwireIB(bool flag)
6974
{
7075
mIsOnWwireIB = flag;

PWGEM/PhotonMeson/Core/V0PhotonCut.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ class V0PhotonCut : public TNamed
206206
return v0.pca() <= mMaxPCA;
207207

208208
case V0PhotonCuts::kRZLine:
209-
// return v0.recalculatedVtxR() > abs(v0.vz()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-mMaxV0Eta))) - 12.0; // as long as z recalculation is not fixed use this
210-
return v0.recalculatedVtxR() > abs(v0.recalculatedVtxZ()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-mMaxV0Eta))) - 12.0; // as long as z recalculation is not fixed use this
209+
return v0.recalculatedVtxR() > abs(v0.recalculatedVtxZ()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-mMaxV0Eta))) - mMaxMarginZ; // as long as z recalculation is not fixed use this
211210

212211
case V0PhotonCuts::kOnWwireIB: {
213212
const float rxy_min = 5.506; // cm
@@ -320,6 +319,7 @@ class V0PhotonCut : public TNamed
320319
void SetRxyRange(float min = 0.f, float max = 180.f);
321320
void SetMinCosPA(float min = 0.95);
322321
void SetMaxPCA(float max = 2.f);
322+
void SetMaxMarginZ(float max = 7.f);
323323
void SetMaxMeePsiPairDep(std::function<float(float)> psiDepCut);
324324
void SetOnWwireIB(bool flag = false);
325325
void SetOnWwireOB(bool flag = false);
@@ -354,6 +354,7 @@ class V0PhotonCut : public TNamed
354354
float mMinRxy{0.f}, mMaxRxy{180.f};
355355
float mMinCosPA{0.95};
356356
float mMaxPCA{2.f};
357+
float mMaxMarginZ{7.f};
357358
std::function<float(float)> mMaxMeePsiPairDep{}; // max mee as a function of psipair
358359
bool mIsOnWwireIB{false};
359360
bool mIsOnWwireOB{false};

PWGEM/PhotonMeson/Tasks/pcmQC.cxx

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct PCMQC {
5858
std::vector<V0PhotonCut> fPCMCuts;
5959

6060
OutputObj<THashList> fOutputEvent{"Event"};
61-
OutputObj<THashList> fOutputTrack{"Track"};
61+
OutputObj<THashList> fOutputV0Leg{"V0Leg"};
6262
OutputObj<THashList> fOutputV0{"V0"};
6363
THashList* fMainList = new THashList();
6464

@@ -73,23 +73,23 @@ struct PCMQC {
7373
THashList* list_ev = reinterpret_cast<THashList*>(fMainList->FindObject("Event"));
7474
o2::aod::emphotonhistograms::DefineHistograms(list_ev, "Event");
7575

76-
o2::aod::emphotonhistograms::AddHistClass(fMainList, "Track");
77-
THashList* list_tr = reinterpret_cast<THashList*>(fMainList->FindObject("Track"));
76+
o2::aod::emphotonhistograms::AddHistClass(fMainList, "V0Leg");
77+
THashList* list_v0leg = reinterpret_cast<THashList*>(fMainList->FindObject("V0Leg"));
7878

7979
o2::aod::emphotonhistograms::AddHistClass(fMainList, "V0");
8080
THashList* list_v0 = reinterpret_cast<THashList*>(fMainList->FindObject("V0"));
8181

8282
for (const auto& cut : fPCMCuts) {
8383
const char* cutname = cut.GetName();
84-
o2::aod::emphotonhistograms::AddHistClass(list_tr, cutname);
84+
o2::aod::emphotonhistograms::AddHistClass(list_v0leg, cutname);
8585
o2::aod::emphotonhistograms::AddHistClass(list_v0, cutname);
8686
}
8787

8888
// for single tracks
8989
for (auto& cut : fPCMCuts) {
9090
std::string_view cutname = cut.GetName();
91-
THashList* list = reinterpret_cast<THashList*>(fMainList->FindObject("Track")->FindObject(cutname.data()));
92-
o2::aod::emphotonhistograms::DefineHistograms(list, "Track");
91+
THashList* list = reinterpret_cast<THashList*>(fMainList->FindObject("V0Leg")->FindObject(cutname.data()));
92+
o2::aod::emphotonhistograms::DefineHistograms(list, "V0Leg");
9393
}
9494

9595
// for V0s
@@ -120,61 +120,16 @@ struct PCMQC {
120120
addhistograms(); // please call this after DefinCuts();
121121

122122
fOutputEvent.setObject(reinterpret_cast<THashList*>(fMainList->FindObject("Event")));
123-
fOutputTrack.setObject(reinterpret_cast<THashList*>(fMainList->FindObject("Track")));
123+
fOutputV0Leg.setObject(reinterpret_cast<THashList*>(fMainList->FindObject("V0Leg")));
124124
fOutputV0.setObject(reinterpret_cast<THashList*>(fMainList->FindObject("V0")));
125125
}
126126

127-
template <typename T>
128-
void fillHistosLeg(const T& leg, const char* cutname)
129-
{
130-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hPt"))->Fill(leg.pt());
131-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hQoverPt"))->Fill(leg.sign() / leg.pt());
132-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hEtaPhi"))->Fill(leg.phi(), leg.eta());
133-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hDCAxyz"))->Fill(leg.dcaXY(), leg.dcaZ());
134-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hNclsTPC"))->Fill(leg.tpcNClsFound());
135-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hNclsITS"))->Fill(leg.itsNCls());
136-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hNcrTPC"))->Fill(leg.tpcNClsCrossedRows());
137-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hTPCNcr2Nf"))->Fill(leg.tpcCrossedRowsOverFindableCls());
138-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hTPCNcls2Nf"))->Fill(leg.tpcFoundOverFindableCls());
139-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hChi2TPC"))->Fill(leg.tpcChi2NCl());
140-
reinterpret_cast<TH1F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hChi2ITS"))->Fill(leg.itsChi2NCl());
141-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hTPCdEdx"))->Fill(leg.tpcInnerParam(), leg.tpcSignal());
142-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hTPCNsigmaEl"))->Fill(leg.tpcInnerParam(), leg.tpcNSigmaEl());
143-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hTPCNsigmaPi"))->Fill(leg.tpcInnerParam(), leg.tpcNSigmaPi());
144-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hXY"))->Fill(leg.x(), leg.y());
145-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hZX"))->Fill(leg.z(), leg.x());
146-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hZY"))->Fill(leg.z(), leg.y());
147-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hDCAxyEta"))->Fill(leg.eta(), leg.dcaXY());
148-
reinterpret_cast<TH2F*>(fMainList->FindObject("Track")->FindObject(cutname)->FindObject("hDCAxyZ"))->Fill(leg.z(), leg.dcaXY());
149-
}
150-
151-
template <typename T>
152-
void fillHistosV0(const T& v0, const char* cutname)
153-
{
154-
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hPt"))->Fill(v0.pt());
155-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hEtaPhi"))->Fill(v0.phi(), v0.eta());
156-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hRadius"))->Fill(v0.vz(), v0.v0radius());
157-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hRadius_recalc"))->Fill(v0.recalculatedVtxZ(), v0.recalculatedVtxR());
158-
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hCosPA"))->Fill(abs(v0.cospa()));
159-
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hPCA"))->Fill(v0.pca());
160-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hAPplot"))->Fill(v0.alpha(), v0.qtarm());
161-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hMassGamma"))->Fill(v0.v0radius(), v0.mGamma());
162-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hMassGamma_recalc"))->Fill(v0.recalculatedVtxR(), v0.mGamma());
163-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hGammaPsiPair"))->Fill(v0.psipair(), v0.mGamma());
164-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hGammaRxy"))->Fill(v0.vx(), v0.vy());
165-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hGammaRxy_recalc"))->Fill(v0.recalculatedVtxX(), v0.recalculatedVtxY());
166-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hKFChi2vsR_recalc"))->Fill(v0.recalculatedVtxR(), v0.chiSquareNDF());
167-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hKFChi2vsZ_recalc"))->Fill(v0.recalculatedVtxZ(), v0.chiSquareNDF());
168-
169-
float phi_recalc = atan2(v0.recalculatedVtxY(), v0.recalculatedVtxX());
170-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hGammaRPhi"))->Fill(v0.phi(), v0.v0radius());
171-
reinterpret_cast<TH2F*>(fMainList->FindObject("V0")->FindObject(cutname)->FindObject("hGammaRPhi_recalc"))->Fill(phi_recalc < 0 ? phi_recalc + TMath::TwoPi() : phi_recalc, v0.recalculatedVtxR());
172-
}
173-
174127
Preslice<MyV0Photons> perCollision = aod::v0photon::collisionId;
175128
void processQC(aod::EMReducedEvents const& collisions, MyV0Photons const& v0photons, aod::V0Legs const& v0legs)
176129
{
177130
THashList* list_ev = static_cast<THashList*>(fMainList->FindObject("Event"));
131+
THashList* list_v0 = static_cast<THashList*>(fMainList->FindObject("V0"));
132+
THashList* list_v0leg = static_cast<THashList*>(fMainList->FindObject("V0Leg"));
178133

179134
for (auto& collision : collisions) {
180135
reinterpret_cast<TH1F*>(fMainList->FindObject("Event")->FindObject("hZvtx_before"))->Fill(collision.posZ());
@@ -198,19 +153,22 @@ struct PCMQC {
198153

199154
auto V0Photons_coll = v0photons.sliceBy(perCollision, collision.collisionId());
200155
for (const auto& cut : fPCMCuts) {
201-
int ng = 0;
202-
for (auto& g : V0Photons_coll) {
203-
auto pos = g.posTrack_as<aod::V0Legs>();
204-
auto ele = g.negTrack_as<aod::V0Legs>();
205-
if (cut.IsSelected<aod::V0Legs>(g)) {
206-
fillHistosV0(g, cut.GetName());
207-
ng++;
156+
THashList* list_v0_cut = static_cast<THashList*>(list_v0->FindObject(cut.GetName()));
157+
THashList* list_v0leg_cut = static_cast<THashList*>(list_v0leg->FindObject(cut.GetName()));
158+
159+
int nv0 = 0;
160+
for (auto& v0 : V0Photons_coll) {
161+
auto pos = v0.posTrack_as<aod::V0Legs>();
162+
auto ele = v0.negTrack_as<aod::V0Legs>();
163+
if (cut.IsSelected<aod::V0Legs>(v0)) {
164+
o2::aod::emphotonhistograms::FillHistClass<EMHistType::kV0>(list_v0_cut, "", v0);
165+
nv0++;
208166
for (auto& leg : {pos, ele}) {
209-
fillHistosLeg(leg, cut.GetName());
167+
o2::aod::emphotonhistograms::FillHistClass<EMHistType::kV0Leg>(list_v0leg_cut, "", leg);
210168
}
211169
}
212170
} // end of v0 loop
213-
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hNgamma"))->Fill(ng);
171+
reinterpret_cast<TH1F*>(fMainList->FindObject("V0")->FindObject(cut.GetName())->FindObject("hNgamma"))->Fill(nv0);
214172
} // end of cut loop
215173
} // end of collision loop
216174
} // end of process

0 commit comments

Comments
 (0)