Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 90 additions & 74 deletions PWGJE/Tasks/fullJetSpectra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include <TH1.h>

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <string>
Expand Down Expand Up @@ -182,14 +183,14 @@
if (doprocessBCs) {
auto hBCCounter = registry.get<TH1>(HIST("hBCCounter"));
hBCCounter->GetXaxis()->SetBinLabel(1, "AllBC");
hBCCounter->GetXaxis()->SetBinLabel(2, "BC+TVX");
hBCCounter->GetXaxis()->SetBinLabel(3, "BC+TVX+NoTFB");
hBCCounter->GetXaxis()->SetBinLabel(4, "BC+TVX+NoTFB+NoITSROFB");
hBCCounter->GetXaxis()->SetBinLabel(5, "CollinBC");
hBCCounter->GetXaxis()->SetBinLabel(6, "CollinBC+Sel8");
hBCCounter->GetXaxis()->SetBinLabel(7, "CollinBC+Sel8Full");
hBCCounter->GetXaxis()->SetBinLabel(8, "CollinBC+Sel8Full+GoodZvtx");
hBCCounter->GetXaxis()->SetBinLabel(9, "CollinBC+Sel8Full+VtxZ+GoodZvtx");
hBCCounter->GetXaxis()->SetBinLabel(2, "BC+kTVXinEMC");
hBCCounter->GetXaxis()->SetBinLabel(3, "BC+kTVXinEMC+NoTFB");
hBCCounter->GetXaxis()->SetBinLabel(4, "BC+kTVXinEMC+NoTFB+NoITSROFB");
hBCCounter->GetXaxis()->SetBinLabel(5, "kTVXinEMC+CollinBC");
hBCCounter->GetXaxis()->SetBinLabel(6, "kTVXinEMC+CollinBC+Sel8");
hBCCounter->GetXaxis()->SetBinLabel(7, "kTVXinEMC+CollinBC+Sel8Full");
hBCCounter->GetXaxis()->SetBinLabel(8, "kTVXinEMC+CollinBC+Sel8Full+GoodZvtx");
hBCCounter->GetXaxis()->SetBinLabel(9, "kTVXinEMC+CollinBC+Sel8Full+VtxZ+GoodZvtx");
}

if (doprocessDataTracks || doprocessMCTracks) {
Expand Down Expand Up @@ -233,17 +234,21 @@
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(1, "allDetTrigColl");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(2, "DetTrigCollAfterZorroSelection");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(3, "DetTrigCollWithVertexZ");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(4, "EventsNotSatisfyingEventSelection");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(5, "EMCreadoutDetTrigEventsWithkTVXinEMC");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(6, "OnlyHighPt+NoLowPt+NoMB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(7, "OnlyLowPt+NoMB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(8, "OnlyMB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(9, "FullJetHighPt+FullJetLowPt");
// hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(9, "EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(10, "FullJetHighPt+MB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(11, "FullJetLowPt+MB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(12, "AllRejectedTrigOverlaps");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(4, "EventsNotSatisfyingEvent+TriggerSelection");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(5, "OnlyFullJetHighPt+NoFullJetLowPt");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(6, "OnlyFullJetLowPt");
// hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(7, "OnlyLowPt+NoMB");
// hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(8, "OnlyMB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(7, "FullJetHighPt+FullJetLowPt");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(8, "FullJetHighPt+MB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(9, "FullJetLowPt+MB");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(10, "AllRejectedTrigOverlaps");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(11, "EMCAcceptedDetTrigCollAfterTrigOverlapChecks");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(12, "AllRejectedDetTrigEventsAfterEMCEventSelection");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(13, "EMCAcceptedDetTrigColl");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(14, "EMCAcceptedDetTrigCollWithLowChargedJetTriggers");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(15, "EMCAcceptedDetTrigCollWithHighChargedJetTriggers");
hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(16, "EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers");
}

if (doprocessJetsMCP || doprocessJetsMCPWeighted) {
Expand Down Expand Up @@ -419,7 +424,7 @@
}

// Jet QA histograms
if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted) {
if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted || doprocessJetsTriggeredData) {

registry.add("hDetcollisionCounter", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.}}}, doSumw2);

