Skip to content

Commit e3d7512

Browse files
committed
Feat: small fixes in V0 & cascade histogramming
1 parent bafb71d commit e3d7512

3 files changed

Lines changed: 36 additions & 20 deletions

File tree

PWGCF/Femto/Core/cascadeHistManager.h

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum CascadeHist {
4848
kPhi,
4949
kMass,
5050
kSign,
51+
kPtVsMass, // nice to have during analysis
5152
// qa variables
5253
kMassXi,
5354
kMassOmega,
@@ -109,6 +110,8 @@ template <const char* Prefix>
109110
struct ConfCascadeQaBinning : o2::framework::ConfigurableGroup {
110111
std::string prefix = Prefix;
111112
o2::framework::Configurable<bool> plot2d{"plot2d", true, "Enable 2d Qa histograms"};
113+
o2::framework::Configurable<bool> plotOrigins{"plotOrigins", true, "MC ONLY: Plot pt vs cosPa for different particle origins"};
114+
o2::framework::Configurable<std::vector<int>> pdgCodesForMothersOfSecondary{"pdgCodesForMothersOfSecondary", {3312, 3334}, "MC ONLY: PDG codes of mothers of secondaries (Max 3 will be considered)"};
112115
o2::framework::ConfigurableAxis cosPa{"cosPa", {{100, 0.9, 1}}, "Cosine of poiting angle"};
113116
o2::framework::ConfigurableAxis dauDcaAtDecay{"dauDcaAtDecay", {{150, 0, 1.5}}, "Daughter DCA at decay vertex"};
114117
o2::framework::ConfigurableAxis transRadius{"transRadius", {{100, 0, 100}}, "Transverse radius"};
@@ -123,8 +126,8 @@ struct ConfCascadeQaBinning : o2::framework::ConfigurableGroup {
123126
constexpr const char PrefixXiQaBinning[] = "XiQaBinning";
124127
using ConfXiQaBinning = ConfCascadeQaBinning<PrefixXiQaBinning>;
125128

126-
constexpr const char PrefixOmegatQaBinning[] = "OmegaQaBinning";
127-
using ConfOmegaQaBinning = ConfCascadeQaBinning<PrefixOmegatQaBinning>;
129+
constexpr const char PrefixOmegaQaBinning[] = "OmegaQaBinning";
130+
using ConfOmegaQaBinning = ConfCascadeQaBinning<PrefixOmegaQaBinning>;
128131

129132
// must be in sync with enum TrackVariables
130133
// the enum gives the correct index in the array
@@ -134,6 +137,7 @@ constexpr std::array<histmanager::HistInfo<CascadeHist>, kCascadeHistLast> HistT
134137
{kPhi, o2::framework::HistType::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"},
135138
{kMass, o2::framework::HistType::kTH1F, "hMass", "Invariant Mass; m_{Inv} (GeV/#it{c}^{2}); Entries"},
136139
{kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> antiparticle, 0 -> self conjugate, +1 -> particle); sign; Entries"},
140+
{kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "Transverse momentum vs invariant mass; p_{T} (GeV/#it{c}); m_{Inv} (GeV/#it{c}^{2})"},
137141
{kMassXi, o2::framework::HistType::kTH1F, "hMassXi", "Mass #Xi; m_{#Lambda#pi} (GeV/#it{c}^{2}); Entries"},
138142
{kMassOmega, o2::framework::HistType::kTH1F, "hMassOmega", "mass #Omega; m_{#LambdaK} (GeV/#it{c}^{2}); Entries"},
139143
{kCosPa, o2::framework::HistType::kTH1F, "hCosPa", "Cosine of pointing angle; cos(#alpha); Entries"},
@@ -163,17 +167,18 @@ constexpr std::array<histmanager::HistInfo<CascadeHist>, kCascadeHistLast> HistT
163167
{kFromMaterial, o2::framework::HistType::kTH2F, "hFromMaterial", "Particles from material; p_{T} (GeV/#it{c}); cos(#alpha)"},
164168
{kMissidentified, o2::framework::HistType::kTH2F, "hMissidentified", "Missidentified particles (fake/wrong PDG code); p_{T} (GeV/#it{c}); cos(#alpha)"},
165169
{kSecondary1, o2::framework::HistType::kTH2F, "hFromSecondary1", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
166-
{kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
167-
{kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
168-
{kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}},
170+
{kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
171+
{kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
172+
{kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}},
169173
};
170174

171175
#define CASCADE_HIST_ANALYSIS_MAP(conf) \
172176
{kPt, {conf.pt}}, \
173177
{kEta, {conf.eta}}, \
174178
{kPhi, {conf.phi}}, \
175179
{kMass, {conf.mass}}, \
176-
{kSign, {conf.sign}},
180+
{kSign, {conf.sign}}, \
181+
{kPtVsMass, {conf.pt, conf.mass}},
177182

178183
#define CASCADE_HIST_MC_MAP(conf) \
179184
{kTruePtVsPt, {conf.pt, conf.pt}}, \
@@ -184,12 +189,7 @@ constexpr std::array<histmanager::HistInfo<CascadeHist>, kCascadeHistLast> HistT
184189
{kPdgPartonicMother, {conf.pdgCodes}},
185190

186191
#define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \
187-
{kPt, {confAnalysis.pt}}, \
188-
{kEta, {confAnalysis.eta}}, \
189-
{kPhi, {confAnalysis.phi}}, \
190-
{kMass, {confAnalysis.mass}}, \
191-
{kSign, {confAnalysis.sign}}, \
192-
{kCosPa, {confQa.cosPa}}, \
192+
{kCosPa, {confQa.cosPa}}, \
193193
{kDecayDauDca, {confQa.dauDcaAtDecay}}, \
194194
{kTransRadius, {confQa.transRadius}}, \
195195
{kLambdaCosPa, {confQa.lambdaCosPa}}, \
@@ -349,9 +349,9 @@ class CascadeHistManager
349349
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& BachelorSpecs,
350350
T3 const& ConfBachelorQaBinning,
351351
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& PosDauSpecs,
352-
T4& ConfPosDauQaBinning,
352+
T4 const& ConfPosDauQaBinning,
353353
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& NegDauSpecs,
354-
T5& ConfNegDauQaBinning)
354+
T5 const& ConfNegDauQaBinning)
355355
{
356356
mHistogramRegistry = registry;
357357
mPdgCode = std::abs(ConfCascadeSelection.pdgCodeAbs.value);
@@ -454,6 +454,15 @@ class CascadeHistManager
454454
void enableOptionalHistograms(T const& CascadeConfBinningQa)
455455
{
456456
mPlot2d = CascadeConfBinningQa.plot2d.value;
457+
mPlotOrigins = CascadeConfBinningQa.plotOrigins.value;
458+
mPlotNSecondaries = CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.size();
459+
for (std::size_t i = 0; i < MaxSecondary; i++) {
460+
if (i < CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.size()) {
461+
mPdgCodesSecondaryMother.at(i) = std::abs(CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.at(i));
462+
} else {
463+
mPdgCodesSecondaryMother.at(i) = 0;
464+
}
465+
}
457466
}
458467

459468
void initAnalysis(std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const& cascadeSpecs)
@@ -464,6 +473,7 @@ class CascadeHistManager
464473
mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {cascadeSpecs.at(kPhi)});
465474
mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {cascadeSpecs.at(kMass)});
466475
mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {cascadeSpecs.at(kSign)});
476+
mHistogramRegistry->add(analysisDir + getHistNameV2(kPtVsMass, HistTable), getHistDesc(kPtVsMass, HistTable), getHistType(kPtVsMass, HistTable), {cascadeSpecs.at(kPtVsMass)});
467477
}
468478

469479
void initQa(std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const& cascadeSpecs)
@@ -540,6 +550,7 @@ class CascadeHistManager
540550
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), cascadeCandidate.phi());
541551
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), cascadeCandidate.mass());
542552
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), cascadeCandidate.sign());
553+
mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kPtVsMass, HistTable)), cascadeCandidate.pt(), cascadeCandidate.mass());
543554
}
544555

