Skip to content

Commit 05868d8

Browse files
committed
Add leading jet pT bkg-sub event counters for spectra normalization
1 parent 20b21e7 commit 05868d8

1 file changed

Lines changed: 110 additions & 12 deletions

File tree

‎PWGJE/Tasks/nucleiInJets.cxx‎

Lines changed: 110 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ struct nucleiInJets {
114114
}
115115
}
116116

117+
template <typename T>
118+
int getParticleOriginType(const T& mcParticle)
119+
{
120+
if (mcParticle.isPhysicalPrimary()) {
121+
return 1; // physical primary
122+
}
123+
if (mcParticle.getProcess() == TMCProcess::kPDecay) {
124+
return 3; // weak-decay feed-down
125+
}
126+
return 2; // other secondary / material / transport
127+
}
128+
117129
Configurable<std::string> cfgtrackSelections{"cfgtrackSelections", "globalTracks", "set track selections"};
118130
Configurable<bool> isMC{"isMC", false, "flag for the MC"};
119131
Configurable<bool> isWithJetEvents{"isWithJetEvents", true, "Events with at least one jet"};
@@ -138,6 +150,7 @@ struct nucleiInJets {
138150
Configurable<double> cfgnITSChi2{"cfgnITShi2", 36.0, "nITS Chi2 per Cluster"};
139151

140152
Configurable<float> cfgjetPtMin{"cfgjetPtMin", 5.0, "minimum jet pT cut"};
153+
Configurable<float> cfgjetPtBkgSubMin{"cfgjetPtBkgSubMin", 10.0f, "minimum background-subtracted jet pT cut for data jet-event normalization"};
141154
Configurable<float> cfgjetR{"cfgjetR", 0.4, "jet resolution parameter"};
142155
Configurable<int> cDebugLevel{"cDebugLevel", 0, "print debug msg"};
143156
Configurable<int> cMaxPt{"cMaxPt", 10, "max pt for Hist"};
@@ -252,6 +265,7 @@ struct nucleiInJets {
252265
jetHist.print();
253266
// const AxisSpec PtAxis = {100, 0, 10.0};
254267
const AxisSpec PtJetAxis = {100, 0, 100.0};
268+
const AxisSpec PtJetBkgSubAxis = {240, -20.f, 100.f, "#it{p}_{T}^{jet,bkg sub} (GeV/#it{c})"};
255269
const AxisSpec MultAxis = {100, 0, 100};
256270
const AxisSpec dRAxis = {100, 0, 3.6};
257271
const AxisSpec CentAxis = {100, 0, 100};
@@ -260,6 +274,7 @@ struct nucleiInJets {
260274
const AxisSpec dedxAxis{binsdEdx, "d#it{E}/d#it{x} A.U."};
261275
const AxisSpec vzAxis{300, -15.f, 15.f, "Vz (cm)"};
262276
const AxisSpec EtaAxis{40, -1.f, 1.f, "#eta"};
277+
const AxisSpec ParticleOriginAxis{3, 0.5, 3.5, "origin: 1 primary, 2 secondary/material, 3 weak decay"};
263278

264279
const AxisSpec betaAxis{binsBeta, "TOF #beta"};
265280
const AxisSpec ptZHeAxis{binsPtZHe, "#it{p}_{T}"};
@@ -270,7 +285,7 @@ struct nucleiInJets {
270285
const AxisSpec massHeAxis{binsMassHe, ""};
271286
const AxisSpec PtAxis{ptAxisConf, ""};
272287

273-
jetHist.add("hNEvents", "hNEvents", {HistType::kTH1D, {{8, 0.f, 8.f}}});
288+
jetHist.add("hNEvents", "hNEvents", {HistType::kTH1D, {{9, 0.f, 9.f}}});
274289
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "All");
275290
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "Skimmed");
276291
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(3, "|Vz|<10");
@@ -279,6 +294,7 @@ struct nucleiInJets {
279294
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "isGoodZvtxFT0vsPV");
280295
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(7, "OccupancySel");
281296
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(8, "nJets>0");
297+
jetHist.get<TH1>(HIST("hNEvents"))->GetXaxis()->SetBinLabel(9, "leading jet bkg-sub pT cut");
282298

283299
jetHist.add("hNEventsInc", "hNEventsInc", {HistType::kTH1D, {{6, 0.f, 6.f}}});
284300
jetHist.get<TH1>(HIST("hNEventsInc"))->GetXaxis()->SetBinLabel(1, "All");
@@ -302,12 +318,16 @@ struct nucleiInJets {
302318
jetHist.add("jet/h2JetPtVsBkgRho", "jet_{p_{T}} vs background #rho; jet_{p_{T}} (GeV/c); #rho (GeV/c/area)", kTH2F, {PtJetAxis, {100, 0, 20}});
303319
jetHist.add("jet/h1BkgRho", "Background #rho; #rho (GeV/c/area); Entries", kTH1F, {{100, 0, 20}});
304320
jetHist.add("jet/h1JetEvents", "NumbeOfJetEvents", kTH1F, {{1, 0, 1}});
321+
jetHist.add("jetBkgSub/h1JetEvents", "Number of jet events with leading p_{T}^{jet,bkg sub} above cfgjetPtBkgSubMin", kTH1F, {{1, 0, 1}});
305322
jetHist.add("jet/h1JetEta", "jet_{#eta}", kTH1F, {{100, -1.0, 1.0}});
306323
jetHist.add("jet/h1JetPhi", "jet_{#phi}", kTH1F, {{80, -1.0, 7.}});
307324
jetHist.add("jet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}});
325+
jetHist.add("jetBkgSub/h1LeadingJetPtBkgSub", "leading jet background-subtracted #it{p}_{T}; #it{p}_{T}^{jet,bkg sub} (GeV/#it{c}); Entries", kTH1F, {PtJetBkgSubAxis});
326+
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});
308327
jetHist.add("mcpJet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}});
309328
jetHist.add("mcdJet/nJetsPerEvent", "nJetsPerEvent", kTH1F, {{15, .0, 15.}});
310329
jetHist.add("jet/vertexZ", "vertexZ (Jet flag)", kTH1F, {{vzAxis}});
330+
jetHist.add("jetBkgSub/vertexZ", "vertexZ for events with p_{T}^{jet,bkg sub} above cfgjetPtBkgSubMin; V_{z} (cm); Entries", kTH1F, {{vzAxis}});
311331
jetHist.add("vertexZ", "vertexZ (all)", kTH1F, {{vzAxis}});
312332
jetHist.add("jetOut/vertexZ", "vertexZ (without z-flag)", kTH1F, {{vzAxis}});
313333
////////////////////////////
@@ -776,6 +796,17 @@ struct nucleiInJets {
776796
jetHist.add<TH3>("eff/recmatched/mcCSpectra/gen/pt/PtParticleType", "Pt (gen, mcCSpectra) vs jetflag vs particletype", HistType::kTH3D, {{PtAxis}, {2, 0, 2}, {14, -7, 7}});
777797
jetHist.add<TH2>("eff/recmatched/mcC/gen/perpCone/pt/PtParticleType", "Pt (gen, mcC, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}});
778798
jetHist.add<TH2>("eff/recmatched/mcCSpectra/gen/perpCone/pt/PtParticleType", "Pt (gen, mcCSpectra, perp cone) vs particletype", HistType::kTH2D, {{PtAxis}, {14, -7, 7}});
799+
800+
jetHist.add<TH2>("feeddown/antiProton/jetCone/PtOrigin", "reconstructed #bar{p} origin in jet cone; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
801+
jetHist.add<TH2>("feeddown/antiProton/jetCone/PtOriginTPC", "reconstructed #bar{p} origin in jet cone, TPC PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
802+
jetHist.add<TH2>("feeddown/antiProton/jetCone/PtOriginTOF", "reconstructed #bar{p} origin in jet cone, TOF matched; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
803+
jetHist.add<TH2>("feeddown/antiProton/jetCone/PtOriginTPCTOF", "reconstructed #bar{p} origin in jet cone, TPC+TOF PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
804+
jetHist.add<TH2>("feeddown/antiProton/jetCone/PtOriginTPCTOFVeto", "reconstructed #bar{p} origin in jet cone, TPC+TOF veto; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
805+
jetHist.add<TH2>("feeddown/antiProton/perpCone/PtOrigin", "reconstructed #bar{p} origin in perpendicular cone; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
806+
jetHist.add<TH2>("feeddown/antiProton/perpCone/PtOriginTPC", "reconstructed #bar{p} origin in perpendicular cone, TPC PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
807+
jetHist.add<TH2>("feeddown/antiProton/perpCone/PtOriginTOF", "reconstructed #bar{p} origin in perpendicular cone, TOF matched; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
808+
jetHist.add<TH2>("feeddown/antiProton/perpCone/PtOriginTPCTOF", "reconstructed #bar{p} origin in perpendicular cone, TPC+TOF PID; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
809+
jetHist.add<TH2>("feeddown/antiProton/perpCone/PtOriginTPCTOFVeto", "reconstructed #bar{p} origin in perpendicular cone, TPC+TOF veto; #it{p}_{T}^{rec} (GeV/#it{c}); origin", HistType::kTH2D, {{PtAxis}, {ParticleOriginAxis}});
779810
// gen matched
780811
jetHist.add<TH2>("genmatched/hRecMatchedJetPt", "matched jet pT (Rec level);#it{p}_{T,jet part} (GeV/#it{c}); #it{p}_{T,jet part} - #it{p}_{T,jet det}", HistType::kTH2F, {{100, 0., 100.}, {400, -20., 20.}});
781812
jetHist.add<TH2>("genmatched/hRecMatchedVsGenJetPt", "matched jet pT (Rec level);#it{p}_{T,jet det}; #it{p}_{T,jet part} (GeV/#it{c})", HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}});
@@ -911,10 +942,11 @@ struct nucleiInJets {
911942
double delPhi = TVector2::Phi_mpi_pi(jet.phi() - trk.phi());
912943
double delEta = jet.eta() - trk.eta();
913944
double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi);
914-
if (R < cfgjetR)
945+
if (R < cfgjetR) {
915946
jetFlag = true;
916-
jetPt = jet.pt();
917-
break;
947+
jetPt = jet.pt();
948+
break;
949+
}
918950
}
919951
}
920952
// tof
@@ -1699,6 +1731,7 @@ struct nucleiInJets {
16991731
int nJets = 0;
17001732
std::vector<float> leadingJetWithPtEtaPhi(3);
17011733
float leadingJetPt = -1.0f;
1734+
float leadingJetPtBkgSub = -999.0f;
17021735
float backgroundRho = collision.rho(); // Get background rho from collision
17031736

17041737
// Fill background rho histogram once per event
@@ -1718,6 +1751,8 @@ struct nucleiInJets {
17181751
jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho);
17191752

17201753
if (chargedjet.pt() > leadingJetPt) {
1754+
leadingJetPt = chargedjet.pt();
1755+
leadingJetPtBkgSub = jetPtBkgSub;
17211756
leadingJetWithPtEtaPhi[0] = chargedjet.pt();
17221757
leadingJetWithPtEtaPhi[1] = chargedjet.eta();
17231758
leadingJetWithPtEtaPhi[2] = chargedjet.phi();
@@ -1729,12 +1764,21 @@ struct nucleiInJets {
17291764
if (nJets > 0) {
17301765
jetHist.fill(HIST("jet/vertexZ"), collision.posZ());
17311766
jetHist.fill(HIST("hNEvents"), 7.5);
1767+
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1768+
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
17321769
} else {
17331770
jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ());
17341771
}
1772+
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
1773+
jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ());
1774+
jetHist.fill(HIST("hNEvents"), 8.5);
1775+
}
17351776
if (isWithJetEvents && nJets == 0)
17361777
return;
17371778
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
1779+
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
1780+
jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5);
1781+
}
17381782
for (const auto& track : tracks) {
17391783
auto trk = track.track_as<TrackCandidates>();
17401784
fillTrackInfo<false>(trk, chargedjets, leadingJetWithPtEtaPhi, backgroundRho);
@@ -1773,6 +1817,7 @@ struct nucleiInJets {
17731817
int nJets = 0;
17741818
std::vector<float> leadingJetWithPtEtaPhi(3);
17751819
float leadingJetPt = -1.0f;
1820+
float leadingJetPtBkgSub = -999.0f;
17761821
float backgroundRho = collision.rho(); // Get background rho from collision
17771822

17781823
// Fill background rho histogram once per event
@@ -1792,6 +1837,8 @@ struct nucleiInJets {
17921837
jetHist.fill(HIST("jet/h2JetPtVsBkgRho"), chargedjet.pt(), backgroundRho);
17931838

17941839
if (chargedjet.pt() > leadingJetPt) {
1840+
leadingJetPt = chargedjet.pt();
1841+
leadingJetPtBkgSub = jetPtBkgSub;
17951842
leadingJetWithPtEtaPhi[0] = chargedjet.pt();
17961843
leadingJetWithPtEtaPhi[1] = chargedjet.eta();
17971844
leadingJetWithPtEtaPhi[2] = chargedjet.phi();
@@ -1803,12 +1850,21 @@ struct nucleiInJets {
18031850
if (nJets > 0) {
18041851
jetHist.fill(HIST("jet/vertexZ"), collision.posZ());
18051852
jetHist.fill(HIST("hNEvents"), 7.5);
1853+
jetHist.fill(HIST("jetBkgSub/h1LeadingJetPtBkgSub"), leadingJetPtBkgSub);
1854+
jetHist.fill(HIST("jetBkgSub/h2LeadingJetPtBkgSubVsVertexZ"), leadingJetPtBkgSub, collision.posZ());
18061855
} else {
18071856
jetHist.fill(HIST("jetOut/vertexZ"), collision.posZ());
18081857
}
1858+
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
1859+
jetHist.fill(HIST("jetBkgSub/vertexZ"), collision.posZ());
1860+
jetHist.fill(HIST("hNEvents"), 8.5);
1861+
}
18091862
if (isWithJetEvents && nJets == 0)
18101863
return;
18111864
jetHist.fill(HIST("jet/h1JetEvents"), 0.5);
1865+
if (leadingJetPtBkgSub > cfgjetPtBkgSubMin) {
1866+
jetHist.fill(HIST("jetBkgSub/h1JetEvents"), 0.5);
1867+
}
18121868
for (auto& track : tracks) {
18131869
auto trk = track.track_as<TrackCandidatesLfPid>();
18141870
fillTrackInfo<false>(trk, chargedjets, leadingJetWithPtEtaPhi, backgroundRho);
@@ -2152,10 +2208,10 @@ struct nucleiInJets {
21522208
double delPhi = TVector2::Phi_mpi_pi(mcpjet.phi() - mcParticle.phi());
21532209
double delEta = mcpjet.eta() - mcParticle.eta();
21542210
double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi);
2155-
if (R < cfgjetR)
2211+
if (R < cfgjetR) {
21562212
jetFlag = true;
2157-
// jetPt = mcpjet.pt();
2158-
break;
2213+
break;
2214+
}
21592215
} // jet
21602216
if (mapPDGToValue(mcParticle.pdgCode()) != 0) {
21612217
jetHist.fill(HIST("mcpJet/pt/PtParticleType"), mcParticle.pt(), jetFlag, mapPDGToValue(mcParticle.pdgCode()));
@@ -2185,6 +2241,7 @@ struct nucleiInJets {
21852241
jetHist.fill(HIST("mcdJet/hJetEta"), mcdjet.eta());
21862242
jetHist.fill(HIST("mcdJet/hJetPhi"), mcdjet.phi());
21872243
if (mcdjet.pt() > leadingJetPt) {
2244+
leadingJetPt = mcdjet.pt();
21882245
leadingJetWithPtEtaPhi[0] = mcdjet.pt();
21892246
leadingJetWithPtEtaPhi[1] = mcdjet.eta();
21902247
leadingJetWithPtEtaPhi[2] = mcdjet.phi();
@@ -2227,10 +2284,10 @@ struct nucleiInJets {
22272284
double delPhi = TVector2::Phi_mpi_pi(mcdjet.phi() - track.phi());
22282285
double delEta = mcdjet.eta() - track.eta();
22292286
double R = RecoDecay::sqrtSumOfSquares(delEta, delPhi);
2230-
if (R < cfgjetR)
2287+
if (R < cfgjetR) {
22312288
jetFlag = true;
2232-
// jetPt = mcdjet.pt();
2233-
break;
2289+
break;
2290+
}
22342291
} // jet
22352292
}
22362293
if (mapPDGToValue(mcTrack.pdgCode()) != 0) {
@@ -2338,8 +2395,6 @@ struct nucleiInJets {
23382395
if (!track.has_mcParticle())
23392396
continue;
23402397
auto mcTrack = track.mcParticle_as<aod::JetParticles>();
2341-
if (!mcTrack.isPhysicalPrimary())
2342-
continue;
23432398
if (!isRapiditySelectedForPID(mcTrack.y()))
23442399
continue;
23452400

@@ -2373,6 +2428,49 @@ struct nucleiInJets {
23732428
}
23742429
} // jet
23752430

2431+
if (mapPDGToValue(mcTrack.pdgCode()) == -Particle::kProton) {
2432+
const int particleOriginType = getParticleOriginType(mcTrack);
2433+
const bool isAntiProtonTpcPassed = std::abs(completeTrack.tpcNSigmaPr()) < cfgnTPCPIDPr;
2434+
const bool isAntiProtonTofPidPassed = isTof && std::abs(completeTrack.tofNSigmaPr()) < cfgnTPCPIDPrTOF;
2435+
const bool isAntiProtonTPCTOFPassed = isAntiProtonTpcPassed && isAntiProtonTofPidPassed;
2436+
const bool isAntiProtonTPCTOFVetoPassed = isAntiProtonTpcPassed && (!isTof || isAntiProtonTofPidPassed);
2437+
2438+
if (jetFlag) {
2439+
jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOrigin"), completeTrack.pt(), particleOriginType);
2440+
if (isAntiProtonTpcPassed) {
2441+
jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPC"), completeTrack.pt(), particleOriginType);
2442+
}
2443+
if (isTof) {
2444+
jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTOF"), completeTrack.pt(), particleOriginType);
2445+
}
2446+
if (isAntiProtonTPCTOFPassed) {
2447+
jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPCTOF"), completeTrack.pt(), particleOriginType);
2448+
}
2449+
if (isAntiProtonTPCTOFVetoPassed) {
2450+
jetHist.fill(HIST("feeddown/antiProton/jetCone/PtOriginTPCTOFVeto"), completeTrack.pt(), particleOriginType);
2451+
}
2452+
}
2453+
2454+
if (jetFlagPerpCone) {
2455+
jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOrigin"), completeTrack.pt(), particleOriginType);
2456+
if (isAntiProtonTpcPassed) {
2457+
jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPC"), completeTrack.pt(), particleOriginType);
2458+
}
2459+
if (isTof) {
2460+
jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTOF"), completeTrack.pt(), particleOriginType);
2461+
}
2462+
if (isAntiProtonTPCTOFPassed) {
2463+
jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPCTOF"), completeTrack.pt(), particleOriginType);
2464+
}
2465+
if (isAntiProtonTPCTOFVetoPassed) {
2466+
jetHist.fill(HIST("feeddown/antiProton/perpCone/PtOriginTPCTOFVeto"), completeTrack.pt(), particleOriginType);
2467+
}
2468+
}
2469+
}
2470+
2471+
if (!mcTrack.isPhysicalPrimary())
2472+
continue;
2473+
23762474
const auto particleType = mapPDGToValue(mcTrack.pdgCode());
23772475
if (particleType != 0) {
23782476
bool isTpcPassed = true;

0 commit comments

Comments
 (0)