Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGCF,PWGDQ] Weight merging #9627

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions PWGCF/Flow/Tasks/FlowGFWPbPb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@
fPtAxis = new TAxis(nPtBins, PtBins);

if (cfgOutputNUAWeights) {
fWeights->SetPtBins(nPtBins, PtBins);
fWeights->Init(true, false);
fWeights->setPtBins(nPtBins, PtBins);
fWeights->init(true, false);
}

// add in FlowContainer to Get boostrap sample automatically
Expand Down Expand Up @@ -306,7 +306,7 @@
return;
if (!corrconf.pTDif) {
val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx;
if (TMath::Abs(val) < 1)

Check warning on line 309 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
registry.fill(tarName, cent, val, dnx);
return;
}
Expand All @@ -321,7 +321,7 @@
return;
if (!corrconf.pTDif) {
val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx;
if (TMath::Abs(val) < 1) {

Check warning on line 324 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
tarName->Fill(cent, val, dnx);
}
return;
Expand All @@ -337,16 +337,16 @@
return;
if (!corrconf.pTDif) {
val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx;
if (TMath::Abs(val) < 1)

Check warning on line 340 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm);
return;
}
for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) {

Check warning on line 344 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real();
if (dnx == 0)
continue;
val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx;
if (TMath::Abs(val) < 1)

Check warning on line 349 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm);
}
return;
Expand Down Expand Up @@ -384,7 +384,7 @@
return false;
weight_nue = 1. / eff;
if (mAcceptance)
weight_nua = mAcceptance->GetNUA(phi, eta, vtxz);
weight_nua = mAcceptance->getNUA(phi, eta, vtxz);
else
weight_nua = 1;
return true;
Expand Down Expand Up @@ -443,14 +443,14 @@
float vtxz = -999;
if (collision.numContrib() > 1) {
vtxz = collision.posZ();
float zRes = TMath::Sqrt(collision.covZZ());

Check warning on line 446 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
if (zRes > 0.25 && collision.numContrib() < 20)
vtxz = -999;
}

auto multNTracksPV = collision.multNTracksPV();

if (abs(vtxz) > cfgCutVertex)

Check warning on line 453 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;

if (cfgMultCut) {
Expand All @@ -466,7 +466,7 @@
}

// V0A T0A 5 sigma cut
if (abs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A()))

Check warning on line 469 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;

return true;
Expand All @@ -491,9 +491,9 @@
{
double phimodn = track.phi();
if (field < 0) // for negative polarity field
phimodn = TMath::TwoPi() - phimodn;

Check warning on line 494 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
if (track.sign() < 0) // for negative charge
phimodn = TMath::TwoPi() - phimodn;

Check warning on line 496 in PWGCF/Flow/Tasks/FlowGFWPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math.
if (phimodn < 0)
LOGF(warning, "phi < 0: %g", phimodn);

Expand All @@ -510,8 +510,8 @@
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy);

using Colls = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs>>; // collisions filter
using aodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksDCA, aod::TracksExtra>>; // tracks filter
using Colls = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs>>; // collisions filter
using aodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksDCA, aod::TracksExtra>>; // tracks filter

void process(Colls::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks)
{
Expand Down Expand Up @@ -590,7 +590,7 @@
if (cfgUseAdditionalTrackCut && !trackSelected(track, Magnetfield))
continue;
if (cfgOutputNUAWeights)
fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), centrality, 0);
fWeights->fill(track.phi(), track.eta(), vtxz, track.pt(), centrality, 0);
if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz))
continue;

