Skip to content
60 changes: 30 additions & 30 deletions PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -17,6 +17,7 @@

#include "PWGLF/DataModel/EPCalibrationTables.h"
#include "PWGLF/DataModel/LFhe3HadronTables.h"
#include "PWGLF/Utils/nucleiUtils.h"
#include "PWGLF/Utils/svPoolCreator.h"

#include "Common/Core/PID/PIDTOF.h"
Expand All @@ -38,7 +39,6 @@
#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "MathUtils/BetheBlochAleph.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/ASoAHelpers.h"
Expand All @@ -47,9 +47,10 @@
#include "Framework/HistogramRegistry.h"
#include "Framework/StepTHn.h"
#include "Framework/runDataProcessing.h"
#include "MathUtils/BetheBlochAleph.h"
#include "ReconstructionDataFormats/Track.h"

#include <TDatabasePDG.h>

Check failure on line 53 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include <TDirectory.h>
#include <TFile.h>
#include <TH1F.h>
Expand Down Expand Up @@ -237,6 +238,7 @@
Configurable<float> settingCutPtMinTOFHad{"settingCutPtMinTOFHad", 0.4f, "Minimum pT to apply the TOF cut on hadrons"};
Configurable<float> settingCutNsigmaTOF{"settingCutNsigmaTOF", 3.0f, "Value of the TOF Nsigma cut"};

