Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 20 additions & 2 deletions PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ struct UccZdc {
bool calibrationsLoaded = false;
} cfgNch;

int currentRunNumber;

void init(InitContext const&)
{
currentRunNumber = -1;
const char* tiT0A{"T0A (#times 1/100, 3.5 < #eta < 4.9)"};
const char* tiT0C{"T0C (#times 1/100, -3.3 < #eta < -2.1)"};
const char* tiT0M{"T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9)"};
Expand Down Expand Up @@ -423,6 +426,7 @@ struct UccZdc {
LOG(info) << "\tminPt=" << minPt.value;
LOG(info) << "\tmaxPt=" << maxPt.value;
LOG(info) << "\tmaxPtSpectra=" << maxPtSpectra.value;
LOG(info) << "\tcurrentRunNumber= " << currentRunNumber;

ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
Expand Down Expand Up @@ -602,7 +606,14 @@ struct UccZdc {

bool skipEvent{false};
if (useMidRapNchSel) {
loadNchCalibrations(foundBC.timestamp());

const int nextRunNumber{foundBC.runNumber()};
if (currentRunNumber != nextRunNumber) {
loadNchCalibrations(foundBC.timestamp());
currentRunNumber = nextRunNumber;
LOG(info) << "\tcurrentRunNumber= " << currentRunNumber << " timeStamp = " << foundBC.timestamp();
}

if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch))
return;

Expand Down Expand Up @@ -787,7 +798,14 @@ struct UccZdc {

bool skipEvent{false};
if (useMidRapNchSel) {
loadNchCalibrations(foundBC.timestamp());

const int nextRunNumber{foundBC.runNumber()};
if (currentRunNumber != nextRunNumber) {
loadNchCalibrations(foundBC.timestamp());
currentRunNumber = nextRunNumber;
LOG(info) << "\tcurrentRunNumber= " << currentRunNumber << " timeStamp = " << foundBC.timestamp();
}

if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch))
return;

Expand Down
36 changes: 29 additions & 7 deletions PWGLF/Tasks/Nuspex/piKpRAA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,12 @@ struct PiKpRAA {
return selectedTracks;
}

void
init(InitContext const&)
int currentRunNumberNchSel;
int currentRunNumberPhiSel;
void init(InitContext const&)
{

currentRunNumberNchSel = -1;
currentRunNumberPhiSel = -1;
trkSelDaugthers = trkSelDaugthersV0s();
trkSelGlobal = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default);

Expand Down Expand Up @@ -362,6 +364,8 @@ struct PiKpRAA {
LOG(info) << "\tapplyPhiCut=" << v0Selections.applyPhiCut;
LOG(info) << "\tusePinPhiSelection=" << v0Selections.usePinPhiSelection;
LOG(info) << "\ttitlePorPt=" << titlePorPt;
LOG(info) << "\tcurrentRunNumberNchSel=" << currentRunNumberNchSel;
LOG(info) << "\tcurrentRunNumberPhiSel=" << currentRunNumberPhiSel;

ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
Expand Down Expand Up @@ -406,7 +410,14 @@ struct PiKpRAA {
const double nPV{collision.multNTracksPVeta1() / 1.};

if (applyNchSel) {
loadNchCalibrations(timeStamp);
const int nextRunNumber{foundBC.runNumber()};
if (currentRunNumberNchSel != nextRunNumber) {
loadNchCalibrations(timeStamp);
currentRunNumberNchSel = nextRunNumber;
LOG(info) << "\tcurrentRunNumberNchSel= " << currentRunNumberNchSel << " timeStamp = " << timeStamp;
}

// return if Nch selection objects are nullptr
if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch))
return;
}
Expand Down Expand Up @@ -454,8 +465,18 @@ struct PiKpRAA {
registry.fill(HIST("T0Ccent"), collision.centFT0C());
const float centrality{collision.centFT0C()};

if (v0Selections.applyPhiCut)
loadPhiCutSelections(timeStamp);
if (v0Selections.applyPhiCut) {
const int nextRunNumber{foundBC.runNumber()};
if (currentRunNumberPhiSel != nextRunNumber) {
loadPhiCutSelections(timeStamp);
currentRunNumberPhiSel = nextRunNumber;
LOG(info) << "\tcurrentRunNumberPhiSel= " << currentRunNumberPhiSel << " timeStamp = " << timeStamp;
}

// return if phi cut objects are nullptr
if (!(phiCut.hPhiCutHigh && phiCut.hPhiCutLow))
return;
}

for (const auto& track : tracks) {

Expand Down Expand Up @@ -1069,7 +1090,8 @@ struct PiKpRAA {
LOGF(fatal, "Could not load hSigmaNch histogram from %s", pathSigmaNch.value.c_str());
}
}
cfgNch.calibrationsLoaded = true;
if (cfgNch.hMeanNch && cfgNch.hSigmaNch)
cfgNch.calibrationsLoaded = true;
}

void loadPhiCutSelections(const uint64_t& timeStamp)
Expand Down
Loading