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
9 changes: 9 additions & 0 deletions PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.

Check failure on line 1 in PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/file-cpp]

Use lowerCamelCase or UpperCamelCase for names of C++ files. See the O2 naming conventions for details.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -85,6 +85,9 @@
Configurable<float> confEvtZvtx{"confEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"};
Configurable<bool> confEvtRequireSel8{"confEvtRequireSel8", true, "Evt sel: check for sel8 trigger bit"};
Configurable<bool> confEvtRequirekTVXinEMC{"confEvtRequirekTVXinEMC", false, "Evt sel: check for EMCal MB trigger kTVXinEMC"};
Configurable<bool> confEvtRequireL0{"confEvtRequireL0", false, "Evt sel: check for EMCal L0 trigger"};
Configurable<bool> confEvtRequireGoodZVertex{"confEvtRequireGoodZVertex", false, "Evt sel: check for EMCal good z-vertex"};
Configurable<bool> confEvtRequireNoSameBunchPileUp{"confEvtRequireNoSameBunchPileUp", false, "Evt sel: check for no same bunch pile-up"};

// ---> Track selection
Configurable<LabeledArray<float>> cfgChargedPionCuts{"cfgChargedPionCuts", {hnm::chargedPionCutsTable[0], 3, 2, hnm::chargedPionCutsName, hnm::chargedPionMinMaxName}, "Charged pion track cuts"};
Expand Down Expand Up @@ -224,6 +227,12 @@
return; // Skip this collision if sel8 trigger bit is not set
if (confEvtRequirekTVXinEMC && !iskTVXinEMC)
return; // Skip this collision if kTVXinEMC trigger bit is not set
if (confEvtRequireL0 && !isL0Triggered)
return; // Skip this collision if L0 trigger bit is not set
if (confEvtRequireGoodZVertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))
return; // Skip this collision if good z-vertex condition is not met
if (confEvtRequireNoSameBunchPileUp && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))
return; // Skip this collision if no same bunch pileup condition is not met

if (bcHasEMCCells && iskTVXinEMC)
mHistManager.fill(HIST("Event/nEMCalEvents"), 0);
Expand Down Expand Up @@ -339,4 +348,4 @@
}
};

WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<OmegaMesonEMC>(cfgc, TaskName{"omega-meson-emc"})}; }

Check failure on line 351 in PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names omega-meson-emc and omega-meson-e-m-c generated from the specified task name omega-meson-emc and from the struct name OmegaMesonEMC, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to OmegaMesonEmc and removing TaskName.
26 changes: 16 additions & 10 deletions PWGJE/Tasks/mcGeneratorStudies.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <Framework/InitContext.h>
#include <Framework/runDataProcessing.h>

#include "TDatabasePDG.h"

Check failure on line 33 in PWGJE/Tasks/mcGeneratorStudies.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 <TH1.h>
#include <TString.h>

Expand Down Expand Up @@ -60,6 +60,7 @@
Configurable<bool> mRequireNoSameBunchPileup{"mRequireNoSameBunchPileup", true, "require no same bunch pileup in event cut"};
Configurable<bool> mRequireGoodZvtxFT0vsPV{"mRequireGoodZvtxFT0vsPV", true, "require good Zvtx between FT0 vs. PV in event cut"};
Configurable<bool> mRequireEMCReadoutInMB{"mRequireEMCReadoutInMB", true, "require the EMC to be read out in an MB collision (kTVXinEMC)"};
Configurable<bool> mRequireEMCReadoutInL0{"mRequireEMCReadoutInL0", false, "require the EMC to be read out by L0 trigger"};

