diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index bad2b681d13..339088a311c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -45,10 +45,8 @@ #include "Math/Vector3D.h" #include -#include #include #include -#include #include #include @@ -56,6 +54,7 @@ #include #include #include +#include #include using namespace o2; @@ -471,15 +470,17 @@ struct sigma0builder { histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); - histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + if (doprocessPCMVsEMCalQA) { + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + } } else { for (const auto& histodir : DirList2) { @@ -491,6 +492,16 @@ struct sigma0builder { histos.add(histodir + "/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); histos.add(histodir + "/h2dShape", "h2dShape", kTH2D, {axisPt, axisClrShape}); } + + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); } histos.add("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); @@ -863,7 +874,8 @@ struct sigma0builder { info.DCADau = (cross.Mag2() > 0) ? std::abs(posdiff.Dot(cross)) / cross.R() : 999.f; info.CosPA = v01momentumNorm.Dot(v02momentumNorm); - if (d < 1e-5f) { // Parallel or nearly parallel lines + float Min_threshold = 1e-5f; // Threshold to consider lines as parallel, can be tuned + if (d < Min_threshold) { // Parallel or nearly parallel lines info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? return info; } @@ -1527,7 +1539,7 @@ struct sigma0builder { auto v0MC = v0.template v0MCCore_as>(); - float V0MCpT = RecoDecay::pt(array{v0MC.pxMC(), v0MC.pyMC()}); + float V0MCpT = RecoDecay::pt(std::array{v0MC.pxMC(), v0MC.pyMC()}); float V0PA = TMath::ACos(v0.v0cosPA()); bool fIsV0CorrectlyAssigned = (v0MC.straMCCollisionId() == v0MCCollision.globalIndex()); bool isPrimary = v0MC.isPhysicalPrimary(); @@ -1591,7 +1603,7 @@ struct sigma0builder { histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); // Checking decay modes and getting daughter pTs - for (auto& daughter : daughters) { + for (auto const& daughter : daughters) { histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); if (GenInfo.NDaughters == 2) { @@ -1606,13 +1618,13 @@ struct sigma0builder { if ((GenInfo.IsKStar) && genSelections.doQA) { histos.fill(HIST("GenQA/h2dKStarMCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dKStarNDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } if (GenInfo.IsPi0 && genSelections.doQA) { histos.fill(HIST("GenQA/h2dPi0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } } @@ -1722,7 +1734,7 @@ struct sigma0builder { template void genProcess(TMCParticles const& mcParticles) { - for (auto& mcParticle : mcParticles) { + for (auto const& mcParticle : mcParticles) { // Rapidity selection if ((mcParticle.y() < genSelections.mc_rapidityMin) || (mcParticle.y() > genSelections.mc_rapidityMax)) continue; @@ -1778,7 +1790,7 @@ struct sigma0builder { static constexpr std::string_view MainDir2[] = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; // calculate pT for cluster assuming they are photons (so no mass) - float gammapT = sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); + float gammapT = std::sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); histos.fill(HIST(MainDir2[mode]) + HIST("/hDefinition"), cluster.definition()); histos.fill(HIST(MainDir2[mode]) + HIST("/h2dNCells"), gammapT, cluster.nCells()); @@ -2388,7 +2400,7 @@ struct sigma0builder { bool buildEMCalSigma0(TV0Object const& lambda, TEMCalClsObject const& gamma, TCollision const& collision, TMCParticles const& mcparticles, std::vector const& emcaltracksmatched) { // calculate pT for cluster assuming they are photons (so no mass) - float gammapT = sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); + float gammapT = std::sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); // Momentum components float gammapx = gammapT * std::cos(gamma.phi()); @@ -2720,7 +2732,6 @@ struct sigma0builder { //_______________________________________________ // Photon-V0 nested loop - int nSigma0Candidates = 0; for (size_t i = 0; i < bestGammasArray.size(); ++i) { //_______________________________________________ @@ -2739,8 +2750,6 @@ struct sigma0builder { if (!buildPCMSigma0(lambda, gamma1, coll, mcparticles)) continue; } - - nSigma0Candidates++; } } @@ -2774,8 +2783,6 @@ struct sigma0builder { } } } - - LOGF(info, "N. photons: %i, N. lambdas: %i, expected pairs: %i, got: %i", bestGammasArray.size(), bestLambdasArray.size(), bestGammasArray.size() * bestLambdasArray.size(), nSigma0Candidates); } }