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
16 changes: 6 additions & 10 deletions PWGUD/Tasks/ProcessMCDPMJetSGv3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#include "Framework/AnalysisTask.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Framework/ASoAHelpers.h"
#include "TDatabasePDG.h"

Check failure on line 20 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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 "PWGUD/Core/UPCHelpers.h"
#include "PWGUD/DataModel/UDTables.h"
// #include "TLorentzVector.h"
// #include "TVector3.h"
#include "Math/LorentzVector.h" // ROOT::Math::LorentzVector
#include "Math/PxPyPzM4D.h" // ROOT::Math::PxPyPzM4D
#include "Math/LorentzVector.h" // ROOT::Math::LorentzVector
#include "Math/PxPyPzM4D.h" // ROOT::Math::PxPyPzM4D
#include "TMath.h"

using namespace o2;
Expand All @@ -32,7 +32,7 @@

struct ProcessMCDPMJetSGv3 {
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
TDatabasePDG* fPDG = TDatabasePDG::Instance();

Check failure on line 35 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.

Configurable<int> nBinsPt{"nBinsPt", 100, "N bins in pT histo"};

Expand All @@ -56,9 +56,6 @@
using TC = TCs::iterator;
using LorentzVectorM = ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double>>;




double massPion = 0.;
double massKaon = 0.;
double massProton = 0.;
Expand Down Expand Up @@ -175,11 +172,10 @@
counterMC += 1;
// if(mcParticle.isPhysicalPrimary()) counterMC += 1;
LorentzVectorM protoMC(
mcParticle.px(),
mcParticle.py(),
mcParticle.pz(),
massPion
);
mcParticle.px(),
mcParticle.py(),
mcParticle.pz(),
massPion);
double etaMax = 0.8;
double ptMin = 0.1;
if (std::fabs(protoMC.Eta()) < etaMax && protoMC.Pt() > ptMin) {
Expand Down Expand Up @@ -251,7 +247,7 @@
int NFindableMin = 70;

int counter = 0;
for (auto& track : tracks) {

Check failure on line 250 in PWGUD/Tasks/ProcessMCDPMJetSGv3.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (track.isPVContributor()) {
int NFindable = track.tpcNClsFindable();
if (NFindable < ptMin) {
Expand All @@ -273,7 +269,7 @@
// continue;
// }

double momentum = TMath::Sqrt(track.px() * track.px() + track.py() * track.py() + track.pz() * track.pz());

Check failure on line 272 in PWGUD/Tasks/ProcessMCDPMJetSGv3.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
double dEdx = track.tpcSignal();
histos.fill(HIST("hdEdx"), momentum, dEdx);

Expand All @@ -291,7 +287,7 @@
nSigmaPi = track.tpcNSigmaPi();
nSigmaKa = track.tpcNSigmaKa();
nSigmaPr = track.tpcNSigmaPr();
if (std::abs(nSigmaPi) < 3. && std::abs(pion.Rapidity()) < 0.8) {

Check failure on line 290 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaPion"), track.pt(), nSigmaPi);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand All @@ -305,7 +301,7 @@
}
}
}
if (std::abs(nSigmaKa) < 3. && std::abs(kaon.Rapidity()) < 0.8) {

Check failure on line 304 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaKaon"), track.pt(), nSigmaKa);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand All @@ -318,7 +314,7 @@
}
}
}
if (std::abs(nSigmaPr) < 3. && std::abs(proton.Rapidity()) < 0.8) {

Check failure on line 317 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaProton"), track.pt(), nSigmaPr);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand Down Expand Up @@ -347,7 +343,7 @@
nSigmaPiTOF = track.tofNSigmaPi();
nSigmaKaTOF = track.tofNSigmaKa();
nSigmaPrTOF = track.tofNSigmaPr();
if (std::abs(nSigmaPiTOF) < 3. && std::abs(pion.Rapidity()) < 0.8) {

Check failure on line 346 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaPionTOF"), track.pt(), nSigmaPiTOF);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand All @@ -361,7 +357,7 @@
}
}
}
if (std::abs(nSigmaKaTOF) < 3. && std::abs(kaon.Rapidity()) < 0.8) {

Check failure on line 360 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaKaonTOF"), track.pt(), nSigmaKaTOF);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand All @@ -374,7 +370,7 @@
}
}
}
if (std::abs(nSigmaPrTOF) < 3. && std::abs(proton.Rapidity()) < 0.8) {

Check failure on line 373 in PWGUD/Tasks/ProcessMCDPMJetSGv3.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.
histos.fill(HIST("hSigmaProtonTOF"), track.pt(), nSigmaPrTOF);
if (track.has_udMcParticle()) {
auto mcParticle = track.udMcParticle();
Expand Down
Loading