@@ -461,6 +461,8 @@ struct derivedlambdakzeroanalysis {
461461 histos.add (" hInteractionRate" , " hInteractionRate" , kTH1F , {axisIRBinning});
462462 histos.add (" hCentralityVsInteractionRate" , " hCentralityVsInteractionRate" , kTH2F , {{101 , 0 .0f , 101 .0f }, axisIRBinning});
463463
464+ histos.add (" hInteractionRateVsOccupancy" , " hInteractionRateVsOccupancy" , kTH2F , {axisIRBinning, axisOccupancy});
465+
464466 // for QA and test purposes
465467 auto hRawCentrality = histos.add <TH1>(" hRawCentrality" , " hRawCentrality" , kTH1F , {axisRawCentrality});
466468
@@ -1593,7 +1595,8 @@ struct derivedlambdakzeroanalysis {
15931595 histos.fill (HIST (" hEventSelection" ), 17 /* Above max occupancy */ );
15941596 }
15951597
1596- double interactionRate = rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 ;
1598+ // Fetch interaction rate only if required (in order to limit ccdb calls)
1599+ double interactionRate = (eventSelections.minIR >= 0 || eventSelections.maxIR >= 0 ) ? rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 : -1 ;
15971600 if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR ) {
15981601 return false ;
15991602 }
@@ -1721,7 +1724,8 @@ struct derivedlambdakzeroanalysis {
17211724 centrality = hRawCentrality->GetBinContent (hRawCentrality->FindBin (doPPAnalysis ? collision.multFT0A () + collision.multFT0C () : collision.multFT0C ()));
17221725 }
17231726 float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange () : collision.trackOccupancyInTimeRange ();
1724- double interactionRate = rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 ;
1727+ // Fetch interaction rate only if required (in order to limit ccdb calls)
1728+ double interactionRate = !irSource.value .empty () ? rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 : -1 ;
17251729
17261730 // gap side
17271731 int gapSide = collision.gapSide ();
@@ -1748,6 +1752,8 @@ struct derivedlambdakzeroanalysis {
17481752 histos.fill (HIST (" hInteractionRate" ), interactionRate);
17491753 histos.fill (HIST (" hCentralityVsInteractionRate" ), centrality, interactionRate);
17501754
1755+ histos.fill (HIST (" hInteractionRateVsOccupancy" ), interactionRate, collisionOccupancy);
1756+
17511757 // __________________________________________
17521758 // perform main analysis
17531759 int nK0Shorts = 0 ;
@@ -1805,7 +1811,8 @@ struct derivedlambdakzeroanalysis {
18051811 centrality = hRawCentrality->GetBinContent (hRawCentrality->FindBin (doPPAnalysis ? collision.multFT0A () + collision.multFT0C () : collision.multFT0C ()));
18061812 }
18071813 float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange () : collision.trackOccupancyInTimeRange ();
1808- double interactionRate = rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 ;
1814+ // Fetch interaction rate only if required (in order to limit ccdb calls)
1815+ double interactionRate = !irSource.value .empty () ? rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 : -1 ;
18091816
18101817 // gap side
18111818 int gapSide = collision.gapSide ();
@@ -1832,6 +1839,8 @@ struct derivedlambdakzeroanalysis {
18321839 histos.fill (HIST (" hInteractionRate" ), interactionRate);
18331840 histos.fill (HIST (" hCentralityVsInteractionRate" ), centrality, interactionRate);
18341841
1842+ histos.fill (HIST (" hInteractionRateVsOccupancy" ), interactionRate, collisionOccupancy);
1843+
18351844 // __________________________________________
18361845 // perform main analysis
18371846 int nK0Shorts = 0 ;
0 commit comments