545556
template <typename T>

PWGCF/Femto/Core/v0HistManager.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum V0Hist {
4848
kPhi,
4949
kMass,
5050
kSign,
51+
kPtVsMass, // nice to have during analysis
5152
// qa variables
5253
kMassLambda,
5354
kMassAntiLambda,
@@ -148,6 +149,7 @@ constexpr std::array<histmanager::HistInfo<V0Hist>, kV0HistLast> HistTable = {
148149
{kPhi, o2::framework::HistType::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"},
149150
{kMass, o2::framework::HistType::kTH1F, "hMass", "Invariant Mass; m_{Inv} (GeV/#it{c}^{2}); Entries"},
150151
{kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> antiparticle, 0 -> self conjugate, +1 -> particle); sign; Entries"},
152+
{kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "Transverse momentum vs invariant mass; p_{T} (GeV/#it{c}); m_{Inv} (GeV/#it{c}^{2})"},
151153
{kMassLambda, o2::framework::HistType::kTH1F, "hMassLambda", "#Lambda mass; m_{p#pi^{-}} (GeV/#it{c}^{2}); Entries"},
152154
{kMassAntiLambda, o2::framework::HistType::kTH1F, "hMassAntiLambda", "#bar{#Lambda} mass; m_{#bar{p}#pi^{+}} (GeV/#it{c}^{2}); Entries"},
153155
{kMassK0short, o2::framework::HistType::kTH1F, "hMassK0short", "K^{0}_{s} mass; m_{#pi^{+}#pi^{-}} (GeV/#it{c}^{2}); Entries"},
@@ -181,17 +183,18 @@ constexpr std::array<histmanager::HistInfo<V0Hist>, kV0HistLast> HistTable = {
181183
{kFromMaterial, o2::framework::HistType::kTH2F, "hFromMaterial", "Particles from material; p_{T} (GeV/#it{c}); cos(#alpha)"},
182184
{kMissidentified, o2::framework::HistType::kTH2F, "hMissidentified", "Missidentified particles (fake/wrong PDG code); p_{T} (GeV/#it{c}); cos(#alpha)"},
183185
{kSecondary1, o2::framework::HistType::kTH2F, "hFromSecondary1", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
184-
{kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
185-
{kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
186-
{kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}},
186+
{kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
187+
{kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"},
188+
{kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}},
187189
};
188190

189191
#define V0_HIST_ANALYSIS_MAP(conf) \
190192
{kPt, {conf.pt}}, \
191193
{kEta, {conf.eta}}, \
192194
{kPhi, {conf.phi}}, \
193195
{kMass, {conf.mass}}, \
194-
{kSign, {conf.sign}},
196+
{kSign, {conf.sign}}, \
197+
{kPtVsMass, {conf.pt, conf.mass}},
195198

196199
#define V0_HIST_MC_MAP(conf) \
197200
{kTruePtVsPt, {conf.pt, conf.pt}}, \
@@ -451,6 +454,7 @@ class V0HistManager
451454
mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {V0Specs.at(kPhi)});
452455
mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {V0Specs.at(kMass)});
453456
mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {V0Specs.at(kSign)});
457+
mHistogramRegistry->add(analysisDir + getHistNameV2(kPtVsMass, HistTable), getHistDesc(kPtVsMass, HistTable), getHistType(kPtVsMass, HistTable), {V0Specs.at(kPtVsMass)});
454458
}
455459

456460
void initQa(std::map<V0Hist, std::vector<o2::framework::AxisSpec>> const& V0Specs)
@@ -531,6 +535,7 @@ class V0HistManager
531535
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kEta, HistTable)), v0candidate.eta());
532536
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), v0candidate.phi());
533537
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), v0candidate.mass());
538+
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kPtVsMass, HistTable)), v0candidate.pt(), v0candidate.mass());
534539

