@@ -241,10 +241,12 @@ struct PiKpRAA {
241241 return selectedTracks;
242242 }
243243
244- void
245- init (InitContext const &)
244+ int currentRunNumberNchSel;
245+ int currentRunNumberPhiSel;
246+ void init (InitContext const &)
246247 {
247-
248+ currentRunNumberNchSel = -1 ;
249+ currentRunNumberPhiSel = -1 ;
248250 trkSelDaugthers = trkSelDaugthersV0s ();
249251 trkSelGlobal = getGlobalTrackSelectionRun3ITSMatch (TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default);
250252
@@ -362,6 +364,8 @@ struct PiKpRAA {
362364 LOG (info) << " \t applyPhiCut=" << v0Selections.applyPhiCut ;
363365 LOG (info) << " \t usePinPhiSelection=" << v0Selections.usePinPhiSelection ;
364366 LOG (info) << " \t titlePorPt=" << titlePorPt;
367+ LOG (info) << " \t currentRunNumberNchSel=" << currentRunNumberNchSel;
368+ LOG (info) << " \t currentRunNumberPhiSel=" << currentRunNumberPhiSel;
365369
366370 ccdb->setURL (" http://alice-ccdb.cern.ch" );
367371 ccdb->setCaching (true );
@@ -406,7 +410,14 @@ struct PiKpRAA {
406410 const double nPV{collision.multNTracksPVeta1 () / 1 .};
407411
408412 if (applyNchSel) {
409- loadNchCalibrations (timeStamp);
413+ const int nextRunNumber{foundBC.runNumber ()};
414+ if (currentRunNumberNchSel != nextRunNumber) {
415+ loadNchCalibrations (timeStamp);
416+ currentRunNumberNchSel = nextRunNumber;
417+ LOG (info) << " \t currentRunNumberNchSel= " << currentRunNumberNchSel << " timeStamp = " << timeStamp;
418+ }
419+
420+ // return if Nch selection objects are nullptr
410421 if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch ))
411422 return ;
412423 }
@@ -454,8 +465,18 @@ struct PiKpRAA {
454465 registry.fill (HIST (" T0Ccent" ), collision.centFT0C ());
455466 const float centrality{collision.centFT0C ()};
456467
457- if (v0Selections.applyPhiCut )
458- loadPhiCutSelections (timeStamp);
468+ if (v0Selections.applyPhiCut ) {
469+ const int nextRunNumber{foundBC.runNumber ()};
470+ if (currentRunNumberPhiSel != nextRunNumber) {
471+ loadPhiCutSelections (timeStamp);
472+ currentRunNumberPhiSel = nextRunNumber;
473+ LOG (info) << " \t currentRunNumberPhiSel= " << currentRunNumberPhiSel << " timeStamp = " << timeStamp;
474+ }
475+
476+ // return if phi cut objects are nullptr
477+ if (!(phiCut.hPhiCutHigh && phiCut.hPhiCutLow ))
478+ return ;
479+ }
459480
460481 for (const auto & track : tracks) {
461482
@@ -1069,7 +1090,8 @@ struct PiKpRAA {
10691090 LOGF (fatal, " Could not load hSigmaNch histogram from %s" , pathSigmaNch.value .c_str ());
10701091 }
10711092 }
1072- cfgNch.calibrationsLoaded = true ;
1093+ if (cfgNch.hMeanNch && cfgNch.hSigmaNch )
1094+ cfgNch.calibrationsLoaded = true ;
10731095 }
10741096
10751097 void loadPhiCutSelections (const uint64_t & timeStamp)
0 commit comments