Skip to content

Commit

Permalink
removed redundant namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcellocosti committed Jan 8, 2025
1 parent c1b48c2 commit b76b7a7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 31 deletions.
4 changes: 3 additions & 1 deletion PWGHF/Core/CentralityEstimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ float getCentralityColl(const Coll&)

/// Get the centrality
/// \param collision is the collision with the centrality information
/// \param centEstimator integer to select the centrality estimator
/// \return collision centrality
template <typename Coll>
float getCentralityColl(const Coll& collision, int centEstimator)
Expand Down Expand Up @@ -150,7 +151,7 @@ float getCentralityColl(const Coll& collision, int centEstimator)
}
break;
default:
LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Fallback to V0A";
LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Setting value to -999.";
cent = -999.;
break;
}
Expand All @@ -177,6 +178,7 @@ float getCentralityGenColl(CCs const& collSlice)

/// \brief Function to get MC collision centrality
/// \param collSlice collection of reconstructed collisions associated to a generated one
/// \param centEstimator integer to select the centrality estimator
/// \return generated MC collision centrality
template <typename CCs>
float getCentralityGenColl(CCs const& collSlice, int centEstimator)
Expand Down
28 changes: 13 additions & 15 deletions PWGHF/D2H/Tasks/taskDplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ using namespace o2::analysis;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_centrality;
using namespace o2::hf_occupancy;

enum OccupancyEstimator { None = 0,
ITS,
FT0C };

/// D± analysis task
struct HfTaskDplus {
Expand All @@ -62,8 +60,8 @@ struct HfTaskDplus {
using CandDplusMcRecoWithMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec, aod::HfMlDplusToPiKPi>>;
using CandDplusMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;

using CollisionsCent = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As>;
using McRecoCollisionsCent = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As>;
using CollisionsCent = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>;
using McRecoCollisionsCent = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>;

Filter filterDplusFlag = (o2::aod::hf_track_index::hfflag & static_cast<uint8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast<uint8_t>(0);

Expand Down Expand Up @@ -451,10 +449,10 @@ struct HfTaskDplus {
if (storeCentrality || storeOccupancy) {
auto collision = candidate.template collision_as<CollisionsCent>();
if (storeCentrality && centEstimator != CentralityEstimator::None) {
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
cent = getCentralityColl(collision, centEstimator);
}
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
occ = o2::hf_occupancy::getOccupancyColl(collision);
occ = getOccupancyColl(collision, occEstimator);
}
}

Expand Down Expand Up @@ -497,15 +495,15 @@ struct HfTaskDplus {
continue;
}
ptBhad = candidate.ptBhadMotherPart();
flagBHad = o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart());
flagBHad = getBHadMotherFlag(candidate.pdgBhadMotherPart());

if (storeCentrality || storeOccupancy) {
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
if (storeCentrality && centEstimator != CentralityEstimator::None) {
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
cent = getCentralityColl(collision, centEstimator);
}
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
occ = o2::hf_occupancy::getOccupancyColl(collision);
occ = getOccupancyColl(collision, occEstimator);
}
}

Expand All @@ -522,10 +520,10 @@ struct HfTaskDplus {
}
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
if (storeCentrality && centEstimator != CentralityEstimator::None) {
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
cent = getCentralityColl(collision, centEstimator);
}
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
occ = o2::hf_occupancy::getOccupancyColl(collision);
occ = getOccupancyColl(collision, occEstimator);
}
fillHistoMCRec<false>(candidate);
fillSparseML<true, false>(candidate, ptBhad, flagBHad, cent, occ);
Expand All @@ -552,10 +550,10 @@ struct HfTaskDplus {
const auto recoCollsPerGenMcColl = mcRecoCollisions.sliceBy(recoColPerMcCollision, mcGenCollision.globalIndex());
const auto mcParticlesPerGenMcColl = mcGenParticles.sliceBy(mcParticlesPerMcCollision, mcGenCollision.globalIndex());
if (storeCentrality && centEstimator != CentralityEstimator::None) {
cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerGenMcColl, centEstimator);
cent = getCentralityGenColl(recoCollsPerGenMcColl, centEstimator);
}
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerGenMcColl);
occ = getOccupancyGenColl(recoCollsPerGenMcColl, occEstimator);
}

