Skip to content
Closed
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
26 changes: 19 additions & 7 deletions PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@
#ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEANGULARCONTAINER_H_
#define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEANGULARCONTAINER_H_

#include <fairlogger/Logger.h>
#include <vector>
#include <string>
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h"

#include "Framework/HistogramRegistry.h"
#include "Common/Core/RecoDecay.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h"

#include "Framework/HistogramRegistry.h"

#include "Math/Vector4D.h"
#include "TMath.h"
#include "TDatabasePDG.h"

Check failure on line 30 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include "TMath.h"

#include <fairlogger/Logger.h>

#include <string>
#include <vector>

using namespace o2::framework;

Check failure on line 38 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

namespace o2::analysis::femto_universe
{
Expand Down Expand Up @@ -78,6 +81,9 @@
if (use3dplots) {
// use 3d plots
}
if (DoContainer) {
mHistogramRegistry->add((folderName + "/CorrelationContainer").c_str(), "; #Delta#varphi (rad); #Delta#eta; Inv Mass; #p_{1T}; #p_{2T}", kTHnF, {phiAxis, etaAxis, minvAxis, pT1Axis, pT2Axis});
}
}

/// Initializes specialized Monte Carlo truth histograms for the task
Expand All @@ -103,8 +109,9 @@
/// \param phiBins phi binning for the histograms
/// \param isMC add Monte Carlo truth histograms to the output file
template <typename T, typename P>
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots)
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots, bool doContainer = false)
{
DoContainer = doContainer;
mHistogramRegistry = registry;
std::string femtoObs;
if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) {
Expand All @@ -125,6 +132,7 @@
mPhiHigh = o2::constants::math::TwoPI + (-static_cast<int>(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins;
framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh};
framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0};
// for the container

std::string folderName = static_cast<std::string>(FolderSuffix[EventType]) + static_cast<std::string>(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]);

Expand All @@ -141,8 +149,8 @@
/// \param pdg2 PDG code of particle two
void setPDGCodes(const int pdg1, const int pdg2)
{
mMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass();

Check failure on line 152 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
mMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass();

Check failure on line 153 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
mPDGOne = pdg1;
mPDGTwo = pdg2;
}
Expand All @@ -161,10 +169,10 @@
deltaPhi = part1.phi() - part2.phi();

while (deltaPhi < mPhiLow) {
deltaPhi += o2::constants::math::TwoPI;

Check failure on line 172 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.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.
}
while (deltaPhi > mPhiHigh) {
deltaPhi -= o2::constants::math::TwoPI;

Check failure on line 175 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.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.
}

mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight);
Expand Down Expand Up @@ -241,6 +249,10 @@
double mPhiHigh;
double deltaEta;
double deltaPhi;
framework::AxisSpec minvAxis = {100, 0.9, 1.05}; ///< Axis for invariant mass
framework::AxisSpec pT1Axis = {100, 0.0, 5.0}; ///< Axis for pT of particle 1
framework::AxisSpec pT2Axis = {100, 0.0, 5.0}; ///< Axis for pT of particle 2
bool DoContainer = false; ///< Flag to indicate if the container is used

Check failure on line 255 in PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
};

} // namespace o2::analysis::femto_universe
Expand Down
13 changes: 12 additions & 1 deletion PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <string>
#include <vector>

using namespace o2::framework;

Check failure on line 39 in PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

namespace o2::analysis::femto_universe
{
Expand Down Expand Up @@ -92,6 +92,9 @@
if (use3dplots) {
mHistogramRegistry->add((folderName + "/relPairkstarmTMult").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2}); Multiplicity").c_str(), kTH3F, {femtoObsAxis, mTAxis3D, multAxis3D});
}
if (DoContainer) {
mHistogramRegistry->add((folderName + "/CorrelationContainer").c_str(), "; #Delta#varphi (rad); #Delta#eta; Inv Mass; #p_{1T}; #p_{2T}", kTHnF, {phiAxis, etaAxis, minvAxis, pT1Axis, pT2Axis});
}
}