Expand Down Expand Up @@ -471,7 +476,8 @@
registry.add("h2_full_jet_nef_corr_allTracks70", "Jet pT vs NEF (corr, alltracks70); p_{T,jet}; NEF", {HistType::kTH2F, {{350, 0., 350.}, {100, 0., 1.}}}, doSumw2);
}
if (doprocessJetsTriggeredData) {
registry.add("hDetTrigcollisionCounter", "event status;;entries", {HistType::kTH1F, {{14, 0.0, 14.}}}, doSumw2);
registry.add("hDetTrigcollisionCounter", "event status;;entries", {HistType::kTH1F, {{17, 0.0, 17.}}}, doSumw2);
// registry.add("h2_full_jet_nef_rejected", "#it{p}_{T,jet} vs nef at Det Level for rejected events; #it{p}_{T,jet} (GeV/#it{c});nef", {HistType::kTH2F, {{350, 0., 350.}, {105, 0., 1.05}}}, doSumw2);
}
if (doprocessJetsMCP || doprocessJetsMCPWeighted) {
registry.add("hPartcollisionCounter", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}, doSumw2);
Expand Down Expand Up @@ -1037,7 +1043,7 @@
if (bcs.size() == 0) {
return;
}
for (auto bc : bcs) {

Check failure on line 1046 in PWGJE/Tasks/fullJetSpectra.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
registry.fill(HIST("hBCCounter"), 0.5); // All BC
if (bc.selection_bit(aod::evsel::kIsTriggerTVX)) {
registry.fill(HIST("hBCCounter"), 1.5); // BC+TVX
Expand All @@ -1049,7 +1055,7 @@
}
}
auto collisionsInBC = collisions.sliceBy(perFoundBC, bc.globalIndex());
for (auto collision : collisionsInBC) {

Check failure on line 1058 in PWGJE/Tasks/fullJetSpectra.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
registry.fill(HIST("hBCCounter"), 4.5); // CollinBC
if (collision.sel8()) {
registry.fill(HIST("hBCCounter"), 5.5); // CollinBC+sel8
Expand Down Expand Up @@ -1123,10 +1129,10 @@
}
PROCESS_SWITCH(FullJetSpectra, processJetsData, "Full Jets Data", false);

void processJetsTriggeredData(soa::Filtered<EMCCollisionsTriggeredData>::iterator const& collision, FullJetTableDataJoined const& /*jets*/,
void processJetsTriggeredData(soa::Filtered<EMCCollisionsTriggeredData>::iterator const& collision, FullJetTableDataJoined const& jets,
aod::JetTracks const&, ClusterWithCorrections const&, aod::JBCs const&)
{
// bool eventAccepted = false;
bool eventAccepted = false;

registry.fill(HIST("hDetTrigcollisionCounter"), 0.5); // allDetTrigColl

Expand All @@ -1149,11 +1155,11 @@
registry.fill(HIST("hDetTrigcollisionCounter"), 3.5); // EventsNotSatisfyingEvent+TriggerSelection
return;
}
//- should this kTVX HW trigger be still in place??
if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) {
//- should this kTVX HW trigger be still in place? - Removing it for now; probably not needed if we are only interested in SW triggers
/*if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) {
// eventAccepted = true;
registry.fill(HIST("hDetTrigcollisionCounter"), 4.5); // EMCreadoutDetTrigEventsWithkTVXinEMC
}
}*/
// split event selections based on selected triggers -
// make sure there're no trigger overlaps: when analysing JetFullHighPt-> check no JetFullLowPt and kTVXinEMC are fired
// when analysing JetFullLowPt, check kTVXinEMC isn't fired!
Expand All @@ -1171,75 +1177,85 @@

// Case 1: hasFullJetHighPt && !hasFullJetLowPt && !hasMB : Pure FullJetHighPt
// i.e. for every JetFullHighPt trig that was fired, check the low triggers weren't fired
if (hasFullJetHighPt && !hasFullJetLowPt && !hasMB) {
registry.fill(HIST("hDetTrigcollisionCounter"), 5.5); // OnlyHighPt+NoLowPt+NoMB
if (hasFullJetHighPt && !hasFullJetLowPt) {
registry.fill(HIST("hDetTrigcollisionCounter"), 4.5); // FullJetHighPt+FullJetLowPt
eventAccepted = true;
}
// Case 2: hasFullJetLowPt && !hasMB : Pure FullJetLowPt
// i.e. for every hasFullJetLowPt trig that was fired, check the MB trig wasn't fired
if (hasFullJetLowPt && !hasMB) {
registry.fill(HIST("hDetTrigcollisionCounter"), 6.5); // OnlyLowPt+NoMB
}
// Case 3: hasMB && !hasFullJetLowPt && !hasFullJetHighPt : Pure MB
// i.e. for every MB trig that was fired, check the higher trigs weren't fired
if (hasMB && !hasFullJetLowPt && !hasFullJetHighPt) {
registry.fill(HIST("hDetTrigcollisionCounter"), 7.5); // OnlyMB
}
if (hasFullJetLowPt) {
registry.fill(HIST("hDetTrigcollisionCounter"), 5.5); // FullJetLowPt
eventAccepted = true;
}
// // Case 3: hasMB && !hasFullJetLowPt && !hasFullJetHighPt : Pure MB
// // i.e. for every MB trig that was fired, check the higher trigs weren't fired
// if (hasMB && !hasFullJetLowPt && !hasFullJetHighPt) {
// registry.fill(HIST("hDetTrigcollisionCounter"), 7.5); // OnlyMB
// }

//*****Step 2: Check for trigger overlap cases (for QA):*****

if (hasFullJetHighPt && hasFullJetLowPt) {
registry.fill(HIST("hDetTrigcollisionCounter"), 8.5); // FullJetHighPt+FullJetLowPt
registry.fill(HIST("hDetTrigcollisionCounter"), 6.5); // FullJetHighPt+FullJetLowPt
eventAccepted = true;
}
if (hasFullJetHighPt && hasMB) {
registry.fill(HIST("hDetTrigcollisionCounter"), 9.5); // FullJetHighPt+MB
registry.fill(HIST("hDetTrigcollisionCounter"), 7.5); // FullJetHighPt+MB
eventAccepted = true;
}
if (hasFullJetLowPt && hasMB) {
registry.fill(HIST("hDetTrigcollisionCounter"), 10.5); // FullJetLowPt+MB
registry.fill(HIST("hDetTrigcollisionCounter"), 8.5); // FullJetLowPt+MB
eventAccepted = true;
}

//*****Step 3: Reject ALL overlapping events by applying EXCLUSIVE Trigger Selections *****
// Skip further processing if ANY overlaps exist
if ((hasFullJetHighPt && (hasFullJetLowPt || hasMB)) || (hasFullJetLowPt && hasMB)) {
registry.fill(HIST("hDetTrigcollisionCounter"), 11.5); // AllRejectedTrigOverlaps
// if ((hasFullJetHighPt && (hasFullJetLowPt || hasMB)) || (hasFullJetLowPt && hasMB)) {
// registry.fill(HIST("hDetTrigcollisionCounter"), 11.5); // AllRejectedTrigOverlaps
// return;
// }
if ((hasFullJetHighPt && hasFullJetLowPt)) {
registry.fill(HIST("hDetTrigcollisionCounter"), 9.5); // AllRejectedTrigOverlaps
return;
}
registry.fill(HIST("hDetTrigcollisionCounter"), 10.5); // EMCAcceptedDetTrigCollAfterTrigOverlapChecks

if (!eventAccepted) {
for (auto const& jet : jets) {
if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet)) {
fillRejectedJetHistograms(jet, 1.0);
}
}
registry.fill(HIST("hDetTrigcollisionCounter"), 11.5); // AllRejectedDetTrigEventsAfterEMCEventSelection
return;
}
registry.fill(HIST("hDetTrigcollisionCounter"), 12.5); // EMCAcceptedDetTrigColl
// if (!eventAccepted) {
// // for (auto const& jet : jets) {
// // if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedRecoJet<aod::JetTracks, aod::JetClusters>(jet)) {
// // fillRejectedJetHistograms(jet, 1.0);
// // }
// // }
// registry.fill(HIST("hDetTrigcollisionCounter"), 4.5); // AllRejectedDetTrigEventsAfterEMCEventSelection
// return;
// }
// registry.fill(HIST("hDetTrigcollisionCounter"), 5.5); // EMCAcceptedDetTrigCollWithkTVXinEMC
//

// if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt)) {
// registry.fill(HIST("hDetTrigcollisionCounter"), 8.5); // EMCAcceptedDetTrigCollWithLowChargedJetTriggers
// eventAccepted = true;
// }
// if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt)) {
// registry.fill(HIST("hDetTrigcollisionCounter"), 9.5); // EMCAcceptedDetTrigCollWithHighChargedJetTriggers
// eventAccepted = true;
// }
if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt)) {
registry.fill(HIST("hDetTrigcollisionCounter"), 13.5); // EMCAcceptedDetTrigCollWithLowChargedJetTriggers
eventAccepted = true;
}
if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt)) {
registry.fill(HIST("hDetTrigcollisionCounter"), 14.5); // EMCAcceptedDetTrigCollWithHighChargedJetTriggers
eventAccepted = true;
}

