Skip to content

Commit b76b7a7

Browse files
committed
removed redundant namespaces
1 parent c1b48c2 commit b76b7a7

File tree

7 files changed

+35
-31
lines changed

7 files changed

+35
-31
lines changed

PWGHF/Core/CentralityEstimation.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ float getCentralityColl(const Coll&)
115115

116116
/// Get the centrality
117117
/// \param collision is the collision with the centrality information
118+
/// \param centEstimator integer to select the centrality estimator
118119
/// \return collision centrality
119120
template <typename Coll>
120121
float getCentralityColl(const Coll& collision, int centEstimator)
@@ -150,7 +151,7 @@ float getCentralityColl(const Coll& collision, int centEstimator)
150151
}
151152
break;
152153
default:
153-
LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Fallback to V0A";
154+
LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Setting value to -999.";
154155
cent = -999.;
155156
break;
156157
}
@@ -177,6 +178,7 @@ float getCentralityGenColl(CCs const& collSlice)
177178

178179
/// \brief Function to get MC collision centrality
179180
/// \param collSlice collection of reconstructed collisions associated to a generated one
181+
/// \param centEstimator integer to select the centrality estimator
180182
/// \return generated MC collision centrality
181183
template <typename CCs>
182184
float getCentralityGenColl(CCs const& collSlice, int centEstimator)

PWGHF/D2H/Tasks/taskDplus.cxx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ using namespace o2::analysis;
3636
using namespace o2::framework;
3737
using namespace o2::framework::expressions;
3838
using namespace o2::hf_centrality;
39+
using namespace o2::hf_occupancy;
3940

40-
enum OccupancyEstimator { None = 0,
41-
ITS,
42-
FT0C };
4341

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

65-
using CollisionsCent = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As>;
66-
using McRecoCollisionsCent = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As>;
63+
using CollisionsCent = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>;
64+
using McRecoCollisionsCent = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0Ms, aod::CentFT0Cs>;
6765

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

@@ -451,10 +449,10 @@ struct HfTaskDplus {
451449
if (storeCentrality || storeOccupancy) {
452450
auto collision = candidate.template collision_as<CollisionsCent>();
453451
if (storeCentrality && centEstimator != CentralityEstimator::None) {
454-
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
452+
cent = getCentralityColl(collision, centEstimator);
455453
}
456454
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
457-
occ = o2::hf_occupancy::getOccupancyColl(collision);
455+
occ = getOccupancyColl(collision, occEstimator);
458456
}
459457
}
460458

@@ -497,15 +495,15 @@ struct HfTaskDplus {
497495
continue;
498496
}
499497
ptBhad = candidate.ptBhadMotherPart();
500-
flagBHad = o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart());
498+
flagBHad = getBHadMotherFlag(candidate.pdgBhadMotherPart());
501499

502500
if (storeCentrality || storeOccupancy) {
503501
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
504502
if (storeCentrality && centEstimator != CentralityEstimator::None) {
505-
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
503+
cent = getCentralityColl(collision, centEstimator);
506504
}
507505
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
508-
occ = o2::hf_occupancy::getOccupancyColl(collision);
506+
occ = getOccupancyColl(collision, occEstimator);
509507
}
510508
}
511509

@@ -522,10 +520,10 @@ struct HfTaskDplus {
522520
}
523521
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
524522
if (storeCentrality && centEstimator != CentralityEstimator::None) {
525-
cent = o2::hf_centrality::getCentralityColl(collision, centEstimator);
523+
cent = getCentralityColl(collision, centEstimator);
526524
}
527525
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
528-
occ = o2::hf_occupancy::getOccupancyColl(collision);
526+
occ = getOccupancyColl(collision, occEstimator);
529527
}
530528
fillHistoMCRec<false>(candidate);
531529
fillSparseML<true, false>(candidate, ptBhad, flagBHad, cent, occ);
@@ -552,10 +550,10 @@ struct HfTaskDplus {
552550
const auto recoCollsPerGenMcColl = mcRecoCollisions.sliceBy(recoColPerMcCollision, mcGenCollision.globalIndex());
553551
const auto mcParticlesPerGenMcColl = mcGenParticles.sliceBy(mcParticlesPerMcCollision, mcGenCollision.globalIndex());
554552
if (storeCentrality && centEstimator != CentralityEstimator::None) {
555-
cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerGenMcColl, centEstimator);
553+
cent = getCentralityGenColl(recoCollsPerGenMcColl, centEstimator);
556554
}
557555
if (storeOccupancy && occEstimator != OccupancyEstimator::None) {
558-
occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerGenMcColl);
556+
occ = getOccupancyGenColl(recoCollsPerGenMcColl, occEstimator);
559557
}
560558

561559
for (const auto& particle : mcParticlesPerGenMcColl) {
@@ -567,7 +565,7 @@ struct HfTaskDplus {
567565
}
568566
if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) {
569567
auto bHadMother = mcGenParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcGenParticles.offset());
570-
flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
568+
flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
571569
ptGenB = bHadMother.pt();
572570
}
573571
fillHistoMCGen(particle);

