Skip to content

Commit 5f98692

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 2388d3a + 9ec7555 commit 5f98692

4 files changed

Lines changed: 380 additions & 148 deletions

File tree

PWGCF/EbyEFluctuations/Tasks/MeanptFluctuations.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <TH2F.h>
3535
#include <THn.h>
3636
#include <TList.h>
37-
#include <TLorentzVector.h>
3837
#include <TMath.h>
3938
#include <TObjArray.h>
4039
#include <TPDGCode.h>
@@ -72,6 +71,7 @@ struct MeanptFluctuationsAnalysis {
7271
Configurable<int> cfgITScluster{"cfgITScluster", 1, "Minimum Number of ITS cluster"};
7372
Configurable<int> cfgTPCcluster{"cfgTPCcluster", 80, "Minimum Number of TPC cluster"};
7473
Configurable<int> cfgTPCnCrossedRows{"cfgTPCnCrossedRows", 70, "Minimum Number of TPC crossed-rows"};
74+
Configurable<float> cfgTPCnCrossedRowsOverFindableCls{"cfgTPCnCrossedRowsOverFindableCls", 0.8, "Minimum ratio of crossed rows over findable clusters TPC"};
7575
ConfigurableAxis nchAxis{"nchAxis", {500, 0.5, 500.5}, "Axis for multiplicity of GlobalTracks/PVTracks"};
7676
ConfigurableAxis nchAxis2{"nchAxis2", {1000, 0.5, 30000.5}, "Axis for multiplicity of FT0A/FT0C/FV0A"};
7777
ConfigurableAxis nchAxis3{"nchAxis3", {1000, 0.5, 100000.5}, "Axis for multiplicity of FT0A/FT0C/FV0A"};
@@ -126,6 +126,7 @@ struct MeanptFluctuationsAnalysis {
126126

127127
O2_DEFINE_CONFIGURABLE(cfgUse22sEventCut, bool, true, "Use 22s event cut on mult correlations")
128128
O2_DEFINE_CONFIGURABLE(cfgUseSmallIonAdditionalEventCut, bool, true, "Use additional event cut on mult correlations for small ions")
129+
O2_DEFINE_CONFIGURABLE(cfgUseSmallIonAdditionalEventCutInMC, bool, false, "Use additional event cut on mult correlations for small ions while using MC generated")
129130

130131
// Filter command***********
131132
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
@@ -177,6 +178,8 @@ struct MeanptFluctuationsAnalysis {
177178
histos.add("hCentrality", ";centrality (%)", kTH1F, {{90, 0, 90}});
178179
histos.add("hDcaXY", ";#it{dca}_{XY}", kTH1F, {{1000, -5, 5}});
179180
histos.add("hDcaZ", ";#it{dca}_{Z}", kTH1F, {{1000, -5, 5}});
181+
histos.add("his2DdcaXYvsPt", "", {HistType::kTH2D, {ptAxis, {1000, -1, 1}}});
182+
histos.add("his2DdcaZvsPt", "", {HistType::kTH2D, {ptAxis, {1000, -1, 1}}});
180183
histos.add("hMeanPt", "", kTProfile, {centAxis});
181184
histos.add("Hist2D_globalTracks_PVTracks", "", {HistType::kTH2D, {nchAxis, nchAxis}});
182185
histos.add("Hist2D_cent_nch", "", {HistType::kTH2D, {nchAxis, centAxis}});
@@ -417,7 +420,7 @@ struct MeanptFluctuationsAnalysis {
417420
histos.fill(HIST("MultCorrelationPlots/AfterSelection/His2D_V0ATracks_T0CTracks_afterSel"), coll.multFT0C(), coll.multFV0A());
418421
}
419422

420-
void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
423+
void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions, MyMCTracks const& tracks)
421424
{
422425
histos.fill(HIST("MCGenerated/hMC"), 0.5);
423426
if (std::abs(mcCollision.posZ()) < cfgCutVertex) {
@@ -458,7 +461,7 @@ struct MeanptFluctuationsAnalysis {
458461
if (cfgEvSelUseGoodZvtxFT0vsPV && !(collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) {
459462
continue;
460463
}
461-
if (cfgUseSmallIonAdditionalEventCut && !eventSelectedSmallion(collision, mcParticles.size(), cent)) {
464+
if (cfgUseSmallIonAdditionalEventCutInMC && !eventSelectedSmallion(collision, tracks.size(), cent)) {
462465
continue;
463466
}
464467

@@ -568,6 +571,7 @@ struct MeanptFluctuationsAnalysis {
568571
fillMultCorrPlotsAfterSel(collision, tracks);
569572
}
570573

574+
histos.fill(HIST("MCGenerated/hMC"), 5.5);
571575
histos.fill(HIST("hZvtx_after_sel"), collision.posZ());
572576

573577
double cent = 0.0;
@@ -616,7 +620,7 @@ struct MeanptFluctuationsAnalysis {
616620
if (!track.isPVContributor()) {
617621
continue;
618622
}
619-
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) {
623+
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows) || !(track.tpcCrossedRowsOverFindableCls() >= cfgTPCnCrossedRowsOverFindableCls)) {
620624
continue;
621625
}
622626

@@ -628,6 +632,8 @@ struct MeanptFluctuationsAnalysis {
628632
histos.fill(HIST("hPhi"), track.phi());
629633
histos.fill(HIST("hDcaXY"), track.dcaXY());
630634
histos.fill(HIST("hDcaZ"), track.dcaZ());
635+
histos.fill(HIST("his2DdcaXYvsPt"), track.pt(), track.dcaXY());
636+
histos.fill(HIST("his2DdcaZvsPt"), track.pt(), track.dcaZ());
631637
histos.fill(HIST("MCGenerated/hPtParticleVsTrack"), particle.pt(), track.pt());
632638
histos.fill(HIST("MCGenerated/hEtaParticleVsTrack"), particle.eta(), track.eta());
633639
histos.fill(HIST("MCGenerated/hPhiParticleVsTrack"), particle.phi(), track.phi());
@@ -737,7 +743,7 @@ struct MeanptFluctuationsAnalysis {
737743
continue;
738744
}
739745

740-
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) {
746+
if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows) || !(track.tpcCrossedRowsOverFindableCls() >= cfgTPCnCrossedRowsOverFindableCls)) {
741747
continue;
742748
}
743749

@@ -747,6 +753,8 @@ struct MeanptFluctuationsAnalysis {
747753
histos.fill(HIST("hPhi"), track.phi());
748754
histos.fill(HIST("hDcaXY"), track.dcaXY());
749755
histos.fill(HIST("hDcaZ"), track.dcaZ());
756+
histos.fill(HIST("his2DdcaXYvsPt"), track.pt(), track.dcaXY());
757+
histos.fill(HIST("his2DdcaZvsPt"), track.pt(), track.dcaZ());
750758

751759
pTsum += track.pt();
752760
nN += 1.0;

PWGHF/D2H/Tasks/taskDs.cxx

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,32 @@ DECLARE_SOA_COLUMN(Pt, pt, float); //!
101101
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of D-meson candidates (GeV/c)
102102
DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Centrality of collision
103103
DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float); //! Impact parameter of D-meson candidate
104+
DECLARE_SOA_COLUMN(ImpactParameterMc, impactParameterMc, float); //! Generated impact parameter of D-meson candidate
104105
DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of D-meson candidate
105106
DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of D-meson candidate
106107
DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of D-meson candidate
107108
DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of D-meson candidate
108109
DECLARE_SOA_COLUMN(FlagMc, flagMc, int); //! MC flag (according to DataType enum)
109110
} // namespace hf_cand_ds_mini
110111

111-
DECLARE_SOA_TABLE(HfCandDsMinis, "AOD", "HFCANDDSMINI", //! Table with few Ds properties
112+
DECLARE_SOA_TABLE(HfCandDsMinis, "AOD", "HFDSMINI", //! Table with few Ds properties
112113
hf_cand_ds_mini::M,
113114
hf_cand_ds_mini::Pt,
114115
hf_cand_ds_mini::Centrality);
115116

116-
DECLARE_SOA_TABLE(HfCandDsDlMinis, "AOD", "HFCANDDSDLMINI", //! Table with decay length Ds properties
117+
DECLARE_SOA_TABLE(HfCandDsDlMinis, "AOD", "HFDSDLMINI", //! Table with decay length Ds properties
117118
hf_cand_ds_mini::DecayLength,
118119
hf_cand_ds_mini::DecayLengthXY,
119120
hf_cand_ds_mini::DecayLengthNormalised,
120121
hf_cand_ds_mini::DecayLengthXYNormalised);
121122

122-
DECLARE_SOA_TABLE(HfCandDsD0Minis, "AOD", "HFCANDDSD0MINI", //! Table with impact parameter (d0)
123+
DECLARE_SOA_TABLE(HfCandDsD0Minis, "AOD", "HFDSD0MINI", //! Table with impact parameter (d0)
123124
hf_cand_ds_mini::ImpactParameter);
124125

125-
DECLARE_SOA_TABLE(HfCandDsMcMinis, "AOD", "HFCANDDSMCMINI", //! Table with MC decay type check
126+
DECLARE_SOA_TABLE(HfCandDsD0McMinis, "AOD", "HFDSD0MCMINI", //! Table with generated impact parameter (d0)
127+
hf_cand_ds_mini::ImpactParameterMc);
128+
129+
DECLARE_SOA_TABLE(HfCandDsMcMinis, "AOD", "HFDSMCMINI", //! Table with MC decay type check
126130
hf_cand_ds_mini::FlagMc);
127131
} // namespace o2::aod
128132

@@ -141,6 +145,7 @@ struct HfTaskDs {
141145
Produces<aod::HfCandDsDlMinis> hfCandDsDlMinis;
142146
Produces<aod::HfCandDsD0Minis> hfCandDsD0Minis;
143147
Produces<aod::HfCandDsMcMinis> hfCandDsMcMinis;
148+
Produces<aod::HfCandDsD0McMinis> hfCandDsD0McMinis;
144149

145150
Configurable<int> decayChannel{"decayChannel", 1, "Switch between resonant decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"};
146151
Configurable<bool> fillDplusMc{"fillDplusMc", true, "Switch to fill Dplus MC information"};
@@ -584,8 +589,8 @@ struct HfTaskDs {
584589
}
585590
}
586591

587-
template <bool IsMc, typename Coll, typename Cand>
588-
void fillMiniTrees(const Cand& candidate, DataType dataType, FinalState finalState)
592+
template <typename Coll, typename Cand>
593+
void fillMiniTrees(const Cand& candidate, FinalState finalState)
589594
{
590595
auto mass = finalState == FinalState::KKPi ? HfHelper::invMassDsToKKPi(candidate) : HfHelper::invMassDsToPiKK(candidate);
591596
auto pt = candidate.pt();
@@ -597,8 +602,32 @@ struct HfTaskDs {
597602
if (miniTrees.extendWithImpactParameter) {
598603
hfCandDsD0Minis(candidate.impactParameterXY());
599604
}
600-
if constexpr (IsMc) {
601-
hfCandDsMcMinis(dataType);
605+
}
606+
607+
template <typename Coll, typename Cand>
608+
void fillMiniTreesMc(const Cand& candidate, DataType dataType, FinalState finalState, const CandDsMcGen& mcParticles, int indexMother)
609+
{
610+
auto mass = finalState == FinalState::KKPi ? HfHelper::invMassDsToKKPi(candidate) : HfHelper::invMassDsToPiKK(candidate);
611+
auto pt = candidate.pt();
612+
613+
hfCandDsMinis(mass, pt, evaluateCentralityCand<Coll>(candidate));
614+
if (miniTrees.extendWithDecayLength) {
615+
hfCandDsDlMinis(candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised());
616+
}
617+
if (miniTrees.extendWithImpactParameter) {
618+
hfCandDsD0Minis(candidate.impactParameterXY());
619+
}
620+
hfCandDsMcMinis(dataType);
621+
622+
if (miniTrees.extendWithImpactParameter) {
623+
// indexMother is != -1 here
624+
auto particleMc = mcParticles.rawIteratorAt(indexMother);
625+
auto prong0 = mcParticles.rawIteratorAt(particleMc.daughtersIds()[0]);
626+
627+
std::array pv{particleMc.mcCollision().posX(), particleMc.mcCollision().posY(), particleMc.mcCollision().posZ()};
628+
std::array sv{prong0.vx(), prong0.vy(), prong0.vz()};
629+
auto genD0 = RecoDecay::impParXY(pv, sv, std::array{particleMc.px(), particleMc.py(), particleMc.pz()});
630+
hfCandDsD0McMinis(genD0);
602631
}
603632
}
604633

@@ -663,7 +692,7 @@ struct HfTaskDs {
663692
fillHisto(candidate, dataType);
664693
fillHistoKKPi<true, Coll>(candidate, dataType);
665694
if (miniTrees.produceMiniTrees) {
666-
fillMiniTrees<true, Coll>(candidate, dataType, FinalState::KKPi);
695+
fillMiniTreesMc<Coll>(candidate, dataType, FinalState::KKPi, mcParticles, indexMother);
667696
}
668697
if (TESTBIT(candidate.isSelDsToKKPi(), aod::SelectionStep::RecoSkims)) {
669698
std::get<TH2Ptr>(histosPtr[dataType]["hPtVsYRecoSkim"])->Fill(pt, yCand);
@@ -683,7 +712,7 @@ struct HfTaskDs {
683712
fillHisto(candidate, dataType);
684713
fillHistoPiKK<true, Coll>(candidate, dataType);
685714
if (miniTrees.produceMiniTrees) {
686-
fillMiniTrees<true, Coll>(candidate, dataType, FinalState::PiKK);
715+
fillMiniTreesMc<Coll>(candidate, dataType, FinalState::PiKK, mcParticles, indexMother);
687716
}
688717

689718
if (TESTBIT(candidate.isSelDsToPiKK(), aod::SelectionStep::RecoSkims)) {
@@ -709,7 +738,7 @@ struct HfTaskDs {
709738
fillHisto(candidate, DataType::Data);
710739
fillHistoKKPi<false, Coll>(candidate, DataType::Data);
711740
if (miniTrees.produceMiniTrees) {
712-
fillMiniTrees<true, Coll>(candidate, DataType::Data, FinalState::KKPi);
741+
fillMiniTrees<Coll>(candidate, FinalState::KKPi);
713742
}
714743
}
715744
if (candidate.isSelDsToPiKK() >= selectionFlagDs) { // PiKK
@@ -719,7 +748,7 @@ struct HfTaskDs {
719748
fillHisto(candidate, DataType::Data);
720749
fillHistoPiKK<false, Coll>(candidate, DataType::Data);
721750
if (miniTrees.produceMiniTrees) {
722-
fillMiniTrees<true, Coll>(candidate, DataType::Data, FinalState::PiKK);
751+
fillMiniTrees<Coll>(candidate, FinalState::PiKK);
723752
}
724753
}
725754
}

0 commit comments

Comments
 (0)