Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
prchakra authored Feb 17, 2025
2 parents 3edf3bc + 175a82d commit 2321ecd
Show file tree
Hide file tree
Showing 9 changed files with 2,359 additions and 217 deletions.
294 changes: 144 additions & 150 deletions Common/TableProducer/PID/pidTOFMerge.cxx

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions Common/TableProducer/ft0CorrectedTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ struct ft0CorrectedTable {
histos.add("t0A", "t0A", kTH1D, {{1000, -1, 1, "t0A (ns)"}});
histos.add("t0C", "t0C", kTH1D, {{1000, -1, 1, "t0C (ns)"}});
histos.add("t0AC", "t0AC", kTH1D, {{1000, -1000, 1000, "t0AC (ns)"}});
histos.add("deltat0AC", "deltat0AC", kTH1D, {{1000, -10, 10, "#Deltat0AC (ns)"}});
histos.add("deltat0AC", "deltat0AC", kTH1D, {{1000, -1, 1, "#Deltat0AC (ns)"}});
histos.add("deltat0ACps", "deltat0ACps", kTH1D, {{1000, -1000, 1000, "#Deltat0AC (ps)"}});
if (doprocessWithBypassFT0timeInMC) {
histos.add("MC/deltat0A", "t0A", kTH1D, {{1000, -50, 50, "t0A (ps)"}});
histos.add("MC/deltat0C", "t0C", kTH1D, {{1000, -50, 50, "t0C (ps)"}});
Expand All @@ -88,7 +89,7 @@ struct ft0CorrectedTable {
table.reserve(collisions.size());
float t0A = 1e10f;
float t0C = 1e10f;
for (auto& collision : collisions) {
for (const auto& collision : collisions) {
t0A = 1e10f;
t0C = 1e10f;
const float vertexPV = collision.posZ();
Expand All @@ -112,8 +113,11 @@ struct ft0CorrectedTable {
if (addHistograms) {
histos.fill(HIST("t0A"), t0A);
histos.fill(HIST("t0C"), t0C);
histos.fill(HIST("t0AC"), (t0A + t0C) * 0.5f);
histos.fill(HIST("deltat0AC"), t0A - t0C);
if (t0A < 1e10f && t0C < 1e10f) {
histos.fill(HIST("t0AC"), (t0A + t0C) * 0.5f);
histos.fill(HIST("deltat0AC"), (t0A - t0C) * 0.5f);
histos.fill(HIST("deltat0ACps"), (t0A - t0C) * 500.f);
}
}
table(t0A, t0C);
}
Expand Down Expand Up @@ -152,7 +156,7 @@ struct ft0CorrectedTable {
float posZMC = 0;
bool hasMCcoll = false;

for (auto& collision : collisions) {
for (const auto& collision : collisions) {
hasMCcoll = false;
eventtimeMC = 1e10f;
t0A = 1e10f;
Expand Down
7 changes: 2 additions & 5 deletions Common/Tasks/flowTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ struct flowTest {
auto const& tracks = mcParticle.tracks_as<recoTracksWithLabels>();
for (auto const& track : tracks) {
bool isITSFake = false;

for (int bit = 0; bit < 7; bit++) {
if (bitcheck(track.mcMask(), bit)) {
isITSFake = true;
}
if (bitcheck(track.mcMask(), 13)) { // should perhaps be done better at some point
isITSFake = true;
}

if (track.tpcNClsFound() >= analysisMinimumTPCClusters && track.itsNCls() >= analysisMinimumITSClusters) {
Expand Down
25 changes: 14 additions & 11 deletions PWGCF/Flow/Tasks/flowMc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "GFW.h"
#include "GFWCumulant.h"
#include "GFWWeights.h"
#include <TPDGCode.h>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -98,6 +99,7 @@ struct FlowMc {

histos.add<TH1>("hPhi", "#phi distribution", HistType::kTH1D, {axisPhi});
histos.add<TH1>("hPhiWeighted", "corrected #phi distribution", HistType::kTH1D, {axisPhi});
histos.add<TH2>("hEPVsPhi", "hEPVsPhi;Event Plane Angle; #varphi", HistType::kTH2D, {axisPhi, axisPhi});

if (cfgOutputNUAWeights) {
o2::framework::AxisSpec axis = axisPt;
Expand Down Expand Up @@ -172,7 +174,7 @@ struct FlowMc {
for (auto const& mcParticle : mcParticles) {
// focus on bulk: e, mu, pi, k, p
int pdgCode = std::abs(mcParticle.pdgCode());
if (pdgCode != 11 && pdgCode != 13 && pdgCode != 211 && pdgCode != 321 && pdgCode != 2212)
if (pdgCode != PDG_t::kElectron && pdgCode != PDG_t::kMuonMinus && pdgCode != PDG_t::kPiPlus && pdgCode != kKPlus && pdgCode != PDG_t::kProton)
continue;

if (!mcParticle.isPhysicalPrimary())
Expand Down Expand Up @@ -224,6 +226,7 @@ struct FlowMc {
if (withinPtRef) {
histos.fill(HIST("hPhi"), mcParticle.phi());
histos.fill(HIST("hPhiWeighted"), mcParticle.phi(), wacc);
histos.fill(HIST("hEPVsPhi"), evPhi, mcParticle.phi());
}

// if valid global, fill
Expand Down Expand Up @@ -253,7 +256,7 @@ struct FlowMc {
float imp = mcCollision.impactParameter();

int pdgCode = std::abs(mcParticle.pdgCode());
if (pdgCode != 3312 && pdgCode != 3334)
if (pdgCode != PDG_t::kXiMinus && pdgCode != PDG_t::kOmegaMinus)
return;

if (!mcParticle.isPhysicalPrimary())
Expand All @@ -266,15 +269,15 @@ struct FlowMc {
deltaPhi += constants::math::TwoPI;
if (deltaPhi > constants::math::TwoPI)
deltaPhi -= constants::math::TwoPI;
if (pdgCode == 3312)
if (pdgCode == PDG_t::kXiMinus)
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
if (pdgCode == PDG_t::kOmegaMinus)
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());

if (cascades.size() > 0) {
if (pdgCode == 3312)
if (pdgCode == PDG_t::kXiMinus)
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
if (pdgCode == PDG_t::kOmegaMinus)
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
}
}
Expand All @@ -288,7 +291,7 @@ struct FlowMc {
float imp = mcCollision.impactParameter();

int pdgCode = std::abs(mcParticle.pdgCode());
if (pdgCode != 310 && pdgCode != 3122)
if (pdgCode != PDG_t::kK0Short && pdgCode != PDG_t::kLambda0)
return;

if (!mcParticle.isPhysicalPrimary())
Expand All @@ -301,15 +304,15 @@ struct FlowMc {
deltaPhi += constants::math::TwoPI;
if (deltaPhi > constants::math::TwoPI)
deltaPhi -= constants::math::TwoPI;
if (pdgCode == 310)
if (pdgCode == PDG_t::kK0Short)
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
if (pdgCode == PDG_t::kLambda0)
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());

if (v0s.size() > 0) {
if (pdgCode == 310)
if (pdgCode == PDG_t::kK0Short)
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
if (pdgCode == PDG_t::kLambda0)
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
}
}
Expand Down
39 changes: 25 additions & 14 deletions PWGCF/Flow/Tasks/flowPtEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "FlowContainer.h"
#include <TProfile.h>
#include <TRandom3.h>
#include <TPDGCode.h>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -119,20 +120,21 @@ struct FlowPtEfficiency {
GFW* fGFWTrue = new GFW();
GFW* fGFWReco = new GFW();
TAxis* fPtAxis;
std::vector<GFW::CorrConfig> corrconfigs;
std::vector<GFW::CorrConfig> corrconfigsTruth;
std::vector<GFW::CorrConfig> corrconfigsReco;
TRandom3* fRndm = new TRandom3(0);

bool isStable(int pdg)
{
if (std::abs(pdg) == 211)
if (std::abs(pdg) == PDG_t::kPiPlus)
return true;
if (std::abs(pdg) == 321)
if (std::abs(pdg) == PDG_t::kKPlus)
return true;
if (std::abs(pdg) == 2212)
if (std::abs(pdg) == PDG_t::kProton)
return true;
if (std::abs(pdg) == 11)
if (std::abs(pdg) == PDG_t::kElectron)
return true;
if (std::abs(pdg) == 13)
if (std::abs(pdg) == PDG_t::kMuonMinus)
return true;
return false;
}
Expand All @@ -143,9 +145,11 @@ struct FlowPtEfficiency {
// create histograms
registry.add("eventCounter", "eventCounter", kTH1F, {axisCounter});
registry.add("hPtMCRec", "Monte Carlo Reco", {HistType::kTH1D, {axisPt}});
registry.add("hPtCentMCRec", "Reco production; pT (GeV/c); centrality (%)", {HistType::kTH2D, {axisPt, axisCentrality}});

registry.add("mcEventCounter", "Monte Carlo Truth EventCounter", kTH1F, {axisCounter});
registry.add("hPtMCGen", "Monte Carlo Truth", {HistType::kTH1D, {axisPt}});
registry.add("hPtCentMCGen", "Truth production; pT (GeV/c); centrality (%)", {HistType::kTH2D, {axisPt, axisCentrality}});

if (cfgFlowEnabled) {
registry.add("hImpactParameterReco", "hImpactParameterReco", {HistType::kTH1D, {axisB}});
Expand Down Expand Up @@ -183,10 +187,10 @@ struct FlowPtEfficiency {
fGFWTrue->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2);
fGFWTrue->AddRegion("olN10", -0.8, -0.5, 1, 4);
fGFWTrue->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4);
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
fGFWTrue->CreateRegions();

fGFWReco->AddRegion("full", -0.8, 0.8, 1, 1);
Expand All @@ -196,6 +200,10 @@ struct FlowPtEfficiency {
fGFWReco->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2);
fGFWReco->AddRegion("olN10", -0.8, -0.5, 1, 4);
fGFWReco->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4);
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
fGFWReco->CreateRegions();
}

Expand Down Expand Up @@ -385,6 +393,7 @@ struct FlowPtEfficiency {
}
if (isStable(mcParticle.pdgCode())) {
registry.fill(HIST("hPtMCRec"), track.pt());
registry.fill(HIST("hPtCentMCRec"), track.pt(), centrality);

if (cfgFlowEnabled) {
bool withinPtPOI = (cfgFlowCutPtPOIMin < track.pt()) && (track.pt() < cfgFlowCutPtPOIMax); // within POI pT range
Expand All @@ -409,8 +418,8 @@ struct FlowPtEfficiency {
}
if (cfgFlowEnabled) {
// Filling Flow Container
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {
fillFC(fGFWReco, false, corrconfigs.at(l_ind), centrality, lRandom);
for (uint l_ind = 0; l_ind < corrconfigsReco.size(); l_ind++) {
fillFC(fGFWReco, false, corrconfigsReco.at(l_ind), centrality, lRandom);
}
}
}
Expand Down Expand Up @@ -442,6 +451,8 @@ struct FlowPtEfficiency {
for (const auto& mcParticle : mcParticles) {
if (mcParticle.isPhysicalPrimary() && isStable(mcParticle.pdgCode())) {
registry.fill(HIST("hPtMCGen"), mcParticle.pt());
registry.fill(HIST("hPtCentMCGen"), mcParticle.pt(), centrality);

if (cfgFlowEnabled) {
bool withinPtPOI = (cfgFlowCutPtPOIMin < mcParticle.pt()) && (mcParticle.pt() < cfgFlowCutPtPOIMax); // within POI pT range
bool withinPtRef = (cfgFlowCutPtRefMin < mcParticle.pt()) && (mcParticle.pt() < cfgFlowCutPtRefMax); // within RF pT range
Expand All @@ -456,8 +467,8 @@ struct FlowPtEfficiency {
}
if (cfgFlowEnabled) {
// Filling Flow Container
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {
fillFC(fGFWTrue, true, corrconfigs.at(l_ind), centrality, lRandom);
for (uint l_ind = 0; l_ind < corrconfigsTruth.size(); l_ind++) {
fillFC(fGFWTrue, true, corrconfigsTruth.at(l_ind), centrality, lRandom);
}
}
}
Expand Down
Loading

0 comments on commit 2321ecd

Please sign in to comment.