Expand Down
8 changes: 4 additions & 4 deletions PWGCF/Flow/Tasks/flowAnalysisGF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ struct flowAnalysisGF {
fPtAxis = new TAxis(ptbins, &ptbinning[0]);

if (cfgFillWeights) {
fWeights->SetPtBins(ptbins, &ptbinning[0]);
fWeights->Init(true, false);
fWeights->setPtBins(ptbins, &ptbinning[0]);
fWeights->init(true, false);
}

if (doprocessMCGen) {
Expand Down Expand Up @@ -388,7 +388,7 @@ struct flowAnalysisGF {
return false;
weight_nue = 1. / eff;
if (cfg.mAcceptance)
weight_nua = cfg.mAcceptance->GetNUA(phi, eta, vtxz);
weight_nua = cfg.mAcceptance->getNUA(phi, eta, vtxz);
else
weight_nua = 1;
return true;
Expand Down Expand Up @@ -582,7 +582,7 @@ struct flowAnalysisGF {
return false;

if (cfgFillWeights)
fWeights->Fill(particle.phi(), particle.eta(), vtxz, particle.pt(), centrality, 0);
fWeights->fill(particle.phi(), particle.eta(), vtxz, particle.pt(), centrality, 0);

if (!setCurrentParticleWeights(weff, wacc, particle.phi(), particle.eta(), particle.pt(), vtxz))
return false;
Expand Down
32 changes: 16 additions & 16 deletions PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,16 @@ struct FlowGFWOmegaXi {

// fWeight output
if (cfgOutputNUAWeights) {
fWeightsREF->SetPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsREF->Init(true, false);
fWeightsK0s->SetPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsK0s->Init(true, false);
fWeightsLambda->SetPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsLambda->Init(true, false);
fWeightsXi->SetPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsXi->Init(true, false);
fWeightsOmega->SetPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsOmega->Init(true, false);
fWeightsREF->setPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsREF->init(true, false);
fWeightsK0s->setPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsK0s->init(true, false);
fWeightsLambda->setPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsLambda->init(true, false);
fWeightsXi->setPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsXi->init(true, false);
fWeightsOmega->setPtBins(nPtBins, &(axisPt.binEdges)[0]);
fWeightsOmega->init(true, false);
}
}

Expand Down Expand Up @@ -565,7 +565,7 @@ struct FlowGFWOmegaXi {
return false;
weight_nue = 1. / eff;
if (mAcceptance.size() == 5)
weight_nua = mAcceptance[ispecies]->GetNUA(track.phi(), track.eta(), vtxz);
weight_nua = mAcceptance[ispecies]->getNUA(track.phi(), track.eta(), vtxz);
else
weight_nua = 1;
return true;
Expand Down Expand Up @@ -681,7 +681,7 @@ struct FlowGFWOmegaXi {
fGFW->Fill(track.eta(), ptbin, track.phi(), wacc * weff, 32);
}
if (cfgOutputNUAWeights)
fWeightsREF->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
fWeightsREF->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
}
// fill GFW of V0 flow
for (const auto& v0 : V0s) {
Expand Down Expand Up @@ -767,15 +767,15 @@ struct FlowGFWOmegaXi {
registry.fill(HIST("hEtaPhiVtxzPOIK0s"), v0.phi(), v0.eta(), vtxz, wacc);
fGFW->Fill(v0.eta(), fV0PtAxis->FindBin(v0.pt()) - 1 + ((fK0sMass->FindBin(v0.mK0Short()) - 1) * nV0PtBins), v0.phi(), wacc * weff, 8);
if (cfgOutputNUAWeights)
fWeightsK0s->Fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
fWeightsK0s->fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
}
if (isLambda) {
candNum[1] = candNum[1] + 1;
registry.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), v0.eta(), cent);
registry.fill(HIST("hEtaPhiVtxzPOILambda"), v0.phi(), v0.eta(), vtxz, wacc);
fGFW->Fill(v0.eta(), fV0PtAxis->FindBin(v0.pt()) - 1 + ((fLambdaMass->FindBin(v0.mLambda()) - 1) * nV0PtBins), v0.phi(), wacc * weff, 16);
if (cfgOutputNUAWeights)
fWeightsLambda->Fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
fWeightsLambda->fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
}
}
// fill GFW of casc flow
Expand Down Expand Up @@ -861,15 +861,15 @@ struct FlowGFWOmegaXi {
registry.fill(HIST("InvMassOmega"), casc.pt(), casc.mOmega(), casc.eta(), cent);
fGFW->Fill(casc.eta(), fXiPtAxis->FindBin(casc.pt()) - 1 + ((fOmegaMass->FindBin(casc.mOmega()) - 1) * nXiPtBins), casc.phi(), wacc * weff, 4);
if (cfgOutputNUAWeights)
fWeightsOmega->Fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
fWeightsOmega->fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
}
if (isXi) {
candNum[2] = candNum[2] + 1;
registry.fill(HIST("hEtaPhiVtxzPOIXi"), casc.phi(), casc.eta(), vtxz, wacc);
registry.fill(HIST("InvMassXi"), casc.pt(), casc.mXi(), casc.eta(), cent);
fGFW->Fill(casc.eta(), fXiPtAxis->FindBin(casc.pt()) - 1 + ((fXiMass->FindBin(casc.mXi()) - 1) * nXiPtBins), casc.phi(), wacc * weff, 2);
if (cfgOutputNUAWeights)
fWeightsXi->Fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
fWeightsXi->fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
}
}
for (int i = 0; i < 4; i++) {
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/Flow/Tasks/flowRunbyRun.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ struct FlowRunbyRun {
LOGF(fatal, "Could not find the weight for run %d", runNumber);
return;
}
weight->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0);
weight->fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0);
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions PWGCF/Flow/Tasks/flowTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ struct FlowTask {
fPtAxis = new TAxis(nPtBins, ptBins);

if (cfgOutputNUAWeights) {
fWeights->SetPtBins(nPtBins, ptBins);
fWeights->Init(true, false);
fWeights->setPtBins(nPtBins, ptBins);
fWeights->init(true, false);
}

TList* groupNUAWeightlist = new TList();
Expand All @@ -271,8 +271,8 @@ struct FlowTask {
else
groupweight = new GFWWeights(Form("groupweight_last"));

groupweight->SetPtBins(nPtBins, ptBins);
groupweight->Init(true, false);
groupweight->setPtBins(nPtBins, ptBins);
groupweight->init(true, false);
groupNUAWeightlist->Add(groupweight);
std::shared_ptr<GFWWeights> sharePtrGroupWeight(groupweight);
groupNUAWeightPtr[i] = sharePtrGroupWeight;
Expand Down Expand Up @@ -531,14 +531,14 @@ struct FlowTask {
weight_nue = 1. / eff;
if (cfgAcceptanceGroupUse) {
if (mGroupAcceptanceList && mGroupAcceptanceList->At(groupNUAIndex)) {
weight_nua = reinterpret_cast<GFWWeights*>(mGroupAcceptanceList->At(groupNUAIndex))->GetNUA(phi, eta, vtxz);
weight_nua = reinterpret_cast<GFWWeights*>(mGroupAcceptanceList->At(groupNUAIndex))->getNUA(phi, eta, vtxz);
} else {
weight_nua = 1;
}
return true;
}
if (mAcceptance)
weight_nua = mAcceptance->GetNUA(phi, eta, vtxz);
weight_nua = mAcceptance->getNUA(phi, eta, vtxz);
else
weight_nua = 1;
return true;
Expand Down Expand Up @@ -761,18 +761,18 @@ struct FlowTask {
if (cfgOutputNUAWeights) {
if (cfgOutputNUAWeightsRefPt) {
if (withinPtRef)
fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
fWeights->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
} else {
fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
fWeights->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
}
}
if (cfgOutputGroupNUAWeights) {
if (cfgOutputNUAWeightsRefPt) {
if (withinPtRef) {
groupNUAWeightPtr[groupNUAIndex]->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
groupNUAWeightPtr[groupNUAIndex]->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
}
} else {
groupNUAWeightPtr[groupNUAIndex]->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
groupNUAWeightPtr[groupNUAIndex]->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
}
}
if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz, groupNUAIndex))
Expand Down
Loading
Loading