PWGHF/D2H/Tasks/taskDs.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,10 @@ struct HfTaskDs {
456456
if constexpr (isMc) {
457457
if (dataType == DataType::McDsNonPrompt) { // If data do not fill PV contributors in sparse
458458
if (storeOccupancy) {
459-
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));
459+
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));
460460
return;
461461
} else {
462-
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()));
462+
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()));
463463
return;
464464
}
465465
} else {
@@ -496,10 +496,10 @@ struct HfTaskDs {
496496
if constexpr (isMc) {
497497
if (dataType == DataType::McDsNonPrompt) { // If data do not fill PV contributors in sparse
498498
if (storeOccupancy) {
499-
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));
499+
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));
500500
return;
501501
} else {
502-
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()));
502+
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()));
503503
return;
504504
}
505505
} else {
@@ -710,7 +710,7 @@ struct HfTaskDs {
710710
std::get<TH1Ptr>(histosPtr[DataType::McDsNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT
711711
std::get<TH1Ptr>(histosPtr[DataType::McDsNonPrompt]["hEtaGen"])->Fill(particle.eta());
712712
auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset());
713-
int flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
713+
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
714714
float ptGenB = bHadMother.pt();
715715
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
716716
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);
@@ -736,7 +736,7 @@ struct HfTaskDs {
736736
std::get<TH1Ptr>(histosPtr[DataType::McDplusNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT
737737
std::get<TH1Ptr>(histosPtr[DataType::McDplusNonPrompt]["hEtaGen"])->Fill(particle.eta());
738738
auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset());
739-
int flagGenB = o2::analysis::getBHadMotherFlag(bHadMother.pdgCode());
739+
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
740740
float ptGenB = bHadMother.pt();
741741
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
742742
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);

PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using namespace o2::aod;
3737
using namespace o2::framework;
3838
using namespace o2::framework::expressions;
3939
using namespace o2::hf_centrality;
40+
using namespace o2::hf_occupancy;
4041
using namespace o2::hf_evsel;
4142

4243
enum DecayChannel { DplusToPiKPi = 0,
@@ -340,7 +341,7 @@ struct HfTaskFlowCharmHadrons {
340341
aod::BCsWithTimestamps const&,
341342
float& centrality)
342343
{
343-
float occupancy = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
344+
float occupancy = getOccupancyColl(collision, occEstimator);
344345
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, centEstimator, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
345346
centrality = o2::hf_centrality::getCentralityColl(collision, centEstimator);
346347

@@ -412,7 +413,7 @@ struct HfTaskFlowCharmHadrons {
412413
float occupancy = 0.;
413414
uint16_t hfevflag{};
414415
if (occEstimator != 0) {
415-
occupancy = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
416+
occupancy = getOccupancyColl(collision, occEstimator);
416417
registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange());
417418
hfevflag = hfEvSel.getHfCollisionRejectionMask<true, o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(collision, cent, ccdb, registry);
418419
}

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ using namespace o2::hf_evsel;
5656
using namespace o2::hf_trkcandsel;
5757
using namespace o2::aod::hf_cand_2prong;
5858
using namespace o2::hf_centrality;
59+
using namespace o2::hf_occupancy;
5960
using namespace o2::constants::physics;
6061
using namespace o2::framework;
6162
using namespace o2::aod::pid_tpc_tof_utils;
@@ -627,7 +628,7 @@ struct HfCandidateCreator2Prong {
627628

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

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

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

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

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

669670
/// monitor the satisfied event selections

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ using namespace o2::hf_evsel;
4444
using namespace o2::hf_trkcandsel;
4545
using namespace o2::aod::hf_cand_3prong;
4646
using namespace o2::hf_centrality;
47+
using namespace o2::hf_occupancy;
4748
using namespace o2::constants::physics;
4849
using namespace o2::framework;
4950
using namespace o2::framework::expressions;
@@ -405,7 +406,7 @@ struct HfCandidateCreator3Prong {
405406

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

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

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

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

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

447448
/// monitor the satisfied event selections

PWGHF/Tasks/taskMcValidation.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ using namespace o2::framework;
4444
using namespace o2::framework::expressions;
4545
using namespace o2::hf_evsel;
4646
using namespace o2::hf_centrality;
47+
using namespace o2::hf_occupancy;
4748

4849
namespace
4950
{
@@ -253,7 +254,7 @@ struct HfTaskMcValidationGen {
253254
float centrality{105.f};
254255
int occupancy = 0;
255256
if (storeOccupancy) {
256-
occupancy = o2::hf_occupancy::getOccupancyGenColl(recoCollisions, o2::hf_occupancy::OccupancyEstimator::Its);
257+
occupancy = getOccupancyGenColl(recoCollisions, OccupancyEstimator::Its);
257258
}
258259
uint16_t rejectionMask{0};
259260
if constexpr (centEstimator == CentralityEstimator::FT0C) {

0 commit comments

Comments
 (0)