4141
4242#include < TH1.h>
4343
44+ #include < algorithm>
4445#include < cmath>
4546#include < cstddef>
4647#include < string>
@@ -182,14 +183,14 @@ struct FullJetSpectra {
182183 if (doprocessBCs) {
183184 auto hBCCounter = registry.get <TH1>(HIST (" hBCCounter" ));
184185 hBCCounter->GetXaxis ()->SetBinLabel (1 , " AllBC" );
185- hBCCounter->GetXaxis ()->SetBinLabel (2 , " BC+TVX " );
186- hBCCounter->GetXaxis ()->SetBinLabel (3 , " BC+TVX +NoTFB" );
187- hBCCounter->GetXaxis ()->SetBinLabel (4 , " BC+TVX +NoTFB+NoITSROFB" );
188- hBCCounter->GetXaxis ()->SetBinLabel (5 , " CollinBC" );
189- hBCCounter->GetXaxis ()->SetBinLabel (6 , " CollinBC+Sel8" );
190- hBCCounter->GetXaxis ()->SetBinLabel (7 , " CollinBC+Sel8Full" );
191- hBCCounter->GetXaxis ()->SetBinLabel (8 , " CollinBC+Sel8Full+GoodZvtx" );
192- hBCCounter->GetXaxis ()->SetBinLabel (9 , " CollinBC+Sel8Full+VtxZ+GoodZvtx" );
186+ hBCCounter->GetXaxis ()->SetBinLabel (2 , " BC+kTVXinEMC " );
187+ hBCCounter->GetXaxis ()->SetBinLabel (3 , " BC+kTVXinEMC +NoTFB" );
188+ hBCCounter->GetXaxis ()->SetBinLabel (4 , " BC+kTVXinEMC +NoTFB+NoITSROFB" );
189+ hBCCounter->GetXaxis ()->SetBinLabel (5 , " kTVXinEMC+ CollinBC" );
190+ hBCCounter->GetXaxis ()->SetBinLabel (6 , " kTVXinEMC+ CollinBC+Sel8" );
191+ hBCCounter->GetXaxis ()->SetBinLabel (7 , " kTVXinEMC+ CollinBC+Sel8Full" );
192+ hBCCounter->GetXaxis ()->SetBinLabel (8 , " kTVXinEMC+ CollinBC+Sel8Full+GoodZvtx" );
193+ hBCCounter->GetXaxis ()->SetBinLabel (9 , " kTVXinEMC+ CollinBC+Sel8Full+VtxZ+GoodZvtx" );
193194 }
194195
195196 if (doprocessDataTracks || doprocessMCTracks) {
@@ -233,17 +234,21 @@ struct FullJetSpectra {
233234 hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (1 , " allDetTrigColl" );
234235 hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (2 , " DetTrigCollAfterZorroSelection" );
235236 hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (3 , " DetTrigCollWithVertexZ" );
236- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (4 , " EventsNotSatisfyingEventSelection" );
237- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (5 , " EMCreadoutDetTrigEventsWithkTVXinEMC" );
238- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (6 , " OnlyHighPt+NoLowPt+NoMB" );
239- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (7 , " OnlyLowPt+NoMB" );
240- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (8 , " OnlyMB" );
241- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (9 , " FullJetHighPt+FullJetLowPt" );
242- // hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(9, "EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers");
243- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (10 , " FullJetHighPt+MB" );
244- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (11 , " FullJetLowPt+MB" );
245- hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (12 , " AllRejectedTrigOverlaps" );
237+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (4 , " EventsNotSatisfyingEvent+TriggerSelection" );
238+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (5 , " OnlyFullJetHighPt+NoFullJetLowPt" );
239+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (6 , " OnlyFullJetLowPt" );
240+ // hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(7, "OnlyLowPt+NoMB");
241+ // hDetTrigcollisionCounter->GetXaxis()->SetBinLabel(8, "OnlyMB");
242+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (7 , " FullJetHighPt+FullJetLowPt" );
243+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (8 , " FullJetHighPt+MB" );
244+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (9 , " FullJetLowPt+MB" );
245+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (10 , " AllRejectedTrigOverlaps" );
246+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (11 , " EMCAcceptedDetTrigCollAfterTrigOverlapChecks" );
247+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (12 , " AllRejectedDetTrigEventsAfterEMCEventSelection" );
246248 hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (13 , " EMCAcceptedDetTrigColl" );
249+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (14 , " EMCAcceptedDetTrigCollWithLowChargedJetTriggers" );
250+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (15 , " EMCAcceptedDetTrigCollWithHighChargedJetTriggers" );
251+ hDetTrigcollisionCounter->GetXaxis ()->SetBinLabel (16 , " EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers" );
247252 }
248253
249254 if (doprocessJetsMCP || doprocessJetsMCPWeighted) {
@@ -419,7 +424,7 @@ struct FullJetSpectra {
419424 }
420425
421426 // Jet QA histograms
422- if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted) {
427+ if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted || doprocessJetsTriggeredData ) {
423428
424429 registry.add (" hDetcollisionCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10 .}}}, doSumw2);
425430
@@ -471,7 +476,8 @@ struct FullJetSpectra {
471476 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);
472477 }
473478 if (doprocessJetsTriggeredData) {
474- registry.add (" hDetTrigcollisionCounter" , " event status;;entries" , {HistType::kTH1F , {{14 , 0.0 , 14 .}}}, doSumw2);
479+ registry.add (" hDetTrigcollisionCounter" , " event status;;entries" , {HistType::kTH1F , {{17 , 0.0 , 17 .}}}, doSumw2);
480+ // 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);
475481 }
476482 if (doprocessJetsMCP || doprocessJetsMCPWeighted) {
477483 registry.add (" hPartcollisionCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10.0 }}}, doSumw2);
@@ -1123,10 +1129,10 @@ struct FullJetSpectra {
11231129 }
11241130 PROCESS_SWITCH (FullJetSpectra, processJetsData, " Full Jets Data" , false );
11251131
1126- void processJetsTriggeredData (soa::Filtered<EMCCollisionsTriggeredData>::iterator const & collision, FullJetTableDataJoined const & /* jets*/ ,
1132+ void processJetsTriggeredData (soa::Filtered<EMCCollisionsTriggeredData>::iterator const & collision, FullJetTableDataJoined const & jets,
11271133 aod::JetTracks const &, ClusterWithCorrections const &, aod::JBCs const &)
11281134 {
1129- // bool eventAccepted = false;
1135+ bool eventAccepted = false ;
11301136
11311137 registry.fill (HIST (" hDetTrigcollisionCounter" ), 0.5 ); // allDetTrigColl
11321138
@@ -1149,11 +1155,11 @@ struct FullJetSpectra {
11491155 registry.fill (HIST (" hDetTrigcollisionCounter" ), 3.5 ); // EventsNotSatisfyingEvent+TriggerSelection
11501156 return ;
11511157 }
1152- // - should this kTVX HW trigger be still in place??
1153- if (!collision.isAmbiguous () && jetderiveddatautilities::eventEMCAL (collision) && collision.alias_bit (kTVXinEMC )) {
1158+ // - should this kTVX HW trigger be still in place? - Removing it for now; probably not needed if we are only interested in SW triggers
1159+ /* if (!collision.isAmbiguous() && jetderiveddatautilities::eventEMCAL(collision) && collision.alias_bit(kTVXinEMC)) {
11541160 // eventAccepted = true;
11551161 registry.fill(HIST("hDetTrigcollisionCounter"), 4.5); // EMCreadoutDetTrigEventsWithkTVXinEMC
1156- }
1162+ }*/
11571163 // split event selections based on selected triggers -
11581164 // make sure there're no trigger overlaps: when analysing JetFullHighPt-> check no JetFullLowPt and kTVXinEMC are fired
11591165 // when analysing JetFullLowPt, check kTVXinEMC isn't fired!
@@ -1171,75 +1177,85 @@ struct FullJetSpectra {
11711177
11721178 // Case 1: hasFullJetHighPt && !hasFullJetLowPt && !hasMB : Pure FullJetHighPt
11731179 // i.e. for every JetFullHighPt trig that was fired, check the low triggers weren't fired
1174- if (hasFullJetHighPt && !hasFullJetLowPt && !hasMB) {
1175- registry.fill (HIST (" hDetTrigcollisionCounter" ), 5.5 ); // OnlyHighPt+NoLowPt+NoMB
1180+ if (hasFullJetHighPt && !hasFullJetLowPt) {
1181+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 4.5 ); // FullJetHighPt+FullJetLowPt
1182+ eventAccepted = true ;
11761183 }
11771184 // Case 2: hasFullJetLowPt && !hasMB : Pure FullJetLowPt
11781185 // i.e. for every hasFullJetLowPt trig that was fired, check the MB trig wasn't fired
1179- if (hasFullJetLowPt && !hasMB) {
1180- registry.fill (HIST (" hDetTrigcollisionCounter" ), 6.5 ); // OnlyLowPt+NoMB
1181- }
1182- // Case 3: hasMB && !hasFullJetLowPt && !hasFullJetHighPt : Pure MB
1183- // i.e. for every MB trig that was fired, check the higher trigs weren't fired
1184- if (hasMB && !hasFullJetLowPt && !hasFullJetHighPt) {
1185- registry.fill (HIST (" hDetTrigcollisionCounter" ), 7.5 ); // OnlyMB
1186- }
1186+ if (hasFullJetLowPt) {
1187+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 5.5 ); // FullJetLowPt
1188+ eventAccepted = true ;
1189+ }
1190+ // // Case 3: hasMB && !hasFullJetLowPt && !hasFullJetHighPt : Pure MB
1191+ // // i.e. for every MB trig that was fired, check the higher trigs weren't fired
1192+ // if (hasMB && !hasFullJetLowPt && !hasFullJetHighPt) {
1193+ // registry.fill(HIST("hDetTrigcollisionCounter"), 7.5); // OnlyMB
1194+ // }
11871195
11881196 // *****Step 2: Check for trigger overlap cases (for QA):*****
11891197
11901198 if (hasFullJetHighPt && hasFullJetLowPt) {
1191- registry.fill (HIST (" hDetTrigcollisionCounter" ), 8.5 ); // FullJetHighPt+FullJetLowPt
1199+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 6.5 ); // FullJetHighPt+FullJetLowPt
1200+ eventAccepted = true ;
11921201 }
11931202 if (hasFullJetHighPt && hasMB) {
1194- registry.fill (HIST (" hDetTrigcollisionCounter" ), 9.5 ); // FullJetHighPt+MB
1203+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 7.5 ); // FullJetHighPt+MB
1204+ eventAccepted = true ;
11951205 }
11961206 if (hasFullJetLowPt && hasMB) {
1197- registry.fill (HIST (" hDetTrigcollisionCounter" ), 10.5 ); // FullJetLowPt+MB
1207+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 8.5 ); // FullJetLowPt+MB
1208+ eventAccepted = true ;
11981209 }
11991210
12001211 // *****Step 3: Reject ALL overlapping events by applying EXCLUSIVE Trigger Selections *****
12011212 // Skip further processing if ANY overlaps exist
1202- if ((hasFullJetHighPt && (hasFullJetLowPt || hasMB)) || (hasFullJetLowPt && hasMB)) {
1203- registry.fill (HIST (" hDetTrigcollisionCounter" ), 11.5 ); // AllRejectedTrigOverlaps
1213+ // if ((hasFullJetHighPt && (hasFullJetLowPt || hasMB)) || (hasFullJetLowPt && hasMB)) {
1214+ // registry.fill(HIST("hDetTrigcollisionCounter"), 11.5); // AllRejectedTrigOverlaps
1215+ // return;
1216+ // }
1217+ if ((hasFullJetHighPt && hasFullJetLowPt)) {
1218+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 9.5 ); // AllRejectedTrigOverlaps
1219+ return ;
1220+ }
1221+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 10.5 ); // EMCAcceptedDetTrigCollAfterTrigOverlapChecks
1222+
1223+ if (!eventAccepted) {
1224+ for (auto const & jet : jets) {
1225+ if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet)) {
1226+ fillRejectedJetHistograms (jet, 1.0 );
1227+ }
1228+ }
1229+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 11.5 ); // AllRejectedDetTrigEventsAfterEMCEventSelection
12041230 return ;
12051231 }
12061232 registry.fill (HIST (" hDetTrigcollisionCounter" ), 12.5 ); // EMCAcceptedDetTrigColl
1207- // if (!eventAccepted) {
1208- // // for (auto const& jet : jets) {
1209- // // if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || !isAcceptedRecoJet<aod::JetTracks, aod::JetClusters>(jet)) {
1210- // // fillRejectedJetHistograms(jet, 1.0);
1211- // // }
1212- // // }
1213- // registry.fill(HIST("hDetTrigcollisionCounter"), 4.5); // AllRejectedDetTrigEventsAfterEMCEventSelection
1214- // return;
1215- // }
1216- // registry.fill(HIST("hDetTrigcollisionCounter"), 5.5); // EMCAcceptedDetTrigCollWithkTVXinEMC
1217- //
12181233
1219- // if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChLowPt)) {
1220- // registry.fill(HIST("hDetTrigcollisionCounter"), 8 .5); // EMCAcceptedDetTrigCollWithLowChargedJetTriggers
1221- // eventAccepted = true;
1222- // }
1223- // if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetChHighPt)) {
1224- // registry.fill(HIST("hDetTrigcollisionCounter"), 9 .5); // EMCAcceptedDetTrigCollWithHighChargedJetTriggers
1225- // eventAccepted = true;
1226- // }
1234+ if (jetderiveddatautilities::selectTrigger (collision, jetderiveddatautilities::JTrigSel::JetChLowPt)) {
1235+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 13 .5 ); // EMCAcceptedDetTrigCollWithLowChargedJetTriggers
1236+ eventAccepted = true ;
1237+ }
1238+ if (jetderiveddatautilities::selectTrigger (collision, jetderiveddatautilities::JTrigSel::JetChHighPt)) {
1239+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 14 .5 ); // EMCAcceptedDetTrigCollWithHighChargedJetTriggers
1240+ eventAccepted = true ;
1241+ }
12271242
1228- // if (jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullLowPt) && jetderiveddatautilities::selectTrigger(collision, jetderiveddatautilities::JTrigSel::JetFullHighPt)) {
1229- // registry.fill(HIST("hDetTrigcollisionCounter"), 8.5); // EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers
1230- // }
1231- // for (auto const& jet : jets) {
1232- // if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
1233- // continue;
1234- // }
1235- // if (jet.phi() < jetPhiMin || jet.phi() > jetPhiMax) {
1236- // continue;
1237- // }
1238- // if (!isAcceptedRecoJet<aod::JetTracks, aod::JetClusters>(jet)) {
1239- // continue;
1240- // }
1241- // fillJetHistograms(jet);
1242- // }
1243+ if (jetderiveddatautilities::selectTrigger (collision, jetderiveddatautilities::JTrigSel::JetFullLowPt) && jetderiveddatautilities::selectTrigger (collision, jetderiveddatautilities::JTrigSel::JetFullHighPt)) {
1244+ registry.fill (HIST (" hDetTrigcollisionCounter" ), 15.5 ); // EMCAcceptedDetTrigCollWithLow+HighFullJetTriggers
1245+ eventAccepted = true ;
1246+ }
1247+ for (auto const & jet : jets) {
1248+ if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) {
1249+ continue ;
1250+ }
1251+ if (jet.phi () < jetPhiMin || jet.phi () > jetPhiMax) {
1252+ continue ;
1253+ }
1254+ if (!isAcceptedRecoJet<aod::JetTracks, ClusterWithCorrections>(jet)) {
1255+ continue ;
1256+ }
1257+ fillJetHistograms (jet);
1258+ }
12431259 }
12441260 PROCESS_SWITCH (FullJetSpectra, processJetsTriggeredData, " Full Jets Triggered Data" , false );
12451261
0 commit comments