Skip to content

Commit b0955ff

Browse files
authored
PWGLF: Update lambda1520SpherocityAnalysis.cxx (#4663)
1 parent 01d5ef0 commit b0955ff

File tree

1 file changed

+52
-26
lines changed

1 file changed

+52
-26
lines changed

PWGLF/Tasks/Resonances/lambda1520SpherocityAnalysis.cxx

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file lambda1520_spherocity_analysis.cxx
13-
/// \brief Produce Spherocity table.
14-
/// Invariant Mass Reconstruction of Lambda(1520) Resonance.
15-
///
13+
/// \brief Invariant Mass Reconstruction of Lambda(1520) Resonance
1614
/// \author Yash Patley <yash.patley@cern.ch>
1715

1816
#include <TLorentzVector.h>
@@ -49,11 +47,15 @@ struct lambdaAnalysis {
4947
Configurable<float> cEtaCut{"cEtaCut", 0.8, "Pseudorapidity cut"};
5048
Configurable<float> cDcaz{"cDcazMin", 1., "Minimum DCAz"};
5149
Configurable<float> cDcaxy{"cDcaxyMin", 0.1, "Minimum DCAxy"};
52-
Configurable<bool> cKinCuts{"cKinCuts", false, "Kinematic Cuts for p-K pair opening angle"};
5350
Configurable<bool> cPrimaryTrack{"cPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz
5451
Configurable<bool> cGlobalWoDCATrack{"cGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange)
5552
Configurable<bool> cPVContributor{"cPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor
5653

54+
// Kinematics cuts
55+
Configurable<bool> cKinCuts{"cKinCuts", true, "Kinematic Cuts for p-K pair opening angle"};
56+
Configurable<std::vector<float>> cKinCutsPt{"cKinCutsPt", {0.0, 0.8, 1.2, 1.6, 2.0, 9999999999.}, "p_{T} of L* for kinematic cuts"};
57+
Configurable<std::vector<float>> cKinCutsAlpha{"cKinCutsAlpha", {3.0, 1.8, 1.4, 1.0, 0.8}, "Opening angle of p-K of L*"};
58+
5759
// PID Selections
5860
Configurable<bool> cUseOnlyTOFTrackPr{"cUseOnlyTOFTrackPr", false, "Use only TOF track for PID selection"}; // Use only TOF track for Proton PID selection
5961
Configurable<bool> cUseOnlyTOFTrackKa{"cUseOnlyTOFTrackKa", false, "Use only TOF track for PID selection"}; // Use only TOF track for Kaon PID selection
@@ -70,8 +72,8 @@ struct lambdaAnalysis {
7072
Configurable<double> cMaxTPCnSigmaKaon{"cMaxTPCnSigmaKaon", 4.0, "TPC nSigma cut for Kaon"}; // TPC
7173
Configurable<double> cMaxTOFnSigmaKaon{"cMaxTOFnSigmaKaon", 3.0, "TOF nSigma cut for Kaon"}; // TOF
7274
Configurable<double> nsigmaCutCombinedKaon{"nsigmaCutCombinedKaon", 3.0, "Combined nSigma cut for Kaon"}; // Combined
73-
Configurable<std::vector<float>> kaonTPCPIDp{"kaonTPCPIDp", {0.15, 0.3, 0.35, 0.40}, "p dependent TPC cuts kaons"};
74-
Configurable<std::vector<float>> kaonTPCPIDcut{"kaonTPCPIDcut", {5., 4., 3.}, "TPC nsigma cuts kaons"};
75+
Configurable<std::vector<float>> kaonTPCPIDp{"kaonTPCPIDp", {0.15, 0.3, 0.35, 0.40, 0.54}, "p dependent TPC cuts kaons"};
76+
Configurable<std::vector<float>> kaonTPCPIDcut{"kaonTPCPIDcut", {5., 4., 3., 2.}, "TPC nsigma cuts kaons"};
7577
// Event Mixing.
7678
Configurable<bool> cMixSph{"cMixSph", true, "Include Sph Bins to be mixed"};
7779
Configurable<int> cNumMixEv{"cNumMixEv", 20, "Number of Events to be mixed"};
@@ -92,6 +94,7 @@ struct lambdaAnalysis {
9294
const AxisSpec axisP_pid(600, 0., 6., "p (GeV/c)");
9395
const AxisSpec axisPt_pid(600, 0., 6., "p_{T} (GeV/c)");
9496
const AxisSpec axisPt(nBinsPt, 0., 10., "p_{T} (GeV/c)");
97+
const AxisSpec axisAlpha(200, 0 - 0.15, 2 * TMath::Pi() + 0.15, "#alpha");
9598
const AxisSpec axisEta(40, -1, 1, "#eta");
9699
const AxisSpec axisPhi(128, -0.05, 6.35, "#phi (rad)");
97100
const AxisSpec axisDCAz(500, -0.5, 0.5, {"DCA_{z} (cm)"});
@@ -117,28 +120,28 @@ struct lambdaAnalysis {
117120
histos.add("QAbefore/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma});
118121

119122
// QA After
120-
histos.add("QAafter/Proton/h1d_pr_pt", "p_{T}-spectra Protons", kTH1F, {axisPt_pid});
121-
histos.add("QAafter/Proton/h2d_pr_dca_z", "dca_{z} Protons", kTH2F, {axisPt_pid, axisDCAz});
122-
histos.add("QAafter/Proton/h2d_pr_dca_xy", "dca_{xy} Protons", kTH2F, {axisPt_pid, axisDCAxy});
123+
histos.add("QAafter/Proton/h2d_pr_dca_z", "Protons", kTH2F, {axisPt_pid, axisDCAz});
124+
histos.add("QAafter/Proton/h2d_pr_dca_xy", "Protons", kTH2F, {axisPt_pid, axisDCAxy});
123125
histos.add("QAafter/Proton/h2d_pr_dEdx_p", "TPC Signal Protons", kTH2F, {axisP_pid, axisdEdx});
124-
histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_pt", " Protons", kTH2F, {axisPt_pid, axisTPCNsigma});
125-
histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_p", " Protons", kTH2F, {axisP_pid, axisTPCNsigma});
126-
histos.add("QAafter/Proton/h2d_pr_nsigma_tof_pt", " Protons", kTH2F, {axisPt_pid, axisTOFNsigma});
127-
histos.add("QAafter/Proton/h2d_pr_nsigma_tof_p", " Protons", kTH2F, {axisP_pid, axisTOFNsigma});
126+
histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_pt", "Protons", kTH2F, {axisPt_pid, axisTPCNsigma});
127+
histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_p", "Protons", kTH2F, {axisP_pid, axisTPCNsigma});
128+
histos.add("QAafter/Proton/h2d_pr_nsigma_tof_pt", "Protons", kTH2F, {axisPt_pid, axisTOFNsigma});
129+
histos.add("QAafter/Proton/h2d_pr_nsigma_tof_p", "Protons", kTH2F, {axisP_pid, axisTOFNsigma});
128130
histos.add("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma});
129-
histos.add("QAafter/Kaon/h1d_ka_pt", "p_{T}-spectra Kaons", kTH1F, {axisPt_pid});
130-
histos.add("QAafter/Kaon/h2d_ka_dca_z", "dca_{z} Kaons", kTH2F, {axisPt_pid, axisDCAz});
131-
histos.add("QAafter/Kaon/h2d_ka_dca_xy", "dca_{xy} Kaons", kTH2F, {axisPt_pid, axisDCAxy});
131+
histos.add("QAafter/Kaon/h2d_ka_dca_z", "Kaons", kTH2F, {axisPt_pid, axisDCAz});
132+
histos.add("QAafter/Kaon/h2d_ka_dca_xy", "Kaons", kTH2F, {axisPt_pid, axisDCAxy});
132133
histos.add("QAafter/Kaon/h2d_ka_dEdx_p", "TPC Signal Kaon", kTH2F, {axisP_pid, axisdEdx});
133-
histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_pt", " Kaons", kTH2F, {axisPt_pid, axisTPCNsigma});
134-
histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_p", " Kaons", kTH2F, {axisP_pid, axisTPCNsigma});
135-
histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_pt", " Kaons", kTH2F, {axisPt_pid, axisTOFNsigma});
136-
histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_p", " Kaons", kTH2F, {axisP_pid, axisTOFNsigma});
134+
histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_pt", "Kaons", kTH2F, {axisPt_pid, axisTPCNsigma});
135+
histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_p", "Kaons", kTH2F, {axisP_pid, axisTPCNsigma});
136+
histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_pt", "Kaons", kTH2F, {axisPt_pid, axisTOFNsigma});
137+
histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_p", "Kaons", kTH2F, {axisP_pid, axisTOFNsigma});
137138
histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma});
138139

139140
// QA checks for protons and kaons
140141
histos.add("QAChecks/h1d_pr_pt", "p_{T}-spectra Protons", kTH1F, {axisPt_pid});
141142
histos.add("QAChecks/h1d_ka_pt", "p_{T}-spectra Kaons", kTH1F, {axisPt_pid});
143+
histos.add("QAChecks/h2d_lstar_alpha_vs_pt", "#alpha_{oa} vs p_{T} Before Cuts", kTH2F, {axisPt, axisAlpha});
144+
histos.add("QAChecks/h2d_sel_kincuts_lstar_alpha_vs_pt", "#alpha_{oa} vs p_{T} After Cuts", kTH2F, {axisPt, axisAlpha});
142145

143146
// Analysis
144147
// Lambda Invariant Mass
@@ -324,6 +327,30 @@ struct lambdaAnalysis {
324327
return false;
325328
}
326329

330+
// kinematic cuts method
331+
template <typename trackType, typename T>
332+
bool kinCuts(trackType trkPr, trackType trkKa, T p, float& alpha)
333+
{
334+
// initialize
335+
std::vector<float> kinCutsPt = static_cast<std::vector<float>>(cKinCutsPt);
336+
std::vector<float> kinCutsAlpha = static_cast<std::vector<float>>(cKinCutsAlpha);
337+
int kinCutsSize = static_cast<int>(kinCutsAlpha.size());
338+
339+
TVector3 v1(trkPr.px(), trkPr.py(), trkPr.pz());
340+
TVector3 v2(trkKa.px(), trkKa.py(), trkKa.pz());
341+
alpha = v1.Angle(v2);
342+
343+
histos.fill(HIST("QAChecks/h2d_lstar_alpha_vs_pt"), p.Pt(), alpha);
344+
345+
for (int i = 0; i < kinCutsSize; ++i) {
346+
if ((p.Pt() > kinCutsPt[i] && p.Pt() <= kinCutsPt[i + 1]) && (alpha > kinCutsAlpha[i])) {
347+
return false;
348+
}
349+
}
350+
351+
return true;
352+
}
353+
327354
template <bool mix, bool mc, typename trackType>
328355
void fillDataHistos(trackType const& trk1, trackType const& trk2, float const& sph, float const& mult)
329356
{
@@ -368,7 +395,6 @@ struct lambdaAnalysis {
368395
// Fill QA after track selection.
369396
if constexpr (!mix) {
370397
// Proton
371-
histos.fill(HIST("QAafter/Proton/h1d_pr_pt"), trkPr.pt());
372398
histos.fill(HIST("QAafter/Proton/h2d_pr_dca_z"), trkPr.pt(), trkPr.dcaZ());
373399
histos.fill(HIST("QAafter/Proton/h2d_pr_dca_xy"), trkPr.pt(), trkPr.dcaXY());
374400
histos.fill(HIST("QAafter/Proton/h2d_pr_dEdx_p"), p_ptot, trkPr.tpcSignal());
@@ -380,7 +406,6 @@ struct lambdaAnalysis {
380406
histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc"), trkPr.tpcNSigmaPr(), trkPr.tofNSigmaPr());
381407
}
382408
// Kaon
383-
histos.fill(HIST("QAafter/Kaon/h1d_ka_pt"), trkKa.pt());
384409
histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_z"), trkKa.pt(), trkKa.dcaZ());
385410
histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_xy"), trkKa.pt(), trkKa.dcaXY());
386411
histos.fill(HIST("QAafter/Kaon/h2d_ka_dEdx_p"), k_ptot, trkKa.tpcSignal());
@@ -403,11 +428,12 @@ struct lambdaAnalysis {
403428

404429
// Apply kinematic cuts.
405430
if (cKinCuts) {
406-
TVector3 v1(trkPr.px(), trkPr.py(), trkPr.pz());
407-
TVector3 v2(trkKa.px(), trkKa.py(), trkKa.pz());
408-
float alpha = v1.Angle(v2);
409-
if (alpha > 1.4 && alpha < 2.4)
431+
float alpha = 0;
432+
bool kinCutFlag = kinCuts(trkPr, trkKa, p, alpha);
433+
if (!kinCutFlag) {
410434
continue;
435+
}
436+
histos.fill(HIST("QAChecks/h2d_sel_kincuts_lstar_alpha_vs_pt"), p.Pt(), alpha);
411437
}
412438

413439
// Fill Invariant Mass Histograms.

0 commit comments

Comments
 (0)