Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@
int nchInel = 0;
for (const auto& mcParticle : mcParticles) {
auto pdgcode = std::abs(mcParticle.pdgCode());
if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) {

Check warning on line 949 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (std::abs(mcParticle.eta()) < 1.0) {
nchInel = nchInel + 1;
}
Expand Down Expand Up @@ -990,14 +990,19 @@
float nAntiprot = 0.0;

for (const auto& mcParticle : mcParticles) {
if (!mcParticle.has_mcCollision())
continue;
if (!(mcParticle.mcCollision().globalIndex() == mcCollision.globalIndex()))
continue;

if (mcParticle.isPhysicalPrimary()) {
if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) {
histos.fill(HIST("hgenPtAll"), mcParticle.pt());
histos.fill(HIST("hgenEtaAll"), mcParticle.eta());
histos.fill(HIST("hgenPhiAll"), mcParticle.phi());

if (std::abs(mcParticle.pdgCode()) == 2212 /*&& std::abs(mcParticle.y()) < 0.5*/) {

Check warning on line 1004 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (mcParticle.pdgCode() == 2212) {

Check warning on line 1005 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("hgenPtProton"), mcParticle.pt()); //! hist for p gen
histos.fill(HIST("hgenPtDistProtonVsCentrality"), mcParticle.pt(), cent);
histos.fill(HIST("hgen2DEtaVsPtProton"), mcParticle.pt(), mcParticle.eta());
Expand All @@ -1006,7 +1011,7 @@
if (mcParticle.pt() < cfgCutPtUpper)
nProt = nProt + 1.0;
}
if (mcParticle.pdgCode() == -2212) {

Check warning on line 1014 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("hgenPtAntiproton"), mcParticle.pt()); //! hist for anti-p gen
histos.fill(HIST("hgenPtDistAntiprotonVsCentrality"), mcParticle.pt(), cent);
histos.fill(HIST("hgen2DEtaVsPtAntiproton"), mcParticle.pt(), mcParticle.eta());
Expand Down Expand Up @@ -1096,6 +1101,13 @@

// Start of the Monte-Carlo reconstructed tracks
for (const auto& track : tracks) {
if (!track.has_collision()) {
continue;
}
if (!(track.collision().globalIndex() == collision.globalIndex())) {
continue;
}

if (!track.has_mcParticle()) //! check if track has corresponding MC particle
{
continue;
Expand All @@ -1106,6 +1118,9 @@
}

auto particle = track.mcParticle();
if (!particle.has_mcCollision())
continue;

if ((particle.pt() < cfgCutPtLower) || (particle.pt() > 5.0f) || (std::abs(particle.eta()) > cfgCutEta)) {
continue;
}
Expand Down Expand Up @@ -1166,7 +1181,7 @@
}
}
}
if (particle.pdgCode() == 2212) {

Check warning on line 1184 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("hrecTruePtProton"), particle.pt()); //! hist for p purity
}
}
Expand All @@ -1188,7 +1203,7 @@
}
}
}
if (particle.pdgCode() == -2212) {

Check warning on line 1206 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
histos.fill(HIST("hrecTruePtAntiproton"), particle.pt()); //! hist for anti-p purity
}
}
Expand All @@ -1215,10 +1230,10 @@

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

float fQ11_1 = fTCP1[1];

Check warning on line 1233 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use lowerCamelCase for names of functions and variables.
float fQ11_2 = std::pow(fTCP1[1], 2);

Check warning on line 1234 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use lowerCamelCase for names of functions and variables.
float fQ11_3 = std::pow(fTCP1[1], 3);

Check warning on line 1235 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use lowerCamelCase for names of functions and variables.
float fQ11_4 = std::pow(fTCP1[1], 4);

Check warning on line 1236 in PWGCF/EbyEFluctuations/Tasks/antiprotonCumulantsMc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

Use lowerCamelCase for names of functions and variables.
float fQ11_5 = std::pow(fTCP1[1], 5);
float fQ11_6 = std::pow(fTCP1[1], 6);

Expand Down Expand Up @@ -2037,6 +2052,12 @@

// Start of the Monte-Carlo reconstructed tracks
for (const auto& track : inputTracks) {
if (!track.has_collision()) {
continue;
}
if (!(track.collision().globalIndex() == coll.globalIndex())) {
continue;
}
if (!track.isPVContributor()) //! track check as used in data
{
continue;
Expand Down
19 changes: 19 additions & 0 deletions PWGCF/EbyEFluctuations/Tasks/netprotonCumulantsMc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,11 @@ struct NetprotonCumulantsMc {
float nAntiprot = 0.0;

for (const auto& mcParticle : mcParticles) {
if (!mcParticle.has_mcCollision())
continue;
if (!(mcParticle.mcCollision().globalIndex() == mcCollision.globalIndex()))
continue;

if (mcParticle.isPhysicalPrimary()) {
if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) {
histos.fill(HIST("hgenPtAll"), mcParticle.pt());
Expand Down Expand Up @@ -1096,6 +1101,12 @@ struct NetprotonCumulantsMc {

// Start of the Monte-Carlo reconstructed tracks
for (const auto& track : tracks) {
if (!track.has_collision()) {
continue;
}
if (!(track.collision().globalIndex() == collision.globalIndex())) {
continue;
}
if (!track.has_mcParticle()) //! check if track has corresponding MC particle
{
continue;
Expand All @@ -1106,6 +1117,8 @@ struct NetprotonCumulantsMc {
}

auto particle = track.mcParticle();
if (!particle.has_mcCollision())
continue;
if ((particle.pt() < cfgCutPtLower) || (particle.pt() > 5.0f) || (std::abs(particle.eta()) > cfgCutEta)) {
continue;
}
Expand Down Expand Up @@ -2037,6 +2050,12 @@ struct NetprotonCumulantsMc {

// Start of the Monte-Carlo reconstructed tracks
for (const auto& track : inputTracks) {
if (!track.has_collision()) {
continue;
}
if (!(track.collision().globalIndex() == coll.globalIndex())) {
continue;
}
if (!track.isPVContributor()) //! track check as used in data
{
continue;
Expand Down
Loading