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
162 changes: 158 additions & 4 deletions PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@
Configurable<float> cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"};
Configurable<int> cfgITScluster{"cfgITScluster", 1, "Minimum Number of ITS cluster"};
Configurable<int> cfgTPCcluster{"cfgTPCcluster", 80, "Minimum Number of TPC cluster"};
Configurable<float> cfgTPCcrossedRowsOverFindable{"cfgTPCcrossedRowsOverFindable", 0.8, "Min crossedRows/findable ratio"};
Configurable<bool> cfgUseTPCratioCut{"cfgUseTPCratioCut", true, "Apply crossedRows/findable cut"};
Configurable<int> cfgTPCnCrossedRows{"cfgTPCnCrossedRows", 70, "Minimum Number of TPC crossed-rows"};
Configurable<bool> cfgUseTPCcrossedRowsCut{"cfgUseTPCcrossedRowsCut", true, "Apply crossed rows cut"};
Configurable<bool> cfgUseTPCclusterCut{"cfgUseTPCclusterCut", true, "Apply TPC cluster cut"};
Configurable<bool> cfgUseItsPid{"cfgUseItsPid", true, "Use ITS nSigma Cut"};

// Calculation of cumulants central/error
Expand All @@ -94,7 +98,10 @@
Configurable<bool> cfgEvSelkIsVertexTOFmatched{"cfgEvSelkIsVertexTOFmatched", true, "If matched with TOF, for pileup"};
Configurable<bool> cfgEvSelkIsGoodZvtxFT0vsPV{"cfgEvSelkIsGoodZvtxFT0vsPV", false, "Apply kIsGoodZvtxFT0vsPV event selection"};
ConfigurableAxis cfgCentralityBins{"cfgCentralityBins", {90, 0., 90.}, "Centrality/Multiplicity percentile bining"};

Configurable<bool> cfgUsePtDepDCAxy{"cfgUsePtDepDCAxy", true, "Use pt-dependent DCAxy cut"};
Configurable<bool> cfgUsePtDepDCAz{"cfgUsePtDepDCAz", true, "Use pt-dependent DCAz cut"};
Configurable<std::string> cfgDCAxyFunc{"cfgDCAxyFunc", "(0.0010+0.0080/(x^0.73))", "DCAxy function"};
Configurable<std::string> cfgDCAzFunc{"cfgDCAzFunc", "(0.0020+0.0100/(x^0.70))", "DCAz function"};
// Connect to ccdb
Service<ccdb::BasicCCDBManager> ccdb;
Configurable<int64_t> ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
Expand All @@ -108,10 +115,12 @@
// Eff histograms 2d: eff(pT, eta)
TH2F* hRatio2DEtaVsPtProton = nullptr;
TH2F* hRatio2DEtaVsPtAntiproton = nullptr;
TF1* fPtDepDCAxy = nullptr;
TF1* fPtDepDCAz = nullptr;

// Filter command for rec (data)***********
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy);

Check failure on line 123 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.

