Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Archita-Dash authored Jan 21, 2025
2 parents 83b62c4 + ee7cb93 commit f486659
Show file tree
Hide file tree
Showing 76 changed files with 8,621 additions and 1,396 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/PWGEM @alibuild @feisenhu @dsekihat @ivorobye
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano @zhangbiao-phy
# PWG-LF
/PWGLF @alibuild @njacazio @skundu692
/PWGLF/Tasks/GlobalEventProperties @alibuild @njacazio @skundu692 @gbencedi @omvazque
Expand Down
54 changes: 43 additions & 11 deletions Common/Core/RecoDecay.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,11 @@ struct RecoDecay {
}

/// Checks whether the reconstructed decay candidate is the expected decay.
/// \param checkProcess switch to accept only decay daughters by checking the production process of MC particles
/// \param acceptIncompleteReco switch to accept candidates with only part of the daughters reconstructed
/// \tparam acceptFlavourOscillation switch to accept flavour oscillastion (i.e. B0 -> B0bar -> D+pi-)
/// \tparam checkProcess switch to accept only decay daughters by checking the production process of MC particles
/// \tparam acceptIncompleteReco switch to accept candidates with only part of the daughters reconstructed
/// \tparam acceptTrackDecay switch to accept candidates with daughter tracks of pions and kaons which decayed
/// \tparam acceptTrackIntWithMaterial switch to accept candidates with final (i.e. p, K, pi) daughter tracks interacting with material
/// \param particlesMC table with MC particles
/// \param arrDaughters array of candidate daughters
/// \param PDGMother expected mother PDG code
Expand All @@ -680,8 +682,9 @@ struct RecoDecay {
/// \param depthMax maximum decay tree level to check; Daughters up to this level will be considered. If -1, all levels are considered.
/// \param nPiToMu number of pion prongs decayed to a muon
/// \param nKaToPi number of kaon prongs decayed to a pion
/// \param nInteractionsWithMaterial number of daughter particles that interacted with material
/// \return index of the mother particle if the mother and daughters are correct, -1 otherwise
template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, bool acceptTrackDecay = false, std::size_t N, typename T, typename U>
template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, bool acceptTrackDecay = false, bool acceptTrackIntWithMaterial = false, std::size_t N, typename T, typename U>
static int getMatchedMCRec(const T& particlesMC,
const std::array<U, N>& arrDaughters,
int PDGMother,
Expand All @@ -690,16 +693,18 @@ struct RecoDecay {
int8_t* sign = nullptr,
int depthMax = 1,
int8_t* nPiToMu = nullptr,
int8_t* nKaToPi = nullptr)
int8_t* nKaToPi = nullptr,
int8_t* nInteractionsWithMaterial = nullptr)
{
// Printf("MC Rec: Expected mother PDG: %d", PDGMother);
int8_t coefFlavourOscillation = 1; // 1 if no B0(s) flavour oscillation occured, -1 else
int8_t sgn = 0; // 1 if the expected mother is particle, -1 if antiparticle (w.r.t. PDGMother)
int8_t nPiToMuLocal = 0; // number of pion prongs decayed to a muon
int8_t nKaToPiLocal = 0; // number of kaon prongs decayed to a pion
int indexMother = -1; // index of the mother particle
std::vector<int> arrAllDaughtersIndex; // vector of indices of all daughters of the mother of the first provided daughter
std::array<int, N> arrDaughtersIndex; // array of indices of provided daughters
int8_t coefFlavourOscillation = 1; // 1 if no B0(s) flavour oscillation occured, -1 else
int8_t sgn = 0; // 1 if the expected mother is particle, -1 if antiparticle (w.r.t. PDGMother)
int8_t nPiToMuLocal = 0; // number of pion prongs decayed to a muon
int8_t nKaToPiLocal = 0; // number of kaon prongs decayed to a pion
int8_t nInteractionsWithMaterialLocal = 0; // number of interactions with material
int indexMother = -1; // index of the mother particle
std::vector<int> arrAllDaughtersIndex; // vector of indices of all daughters of the mother of the first provided daughter
std::array<int, N> arrDaughtersIndex; // array of indices of provided daughters
if (sign) {
*sign = sgn;
}
Expand Down Expand Up @@ -737,6 +742,28 @@ struct RecoDecay {
particleI = motherI;
}
}
if constexpr (acceptTrackIntWithMaterial) {
// Replace the MC particle associated with the prong by its mother for part → part due to material interactions.
// It keeps looking at the mother iteratively, until it finds a particle from decay or primary
auto process = particleI.getProcess();
auto pdgI = std::abs(particleI.pdgCode());
auto pdgMotherI = std::abs(particleI.pdgCode());
while (process != TMCProcess::kPDecay && process != TMCProcess::kPPrimary && pdgI == pdgMotherI) {
if (!particleI.has_mothers()) {
break;
}
auto motherI = particleI.template mothers_first_as<T>();
pdgI = std::abs(particleI.pdgCode());
pdgMotherI = std::abs(motherI.pdgCode());
if (pdgI == pdgMotherI) {
particleI = motherI;
process = particleI.getProcess();
if (process == TMCProcess::kPDecay || process == TMCProcess::kPPrimary) { // we found the original daughter that interacted with material
nInteractionsWithMaterialLocal++;
}
}
}
}
arrDaughtersIndex[iProng] = particleI.globalIndex();
// Get the list of daughter indices from the mother of the first prong.
if (iProng == 0) {
Expand Down Expand Up @@ -817,6 +844,11 @@ struct RecoDecay {
*nKaToPi = nKaToPiLocal;
}
}
if constexpr (acceptTrackIntWithMaterial) {
if (nInteractionsWithMaterial) {
*nInteractionsWithMaterial = nInteractionsWithMaterialLocal;
}
}
return indexMother;
}