// if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullLowPt) && jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullHighPt)) {
// registry.fill(HIST("hDetTrigcollisionCounter"), 8.5); // EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers
// }
// for (auto const& jet : jets) {
// if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
// continue;
// }
// if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) {
// continue;
// }
// if (!isAcceptedRecoJet<aod::JetTracks, aod::JetClusters>(jet)) {
// continue;
// }
// fillJetHistograms(jet);
// }
if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullLowPt) && jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullHighPt)) {
registry.fill(HIST("hDetTrigcollisionCounter"), 15.5); // EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers
eventAccepted = true;
}
for (auto const& jet : jets) {
if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
continue;
}
if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) {
continue;
}
if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet)) {
continue;
}
fillJetHistograms(jet);
}
}
PROCESS_SWITCH(FullJetSpectra, processJetsTriggeredData, "Full Jets Triggered Data", false);

Expand Down Expand Up @@ -1882,7 +1898,7 @@
callCount++;

// Clean up cache every 50000 calls to prevent memory issues
if (doMcClosure && callCount % 50000 == 0 && mcCollisionRandomValues.size() > 20000) {

Check failure on line 1901 in PWGJE/Tasks/fullJetSpectra.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGF(info, "Cleaning up MC collision random values cache (size: %zu)", mcCollisionRandomValues.size());
mcCollisionRandomValues.clear();

Expand Down
Loading