Skip to content
Merged
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
24 changes: 18 additions & 6 deletions PWGCF/Flow/Tasks/pidFlowPtCorr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3748,8 +3748,8 @@ struct PidFlowPtCorr {
PROCESS_SWITCH(PidFlowPtCorr, processMCClosure, "Run truth-level MC flow closure", false);

/**
* @brief this function is used to fill THn hist for NUA correction and for NUE correction
* @details hist THn: (runNumberIDX, phi, eta, Vz), note that different runNumber will be put in the same hist
* @brief Fill THnSparse histograms used to derive NUA weights
* @details Histograms use (runNumberIDX, phi, eta, Vz, pT); cfgUseNUAWithPt enables NUE weighting before filling
*
* @param collision
* @param tracks
Expand Down Expand Up @@ -3780,6 +3780,10 @@ struct PidFlowPtCorr {
}
// end collision cut

if (switchsOpts.cfgUseNUAWithPt.value) {
loadCorrections(bc.timestamp());
}

// loop the vector, find the place to put (phi eta Vz)
// if the run number is new, create one
int matchedPosition = -1;
Expand Down Expand Up @@ -3816,24 +3820,32 @@ struct PidFlowPtCorr {

// fill the THn
if (isWithinRefPtRange(track.pt())) {
registry.fill(HIST("correction/hRunNumberPhiEtaVertex"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt());
float weightNUE = 1.f;
if (switchsOpts.cfgUseNUAWithPt.value) {
setParticleNUEWeight(weightNUE, track, cent);
}
registry.fill(HIST("correction/hRunNumberPhiEtaVertex"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt(), weightNUE);
}

int pid = this->getPidConfigurable(track);
if (!isWithinPOIPtRange(pid, track.pt())) {
continue;
}
float weightNUEPid = 1.f;
if (switchsOpts.cfgUseNUAWithPt.value) {
setParticleNUEWeight(weightNUEPid, track, cent, pid);
}
switch (pid) {
case MyParticleType::kPion:
registry.fill(HIST("correction/hRunNumberPhiEtaVertexPion"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt());
registry.fill(HIST("correction/hRunNumberPhiEtaVertexPion"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt(), weightNUEPid);
break;

case MyParticleType::kKaon:
registry.fill(HIST("correction/hRunNumberPhiEtaVertexKaon"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt());
registry.fill(HIST("correction/hRunNumberPhiEtaVertexKaon"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt(), weightNUEPid);
break;

case MyParticleType::kProton:
registry.fill(HIST("correction/hRunNumberPhiEtaVertexProton"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt());
registry.fill(HIST("correction/hRunNumberPhiEtaVertexProton"), matchedPosition, track.phi(), track.eta(), collision.posZ(), track.pt(), weightNUEPid);
break;

default:
Expand Down
Loading