535540
if constexpr (modes::isEqual(v0, modes::V0::kLambda) || modes::isEqual(v0, modes::V0::kAntiLambda)) {
536541
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), v0candidate.sign());

PWGCF/Femto/Tasks/femtoV0Qa.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct FemtoV0Qa {
120120

121121
void init(o2::framework::InitContext&)
122122
{
123-
if ((doprocessLambda + doprocessLambdaMc + doprocessK0short + doprocessK0shortMc) > 1) {
123+
if ((doprocessLambda + doprocessLambdaMc + doprocessK0short + doprocessK0shortMc) != 1) {
124124
LOG(fatal) << "Only one process can be activated";
125125
}
126126
bool processData = doprocessLambda || doprocessK0short;
@@ -220,7 +220,7 @@ struct FemtoV0Qa {
220220
lambdaHistManager.fill<modes::Mode::kAnalysis_Qa_Mc>(lambda, tracks, mcParticles, mcMothers, mcPartonicMothers);
221221
}
222222
}
223-
PROCESS_SWITCH(FemtoV0Qa, processLambdaMc, "Process lambdas", false);
223+
PROCESS_SWITCH(FemtoV0Qa, processLambdaMc, "Process lambdas with MC informaton", false);
224224
};
225225

226226
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc)

0 commit comments

Comments
 (0)