Skip to content
Open
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
19 changes: 14 additions & 5 deletions PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <TH2F.h>
#include <THn.h>
#include <TList.h>
#include <TLorentzVector.h>

Check failure on line 47 in PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TObjArray.h>
#include <TPDGCode.h>
Expand Down Expand Up @@ -101,6 +101,7 @@
Configurable<bool> cfgIfRejectElectron{"cfgIfRejectElectron", true, "Remove electrons"};
Configurable<bool> cfgIfMandatoryTOF{"cfgIfMandatoryTOF", true, "Mandatory TOF requirement to remove pileup"};
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"};

// Connect to ccdb
Expand All @@ -119,7 +120,7 @@

// 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 @@ -806,22 +807,22 @@
//! ----------------------------------------------------------------------
int flag = 0; //! pid check main flag

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

Check failure on line 810 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 815 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 821 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 823 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 825 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 @@ -845,7 +846,7 @@
//! ----------------------------------------------------------------------
int flag = 0; //! pid check main flag

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

Check failure on line 849 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 @@ -853,13 +854,13 @@
flag = 1;
}
}
if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) {

Check failure on line 857 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 863 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)
flag2 += 1;
Expand Down Expand Up @@ -987,6 +988,9 @@
if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) {
continue;
}
if (cfgEvSelkIsGoodZvtxFT0vsPV && !(collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) {
continue;
}

cent = collision.centFT0C();

Expand Down Expand Up @@ -1078,7 +1082,7 @@
}
//-------------------------------------------------------------------------------------------
}
PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", false);
PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", true);

void processMCRec(MyMCRecCollision const& collision, MyMCTracks const& tracks, aod::McCollisions const&, aod::McParticles const&)
{
Expand All @@ -1097,7 +1101,9 @@
}
if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) {
return;
;
}
if (cfgEvSelkIsGoodZvtxFT0vsPV && !(collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) {
return;
}

auto cent = collision.centFT0C();
Expand Down Expand Up @@ -2026,7 +2032,7 @@
histos.get<TProfile2D>(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111);
}
}
PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", false);
PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", true);

void processDataRec(AodCollisions::iterator const& coll, aod::BCsWithTimestamps const&, AodTracks const& inputTracks)
{
Expand All @@ -2044,7 +2050,10 @@

if (cfgEvSelkIsVertexTOFmatched && !(coll.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) {
return;
;
}

if (cfgEvSelkIsGoodZvtxFT0vsPV && !(coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) {
return;
}

histos.fill(HIST("hZvtx_after"), coll.posZ());
Expand Down Expand Up @@ -2978,7 +2987,7 @@
histos.get<TProfile2D>(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111);
}
}
PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", true);
PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Loading