// filtering collisions and tracks for real data***********
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs>>;
Expand Down Expand Up @@ -214,7 +223,60 @@
histos.add("hrec2DEtaVsPtAntiproton", "2D hist of Reconstructed Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis});
histos.add("hgen2DEtaVsPtProton", "2D hist of Generated Proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis});
histos.add("hgen2DEtaVsPtAntiproton", "2D hist of Generated Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis});

histos.add("hNTracksVsCent", "N_{p+#bar{p}} vs FT0C centrality;Centrality (%);N tracks", kTH2F, {centAxis, {200, 0, 200}});
histos.add("hDCAxyVsPt_before",
"DCAxy vs pT (before cut);pT;DCAxy",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hDCAzVsPt_before",
"DCAz vs pT (before cut);pT;DCAz",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hDCAxyVsPt_after",
"DCAxy vs pT (after cut);pT;DCAxy",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hDCAzVsPt_after",
"DCAz vs pT (after cut);pT;DCAz",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hDCAxyVsPt_afterPID",
"DCAxy vs pT after DCA+PID;pT;DCAxy",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hDCAzVsPt_afterPID",
"DCAz vs pT after DCA+PID;pT;DCAz",
kTH2F,
{{100, 0.5, 1.5}, {200, -0.3, 0.3}});

histos.add("hTPCcrossedRows",
"TPC crossed rows;N crossed rows;Counts",
kTH1F,
{{160, 0, 160}});

histos.add("hTPCclusters",
"TPC clusters;N clusters;Counts",
kTH1F,
{{160, 0, 160}});

histos.add("hTPCclusters_afterCrossedRows",
"TPC clusters after crossed rows cut;N clusters;Counts",
kTH1F,
{{160, 0, 160}});
histos.add("h2_dEdxTPC_vs_pT",
"TPC dE/dx vs pT;#it{p}_{T} (GeV/#it{c});TPC dE/dx",
kTH2F,
{ptAxis, {600, 0, 5000}});

histos.add("h2_dEdxTPC_vs_pT_proton",
"TPC dE/dx vs pT (protons);#it{p}_{T} (GeV/#it{c});TPC dE/dx",
kTH2F,
{ptAxis, {600, 0, 5000}});
// 2D histograms of nSigma
histos.add("h2DnsigmaTpcVsPt", "2D hist of nSigmaTPC vs. pT", kTH2F, {ptAxis, nSigmaAxis});
histos.add("h2DnsigmaTofVsPt", "2D hist of nSigmaTOF vs. pT", kTH2F, {ptAxis, nSigmaAxis});
Expand Down Expand Up @@ -786,6 +848,13 @@
histos.add("GenProf2D_mu8_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}});
}
}
if (cfgUsePtDepDCAxy) {
fPtDepDCAxy = new TF1("ptDepDCAxy", cfgDCAxyFunc->c_str(), 0.001, 10.0);
}

if (cfgUsePtDepDCAz) {
fPtDepDCAz = new TF1("ptDepDCAz", cfgDCAzFunc->c_str(), 0.001, 10.0);
}
} // end init()

template <typename T>
Expand All @@ -798,22 +867,22 @@
//! ----------------------------------------------------------------------
int flag = 0; //! pid check main flag

if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) {

Check failure on line 870 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) {
flag = 1;
}
}
if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) {

Check failure on line 875 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0));
const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0));
const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0));

int flag2 = 0;
if (combNSigmaPr < 3.0)

Check failure on line 881 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
flag2 += 1;
if (combNSigmaPi < 3.0)

Check failure on line 883 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
flag2 += 1;
if (combNSigmaKa < 3.0)

Check failure on line 885 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
flag2 += 1;
if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) {
if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) {
Expand All @@ -837,7 +906,7 @@
//! ----------------------------------------------------------------------
int flag = 0; //! pid check main flag

if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) {

Check failure on line 909 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) {
flag = 1;
}
Expand All @@ -845,15 +914,15 @@
flag = 1;
}
}
if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) {

Check failure on line 917 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0));
const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0));
const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0));

int flag2 = 0;
if (combNSigmaPr < 3.0)

Check failure on line 923 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
flag2 += 1;
if (combNSigmaPi < 3.0)