void init(InitContext const&)
{
Expand Down Expand Up @@ -150,16 +151,16 @@
if (bcHasCollision)
mHistManager.fill(HIST("hBCCounter"), 3);

for (auto& mcCollision : MCCollisionsBC) {

Check failure on line 154 in PWGJE/Tasks/mcGeneratorStudies.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.

auto mcParticles_inColl = mcParticles.sliceBy(perMcCollision, mcCollision.globalIndex());

for (auto& mcParticle : mcParticles_inColl) {

Check failure on line 158 in PWGJE/Tasks/mcGeneratorStudies.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 (mSelectedParticleCode != 0 && mcParticle.pdgCode() != mSelectedParticleCode)
continue;
else if (mSelectOnlyChargedParticles && TDatabasePDG::Instance()->GetParticle(mcParticle.pdgCode())->Charge())

Check failure on line 161 in PWGJE/Tasks/mcGeneratorStudies.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.
continue;
if (fabs(mcParticle.y()) > mRapidityCut)
if (std::abs(mcParticle.y()) > mRapidityCut)
continue;
if (!mcParticle.isPhysicalPrimary() && !mcParticle.producedByGenerator())
continue;
Expand All @@ -184,9 +185,9 @@
for (auto& mcParticle : mcParticles_inColl) {
if (mSelectedParticleCode != 0 && mcParticle.pdgCode() != mSelectedParticleCode)
continue;
else if (mSelectOnlyChargedParticles && TDatabasePDG::Instance()->GetParticle(mcParticle.pdgCode())->Charge())

Check failure on line 188 in PWGJE/Tasks/mcGeneratorStudies.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.
continue;
if (fabs(mcParticle.y()) > mRapidityCut)
if (std::abs(mcParticle.y()) > mRapidityCut)
continue;
if (!mcParticle.isPhysicalPrimary() && !mcParticle.producedByGenerator())
continue;
Expand All @@ -198,7 +199,7 @@
mHistManager.fill(HIST("Yield_Accepted"), mcParticle.pt());
if (!mRequireTVX || collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
mHistManager.fill(HIST("Yield_T"), mcParticle.pt());
if (abs(collision.posZ()) < mVertexCut) {
if (std::abs(collision.posZ()) < mVertexCut) {
mHistManager.fill(HIST("Yield_TZ"), mcParticle.pt());
if (!mRequireSel8 || collision.sel8()) {
mHistManager.fill(HIST("Yield_TZS"), mcParticle.pt());
Expand All @@ -207,9 +208,11 @@
if (!mRequireNoSameBunchPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
mHistManager.fill(HIST("Yield_TZSGU"), mcParticle.pt());
if (!mRequireEMCReadoutInMB || (mRequireEMCCellContent ? collision.isemcreadout() : collision.alias_bit(kTVXinEMC))) {
mHistManager.fill(HIST("Yield_TZSGUE"), mcParticle.pt());
if (isAccepted(mcParticle, mcParticles))
mHistManager.fill(HIST("Yield_TZSGUE_Accepted"), mcParticle.pt());
if (!mRequireEMCReadoutInL0 || (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7))) {
mHistManager.fill(HIST("Yield_TZSGUE"), mcParticle.pt());
if (isAccepted(mcParticle, mcParticles))
mHistManager.fill(HIST("Yield_TZSGUE_Accepted"), mcParticle.pt());
}
}
}
}
Expand All @@ -227,7 +230,7 @@
if (daughtersIds.size() != 2)
return false;
for (auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 233 in PWGJE/Tasks/mcGeneratorStudies.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.
return false;
}
return true;
Expand All @@ -240,7 +243,7 @@
if (daughtersIds.size() != 2)
return false;
for (auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 246 in PWGJE/Tasks/mcGeneratorStudies.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.
return false;
int iCellID = -1;
try {
Expand Down Expand Up @@ -271,7 +274,7 @@
fRegistry->fill(HIST("hEMCollisionCounter"), 7.0);
if (collision.sel8())
fRegistry->fill(HIST("hEMCollisionCounter"), 8.0);
if (abs(collision.posZ()) < 10.0)
if (std::abs(collision.posZ()) < 10.0)
fRegistry->fill(HIST("hEMCollisionCounter"), 9.0);
if (collision.alias_bit(kTVXinEMC))
fRegistry->fill(HIST("hEMCollisionCounter"), 10.0);
Expand All @@ -284,16 +287,19 @@
fRegistry->fill(HIST("hCollisionCounter"), 1);
if (!mRequireTVX || collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
fRegistry->fill(HIST("hCollisionCounter"), 2);
if (abs(collision.posZ()) < mVertexCut) {
if (std::abs(collision.posZ()) < mVertexCut) {
fRegistry->fill(HIST("hCollisionCounter"), 3);
if (!mRequireSel8 || collision.sel8()) {
fRegistry->fill(HIST("hCollisionCounter"), 4);
if (!mRequireGoodZvtxFT0vsPV || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
fRegistry->fill(HIST("hCollisionCounter"), 5);
if (!mRequireNoSameBunchPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
fRegistry->fill(HIST("hCollisionCounter"), 6);
if (!mRequireEMCReadoutInMB || (mRequireEMCCellContent ? collision.isemcreadout() : collision.alias_bit(kTVXinEMC)))
fRegistry->fill(HIST("hCollisionCounter"), 7);
if (!mRequireEMCReadoutInMB || (mRequireEMCCellContent ? collision.isemcreadout() : collision.alias_bit(kTVXinEMC))) {
if (!mRequireEMCReadoutInL0 || (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7))) {
fRegistry->fill(HIST("hCollisionCounter"), 7);
}
}
}
}
}
Expand Down
Loading