Configurable<LabeledArray<int>> settingEventSelections{"settingEventSelections", {nuclei::EvSelDefault[0], 8, 1, nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, "Event selections"};
Configurable<int> settingNoMixedEvents{"settingNoMixedEvents", 5, "Number of mixed events per event"};
Configurable<bool> settingEnableBkgUS{"settingEnableBkgUS", false, "Enable US background"};
Configurable<bool> settingEnableDCAfitter{"settingEnableDCAfitter", false, "Enable DCA fitter"};
Expand Down Expand Up @@ -295,13 +297,14 @@
HistogramRegistry mQaRegistry{
"QA",
{
{"hEventSelections", "Event selections; Selection step; Counts", {HistType::kTH1D, {{nuclei::evSel::kNevSels + 1, -0.5f, static_cast<float>(nuclei::evSel::kNevSels) + 0.5f}}}},
{"hEvents", "Number of events processed;Counts", {HistType::kTH1F, {{1, -0.5f, 2.5f}}}},
{"hVtxZBefore", "Vertex distribution in Z before selections;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}},
{"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}},
{"hCentralityFT0A", ";Centrality FT0A (%)", {HistType::kTH1F, {{100, 0, 100.0}}}},
{"hCentralityFT0C", ";Centrality FT0C (%)", {HistType::kTH1F, {{100, 0, 100.0}}}},
{"hNcontributor", "Number of primary vertex contributor", {HistType::kTH1F, {{2000, 0.0f, 2000.0f}}}},
{"hTrackSel", "Accepted tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast<double>(Selections::kAll) - 0.5}}}},
{"hEvents", "; Events;", {HistType::kTH1F, {{3, -0.5, 2.5}}}},
{"hEmptyPool", "svPoolCreator did not find track pairs false/true", {HistType::kTH1F, {{2, -0.5, 1.5}}}},
{"hhe3HadtInvMass", "; M(^{3}He + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{300, 3.74f, 4.34f}}}},

Expand All @@ -319,16 +322,16 @@
{"Had/hNClsHadITS", "had;N_{ITS} Cluster", {HistType::kTH1F, {{20, -10.0f, 10.0f}}}},
{"Had/hChi2NClHadITS", "had;Chi2_{ITS} Ncluster", {HistType::kTH1F, {{100, 0, 100.0f}}}},
{"Had/hHadronPt", "had; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}},
{"Had/h2NsigmaHadronITS", "NsigmaHadron ITS distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{ITS}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronITS_preselection", "NsigmaHadron ITS distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronTPC_preselection", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC_mcBackground", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC_mcSignal", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF_mcBackground", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF_mcSignal", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronITS", "NsigmaHadron ITS distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{ITS}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronITS_preselection", "NsigmaHadron ITS distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronTPC_preselection", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC_mcBackground", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTPC_mcSignal", "NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}},
{"Had/h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF_mcBackground", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
{"Had/h2NsigmaHadronTOF_mcSignal", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}},
},
OutputObjHandlingPolicy::AnalysisObject,
false,
Expand Down Expand Up @@ -358,8 +361,14 @@
if (settingSkipAmbiTracks) {
mSvPoolCreator.setSkipAmbiTracks();
}
const int numberParticle = 5;
for (int i = 0; i < numberParticle; i++) {

mQaRegistry.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(1, "All");
for (int iSel = 1; iSel < nuclei::evSel::kNevSels + 1; iSel++) {
mQaRegistry.get<TH1>(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(iSel + 1, nuclei::eventSelectionLabels[iSel].c_str());
}

const int nBetheBlochParameters = 5;
for (int i = 0; i < nBetheBlochParameters; i++) {
mBBparamsHe[i] = settingBetheBlochParams->get("He3", Form("p%i", i));
}
mBBparamsHe[5] = settingBetheBlochParams->get("He3", "resolution");
Expand Down Expand Up @@ -423,31 +432,22 @@
bool selectCollision(const Tcollision& collision, const aod::BCsWithTimestamps&)
{
mQaRegistry.fill(HIST("hEvents"), 0);
mQaRegistry.fill(HIST("hVtxZBefore"), collision.posZ());

auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
initCCDB(bc);

if constexpr (isMC) {
if (/*!collision.sel8() ||*/ std::abs(collision.posZ()) > settingCutVertex) {
return false;
}
} else {

if (!collision.sel8() || std::abs(collision.posZ()) > settingCutVertex) {
return false;
}
if (settingSkimmedProcessing) {
bool zorroSelected = mZorro.isSelected(collision.template bc_as<aod::BCsWithTimestamps>().globalBC());
if (zorroSelected) {
mQaRegistry.fill(HIST("hEvents"), 2);
}
if (!nuclei::eventSelection(collision, mQaRegistry, settingEventSelections, settingCutVertex)) {
return false;
}
if (settingSkimmedProcessing) {
bool zorroSelected = mZorro.isSelected(collision.template bc_as<aod::BCsWithTimestamps>().globalBC());
if (zorroSelected) {
mQaRegistry.fill(HIST("hEvents"), 2);
}
}

mQaRegistry.fill(HIST("hEvents"), 1);
mQaRegistry.fill(HIST("hNcontributor"), collision.numContrib());
mQaRegistry.fill(HIST("hVtxZ"), collision.posZ());
mQaRegistry.fill(HIST("hCentralityFT0A"), collision.centFT0A());
mQaRegistry.fill(HIST("hCentralityFT0C"), collision.centFT0C());
return true;
Expand Down Expand Up @@ -480,7 +480,7 @@
template <typename Ttrack>
float correctPtHe3TrackedAsTriton(const Ttrack& candidate)
{
if (candidate.pt() < 2.5 && candidate.pidForTracking() == o2::track::PID::Triton)

Check failure on line 483 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return candidate.pt() * 2. * (1. - kHePidTrkParams[0] - kHePidTrkParams[1] * candidate.pt() * 2.);

return candidate.pt() * 2.;
Expand Down Expand Up @@ -648,7 +648,7 @@
std::array<float, 3> collisionVertex = getCollisionVertex(collisions, collIdx);
const auto& pca = mFitter.getPCACandidate();
float distance = defaultTodistance;
for (int i = 0; i < 3; i++) {

Check failure on line 651 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
distance += (pca[i] - collisionVertex[i]) * (pca[i] - collisionVertex[i]);
}
if (distanceMin < 0 || distance < distanceMin) {
Expand All @@ -670,7 +670,7 @@
std::array<float, 3> collisionVertex = getCollisionVertex(collisions, he3Hadcand.collisionID);

he3Hadcand.momHe3 = std::array{trackHe3.px(), trackHe3.py(), trackHe3.pz()};
for (int i = 0; i < 3; i++)

Check failure on line 673 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
he3Hadcand.momHe3[i] = he3Hadcand.momHe3[i] * 2;
he3Hadcand.momHad = std::array{trackHad.px(), trackHad.py(), trackHad.pz()};
float invMass = CommonInite;
Expand Down
Loading