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
43 changes: 24 additions & 19 deletions PWGLF/Tasks/Nuspex/spectraTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,34 @@
///

// O2 includes
#include <string>
#include <vector>
#include "ReconstructionDataFormats/Track.h"
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/Core/TrackSelection.h"
#include "Framework/StaticFor.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "PWGLF/DataModel/LFParticleIdentification.h"
#include "PWGLF/DataModel/spectraTOF.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "PWGLF/Utils/inelGt.h"

#include "PWGLF/DataModel/LFParticleIdentification.h"
#include "PWGLF/DataModel/mcCentrality.h"
#include "PWGLF/Utils/inelGt.h"

#include "Common/Core/RecoDecay.h"
#include "TPDGCode.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/PhysicsConstants.h"
#include "Framework/StaticFor.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"

#include "TPDGCode.h"

#include <string>
#include <vector>
using namespace o2;
using namespace o2::track;
using namespace o2::framework;
Expand Down Expand Up @@ -304,7 +309,7 @@
h->GetXaxis()->SetBinLabel(12, "INEL>1 (fraction)");
h->GetXaxis()->SetBinLabel(13, "posZ passed");
h->GetXaxis()->SetBinLabel(14, evselOptions.cfgINELCut.value == 1 ? "INEL>0" : "INEL>0 (fraction)");
h->GetXaxis()->SetBinLabel(15, evselOptions.cfgINELCut.value == 2 ? "INEL>1" : "INEL>1 (fraction)");

Check failure on line 312 in PWGLF/Tasks/Nuspex/spectraTOF.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.

h = histos.add<TH1>("tracksel", "tracksel", HistType::kTH1D, {{10, 0.5, 10.5}});
h->GetXaxis()->SetBinLabel(1, "Tracks read");
Expand Down Expand Up @@ -1038,12 +1043,12 @@
}
}
// Filling DCA info with the TPC+TOF PID
bool isDCAPureSample = (std::sqrt(nsigmaTOF * nsigmaTOF + nsigmaTPC * nsigmaTPC) < 2.f);

Check failure on line 1046 in PWGLF/Tasks/Nuspex/spectraTOF.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 (track.pt() <= 0.4) {

Check failure on line 1047 in PWGLF/Tasks/Nuspex/spectraTOF.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.
isDCAPureSample = (nsigmaTPC < 1.f);
}
if (isDCAPureSample) {
const bool isInPtRangeForPhi = track.pt() < 1.1f && track.pt() > 0.9f;

Check failure on line 1051 in PWGLF/Tasks/Nuspex/spectraTOF.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 (enableDCAxyzHistograms) {
if (track.sign() > 0) {
hDcaXYZ[id]->Fill(track.pt(), track.dcaXY(), track.dcaZ());
Expand All @@ -1062,7 +1067,7 @@
}
}
}
const bool isInPtRangeForPhi = track.pt() < 1.1f && track.pt() > 0.9f;

Check failure on line 1070 in PWGLF/Tasks/Nuspex/spectraTOF.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 (track.sign() > 0) {
histos.fill(HIST(hdcaxy[id]), track.pt(), track.dcaXY());
histos.fill(HIST(hdcaz[id]), track.pt(), track.dcaZ());
Expand Down Expand Up @@ -1168,7 +1173,7 @@
}
if (collision.isInelGt1()) {
histos.fill(HIST("evsel"), 15.f);
} else if (evselOptions.cfgINELCut == 2) {

Check failure on line 1176 in PWGLF/Tasks/Nuspex/spectraTOF.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 false;
}
histos.fill(HIST("event/vertexz"), collision.posZ());
Expand Down Expand Up @@ -1206,7 +1211,7 @@
return false;
}
}
return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));

Check failure on line 1214 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.
}
return track.isGlobalTrack();
}
Expand Down Expand Up @@ -1397,7 +1402,7 @@
{
switch (detector) {
case 0: // ITS
for (int i = 0; i < 7; i++) {

Check failure on line 1405 in PWGLF/Tasks/Nuspex/spectraTOF.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 (track.mcMask() & 1 << i) {
return true;
}
Expand Down Expand Up @@ -1595,7 +1600,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 1603 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 @@ -1975,7 +1980,7 @@
const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false);
for (const auto& mother : mcParticle.template mothers_as<aod::McParticles>()) {
const int motherPdgCode = std::abs(mother.pdgCode());
if (motherPdgCode == 421) {

Check failure on line 1983 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.
IsD0Mother = true;
}
if (charmOrigin == RecoDecay::OriginType::NonPrompt) {
Expand Down
Loading