Skip to content
Closed
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
40 changes: 20 additions & 20 deletions PWGLF/Tasks/Nuspex/spectraTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

std::array<std::shared_ptr<TH2>, NpCharge> hPtNumTOFMatchWithPIDSignalPrm; // Pt distribution of particles with a hit in the TOF and a compatible signal

std::array<std::array<std::shared_ptr<TH3>, NpCharge>, 3> hMCpdg_nsigmaTPC; //2D array of nsigmaTPC histograms [Selection: pi,K,p][True PDG: 18 species]
std::array<std::array<std::shared_ptr<TH3>, NpCharge>, 3> hMCpdg_nsigmaTPC; // 2D array of nsigmaTPC histograms [Selection: pi,K,p][True PDG: 18 species]

// Spectra task
struct tofSpectra {
Expand Down Expand Up @@ -587,12 +587,12 @@
histos.add("MC/MultiplicityMCINELgt0", "MC multiplicity", kTH1D, {multAxis});
histos.add("MC/MultiplicityMCINELgt1", "MC multiplicity", kTH1D, {multAxis});
}
if (doprocessTrackMCLabels){
for (int par = 2; par <= 4; par++){
for (int i = 0; i < NpCharge; i++){
hMCpdg_nsigmaTPC[par-2][i] = histos.add<TH3>(Form("test_mclabels/nsigmatpc/%s/%s/pdg_%i", (i < Np) ? "pos" : "neg", pN[par], PDGs[i%Np]), Form("True %s (%i) in %s selection", pTCharge[i], PDGs[i], (i < Np) ? pTCharge[par] : pTCharge[par+Np]), kTH3D, {ptAxis, nsigmaTPCAxisOccupancy, multAxis});
}

if (doprocessTrackMCLabels) {
for (int par = 2; par <= 4; par++) {
for (int i = 0; i < NpCharge; i++) {
hMCpdg_nsigmaTPC[par - 2][i] = histos.add<TH3>(Form("test_mclabels/nsigmatpc/%s/%s/pdg_%i", (i < Np) ? "pos" : "neg", pN[par], PDGs[i % Np]), Form("True %s (%i) in %s selection", pTCharge[i], PDGs[i], (i < Np) ? pTCharge[par] : pTCharge[par + Np]), kTH3D, {ptAxis, nsigmaTPCAxisOccupancy, multAxis});
}
}
}

Expand Down Expand Up @@ -1507,9 +1507,9 @@
if (mcParticle.isPhysicalPrimary()) {
if (isTPCPion && rapidityPi <= trkselOptions.cfgCutY) {
if (usePDGcode) {
if (pdgCode == 211) {

Check failure on line 1510 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity);
} else if (pdgCode == -211) {

Check failure on line 1512 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity);
}
} else {
Expand All @@ -1519,9 +1519,9 @@
}
if (isTPCKaon && rapidityKa <= trkselOptions.cfgCutY) {
if (usePDGcode) {
if (pdgCode == 321) {

Check failure on line 1522 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity);
} else if (pdgCode == -321) {

Check failure on line 1524 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity);
}
} else {
Expand All @@ -1531,9 +1531,9 @@
}
if (isTPCProton && rapidityPr <= trkselOptions.cfgCutY) {
if (usePDGcode) {
if (pdgCode == 2212) {

Check failure on line 1534 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity);
} else if (pdgCode == -2212) {

Check failure on line 1536 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatpc/mc_closure/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity);
}
} else {
Expand All @@ -1545,9 +1545,9 @@
// TOF Selection and Histogram Filling
if (isTOFPion && rapidityPi <= trkselOptions.cfgCutY) {
if (usePDGcode) {
if (pdgCode == 211) {

Check failure on line 1548 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatof/mc_closure/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity);
} else if (pdgCode == -211) {

Check failure on line 1550 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatof/mc_closure/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity);
}
} else {
Expand All @@ -1557,7 +1557,7 @@
}
if (isTOFKaon && rapidityKa <= trkselOptions.cfgCutY) {
if (usePDGcode) {
if (pdgCode == 321) {

Check failure on line 1560 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("nsigmatof/mc_closure/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity);
} else if (pdgCode == -321) {
histos.fill(HIST("nsigmatof/mc_closure/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity);
Expand Down Expand Up @@ -1611,7 +1611,7 @@
for (const auto& track : tracks) {
// Track selection criteria
/* if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC || track.tpcChi2NCl() > maxChi2PerClusterTPC || track.tpcChi2NCl() > maxChi2PerClusterTPC ||
track.itsChi2NCl() > maxChi2PerClusterITS || std::abs(track.dcaXY()) > maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f)) || std::abs(track.dcaZ()) > maxDcaZ.value || track.eta() < trkselOptions.cfgCutEtaMin || track.eta() > trkselOptions.cfgCutEtaMax || track.tpcCrossedRowsOverFindableCls() < minNCrossedRowsOverFindableClustersTPC || track.tpcNClsFound() < minTPCNClsFound ||

Check failure on line 1614 in PWGLF/Tasks/Nuspex/spectraTOF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) {
continue;
}*/
Expand Down Expand Up @@ -2795,15 +2795,15 @@
}
}
PROCESS_SWITCH(tofSpectra, processMCgen_RecoEvs, "process generated MC (reconstructed events)", false);

void processTrackMCLabels(CollisionCandidates::iterator const& collisions,
soa::Join<TrackCandidates,
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr> const& tracks,
aod::McTrackLabels const& mcTrackLabels, aod::McParticles const& mcParticles)
soa::Join<TrackCandidates,
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr> const& tracks,
aod::McTrackLabels const& mcTrackLabels, aod::McParticles const& mcParticles)
{
const float multiplicity = getMultiplicity(collisions);

for (const auto& track : tracks) {
if (!track.has_collision()) {
continue;
Expand All @@ -2818,17 +2818,17 @@
const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex());
const auto& mcParticle = mcParticles.iteratorAt(mcLabel.mcParticleId());
int pdgCode = mcParticle.pdgCode();
static_for<2,4>([&](auto par){

static_for<2, 4>([&](auto par) {
const auto& nsigmaTPCpar = o2::aod::pidutils::tpcNSigma<par>(track);
bool isTPCpar = std::abs(nsigmaTPCpar) < trkselOptions.cfgCutNsigma;
// Precompute rapidity values to avoid redundant calculations
double rapiditypar = std::abs(track.rapidity(PID::getMass(par)));
//TPC Selection and histogram filling
if (isTPCpar && rapiditypar <= trkselOptions.cfgCutY){
static_for<0, 17>([&](auto i){
if (pdgCode == PDGs[i]){
hMCpdg_nsigmaTPC[par-2][i]->Fill(track.pt(), nsigmaTPCpar, multiplicity);
// TPC Selection and histogram filling
if (isTPCpar && rapiditypar <= trkselOptions.cfgCutY) {
static_for<0, 17>([&](auto i) {
if (pdgCode == PDGs[i]) {
hMCpdg_nsigmaTPC[par - 2][i]->Fill(track.pt(), nsigmaTPCpar, multiplicity);
}
});
}
Expand Down
Loading