Skip to content

Commit e2acbfb

Browse files
Paola Vargas TorresPaola Vargas Torres
authored andcommitted
Histograms for the p to pT conversion
1 parent 6f85ddd commit e2acbfb

1 file changed

Lines changed: 38 additions & 9 deletions

File tree

PWGLF/Tasks/Nuspex/multiplicityPt.cxx

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct MultiplicityPt {
6868
static constexpr int MultBinMax = 200;
6969
static constexpr int RecMultBinMax = 100;
7070
static constexpr int ParticlesType = 4;
71+
static constexpr int ResponseMatrixTypes = 7;
7172

7273
enum INELCutSelection : int {
7374
INEL = 0,
@@ -115,6 +116,9 @@ struct MultiplicityPt {
115116
// Histogram names for V0s dE/dx analysis
116117
static constexpr std::string_view DedxvsMomentumPos[ParticlesType] = {"dEdx_vs_Momentum_all_Pos", "dEdx_vs_Momentum_Pi_v0_Pos", "dEdx_vs_Momentum_Pr_v0_Pos", "dEdx_vs_Momentum_El_v0_Pos"};
117118
static constexpr std::string_view DedxvsMomentumNeg[ParticlesType] = {"dEdx_vs_Momentum_all_Neg", "dEdx_vs_Momentum_Pi_v0_Neg", "dEdx_vs_Momentum_Pr_v0_Neg", "dEdx_vs_Momentum_El_v0_Neg"};
119+
120+
static constexpr std::string_view EtavspvspTPosPart[ResponseMatrixTypes] = {"heta_vs_pt_vs_p_all_Pos", "heta_vs_pt_vs_p_all_Pos_Pri", "heta_vs_pt_vs_p_all_Pos_Pri_MC", "heta_vs_pt_vs_p_all_Pos_Pri_MC_Part", "heta_vs_pt_vs_p_Pi_Pos", "heta_vs_pt_vs_p_K_Pos", "heta_vs_pt_vs_p_Pr_Pos"};
121+
static constexpr std::string_view EtavspvspTNegPart[ResponseMatrixTypes] = {"heta_vs_pt_vs_p_all_Neg", "heta_vs_pt_vs_p_all_Neg_Pri", "heta_vs_pt_vs_p_all_Neg_Pri_MC", "heta_vs_pt_vs_p_all_Neg_Pri_MC_Part", "heta_vs_pt_vs_p_Pi_Neg", "heta_vs_pt_vs_p_K_Neg", "heta_vs_pt_vs_p_Pr_Neg"};
118122
// Particle fractions histograms
119123
static constexpr std::string_view ParticleFractionsVsMomentumPos[ParticlesType + 1] = {"hFractionVsMomentum_Pion_Pos", "hFractionVsMomentum_Kaon_Pos", "hFractionVsMomentum_Proton_Pos", "hFractionVsMomentum_Electron_Pos", "hFractionVsMomentum_Muon_Pos"};
120124

@@ -481,6 +485,15 @@ void MultiplicityPt::init(InitContext const&)
481485
"dE/dx vs Momentum Negative", HistType::kTH3F,
482486
{{pAxis}, {dedxAxis}, {etaAxis}});
483487
}
488+
// pt vs p
489+
for (int i = 0; i < ResponseMatrixTypes; ++i) {
490+
ue.add(("ResponseMatrix/" + std::string(EtavspvspTPosPart[i])).c_str(),
491+
"eta vs pT vs p Positive", HistType::kTH3F,
492+
{{etaAxis}, {ptAxis}, {pAxis}});
493+
ue.add(("ResponseMatrix/" + std::string(EtavspvspTNegPart[i])).c_str(),
494+
"eta vs pT vs p Negative", HistType::kTH3F,
495+
{{etaAxis}, {ptAxis}, {pAxis}});
496+
}
484497

485498
// ===== Particle Fractions as function of p and pT =====
486499
ue.add("ParticleFractions/hTotalCountsVsMomentumPos", "Total counts vs momentum;#it{p} (GeV/#it{c});Counts", HistType::kTH2D, {{etaAxis}, {pAxis}});
@@ -498,13 +511,6 @@ void MultiplicityPt::init(InitContext const&)
498511
ue.add(("ParticleFractions/" + std::string(ParticleFractionsVsPtNeg[i])).c_str(),
499512
"Particle fraction vs pT", HistType::kTH2D, {{etaAxis}, {ptAxis}});
500513
}
501-
// pt vs p
502-
ue.add(
503-
"heta_vs_pt_vs_p_all_Neg", "eta_vs_pT_vs_p", HistType::kTH3F,
504-
{{etaAxis}, {ptAxis}, {pAxis}});
505-
ue.add(
506-
"heta_vs_pt_vs_p_all_Pos", "eta_vs_pT_vs_p", HistType::kTH3F,
507-
{{etaAxis}, {ptAxis}, {pAxis}});
508514