for (const auto& particle : mcParticlesPerGenMcColl) {
Expand All @@ -567,7 +565,7 @@ struct HfTaskDplus {
}
if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) {
auto bHadMother = mcGenParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcGenParticles.offset());
flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
ptGenB = bHadMother.pt();
}
fillHistoMCGen(particle);
Expand Down
12 changes: 6 additions & 6 deletions PWGHF/D2H/Tasks/taskDs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ struct HfTaskDs {
if constexpr (isMc) {
if (dataType == DataType::McDsNonPrompt) { // If data do not fill PV contributors in sparse
if (storeOccupancy) {
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.ptBhadMotherPart(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
return;
} else {
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.ptBhadMotherPart(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()));
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()));
return;
}
} else {
Expand Down Expand Up @@ -496,10 +496,10 @@ struct HfTaskDs {
if constexpr (isMc) {
if (dataType == DataType::McDsNonPrompt) { // If data do not fill PV contributors in sparse
if (storeOccupancy) {
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
return;
} else {
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()));
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()));
return;
}
} else {
Expand Down Expand Up @@ -710,7 +710,7 @@ struct HfTaskDs {
std::get<TH1Ptr>(histosPtr[DataType::McDsNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT
std::get<TH1Ptr>(histosPtr[DataType::McDsNonPrompt]["hEtaGen"])->Fill(particle.eta());
auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset());
int flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
float ptGenB = bHadMother.pt();
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);
Expand All @@ -736,7 +736,7 @@ struct HfTaskDs {
std::get<TH1Ptr>(histosPtr[DataType::McDplusNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT
std::get<TH1Ptr>(histosPtr[DataType::McDplusNonPrompt]["hEtaGen"])->Fill(particle.eta());
auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset());
int flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
float ptGenB = bHadMother.pt();
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);
Expand Down
5 changes: 3 additions & 2 deletions PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_centrality;
using namespace o2::hf_occupancy;
using namespace o2::hf_evsel;

enum DecayChannel { DplusToPiKPi = 0,
Expand Down Expand Up @@ -340,7 +341,7 @@ struct HfTaskFlowCharmHadrons {
aod::BCsWithTimestamps const&,
float& centrality)
{
float occupancy = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
float occupancy = getOccupancyColl(collision, occEstimator);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, centEstimator, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
centrality = o2::hf_centrality::getCentralityColl(collision, centEstimator);

Expand Down Expand Up @@ -412,7 +413,7 @@ struct HfTaskFlowCharmHadrons {
float occupancy = 0.;
uint16_t hfevflag{};
if (occEstimator != 0) {
occupancy = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
occupancy = getOccupancyColl(collision, occEstimator);
registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
hfevflag = hfEvSel.getHfCollisionRejectionMask<true, o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
}
Expand Down
7 changes: 4 additions & 3 deletions PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ using namespace o2::hf_evsel;
using namespace o2::hf_trkcandsel;
using namespace o2::aod::hf_cand_2prong;
using namespace o2::hf_centrality;
using namespace o2::hf_occupancy;
using namespace o2::constants::physics;
using namespace o2::framework;
using namespace o2::aod::pid_tpc_tof_utils;
Expand Down Expand Up @@ -627,7 +628,7 @@ struct HfCandidateCreator2Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand All @@ -645,7 +646,7 @@ struct HfCandidateCreator2Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand All @@ -663,7 +664,7 @@ struct HfCandidateCreator2Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand Down
7 changes: 4 additions & 3 deletions PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ using namespace o2::hf_evsel;
using namespace o2::hf_trkcandsel;
using namespace o2::aod::hf_cand_3prong;
using namespace o2::hf_centrality;
using namespace o2::hf_occupancy;
using namespace o2::constants::physics;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down Expand Up @@ -405,7 +406,7 @@ struct HfCandidateCreator3Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand All @@ -423,7 +424,7 @@ struct HfCandidateCreator3Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand All @@ -441,7 +442,7 @@ struct HfCandidateCreator3Prong {

/// bitmask with event. selection info
float centrality{-1.f};
float occupancy = o2::hf_occupancy::getOccupancyColl(collision);
float occupancy = getOccupancyColl(collision);
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);

/// monitor the satisfied event selections
Expand Down
3 changes: 2 additions & 1 deletion PWGHF/Tasks/taskMcValidation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_evsel;
using namespace o2::hf_centrality;
using namespace o2::hf_occupancy;

namespace
{
Expand Down Expand Up @@ -253,7 +254,7 @@ struct HfTaskMcValidationGen {
float centrality{105.f};
int occupancy = 0;
if (storeOccupancy) {
occupancy = o2::hf_occupancy::getOccupancyGenColl(recoCollisions, o2::hf_occupancy::OccupancyEstimator::Its);
occupancy = getOccupancyGenColl(recoCollisions, OccupancyEstimator::Its);
}
uint16_t rejectionMask{0};
if constexpr (centEstimator == CentralityEstimator::FT0C) {
Expand Down

0 comments on commit b76b7a7

Please sign in to comment.