Expand Down
120 changes: 70 additions & 50 deletions Common/Tasks/flowTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,70 +150,90 @@ struct flowTest {

using LabeledCascades = soa::Join<aod::CascDataExt, aod::McCascLabels>;

void processCascade(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledCascades> const& cascades, recoTracks const&, aod::McCollisions const&)
void processCascade(aod::McParticles const& mcParticles, LabeledCascades const& cascades, recoTracks const&, aod::McCollisions const&)
{
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();
std::vector<bool> isRecoed;
isRecoed.resize(mcParticles.size(), false);
for (auto const& cascade : cascades) {
if (cascade.has_mcParticle()) {
isRecoed[cascade.mcParticleId()] = true;
}
}

for (auto const& mcParticle : mcParticles) {
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 3312 && pdgCode != 3334)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());

if (cascades.size() > 0) {
int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 3312 && pdgCode != 3334)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());

if (isRecoed[mcParticle.globalIndex()]) {
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
}
}
}
PROCESS_SWITCH(flowTest, processCascade, "Process cascades", true);

using LabeledV0s = soa::Join<aod::V0Datas, aod::McV0Labels>;

void processV0s(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledV0s> const& v0s, recoTracks const&, aod::McCollisions const&)
void processV0s(aod::McParticles const& mcParticles, LabeledV0s const& v0s, recoTracks const&, aod::McCollisions const&)
{
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();
std::vector<bool> isRecoed;
isRecoed.resize(mcParticles.size(), false);
for (auto const& v0 : v0s) {
if (v0.has_mcParticle()) {
isRecoed[v0.mcParticleId()] = true;
}
}

for (auto const& mcParticle : mcParticles) {
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 310 && pdgCode != 3122)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());

if (v0s.size() > 0) {
int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 310 && pdgCode != 3122)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());