509515
LOG(info) << "=== Initialization complete ===";
510516
}
@@ -753,24 +759,41 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
753759
// dedx for all particles
754760
if (charge > 0) {
755761
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_all_Pos"), momentum, tpcSignal, eta);
756-
ue.fill(HIST("heta_vs_pt_vs_p_all_Pos"), eta, track.pt(), momentum);
762+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Pos"), eta, track.pt(), momentum);
757763
} else {
758764
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_all_Neg"), momentum, tpcSignal, eta);
759-
ue.fill(HIST("heta_vs_pt_vs_p_all_Neg"), eta, track.pt(), momentum);
765+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Neg"), eta, track.pt(), momentum);
766+
}
767+
768+
if (track.mcParticle().isPhysicalPrimary()) {
769+
if (charge > 0) {
770+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Pos_Pri"), eta, track.pt(), momentum);
771+
} else {
772+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Neg_Pri"), eta, track.pt(), momentum);
773+
}
760774
}
761775

762776
if (track.has_mcParticle()) {
763777
const auto& particle = track.mcParticle();
764778
int pdgCode = std::abs(particle.pdgCode());
779+
if (particle.isPhysicalPrimary()) {
780+
if (charge > 0) {
781+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Pos_Pri_MC"), eta, track.pt(), momentum);
782+
} else {
783+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Neg_Pri_MC"), eta, track.pt(), momentum);
784+
}
785+
}
765786
if (pdgCode == PDG_t::kPiPlus || pdgCode == PDG_t::kKPlus || pdgCode == PDG_t::kProton || pdgCode == PDG_t::kElectron || pdgCode == PDG_t::kMuonPlus) {
766787
if (particle.isPhysicalPrimary()) {
767788
// Fill total counts for fractions
768789
if (charge > 0) {
769790
ue.fill(HIST("ParticleFractions/hTotalCountsVsMomentumPos"), eta, momentum);
770791
ue.fill(HIST("ParticleFractions/hTotalCountsVsPtPos"), eta, track.pt());
792+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Pos_Pri_MC_Part"), eta, track.pt(), momentum);
771793
} else {
772794
ue.fill(HIST("ParticleFractions/hTotalCountsVsMomentumNeg"), eta, momentum);
773795
ue.fill(HIST("ParticleFractions/hTotalCountsVsPtNeg"), eta, track.pt());
796+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_all_Neg_Pri_MC_Part"), eta, track.pt(), momentum);
774797
}
775798
}
776799
}
@@ -784,10 +807,12 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
784807
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Pion_Pos"), eta, momentum);
785808
ue.fill(HIST("ParticleFractions/hFractionVsPt_Pion_Pos"), eta, track.pt());
786809
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_Pi_v0_Pos"), momentum, tpcSignal, eta);
810+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_Pi_Pos"), eta, track.pt(), momentum);
787811
} else {
788812
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Pion_Neg"), eta, momentum);
789813
ue.fill(HIST("ParticleFractions/hFractionVsPt_Pion_Neg"), eta, track.pt());
790814
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_Pi_v0_Neg"), momentum, tpcSignal, eta);
815+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_Pi_Neg"), eta, track.pt(), momentum);
791816
}
792817

793818
} else {
@@ -801,9 +826,11 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
801826
if (charge > 0) {
802827
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Kaon_Pos"), eta, momentum);
803828
ue.fill(HIST("ParticleFractions/hFractionVsPt_Kaon_Pos"), eta, track.pt());
829+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_K_Pos"), eta, track.pt(), momentum);
804830
} else {
805831
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Kaon_Neg"), eta, momentum);
806832
ue.fill(HIST("ParticleFractions/hFractionVsPt_Kaon_Neg"), eta, track.pt());
833+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_K_Neg"), eta, track.pt(), momentum);
807834
}
808835
} else {
809836
ue.fill(HIST("Inclusive/hPtSecReco"), track.pt());
@@ -817,10 +844,12 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
817844
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Proton_Pos"), eta, momentum);
818845
ue.fill(HIST("ParticleFractions/hFractionVsPt_Proton_Pos"), eta, track.pt());
819846
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_Pr_v0_Pos"), momentum, tpcSignal, eta);
847+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_Pr_Pos"), eta, track.pt(), momentum);
820848
} else {
821849
ue.fill(HIST("ParticleFractions/hFractionVsMomentum_Proton_Neg"), eta, momentum);
822850
ue.fill(HIST("ParticleFractions/hFractionVsPt_Proton_Neg"), eta, track.pt());
823851
ue.fill(HIST("DedxVsMomentum/dEdx_vs_Momentum_Pr_v0_Neg"), momentum, tpcSignal, eta);
852+
ue.fill(HIST("ResponseMatrix/heta_vs_pt_vs_p_Pr_Neg"), eta, track.pt(), momentum);
824853
}
825854
} else {
826855
ue.fill(HIST("Inclusive/hPtSecReco"), track.pt());

0 commit comments

Comments
 (0)