/// Initializes specialized Monte Carlo truth histograms for the task
Expand Down Expand Up @@ -123,8 +126,9 @@
/// \param phiBins phi binning for the histograms
/// \param isMC add Monte Carlo truth histograms to the output file
template <typename T, typename P>
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots)
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots, bool doContainer = false)
{
DoContainer = doContainer;
mHistogramRegistry = registry;
std::string femtoObs;
if constexpr (FemtoObs == femto_universe_container::Observable::kstar) {
Expand Down Expand Up @@ -180,10 +184,10 @@
deltaPhi = part1.phi() - part2.phi();

while (deltaPhi < mPhiLow) {
deltaPhi += o2::constants::math::TwoPI;

Check failure on line 187 in PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.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.
}
while (deltaPhi > mPhiHigh) {
deltaPhi -= o2::constants::math::TwoPI;

Check failure on line 190 in PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.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.
}

mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs, weight);
Expand All @@ -200,6 +204,9 @@
if (use3dplots) {
mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult, weight);
}
if (DoContainer) {
mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/CorrelationContainer"), deltaPhi, deltaEta, FemtoUniverseMath::getMinv(part1, mMassOne, part2, mMassTwo), part1.pt(), part2.pt(), weight);
}
}

/// Called by setPair only in case of Monte Carlo truth
Expand Down Expand Up @@ -285,6 +292,10 @@
double mPhiHigh;
double deltaEta;
double deltaPhi;
framework::AxisSpec minvAxis = {100, 0.9, 1.05}; ///< Axis for invariant mass
framework::AxisSpec pT1Axis = {100, 0.0, 5.0}; ///< Axis for pT of particle 1
framework::AxisSpec pT2Axis = {100, 0.0, 5.0}; ///< Axis for pT of particle 2
bool DoContainer = false; ///< Flag to indicate if the container is used
};

} // namespace o2::analysis::femto_universe
Expand Down
110 changes: 63 additions & 47 deletions PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,31 @@
/// \author Anton Riedel, TU München, anton.riedel@tum.de
/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch

#include <vector>
#include <string>
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCorrection.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/PID.h"

#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCalculator.h"
#include <TFile.h>
#include <TH1.h>

#include <string>
#include <vector>

using namespace o2;
using namespace o2::analysis::femto_universe;
using namespace o2::analysis::femto_universe::efficiency;
using namespace o2::analysis::femto_universe::efficiency_correction;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;
Expand Down Expand Up @@ -94,6 +96,7 @@ struct FemtoUniversePairTaskTrackPhi {
Configurable<bool> ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"};
Configurable<int> ConfBinsPhi{"ConfBinsPhi", 29, "Number of phi bins in deta dphi"};
Configurable<int> ConfBinsEta{"ConfBinsEta", 29, "Number of eta bins in deta dphi"};
Configurable<bool> ConfDoContainer{"ConfDoContainer", true, "Enable correlation containers"};

/// Particle 1 --- IDENTIFIED TRACK
Configurable<int> ConfTrackPDGCode{"ConfTrackPDGCode", 2212, "Particle 2 - PDG code"};
Expand Down Expand Up @@ -187,8 +190,10 @@ struct FemtoUniversePairTaskTrackPhi {

ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{ConfBinsVtx, ConfBinsMult}, true};

EfficiencyConfigurableGroup effConfGroup;
EfficiencyCalculator<TH1> efficiencyCalculator{&effConfGroup};
HistogramRegistry effCorrRegistry{"EfficiencyCorrection", {}, OutputObjHandlingPolicy::AnalysisObject};

EffCorConfigurableGroup effCorConfGroup;
EfficiencyCorrection effCorrection{&effCorConfGroup};

float weight = 1;

Expand Down Expand Up @@ -372,6 +377,12 @@ struct FemtoUniversePairTaskTrackPhi {
}
}

/// @returns 1 if positive, -1 if negative, 0 if zero
auto sign(auto number) -> int8_t
{
return (number > 0) - (number < 0);
}

void init(InitContext&)
{
if (ConfIsMC) {
Expand All @@ -383,7 +394,14 @@ struct FemtoUniversePairTaskTrackPhi {
registryMCpT.add("MCReco/C_p_pT", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}});
registryMCpT.add("MCReco/NC_p_pT", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}});
}
efficiencyCalculator.init();

effCorrection.init(
&effCorrRegistry,
{
static_cast<framework::AxisSpec>(ConfBinsTempFitVarpT),
{ConfBinsEta, -1, 1},
ConfBinsMult,
});

eventHisto.init(&qaRegistry);
qaRegistry.add("PhiDaugh_pos/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}});
Expand Down Expand Up @@ -455,8 +473,8 @@ struct FemtoUniversePairTaskTrackPhi {
mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}});
mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}});

sameEventCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBinsEta, ConfBinsPhi, ConfIsMC, ConfUse3D);
mixedEventCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBinsEta, ConfBinsPhi, ConfIsMC, ConfUse3D);
sameEventCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBinsEta, ConfBinsPhi, ConfIsMC, ConfUse3D, ConfDoContainer);
mixedEventCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBinsEta, ConfBinsPhi, ConfIsMC, ConfUse3D, ConfDoContainer);

sameEventCont.setPDGCodes(333, ConfTrackPDGCode);
mixedEventCont.setPDGCodes(333, ConfTrackPDGCode);
Expand All @@ -467,7 +485,7 @@ struct FemtoUniversePairTaskTrackPhi {
}
}

template <typename PartitionType, typename PartType, typename MCParticles = std::nullptr_t>
template <bool isMC, typename PartitionType, typename PartType, typename MCParticles = std::nullptr_t>
void doSameEvent(PartitionType groupPartsTrack, PartitionType groupPartsPhi, PartType parts, float magFieldTesla, int multCol, [[maybe_unused]] MCParticles mcParts = nullptr)
{
for (auto const& phicandidate : groupPartsPhi) {
Expand All @@ -493,6 +511,10 @@ struct FemtoUniversePairTaskTrackPhi {
qaRegistry.fill(HIST("PhiDaugh_neg/hDCAxy"), negChild.p(), negChild.tempFitVar());

trackHistoPartPhi.fillQA<false, false>(phicandidate);
if constexpr (isMC) {
// reco
effCorrection.fillRecoHist<ParticleNo::ONE, FilteredFDCollisions>(phicandidate, 333);
}
}

for (auto const& track : groupPartsTrack) {
Expand Down Expand Up @@ -529,6 +551,10 @@ struct FemtoUniversePairTaskTrackPhi {
qaRegistry.fill(HIST("Hadron_neg/nSigmaTOFPr"), track.p(), tofNSigmaPr);
}
trackHistoPartTrack.fillQA<false, false>(track);

if constexpr (isMC) {
effCorrection.fillRecoHist<ParticleNo::TWO, FilteredFDCollisions>(track, ConfTrackPDGCode);
}
}

/// Now build the combinations
Expand Down Expand Up @@ -556,13 +582,8 @@ struct FemtoUniversePairTaskTrackPhi {
if (!pairCleaner.isCleanPair(track, phicandidate, parts)) {
continue;
}

weight = efficiencyCalculator.getWeight(ParticleNo::ONE, phicandidate.pt()) * efficiencyCalculator.getWeight(ParticleNo::TWO, track.pt());

if constexpr (std::is_same<PartType, FemtoRecoParticles>::value)
sameEventCont.setPair<true>(track, phicandidate, multCol, ConfUse3D, weight);
else
sameEventCont.setPair<false>(track, phicandidate, multCol, ConfUse3D, weight);
weight = effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::ONE, phicandidate) * effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::TWO, track);
sameEventCont.setPair<isMC>(track, phicandidate, multCol, ConfUse3D, weight);
}

// // Used for better fitting of invariant mass background.
Expand Down Expand Up @@ -592,7 +613,7 @@ struct FemtoUniversePairTaskTrackPhi {
// }
}

template <typename PartitionType, typename PartType, typename MCParticles = std::nullptr_t>
template <bool isMC, typename PartitionType, typename PartType, typename MCParticles = std::nullptr_t>
void doMixedEvent(PartitionType groupPartsTrack, PartitionType groupPartsPhi, PartType parts, float magFieldTesla, int multCol, [[maybe_unused]] MCParticles mcParts = nullptr)
{
for (auto const& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) {
Expand All @@ -612,31 +633,23 @@ struct FemtoUniversePairTaskTrackPhi {
continue;
}
}

weight = efficiencyCalculator.getWeight(ParticleNo::ONE, phicandidate.pt()) * efficiencyCalculator.getWeight(ParticleNo::TWO, track.pt());

if constexpr (std::is_same<PartType, FemtoRecoParticles>::value)
mixedEventCont.setPair<true>(track, phicandidate, multCol, ConfUse3D, weight);
else
mixedEventCont.setPair<false>(track, phicandidate, multCol, ConfUse3D, weight);
weight = effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::ONE, phicandidate) * effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::TWO, track);
mixedEventCont.setPair<isMC>(track, phicandidate, multCol, ConfUse3D, weight);
}
}