if (isRecoed[mcParticle.globalIndex()]) {
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
}
}
}
PROCESS_SWITCH(flowTest, processV0s, "Process V0s", true);
Expand Down
20 changes: 10 additions & 10 deletions DPG/Tasks/AOTTrack/PID/HMPID/qaHMPID.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ struct pidHmpidQa {

histos.fill(HIST("hmpidSignal"), t.hmpidSignal());
histos.fill(HIST("PhivsEta"), t.track_as<TrackCandidates>().eta(), t.track_as<TrackCandidates>().phi());
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), abs(t.hmpidMom()));
histos.fill(HIST("hmpidCkovvsMom"), abs(t.hmpidMom()), t.hmpidSignal());
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), std::abs(t.hmpidMom()));
histos.fill(HIST("hmpidCkovvsMom"), std::abs(t.hmpidMom()), t.hmpidSignal());
histos.fill(HIST("hmpidXTrack"), t.hmpidXTrack());
histos.fill(HIST("hmpidYTrack"), t.hmpidYTrack());
histos.fill(HIST("hmpidXMip"), t.hmpidXMip());
Expand All @@ -173,7 +173,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge"), t.hmpidPhotsCharge()[i]);
Expand All @@ -190,7 +190,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip0"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize0"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom0"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom0"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom0"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge0"), t.hmpidPhotsCharge()[i]);
Expand All @@ -208,7 +208,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip1"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize1"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom1"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom1"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom1"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge1"), t.hmpidPhotsCharge()[i]);
Expand All @@ -226,7 +226,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip2"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize2"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom2"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom2"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom2"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge2"), t.hmpidPhotsCharge()[i]);
Expand All @@ -244,7 +244,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip3"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize3"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom3"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom3"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom3"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge3"), t.hmpidPhotsCharge()[i]);
Expand All @@ -262,7 +262,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip4"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize4"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom4"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom4"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom4"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge4"), t.hmpidPhotsCharge()[i]);
Expand All @@ -280,7 +280,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip5"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize5"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom5"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom5"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom5"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge5"), t.hmpidPhotsCharge()[i]);
Expand All @@ -298,7 +298,7 @@ struct pidHmpidQa {
histos.fill(HIST("hmpidQMip6"), t.hmpidQMip());
histos.fill(HIST("hmpidClusSize6"), (t.hmpidClusSize() % 1000000) / 1000);
histos.fill(HIST("TrackMom6"), t.track_as<TrackCandidates>().p());
histos.fill(HIST("hmpidMom6"), abs(t.hmpidMom()));
histos.fill(HIST("hmpidMom6"), std::abs(t.hmpidMom()));
for (int i = 0; i < 10; i++) {
if (t.hmpidPhotsCharge()[i] > 0)
histos.fill(HIST("hmpidPhotsCharge6"), t.hmpidPhotsCharge()[i]);
Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ struct tofPidBetaQa {

histos.fill(HIST("event/evsel"), 2);

if (abs(collision.posZ()) > 10.f) {
if (std::abs(collision.posZ()) > 10.f) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ struct tpcPidQa {
histos.fill(HIST("event/evsel"), 2);
}

if (abs(collision.posZ()) > 10.f) {
if (std::abs(collision.posZ()) > 10.f) {
return false;
}
if constexpr (fillHistograms) {
Expand Down Expand Up @@ -396,7 +396,7 @@ struct tpcPidQa {
}

if (applyRapidityCut) {
if (abs(t.rapidity(PID::getMass(id))) > 0.5) {
if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) {
continue;
}
}
Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct tpcPidQaSignal {
if (!t.has_collision()) {
continue;
}
if (abs(t.collision().posZ()) > 10.f) {
if (std::abs(t.collision().posZ()) > 10.f) {
continue;
}
if (!isTrackSelected(t)) {
Expand Down Expand Up @@ -269,7 +269,7 @@ struct tpcPidQaSignal {

histos.fill(HIST("event/evsel"), 2);

if (abs(collision.posZ()) > 10.f) {
if (std::abs(collision.posZ()) > 10.f) {
return;
}
histos.fill(HIST("event/evsel"), 3);
Expand Down
6 changes: 4 additions & 2 deletions DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <string>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
Expand Down Expand Up @@ -291,10 +293,10 @@ struct perfK0sResolution {
if (!ntrack.hasTPC() || !ptrack.hasTPC()) {
return false;
}
if (abs(ntrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
if (std::abs(ntrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
return false;
}
if (abs(ptrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
if (std::abs(ptrack.tpcNSigmaPi()) > nMaxTPCNsigma) {
return false;
}
if (ntrack.tpcNClsCrossedRows() < extraCutTPCClusters || ptrack.tpcNClsCrossedRows() < extraCutTPCClusters) {
Expand Down
Loading

0 comments on commit f486659

Please sign in to comment.