Skip to content

Commit ddccf35

Browse files
committed
[PWGJE] add full-cone eta acceptance QA for nuclei-in-jets
1 parent 05868d8 commit ddccf35

1 file changed

Lines changed: 69 additions & 6 deletions

File tree

‎PWGJE/Tasks/nucleiInJets.cxx‎

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ struct nucleiInJets {
179179
Configurable<bool> useMcC{"useMcC", true, "use mcC"};
180180
Configurable<bool> usebkgSubractionMC{"usebkgSubractionMC", true, "use rho-area background subtraction for detector-level matched MC jets"};
181181
Configurable<float> cfgjetPtBkgSubMinMC{"cfgjetPtBkgSubMinMC", 10.0f, "minimum detector-level matched MC jet pT after optional background subtraction"};
182+
Configurable<bool> useFullConeAcceptance{"useFullConeAcceptance", true, "require jet/perpendicular-cone axes to satisfy |eta_axis| < cfgtrkMaxEta - cfgjetR for jet and efficiency histograms"};
182183
Configurable<bool> useRapidityCutForPID{"useRapidityCutForPID", false, "true: use rapidity cut for PID, false: no rapidity cut for PID"};
183184
Configurable<bool> isPOCollision{"isPOCollision", false, "true: use pO rapidity shift for inclusive PID/efficiency rapidity cuts; false: symmetric system, no rapidity shift"};
184185
Configurable<double> cfgPORapidityShiftForPID{"cfgPORapidityShiftForPID", 0.0, "pO rapidity shift for inclusive PID/efficiency rapidity cuts: y_{CMS}=y_{lab}-shift. Set sign/value according to beam convention"};
@@ -201,6 +202,15 @@ struct nucleiInJets {
201202
return std::abs(rap) < std::abs(static_cast<double>(cfgtrkMaxRap));
202203
}
203204

205+
bool isConeAxisAccepted(double etaAxis)
206+
{
207+
if (!useFullConeAcceptance) {
208+
return true;
209+
}
210+
const double maxAcceptedConeAxisEta = static_cast<double>(cfgtrkMaxEta) - static_cast<double>(cfgjetR);
211+
return maxAcceptedConeAxisEta > 0. && std::abs(etaAxis) < maxAcceptedConeAxisEta;
212+
}
213+
204214
Configurable<bool> addpik{"addpik", true, "add pion and kaon hist"};
205215
ConfigurableAxis binsDCA{"binsDCA", {400, -1.f, 1.f}, ""};
206216
ConfigurableAxis binsdEdx{"binsdEdx", {1000, 0.f, 1000.f}, ""};
@@ -322,6 +332,10 @@ struct nucleiInJets {
322332
jetHist.add("jet/h1JetEta", "jet_{#eta}", kTH1F, {{100, -1.0, 1.0}});
323333
jetHist.add("jet/h1JetPhi", "jet_{#phi}", kTH1F, {{80, -1.0, 7.}});
324334
jetHist.add("jet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}});
335+
jetHist.add<TH2>("jet/qa/h2JetConeEtaPhiBeforeAcceptance", "jet-cone axis before full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
336+
jetHist.add<TH2>("jet/qa/h2JetConeEtaPhiAfterAcceptance", "jet-cone axis after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
337+
jetHist.add<TH2>("jet/qa/h2PerpConeEtaPhiAfterAcceptance", "perpendicular-cone axes after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
338+
jetHist.add("jet/qa/nAcceptedJetsPerEvent", "number of full-cone-accepted jets per event;N_{jets};Entries", kTH1F, {{15, .0, 15.}});
325339
jetHist.add("jetBkgSub/h1LeadingJetPtBkgSub", "leading jet background-subtracted #it{p}_{T}; #it{p}_{T}^{jet,bkg sub} (GeV/#it{c}); Entries", kTH1F, {PtJetBkgSubAxis});
326340
jetHist.add("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ", "leading jet background-subtracted #it{p}_{T} vs V_{z}; #it{p}_{T}^{jet,bkg sub} (GeV/#it{c}); V_{z} (cm)", kTH2F, {PtJetBkgSubAxis, vzAxis});
327341
jetHist.add("mcpJet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}});
@@ -756,6 +770,9 @@ struct nucleiInJets {
756770
jetHist.add<TH2>("recmatched/h2ResponseMatrix", "matched jet pT;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}});
757771
jetHist.add<TH2>("recmatched/h2ResponseMatrixLeadingJet", "matched jet rec pT vs true pt;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}});
758772
jetHist.add<TH2>("recmatched/mcC/h2ResponseMatrixLeadingJet", "matched jet rec pT vs true pt;#it{p}_{T} (mes.); #it{p}_{T} (true)", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}});
773+
jetHist.add<TH2>("recmatched/qa/h2JetConeEtaPhiBeforeAcceptance", "matched jet-cone axis before full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
774+
jetHist.add<TH2>("recmatched/qa/h2JetConeEtaPhiAfterAcceptance", "matched jet-cone axis after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
775+
jetHist.add<TH2>("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance", "matched perpendicular-cone axes after full-cone acceptance;#eta_{axis};#varphi_{axis}", HistType::kTH2F, {{EtaAxis}, {70, 0.f, 7.f}});
759776

760777
/////////
761778
jetHist.add<TH1>("recmatched/hRecJetPt", "matched jet pT (Rec level);#it{p}_{T,jet part} (GeV/#it{c}); #it{p}_{T,jet part} - #it{p}_{T,jet det}", HistType::kTH1F, {{100, 0., 100.}});
@@ -923,6 +940,9 @@ struct nucleiInJets {
923940
float jetPt = -999.;
924941

925942
if (isWithLeadingJet) {
943+
if (!isConeAxisAccepted(leadingJetPtEtaPhi[1])) {
944+
return;
945+
}
926946
double delPhi = TVector2::Phi_mpi_pi(leadingJetPtEtaPhi[2] - trk.phi());
927947
double delEta = leadingJetPtEtaPhi[1] - trk.eta();
928948
double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi);
@@ -939,6 +959,9 @@ struct nucleiInJets {
939959
jetFlagPerpCone = true;
940960
} else {
941961
for (auto const& jet : jets) {
962+
if (!isConeAxisAccepted(jet.eta())) {
963+
continue;
964+
}
942965
double delPhi = TVector2::Phi_mpi_pi(jet.phi() - trk.phi());
943966
double delEta = jet.eta() - trk.eta();
944967
double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi);
@@ -1729,6 +1752,7 @@ struct nucleiInJets {
17291752
return;
17301753
jetHist.fill(HIST("hNEvents"), 6.5);
17311754
int nJets = 0;
1755+
int nAcceptedJets = 0;
17321756
std::vector<float> leadingJetWithPtEtaPhi(3);
17331757
float leadingJetPt = -1.0f;
17341758
float leadingJetPtBkgSub = -999.0f;
@@ -1741,6 +1765,7 @@ struct nucleiInJets {
17411765
jetHist.fill(HIST("jet/h1JetPt"), chargedjet.pt());
17421766
jetHist.fill(HIST("jet/h1JetEta"), chargedjet.eta());
17431767
jetHist.fill(HIST("jet/h1JetPhi"), chargedjet.phi());
1768+
jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiBeforeAcceptance"), chargedjet.eta(), chargedjet.phi());
17441769

17451770
// Calculate background subtracted jet pt
17461771
float jetArea = M_PI * cfgjetR * cfgjetR; // Assuming circular jet area
@@ -1750,7 +1775,15 @@ struct nucleiInJets {
17501775
jetHist.fill(HIST("jet/h1JetPtBkgSub"), jetPtBkgSub);
17511776
jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho);
17521777

1753-
if (chargedjet.pt() > leadingJetPt) {
1778+
if (isConeAxisAccepted(chargedjet.eta())) {
1779+
const auto perpConePhiJet = getPerpendicuarPhi(chargedjet.phi());
1780+
jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiAfterAcceptance"), chargedjet.eta(), chargedjet.phi());
1781+
jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[0]);
1782+
jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[1]);
1783+
nAcceptedJets++;
1784+
}
1785+
1786+
if (isConeAxisAccepted(chargedjet.eta()) && chargedjet.pt() > leadingJetPt) {
17541787
leadingJetPt = chargedjet.pt();
17551788
leadingJetPtBkgSub = jetPtBkgSub;
17561789
leadingJetWithPtEtaPhi[0] = chargedjet.pt();
@@ -1760,21 +1793,26 @@ struct nucleiInJets {
17601793
nJets++;
17611794
}
17621795
jetHist.fill(HIST("jet/nJetsPerEvent"), nJets);
1796+
jetHist.fill(HIST("jet/qa/nAcceptedJetsPerEvent"), nAcceptedJets);
17631797
jetHist.fill(HIST("vertexZ"), collision.posZ());
17641798
if (nJets > 0) {
17651799
jetHist.fill(HIST("jet/vertexZ"), collision.posZ());
17661800
jetHist.fill(HIST("hNEvents"), 7.5);
1767-
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1768-
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
17691801
} else {
17701802
jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ());
17711803
}
1804+
if (nAcceptedJets > 0) {
1805+
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1806+
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
1807+
}
17721808
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
17731809
jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ());
17741810
jetHist.fill(HIST("hNEvents"), 8.5);
17751811
}
17761812
if (isWithJetEvents && nJets == 0)
17771813
return;
1814+
if (isWithJetEvents && nAcceptedJets == 0)
1815+
return;
17781816
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
17791817
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
17801818
jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5);
@@ -1815,6 +1853,7 @@ struct nucleiInJets {
18151853
return;
18161854
jetHist.fill(HIST("hNEvents"), 6.5);
18171855
int nJets = 0;
1856+
int nAcceptedJets = 0;
18181857
std::vector<float> leadingJetWithPtEtaPhi(3);
18191858
float leadingJetPt = -1.0f;
18201859
float leadingJetPtBkgSub = -999.0f;
@@ -1827,6 +1866,7 @@ struct nucleiInJets {
18271866
jetHist.fill(HIST("jet/h1JetPt"), chargedjet.pt());
18281867
jetHist.fill(HIST("jet/h1JetEta"), chargedjet.eta());
18291868
jetHist.fill(HIST("jet/h1JetPhi"), chargedjet.phi());
1869+
jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiBeforeAcceptance"), chargedjet.eta(), chargedjet.phi());
18301870

18311871
// Calculate background subtracted jet pt
18321872
float jetArea = M_PI * cfgjetR * cfgjetR; // Assuming circular jet area
@@ -1836,7 +1876,15 @@ struct nucleiInJets {
18361876
jetHist.fill(HIST("jet/h1JetPtBkgSub"), jetPtBkgSub);
18371877
jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho);
18381878

1839-
if (chargedjet.pt() > leadingJetPt) {
1879+
if (isConeAxisAccepted(chargedjet.eta())) {
1880+
const auto perpConePhiJet = getPerpendicuarPhi(chargedjet.phi());
1881+
jetHist.fill(HIST("jet/qa/h2JetConeEtaPhiAfterAcceptance"), chargedjet.eta(), chargedjet.phi());
1882+
jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[0]);
1883+
jetHist.fill(HIST("jet/qa/h2PerpConeEtaPhiAfterAcceptance"), chargedjet.eta(), perpConePhiJet[1]);
1884+
nAcceptedJets++;
1885+
}
1886+
1887+
if (isConeAxisAccepted(chargedjet.eta()) && chargedjet.pt() > leadingJetPt) {
18401888
leadingJetPt = chargedjet.pt();
18411889
leadingJetPtBkgSub = jetPtBkgSub;
18421890
leadingJetWithPtEtaPhi[0] = chargedjet.pt();
@@ -1846,21 +1894,26 @@ struct nucleiInJets {
18461894
nJets++;
18471895
}
18481896
jetHist.fill(HIST("jet/nJetsPerEvent"), nJets);
1897+
jetHist.fill(HIST("jet/qa/nAcceptedJetsPerEvent"), nAcceptedJets);
18491898
jetHist.fill(HIST("vertexZ"), collision.posZ());
18501899
if (nJets > 0) {
18511900
jetHist.fill(HIST("jet/vertexZ"), collision.posZ());
18521901
jetHist.fill(HIST("hNEvents"), 7.5);
1853-
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1854-
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
18551902
} else {
18561903
jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ());
18571904
}
1905+
if (nAcceptedJets > 0) {
1906+
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1907+
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
1908+
}
18581909
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
18591910
jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ());
18601911
jetHist.fill(HIST("hNEvents"), 8.5);
18611912
}
18621913
if (isWithJetEvents && nJets == 0)
18631914
return;
1915+
if (isWithJetEvents && nAcceptedJets == 0)
1916+
return;
18641917
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
18651918
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
18661919
jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5);
@@ -2341,6 +2394,16 @@ struct nucleiInJets {
23412394
if (mcdJetPtForResponse < cfgjetPtBkgSubMinMC) {
23422395
continue;
23432396
}
2397+
const double jetAxisEtaForEff = isWithLeadingJet ? (useLeadingJetDetLevelValue ? mcdjet.eta() : mcpjet.eta()) : mcdjet.eta();
2398+
const double jetAxisPhiForEff = isWithLeadingJet ? (useLeadingJetDetLevelValue ? mcdjet.phi() : mcpjet.phi()) : mcdjet.phi();
2399+
jetHist.fill(HIST("recmatched/qa/h2JetConeEtaPhiBeforeAcceptance"), jetAxisEtaForEff, jetAxisPhiForEff);
2400+
if (!isConeAxisAccepted(jetAxisEtaForEff)) {
2401+
continue;
2402+
}
2403+
const auto perpConePhiJet = getPerpendicuarPhi(static_cast<float>(jetAxisPhiForEff));
2404+
jetHist.fill(HIST("recmatched/qa/h2JetConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, jetAxisPhiForEff);
2405+
jetHist.fill(HIST("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, perpConePhiJet[0]);
2406+
jetHist.fill(HIST("recmatched/qa/h2PerpConeEtaPhiAfterAcceptance"), jetAxisEtaForEff, perpConePhiJet[1]);
23442407
mcdJetPt.push_back(mcdJetPtForResponse);
23452408
mcdJetPhi.push_back(mcdjet.phi());
23462409
mcdJetEta.push_back(mcdjet.eta());

0 commit comments

Comments
 (0)