Check failure on line 925 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.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.
flag2 += 1;
if (combNSigmaKa < 3.0)
flag2 += 1;
Expand Down Expand Up @@ -1129,18 +1198,54 @@
if ((particle.pt() < cfgCutPtLower) || (particle.pt() > 5.0f) || (std::abs(particle.eta()) > cfgCutEta)) {
continue;
}
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) {

histos.fill(HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows());
histos.fill(HIST("hTPCclusters"), track.tpcNClsFound());
// Cluster cut

// Crossed rows cut
if (cfgUseTPCcrossedRowsCut && track.tpcNClsCrossedRows() < cfgTPCnCrossedRows) {
continue;
}

histos.fill(HIST("hTPCclusters_afterCrossedRows"), track.tpcNClsFound());

if (cfgUseTPCclusterCut && track.tpcNClsFound() < cfgTPCcluster) {
continue;
}
// Ratio cut
if (cfgUseTPCratioCut) {
float crossedRows = track.tpcNClsCrossedRows();
float findable = track.tpcNClsFindable();

if (findable > 0) {
if ((crossedRows / findable) < cfgTPCcrossedRowsOverFindable) {
continue;
}
}
}

if (particle.isPhysicalPrimary()) {
histos.fill(HIST("h2_dEdxTPC_vs_pT"), track.pt(), track.tpcSignal());
histos.fill(HIST("hrecPartPtAll"), particle.pt());
histos.fill(HIST("hrecPtAll"), track.pt());
histos.fill(HIST("hrecEtaAll"), particle.eta());
histos.fill(HIST("hrecPhiAll"), particle.phi());
histos.fill(HIST("hrecDcaXYAll"), track.dcaXY());
histos.fill(HIST("hrecDcaZAll"), track.dcaZ());
histos.fill(HIST("hDCAxyVsPt_before"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_before"), track.pt(), track.dcaZ());

if (cfgUsePtDepDCAxy && !(std::abs(track.dcaXY()) < fPtDepDCAxy->Eval(track.pt()))) {
continue;
}

if (cfgUsePtDepDCAz && !(std::abs(track.dcaZ()) < fPtDepDCAz->Eval(track.pt()))) {
continue;
}

histos.fill(HIST("hDCAxyVsPt_after"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_after"), track.pt(), track.dcaZ());
// rejecting electron
if (cfgIfRejectElectron && isElectron(track)) {
continue;
Expand All @@ -1164,10 +1269,13 @@

if (trackSelected) {
// filling nSigma distribution
histos.fill(HIST("h2_dEdxTPC_vs_pT_proton"), track.pt(), track.tpcSignal());
histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr());
histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr());
histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS<o2::track::PID::Proton>(track));

histos.fill(HIST("hDCAxyVsPt_afterPID"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_afterPID"), track.pt(), track.dcaZ());
if (track.sign() > 0) {
histos.fill(HIST("hrecPartPtProton"), particle.pt()); //! hist for p rec
histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec
Expand Down Expand Up @@ -1217,6 +1325,8 @@
} //! end track loop

float netProt = nProt - nAntiprot;
float nTracks = nProt + nAntiprot;
histos.fill(HIST("hNTracksVsCent"), cent, nTracks);
histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent);
histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent);
histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent);
Expand Down Expand Up @@ -2071,9 +2181,35 @@
if ((track.pt() < cfgCutPtLower) || (track.pt() > 5.0f) || (std::abs(track.eta()) > cfgCutEta)) {
continue;
}
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) {

histos.fill(HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows());
histos.fill(HIST("hTPCclusters"), track.tpcNClsFound());
// Cluster cut

// Crossed rows cut
if (cfgUseTPCcrossedRowsCut && track.tpcNClsCrossedRows() < cfgTPCnCrossedRows) {
continue;
}

histos.fill(HIST("hTPCclusters_afterCrossedRows"), track.tpcNClsFound());

if (cfgUseTPCclusterCut && track.tpcNClsFound() < cfgTPCcluster) {
continue;
}

// Ratio cut
if (cfgUseTPCratioCut) {
float crossedRows = track.tpcNClsCrossedRows();
float findable = track.tpcNClsFindable();

if (findable > 0) {
if ((crossedRows / findable) < cfgTPCcrossedRowsOverFindable) {
continue;
}
}
}
histos.fill(HIST("h2_dEdxTPC_vs_pT"), track.pt(), track.tpcSignal());

// for purity calculation
float nsTPC = track.tpcNSigmaPr();
float nsTOF = track.tofNSigmaPr();
Expand Down Expand Up @@ -2101,6 +2237,19 @@
histos.fill(HIST("hrecPhiAll"), track.phi());
histos.fill(HIST("hrecDcaXYAll"), track.dcaXY());
histos.fill(HIST("hrecDcaZAll"), track.dcaZ());
histos.fill(HIST("hDCAxyVsPt_before"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_before"), track.pt(), track.dcaZ());

if (cfgUsePtDepDCAxy && !(std::abs(track.dcaXY()) < fPtDepDCAxy->Eval(track.pt()))) {
continue;
}

if (cfgUsePtDepDCAz && !(std::abs(track.dcaZ()) < fPtDepDCAz->Eval(track.pt()))) {
continue;
}

histos.fill(HIST("hDCAxyVsPt_after"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_after"), track.pt(), track.dcaZ());

// rejecting electron
if (cfgIfRejectElectron && isElectron(track)) {
Expand All @@ -2126,10 +2275,13 @@
if (trackSelected) {

// filling nSigma distribution
histos.fill(HIST("h2_dEdxTPC_vs_pT_proton"), track.pt(), track.tpcSignal());
histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr());
histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr());
histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS<o2::track::PID::Proton>(track));

histos.fill(HIST("hDCAxyVsPt_afterPID"), track.pt(), track.dcaXY());
histos.fill(HIST("hDCAzVsPt_afterPID"), track.pt(), track.dcaZ());
// for protons
if (track.sign() > 0) {
histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec
Expand Down Expand Up @@ -2172,6 +2324,8 @@
} //! end track loop

float netProt = nProt - nAntiprot;
float nTracks = nProt + nAntiprot;
histos.fill(HIST("hNTracksVsCent"), cent, nTracks);
histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent);
histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent);
histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent);
Expand Down
Loading