void processSameEvent(FilteredFDCollision const& col, FilteredFemtoFullParticles const& parts)
{
auto thegroupPartsTrack = partsTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
auto thegroupPartsPhi = partsPhi->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
// auto thegroupPartsPhiDaugh = partsPhiDaugh->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
// auto thegroupPartsKaons = partsKaons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
eventHisto.fillQA(col);
doSameEvent(thegroupPartsTrack, thegroupPartsPhi, parts, col.magField(), col.multNtr());
doSameEvent<false>(thegroupPartsTrack, thegroupPartsPhi, parts, col.magField(), col.multNtr());
}
PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processSameEvent, "Enable processing same event", true);

void processMixedEvent(FilteredFDCollisions const& cols, FilteredFemtoFullParticles const& parts)
{
for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) {

const int multiplicityCol = collision1.multNtr();
mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol}));

Expand All @@ -650,20 +663,19 @@ struct FemtoUniversePairTaskTrackPhi {
continue;
}

doMixedEvent(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol);
doMixedEvent<false>(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol);
}
}
PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMixedEvent, "Enable processing mixed events", true);

///--------------------------------------------MC-------------------------------------------------///
void processSameEventMCReco(FilteredFDCollision const& col, FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts)
{
eventHisto.fillQA(col);
// Reco
auto thegroupPartsTrack = partsTrackMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
auto thegroupPartsPhi = partsPhiMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
// auto thegroupPartsPhiDaugh = partsPhiDaugh->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
// auto thegroupPartsKaons = partsKaons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
eventHisto.fillQA(col);
doSameEvent(thegroupPartsTrack, thegroupPartsPhi, parts, col.magField(), col.multNtr(), mcparts);
doSameEvent<true>(thegroupPartsTrack, thegroupPartsPhi, parts, col.magField(), col.multNtr(), mcparts);
}
PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processSameEventMCReco, "Enable processing same event for MC Reco", true);

Expand All @@ -684,7 +696,7 @@ struct FemtoUniversePairTaskTrackPhi {
auto groupPartsTrack = partsTrackMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
auto groupPartsPhi = partsPhiMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);

doMixedEvent(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol, mcparts);
doMixedEvent<true>(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol, mcparts);
}
}
PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMixedEventMCReco, "Enable processing mixed events for MC Reco", false);
Expand All @@ -702,6 +714,10 @@ struct FemtoUniversePairTaskTrackPhi {
continue;
}

if (pdgCode == ConfTrackPDGCode) {
effCorrection.fillTruthHist<ParticleNo::TWO, FilteredFDCollisions>(part);
}

// charge +
if (pdgParticle->Charge() > 0.0) {
registryMCtruth.fill(HIST("MCtruthAllPositivePt"), part.pt());
Expand All @@ -719,6 +735,7 @@ struct FemtoUniversePairTaskTrackPhi {
if (pdgCode == 333) {
registryMCtruth.fill(HIST("MCtruthPhi"), part.pt(), part.eta());
registryMCtruth.fill(HIST("MCtruthPhiPt"), part.pt());
effCorrection.fillTruthHist<ParticleNo::ONE, FilteredFDCollisions>(part);
continue;
}

Expand Down Expand Up @@ -750,12 +767,12 @@ struct FemtoUniversePairTaskTrackPhi {

if (mcpart.pdgMCTruth() == ConfTrackPDGCode && (part.pt() > ConfTrackPtLow) && (part.pt() < ConfTrackPtHigh) && isParticleNSigmaAccepted(part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) {
registryMCpT.fill(HIST("MCReco/NC_p_pT"), part.pt());
float weightTrack = efficiencyCalculator.getWeight(ParticleNo::TWO, part.pt());
float weightTrack = effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::TWO, part);
registryMCpT.fill(HIST("MCReco/C_p_pT"), part.pt(), weightTrack);
}
if ((mcpart.pdgMCTruth() == 333) && (part.partType() == aod::femtouniverseparticle::ParticleType::kPhi) && (part.pt() > ConfPhiPtLow) && (part.pt() < ConfPhiPtHigh)) {
registryMCpT.fill(HIST("MCReco/NC_phi_pT"), part.pt());
float weightPhi = efficiencyCalculator.getWeight(ParticleNo::ONE, part.pt());
float weightPhi = effCorrection.getWeight<FilteredFDCollisions>(ParticleNo::ONE, part);
registryMCpT.fill(HIST("MCReco/C_phi_pT"), part.pt(), weightPhi);
}

Expand All @@ -778,7 +795,6 @@ struct FemtoUniversePairTaskTrackPhi {
registryMCreco.fill(HIST("MCrecoPnegPt"), mcpart.pt());
}
}

} // partType kTrack
}
}
Expand Down
Loading