Skip to content

Commit 31ecf2d

Browse files
authored
[PWGJE] Update event selection and leadingConstituentPt, fix Nbin error in fit (#10079)
1 parent 39b855e commit 31ecf2d

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

PWGJE/Tasks/jetChargedV2.cxx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct JetChargedV2 {
8989

9090
Configurable<float> jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"};
9191
Configurable<float> leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"};
92+
Configurable<float> leadingConstituentPtMax{"leadingConstituentPtMax", 9999.0, "maximum pT selection on jet constituent"};
9293
Configurable<float> jetPtMin{"jetPtMin", 0.15, "minimum pT acceptance for jets"};
9394
Configurable<float> jetPtMax{"jetPtMax", 200.0, "maximum pT acceptance for jets"};
9495
Configurable<float> jetEtaMin{"jetEtaMin", -0.9, "minimum eta acceptance for jets"};
@@ -221,6 +222,7 @@ struct JetChargedV2 {
221222
registry.add("h2_Chi2Cent_CombinFit", "Chi2 vs centrality; centrality; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 100}, {100, 0, 5}}});
222223
registry.add("h2_PChi2_CombinFit", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}});
223224

225+
registry.add("Thn_PChi2_CombinFitCent", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTHnSparseF, {{100, 0.0, 100.0}, {100, 0, 1}, {100, 0, 5}}});
224226
registry.add("h2_PChi2_CombinFitA", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}});
225227
registry.add("h2_PChi2_CombinFitB", "p-value vs #tilde{#chi^{2}}; p-value; #tilde{#chi^{2}}", {HistType::kTH2F, {{100, 0, 1}, {100, 0, 5}}});
226228

@@ -321,17 +323,27 @@ struct JetChargedV2 {
321323
return false;
322324
}
323325
}
324-
if (leadingConstituentPtMin > -98.0) {
325-
bool isMinleadingConstituent = false;
326+
bool checkConstituentPt = true;
327+
bool checkConstituentMinPt = (leadingConstituentPtMin > -98.0);
328+
bool checkConstituentMaxPt = (leadingConstituentPtMax < 9998.0);
329+
if (!checkConstituentMinPt && !checkConstituentMaxPt) {
330+
checkConstituentPt = false;
331+
}
332+
if (checkConstituentPt) {
333+
bool isMinLeadingConstituent = !checkConstituentMinPt;
334+
bool isMaxLeadingConstituent = true;
335+
326336
for (const auto& constituent : jet.template tracks_as<T>()) {
327-
if (constituent.pt() >= leadingConstituentPtMin) {
328-
isMinleadingConstituent = true;
329-
break;
337+
double pt = constituent.pt();
338+
339+
if (checkConstituentMinPt && pt >= leadingConstituentPtMin) {
340+
isMinLeadingConstituent = true;
341+
}
342+
if (checkConstituentMaxPt && pt > leadingConstituentPtMax) {
343+
isMaxLeadingConstituent = false;
330344
}
331345
}
332-
if (!isMinleadingConstituent) {
333-
return false;
334-
}
346+
return isMinLeadingConstituent && isMaxLeadingConstituent;
335347
}
336348
return true;
337349
}
@@ -472,6 +484,10 @@ struct JetChargedV2 {
472484
registry.fill(HIST("h_evtnum_NTrk"), evtnum, nTrk);
473485
}
474486

487+
if (nTrk <= 0) {
488+
return;
489+
}
490+
475491
hPtsumSumptFit = new TH1F("h_ptsum_sumpt_fit", "h_ptsum_sumpt fit use", TMath::CeilNint(std::sqrt(nTrk)), 0., o2::constants::math::TwoPI);
476492

477493
if (jets.size() > 0) {
@@ -592,6 +608,7 @@ struct JetChargedV2 {
592608
registry.fill(HIST("h2_PvalueCDFCent_CombinFit"), collision.centrality(), cDF);
593609
registry.fill(HIST("h2_Chi2Cent_CombinFit"), collision.centrality(), chiSqr / (static_cast<float>(nDF)));
594610
registry.fill(HIST("h2_PChi2_CombinFit"), cDF, chiSqr / (static_cast<float>(nDF)));
611+
registry.fill(HIST("Thn_PChi2_CombinFitCent"), collision.centrality(), cDF, chiSqr / (static_cast<float>(nDF)));
595612
double evtcent = collision.centrality();
596613
if (evtcent >= 0 && evtcent <= 5) {
597614
registry.fill(HIST("h2_PChi2_CombinFitA"), cDF, chiSqr / (static_cast<float>(nDF)));
@@ -723,7 +740,7 @@ struct JetChargedV2 {
723740
}
724741
registry.fill(HIST("h3_centrality_deltapT_RandomCornPhi_localrhovsphiwithoutleadingjet"), collision.centrality(), randomConePt - o2::constants::math::PI * randomConeR * randomConeR * rholocal, rcPhiPsi2, 1.0);
725742
}
726-
hPtsumSumptFit->Reset();
743+
delete hPtsumSumptFit;
727744
evtnum += 1;
728745
}
729746
PROCESS_SWITCH(JetChargedV2, processSigmaPt, "Sigma pT and bkg as fcn of phi", true);

0 commit comments

Comments
 (0)