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
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Core/TaggingPi0MC.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
using MyV0Photons = o2::soa::Join<o2::aod::V0PhotonsKF, o2::aod::V0KFEMEventIds>;
using MyV0Photon = MyV0Photons::iterator;

using MyEMCClusters = o2::soa::Join<o2::aod::SkimEMCClusters, o2::aod::EMEMCClusterMCLabels, o2::aod::EMCEMEventIds>;
using MyEMCClusters = o2::soa::Join<o2::aod::SkimEMCClusters, o2::aod::EMEMCClusterMCLabels_001, o2::aod::EMCEMEventIds>;
using MyEMCCluster = MyEMCClusters::iterator;

// using MyPHOSClusters = o2::soa::Join<o2::aod::PHOSClusters, o2::aod::PHOSEMEventIds>;
Expand Down Expand Up @@ -423,7 +423,7 @@
weight = collision.weight();
}

if (eventcuts.onlyKeepWeightedEvents && std::fabs(weight - 1.f) < 1e-10) {

Check failure on line 426 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

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.
continue;
}

Expand Down Expand Up @@ -452,7 +452,7 @@

ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.f);
fRegistry.fill(HIST("Photon/candidate/hPt"), v_gamma.Pt(), weight);
fRegistry.fill(HIST("Photon/candidate/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight);

Check failure on line 455 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.

auto pos1 = g1.template posTrack_as<TSubInfos1>();
auto ele1 = g1.template negTrack_as<TSubInfos1>();
Expand All @@ -470,26 +470,26 @@

if (g1mc.isPhysicalPrimary() || g1mc.producedByGenerator()) {
fRegistry.fill(HIST("Photon/primary/hPt"), v_gamma.Pt(), weight);
fRegistry.fill(HIST("Photon/primary/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight);

Check failure on line 473 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
if (g1mc.has_mothers()) {
auto mp = g1mc.template mothers_first_as<TMCParticles>();
if (std::abs(mp.pdgCode()) == 111) {

Check failure on line 476 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

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.

Check failure on line 476 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

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.
fRegistry.fill(HIST("Photon/fromPi0/hPt"), v_gamma.Pt(), weight);
fRegistry.fill(HIST("Photon/fromPi0/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight);

Check failure on line 478 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}
}
} else if (o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as<TMCCollisions>(), g1mc, mcparticles) > 0) {
int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as<TMCCollisions>(), g1mc, mcparticles);
auto str_had = mcparticles.iteratorAt(motherid_strhad);
float weight = 1.f;
if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) {

Check failure on line 485 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

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.
weight = f1fd_k0s_to_pi0->Eval(str_had.pt());
}
fRegistry.fill(HIST("Photon/fromWD/hPt"), v_gamma.Pt(), weight * weight);
fRegistry.fill(HIST("Photon/fromWD/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight * weight);

Check failure on line 489 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
} else {
fRegistry.fill(HIST("Photon/fromHS/hPt"), v_gamma.Pt(), weight);
fRegistry.fill(HIST("Photon/fromHS/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight);

Check failure on line 492 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}

for (const auto& [pos2, ele2] : combinations(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS
Expand Down Expand Up @@ -528,7 +528,7 @@
int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(pi0mc.template emmcevent_as<TMCCollisions>(), pi0mc, mcparticles);
auto str_had = mcparticles.iteratorAt(motherid_strhad);
float weight = 1.f;
if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) {

Check failure on line 531 in PWGEM/PhotonMeson/Core/TaggingPi0MC.h

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.
weight = f1fd_k0s_to_pi0->Eval(str_had.pt());
}
fRegistry.fill(HIST("Pair/fromWD/hMvsPt"), veeg.M(), v_gamma.Pt(), weight * weight);
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCEMCEMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace o2::aod;
using namespace o2::framework;
using namespace o2::aod::pwgem::photonmeson::photonpair;

using MyEMCClusters = soa::Join<aod::MinClusters, aod::EMEMCClusterMCLabels, aod::EMCEMEventIds>;
using MyEMCClusters = soa::Join<aod::MinClusters, aod::EMEMCClusterMCLabels_001, aod::EMCEMEventIds>;

WorkflowSpec defineDataProcessing(ConfigContext const& context)
{
Expand Down
34 changes: 17 additions & 17 deletions PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct EmcalMcTask {

SliceCache cache;

using EMCalPhotons = soa::Join<aod::EMCEMEventIds, aod::MinClusters, aod::EMEMCClusterMCLabels>;
using EMCalPhotons = soa::Join<aod::EMCEMEventIds, aod::MinClusters, aod::EMEMCClusterMCLabels_001>;

using Colls = soa::Join<aod::PMEvents, aod::EMEventsAlias, aod::EMEventsMult_000, aod::EMEventsCent_000, aod::EMMCEventLabels, aod::EmMagFields>;

Expand Down Expand Up @@ -297,13 +297,13 @@ struct EmcalMcTask {

// One templated fill function instead of 9 copy-pasted blocks
template <const int type, o2::soa::is_iterator TCluster, o2::soa::is_iterator TMC>
void fillClusterHistos(HistogramRegistry& histRegistry, TCluster const& clu, TMC const& mcPart, float centOrMult)
void fillClusterHistos(TCluster const& cluster, TMC const& mcPart, float centOrMult)
{
static constexpr std::string_view subDir = kSubDirs[type];
static constexpr std::string_view SubDir = kSubDirs[type];

histRegistry.fill(HIST(subDir) + HIST("hM02"), clu.m02(), clu.e(), centOrMult);
histRegistry.fill(HIST(subDir) + HIST("hEtaRel"), clu.eta() - mcPart.eta(), clu.e(), centOrMult);
histRegistry.fill(HIST(subDir) + HIST("hPhiRel"), clu.phi() - mcPart.phi(), clu.e(), centOrMult);
registry.fill(HIST(SubDir) + HIST("hM02"), cluster.m02(), cluster.e(), centOrMult);
registry.fill(HIST(SubDir) + HIST("hEtaRel"), cluster.eta() - mcPart.eta(), cluster.e(), centOrMult);
registry.fill(HIST(SubDir) + HIST("hPhiRel"), cluster.phi() - mcPart.phi(), cluster.e(), centOrMult);
}

// PCM-EMCal same event
Expand Down Expand Up @@ -340,23 +340,23 @@ struct EmcalMcTask {
mcPhoton1.setCursor(photonEMC.emmcparticleIds()[0]);

if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kGamma) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPhoton>(registry, photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kElectron) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kElectron>(registry, photonEMC, mcPhoton1, centOrMult);
} else if (mcPhoton1.pdgCode() == -PDG_t::kElectron) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPositron>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPhoton>(photonEMC, mcPhoton1, centOrMult);
} else if (mcPhoton1.pdgCode() == PDG_t::kElectron) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kElectron>(photonEMC, mcPhoton1, centOrMult);
} else if (mcPhoton1.pdgCode() == PDG_t::kPositron) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPositron>(photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kPi0) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPi0>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPi0>(photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == o2::constants::physics::Pdg::kEta) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kEta>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kEta>(photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == o2::constants::physics::Pdg::kOmega) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kOmega>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kOmega>(photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kPiPlus) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPion>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kPion>(photonEMC, mcPhoton1, centOrMult);
} else if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kKPlus) {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kKaon>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kKaon>(photonEMC, mcPhoton1, centOrMult);
} else {
fillClusterHistos<o2::em::emcal::mc::ParticleType::kOther>(registry, photonEMC, mcPhoton1, centOrMult);
fillClusterHistos<o2::em::emcal::mc::ParticleType::kOther>(photonEMC, mcPhoton1, centOrMult);
}
} // for (const auto& photonEMC : photonsEMCPerCollision) {
}
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/Tasks/photonResoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct PhotonResoTask {

SliceCache cache;

using EMCalPhotons = soa::Join<aod::EMCEMEventIds, aod::MinClusters, aod::EMEMCClusterMCLabels>;
using EMCalPhotons = soa::Join<aod::EMCEMEventIds, aod::MinClusters, aod::EMEMCClusterMCLabels_001>;
using PcmPhotons = soa::Join<aod::V0PhotonsKF, aod::V0KFEMEventIds>;

using PcmMcLegs = soa::Join<aod::V0Legs, aod::V0LegMCLabels>;
Expand Down
Loading