@@ -85,7 +85,6 @@ struct JetCrossSectionEfficiency {
8585 int binSplit = 3 ;
8686 int binZvtx = -1 ;
8787 int binCentrality = -1 ;
88- int binOccupancy = -1 ;
8988
9089 const char * getStageLabel (int bit)
9190 {
@@ -167,7 +166,6 @@ struct JetCrossSectionEfficiency {
167166
168167 binZvtx = nextEventSelectionBin++;
169168 binCentrality = nextEventSelectionBin++;
170- binOccupancy = nextEventSelectionBin++;
171169
172170 AxisSpec jetPtAxis = {200 , 0 ., jetPtMax, " #it{p}_{T} (GeV/#it{c})" };
173171 int totalEventSelectionBins = nextEventSelectionBin - 1 ;
@@ -189,7 +187,6 @@ struct JetCrossSectionEfficiency {
189187 }
190188 histJetPtVsEventSelection->GetYaxis ()->SetBinLabel (binZvtx, " zvtx" );
191189 histJetPtVsEventSelection->GetYaxis ()->SetBinLabel (binCentrality, " centralitycut" );
192- histJetPtVsEventSelection->GetYaxis ()->SetBinLabel (binOccupancy, " occupancycut" );
193190 }
194191
195192 if (doprocessCrossSectionEfficiency) {
@@ -208,7 +205,6 @@ struct JetCrossSectionEfficiency {
208205 }
209206 histMcCollisionsEventSelection->GetXaxis ()->SetBinLabel (binZvtx, " zvtx" );
210207 histMcCollisionsEventSelection->GetXaxis ()->SetBinLabel (binCentrality, " centralitycut" );
211- histMcCollisionsEventSelection->GetXaxis ()->SetBinLabel (binOccupancy, " occupancycut" );
212208 }
213209
214210 if (doprocessCrossSectionEfficiencyWeighted) {
@@ -227,7 +223,6 @@ struct JetCrossSectionEfficiency {
227223 }
228224 histMcCollisionsEventSelectionWeighted->GetXaxis ()->SetBinLabel (binZvtx, " zvtx" );
229225 histMcCollisionsEventSelectionWeighted->GetXaxis ()->SetBinLabel (binCentrality, " centralitycut" );
230- histMcCollisionsEventSelectionWeighted->GetXaxis ()->SetBinLabel (binOccupancy, " occupancycut" );
231226 }
232227 }
233228
@@ -271,10 +266,29 @@ struct JetCrossSectionEfficiency {
271266 bool passesZvtxCut = (std::abs (mccollision.posZ ()) <= vertexZCut);
272267 bool passesSplitCollCut = !(acceptSplitCollisions == NonSplitOnly && collisions.size () > 1 );
273268
269+ if (hasRecoColl) {
270+ bool occupancyIsGood = false ;
271+ if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) {
272+ auto const & collision = collisions.begin ();
273+ if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
274+ occupancyIsGood = true ;
275+ }
276+ } else {
277+ for (auto const & collision : collisions) {
278+ if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
279+ occupancyIsGood = true ;
280+ break ;
281+ }
282+ }
283+ }
284+ if (!occupancyIsGood) {
285+ return ;
286+ }
287+ }
288+
274289 std::vector<bool > stagePassed (activeStages.size (), false );
275290 bool hasCustomEventSel = false ;
276291 bool centralityIsGood = false ;
277- bool occupancyIsGood = false ;
278292 float centrality = mccollision.centFT0M ();
279293 if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) {
280294 if (hasRecoColl) {
@@ -287,9 +301,6 @@ struct JetCrossSectionEfficiency {
287301 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBits, skipMBGapEvents)) {
288302 hasCustomEventSel = true ;
289303 }
290- if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
291- occupancyIsGood = true ;
292- }
293304 }
294305 if ((centralityMin < centrality) && (centrality < centralityMax)) {
295306 centralityIsGood = true ;
@@ -304,9 +315,6 @@ struct JetCrossSectionEfficiency {
304315 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBits, skipMBGapEvents)) {
305316 hasCustomEventSel = true ;
306317 }
307- if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
308- occupancyIsGood = true ;
309- }
310318 float centrality = -1.0 ;
311319 checkCentFT0M ? centrality = collision.centFT0M () : centrality = collision.centFT0C ();
312320 if ((centralityMin < centrality) && (centrality < centralityMax)) {
@@ -340,11 +348,6 @@ struct JetCrossSectionEfficiency {
340348 goto endEventCounter;
341349 }
342350 registry.fill (HIST (" h_mccollisions_eventselection" ), static_cast <double >(binCentrality));
343-
344- if (!occupancyIsGood) {
345- goto endEventCounter;
346- }
347- registry.fill (HIST (" h_mccollisions_eventselection" ), static_cast <double >(binOccupancy));
348351 }
349352
350353 endEventCounter:
@@ -391,11 +394,6 @@ struct JetCrossSectionEfficiency {
391394 }
392395 registry.fill (HIST (" h2_jet_pt_part_eventselection" ), jet.pt (), static_cast <double >(binCentrality));
393396
394- if (!occupancyIsGood) {
395- goto nextJetUnweighted;
396- }
397- registry.fill (HIST (" h2_jet_pt_part_eventselection" ), jet.pt (), static_cast <double >(binOccupancy));
398-
399397 nextJetUnweighted:;
400398 }
401399 }
@@ -410,10 +408,29 @@ struct JetCrossSectionEfficiency {
410408 bool passesZvtxCut = (std::abs (mccollision.posZ ()) <= vertexZCut);
411409 bool passesSplitCollCut = !(acceptSplitCollisions == NonSplitOnly && collisions.size () > 1 );
412410
411+ if (hasRecoColl) {
412+ bool occupancyIsGood = false ;
413+ if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) {
414+ auto const & collision = collisions.begin ();
415+ if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
416+ occupancyIsGood = true ;
417+ }
418+ } else {
419+ for (auto const & collision : collisions) {
420+ if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
421+ occupancyIsGood = true ;
422+ break ;
423+ }
424+ }
425+ }
426+ if (!occupancyIsGood) {
427+ return ;
428+ }
429+ }
430+
413431 std::vector<bool > stagePassed (activeStages.size (), false );
414432 bool hasCustomEventSel = false ;
415433 bool centralityIsGood = false ;
416- bool occupancyIsGood = false ;
417434 float centrality = mccollision.centFT0M ();
418435 if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly) {
419436 if (hasRecoColl) {
@@ -426,9 +443,6 @@ struct JetCrossSectionEfficiency {
426443 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBits, skipMBGapEvents)) {
427444 hasCustomEventSel = true ;
428445 }
429- if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
430- occupancyIsGood = true ;
431- }
432446 }
433447 if ((centralityMin < centrality) && (centrality < centralityMax)) {
434448 centralityIsGood = true ;
@@ -443,9 +457,6 @@ struct JetCrossSectionEfficiency {
443457 if (jetderiveddatautilities::selectCollision (collision, eventSelectionBits, skipMBGapEvents)) {
444458 hasCustomEventSel = true ;
445459 }
446- if ((trackOccupancyInTimeRangeMin < collision.trackOccupancyInTimeRange ()) && (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMax)) {
447- occupancyIsGood = true ;
448- }
449460 float centrality = -1.0 ;
450461 checkCentFT0M ? centrality = collision.centFT0M () : centrality = collision.centFT0C ();
451462 if ((centralityMin < centrality) && (centrality < centralityMax)) {
@@ -481,11 +492,6 @@ struct JetCrossSectionEfficiency {
481492 goto endEventCounterWeighted;
482493 }
483494 registry.fill (HIST (" h_mccollisions_eventselection_weighted" ), static_cast <double >(binCentrality), eventWeight);
484-
485- if (!occupancyIsGood) {
486- goto endEventCounterWeighted;
487- }
488- registry.fill (HIST (" h_mccollisions_eventselection_weighted" ), static_cast <double >(binOccupancy), eventWeight);
489495 }
490496
491497 endEventCounterWeighted:
@@ -537,11 +543,6 @@ struct JetCrossSectionEfficiency {
537543 }
538544 registry.fill (HIST (" h2_jet_pt_part_eventselection" ), jet.pt (), static_cast <double >(binCentrality), eventWeight);
539545
540- if (!occupancyIsGood) {
541- goto nextJetWeighted;
542- }
543- registry.fill (HIST (" h2_jet_pt_part_eventselection" ), jet.pt (), static_cast <double >(binOccupancy), eventWeight);
544-
545546 nextJetWeighted:;
546547 }
547548 }
0 commit comments