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
37 changes: 19 additions & 18 deletions PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
MC_gen_reg.add("histCentrality", "Impact parameter", HistType::kTH1F, {centralityAxis});
MC_gen_reg.add("hist_gen_p", "generated p distribution", HistType::kTH2F, {pAxis, PDGBINNING});
MC_gen_reg.add("hist_gen_pT", "generated p_{T} distribution", HistType::kTH2F, {ptAxis, PDGBINNING});
MC_gen_reg.add("histPhi", "#phi", HistType::kTH2F, {{100, 0., 2. * TMath::Pi()}, PDGBINNING});

Check warning on line 80 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.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.

Check warning on line 80 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Consider using multiples/fractions of PI defined in o2::constants::math.
MC_gen_reg.add("histEta", "#eta", HistType::kTH2F, {{102, -2.01, 2.01}, PDGBINNING});
MC_gen_reg.add("histRapid", "#gamma", HistType::kTH2F, {{1000, -5.0, 5.0}, PDGBINNING});
MC_gen_reg_cent.add("hist_gen_p_cent", "generated p distribution vs impact param", HistType::kTH3F, {pAxis, PDGBINNING, ImPaAxis});
Expand All @@ -86,7 +86,7 @@
// ********************** Reconstructed *********************
MC_recon_reg.add("histRecVtxMC", "MC reconstructed vertex z position", HistType::kTH1F, {{400, -40., +40., "z position (cm)"}});
MC_recon_reg.add("histCentrality", "Centrality", HistType::kTH1F, {centralityAxis});
MC_recon_reg.add("histPhi", "#phi", HistType::kTH2F, {{100, 0., 2. * TMath::Pi()}, PDGBINNING});

Check warning on line 89 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.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.

Check warning on line 89 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Consider using multiples/fractions of PI defined in o2::constants::math.
MC_recon_reg.add("histEta", "#eta", HistType::kTH2F, {{102, -2.01, 2.01}, PDGBINNING});
MC_recon_reg.add("hist_rec_ITS_vs_p", "ITS reconstructed p distribution", HistType::kTH2F, {pAxis, PDGBINNING});
MC_recon_reg.add("hist_rec_ITS_TPC_vs_p", "ITS_TPC reconstructed p distribution", HistType::kTH2F, {pAxis, PDGBINNING});
Expand Down Expand Up @@ -116,7 +116,7 @@
Configurable<float> minCentrality{"minCentrality", 0.0, "min Centrality used"};
Configurable<float> maxCentrality{"maxCentrality", 80.0, "max Centrality used"};
Configurable<bool> enable_Centrality_cut{"enable_Centrality_cut", true, "enable Centrality cut"};

// Track filter
Configurable<bool> requireITS{"requireITS", true, "Additional cut on the ITS requirement"};
Configurable<bool> requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"};
Expand All @@ -135,15 +135,12 @@
Configurable<float> maxDCA_Z{"maxDCA_Z", 2.0f, "max DCA to vertex z"};
Configurable<int> lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to required in TRD for track selection. -1 does not require any TRD cluster"};
Configurable<bool> requireGoldenChi2{"requireGoldenChi2", false, "Enable the requirement of GoldenChi2"};




Configurable<bool> calc_cent{"calc_cent", false, "Enable centrality processing"};

Configurable<bool> eta_cut_MC_gen{"eta_cut_MC_gen", true, "Enable eta cut for generated MC"};
Configurable<bool> use_pT_cut{"use_pT_cut", true, "0: p is used | 1: pT is used"};



Configurable<bool> removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove TF border"};
Configurable<bool> removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove TF border"};
Configurable<bool> requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Remove TF border"};
Expand All @@ -155,11 +152,16 @@
template <typename CollisionType>
bool isEventSelected(CollisionType const& collision)
{
if (removeITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) return false;
if (removeNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) return false;
if (requireIsGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) return false;
if (requireIsVertexITSTPC && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) return false;
if (removeNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) return false;
if (removeITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))
return false;
if (removeNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup))
return false;
if (requireIsGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
return false;
if (requireIsVertexITSTPC && !collision.selection_bit(aod::evsel::kIsVertexITSTPC))
return false;
if (removeNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))
return false;
return true;
}

Expand All @@ -176,10 +178,10 @@
continue;
if ((MCparticle.y() > yMax_gen || MCparticle.y() < yMin_gen) && y_cut_MC_gen)
continue;
if ((TMath::Abs(MCparticle.eta()) > cfgCutEta) && eta_cut_MC_gen)

Check warning on line 181 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.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.
continue;

int pdgbin = -10;

Check warning on line 184 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
switch (MCparticle.pdgCode()) {
case +211:
histPDG_gen->AddBinContent(1);
Expand All @@ -191,11 +193,11 @@
break;
case +321:
histPDG_gen->AddBinContent(3);
pdgbin = 2;

Check warning on line 196 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
break;
case -321:
histPDG_gen->AddBinContent(4);
pdgbin = 3;

Check warning on line 200 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
break;
case +2212:
histPDG_gen->AddBinContent(5);
Expand Down Expand Up @@ -263,10 +265,12 @@
{
if (event_selection_MC_sel8 && !collision.sel8())
return;
if (collision.posZ() > cfgCutVertex) return;
if (collision.posZ() > cfgCutVertex)
return;
MC_recon_reg.fill(HIST("histRecVtxMC"), collision.posZ());
MC_recon_reg.fill(HIST("histCentrality"), collision.centFT0C());
if (!isEventSelected(collision)) return;
if (!isEventSelected(collision))
return;

for (auto& track : tracks) {
const auto particle = track.mcParticle();
Expand Down Expand Up @@ -360,18 +364,15 @@
float RatioCrossedRowsOverFindableTPC = track.tpcCrossedRowsOverFindableCls();
float Chi2perClusterTPC = track.tpcChi2NCl();
float Chi2perClusterITS = track.itsChi2NCl();

bool insideDCAxy = (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));

Check warning on line 368 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

if (!(insideDCAxy) || TMath::Abs(track.dcaZ()) > maxDCA_Z || TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2PerClusterTPC || Chi2perClusterTPC < minChi2PerClusterTPC || Chi2perClusterITS > maxChi2PerClusterITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || (track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS || track.pt() < p_min || track.pt() > p_max)

Check warning on line 370 in PWGLF/Tasks/Nuspex/NucleiEfficiencyTask.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.
continue;
if ((requireITS && !(track.hasITS())) || (requireTPC && !(track.hasTPC())))
continue;
if (requireGoldenChi2 && !(track.passedGoldenChi2()))
continue;




MC_recon_reg.fill(HIST("histPhi"), track.phi(), pdgbin);
MC_recon_reg.fill(HIST("histEta"), track.eta(), pdgbin);
Expand Down
Loading