Skip to content

Commit f2675a8

Browse files
committed
Added output table to sigma minus task
1 parent 0af789a commit f2675a8

File tree

2 files changed

+72
-5
lines changed

2 files changed

+72
-5
lines changed

PWGLF/DataModel/LFKinkDecayTables.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ DECLARE_SOA_COLUMN(DcaMothPv, dcaMothPv, float); //! DCA of the mother to th
4747
DECLARE_SOA_COLUMN(DcaDaugPv, dcaDaugPv, float); //! DCA of the daughter kink to the primary vertex
4848
DECLARE_SOA_COLUMN(DcaKinkTopo, dcaKinkTopo, float); //! DCA of the kink topology
4949

50+
DECLARE_SOA_COLUMN(NSigmaTPCPi, nSigmaTPCPi, float); //! Number of sigmas for the pion candidate from Sigma kink in TPC
51+
DECLARE_SOA_COLUMN(NSigmaTPCPr, nSigmaTPCPr, float); //! Number of sigmas for the proton candidate from Sigma kink in TPC
52+
DECLARE_SOA_COLUMN(NSigmaTPCKa, nSigmaTPCKa, float); //! Number of sigmas for the kaon candidate from Sigma kink in TPC
53+
54+
// MC Columns
55+
DECLARE_SOA_COLUMN(MothPdgCode, mothPdgCode, int); //! PDG code of the Sigma daughter
56+
DECLARE_SOA_COLUMN(DaugPdgCode, daugPdgCode, int); //! PDG code of the kink daughter
57+
DECLARE_SOA_COLUMN(PtMC, ptMC, float); //! pT of the candidate in MC
58+
DECLARE_SOA_COLUMN(MassMC, massMC, float); //! Invariant mass of the candidate in MC
59+
60+
5061
// DYNAMIC COLUMNS
5162

5263
DECLARE_SOA_DYNAMIC_COLUMN(PxDaugNeut, pxDaugNeut, //! Px of the daughter neutral particle
@@ -120,6 +131,26 @@ DECLARE_SOA_TABLE(KinkCandsUnbound, "AOD", "UBKINKCANDS",
120131
kinkcand::MSigmaPlus<kinkcand::PxMoth, kinkcand::PyMoth, kinkcand::PzMoth, kinkcand::PxDaug, kinkcand::PyDaug, kinkcand::PzDaug>,
121132
kinkcand::MXiMinus<kinkcand::PxMoth, kinkcand::PyMoth, kinkcand::PzMoth, kinkcand::PxDaug, kinkcand::PyDaug, kinkcand::PzDaug>);
122133

134+
DECLARE_SOA_TABLE(SlimKinkCands, "AOD", "SLIMKINKCANDS",
135+
kinkcand::XDecVtx, kinkcand::YDecVtx, kinkcand::ZDecVtx,
136+
kinkcand::PxMoth, kinkcand::PyMoth, kinkcand::PzMoth,
137+
kinkcand::PxDaug, kinkcand::PyDaug, kinkcand::PzDaug,
138+
kinkcand::DcaMothPv, kinkcand::DcaDaugPv, kinkcand::DcaKinkTopo,
139+
kinkcand::MothSign,
140+
kinkcand::NSigmaTPCPi, kinkcand::NSigmaTPCPr, kinkcand::NSigmaTPCKa);
141+
142+
DECLARE_SOA_TABLE(SlimKinkCandsMC, "AOD", "SLIMKINKCANDSMC",
143+
kinkcand::XDecVtx, kinkcand::YDecVtx, kinkcand::ZDecVtx,
144+
kinkcand::PxMoth, kinkcand::PyMoth, kinkcand::PzMoth,
145+
kinkcand::PxDaug, kinkcand::PyDaug, kinkcand::PzDaug,
146+
kinkcand::DcaMothPv, kinkcand::DcaDaugPv, kinkcand::DcaKinkTopo,
147+
kinkcand::MothSign,
148+
kinkcand::NSigmaTPCPi, kinkcand::NSigmaTPCPr, kinkcand::NSigmaTPCKa,
149+
kinkcand::MothPdgCode, kinkcand::DaugPdgCode,
150+
kinkcand::PtMC, kinkcand::MassMC);
151+
152+
153+
123154
} // namespace o2::aod
124155

125156
#endif // PWGLF_DATAMODEL_LFKINKDECAYTABLES_H_

PWGLF/Tasks/Strangeness/sigmaminustask.cxx

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ using namespace o2;
2626
using namespace o2::framework;
2727
using namespace o2::framework::expressions;
2828

29-
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi>;
29+
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi, aod::pidTPCPr, aod::pidTPCKa>;
3030
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSel>;
3131
using CollisionsFullMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSel>;
3232

3333
struct sigmaminustask {
34+
35+
// Output Tables
36+
Produces<aod::SlimKinkCands> outputDataTable;
37+
Produces<aod::SlimKinkCandsMC> outputDataTableMC;
38+
3439
// Histograms are defined with HistogramRegistry
3540
HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
3641
HistogramRegistry rSigmaMinus{"sigmaminus", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
@@ -39,6 +44,8 @@ struct sigmaminustask {
3944
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
4045
Configurable<float> cutNSigmaPi{"cutNSigmaPi", 4, "NSigmaTPCPion"};
4146

47+
Configurable<bool> fillOutputTree{"fillOutputTree", true, "If true, fill the output tree with Kink candidates"};
48+
4249
Preslice<aod::KinkCands> mPerCol = aod::track::collisionId;
4350

4451
void init(InitContext const&)
@@ -71,14 +78,26 @@ struct sigmaminustask {
7178
return;
7279
}
7380
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
81+
7482
for (const auto& kinkCand : KinkCands) {
7583
auto dauTrack = kinkCand.trackDaug_as<TracksFull>();
84+
7685
if (abs(dauTrack.tpcNSigmaPi()) > cutNSigmaPi) {
7786
continue;
7887
}
88+
7989
rSigmaMinus.fill(HIST("h2MassSigmaMinusPt"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus());
8090
rSigmaMinus.fill(HIST("h2SigmaMassVsXiMass"), kinkCand.mXiMinus(), kinkCand.mSigmaMinus());
8191
rSigmaMinus.fill(HIST("h2NSigmaPiPt"), kinkCand.mothSign() * kinkCand.ptMoth(), dauTrack.tpcNSigmaPi());
92+
93+
if(fillOutputTree) {
94+
outputDataTable(kinkCand.xDecVtx(), kinkCand.yDecVtx(), kinkCand.zDecVtx(),
95+
kinkCand.pxMoth(), kinkCand.pyMoth(), kinkCand.pzMoth(),
96+
kinkCand.pxDaug(), kinkCand.pyDaug(), kinkCand.pzDaug(),
97+
kinkCand.dcaMothPv(), kinkCand.dcaDaugPv(), kinkCand.dcaKinkTopo(),
98+
kinkCand.mothSign(), dauTrack.tpcNSigmaPi(), dauTrack.tpcNSigmaPr(), dauTrack.tpcNSigmaKa());
99+
}
100+
82101
}
83102
}
84103
PROCESS_SWITCH(sigmaminustask, processData, "Data processing", true);
@@ -92,7 +111,9 @@ struct sigmaminustask {
92111

93112
rEventSelection.fill(HIST("hVertexZRec"), collision.posZ());
94113
auto kinkCandPerColl = KinkCands.sliceBy(mPerCol, collision.globalIndex());
114+
95115
for (const auto& kinkCand : kinkCandPerColl) {
116+
96117
auto dauTrack = kinkCand.trackDaug_as<TracksFull>();
97118
auto mothTrack = kinkCand.trackMoth_as<TracksFull>();
98119
if (dauTrack.sign() != mothTrack.sign()) {
@@ -106,6 +127,7 @@ struct sigmaminustask {
106127
rSigmaMinus.fill(HIST("h2MassSigmaMinusPt"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus());
107128
rSigmaMinus.fill(HIST("h2SigmaMassVsXiMass"), kinkCand.mXiMinus(), kinkCand.mSigmaMinus());
108129
rSigmaMinus.fill(HIST("h2NSigmaPiPt"), kinkCand.mothSign() * kinkCand.ptMoth(), dauTrack.tpcNSigmaPi());
130+
109131
// do MC association
110132
auto mcLabSigma = trackLabelsMC.rawIteratorAt(mothTrack.globalIndex());
111133
auto mcLabPiDau = trackLabelsMC.rawIteratorAt(dauTrack.globalIndex());
@@ -123,10 +145,23 @@ struct sigmaminustask {
123145
continue;
124146
}
125147
rSigmaMinus.fill(HIST("h2MassPtMCRec"), kinkCand.mothSign() * kinkCand.ptMoth(), kinkCand.mSigmaMinus());
148+
149+
// fill the output table with Mc information
150+
outputDataTableMC(kinkCand.xDecVtx(), kinkCand.yDecVtx(), kinkCand.zDecVtx(),
151+
kinkCand.pxMoth(), kinkCand.pyMoth(), kinkCand.pzMoth(),
152+
kinkCand.pxDaug(), kinkCand.pyDaug(), kinkCand.pzDaug(),
153+
kinkCand.dcaMothPv(), kinkCand.dcaDaugPv(), kinkCand.dcaKinkTopo(),
154+
kinkCand.mothSign(),
155+
dauTrack.tpcNSigmaPi(), dauTrack.tpcNSigmaPr(), dauTrack.tpcNSigmaKa(),
156+
mcTrackSigma.pdgCode(), mcTrackPiDau.pdgCode(),
157+
kinkCand.ptMoth(), kinkCand.mSigmaMinus());
158+
126159
}
127-
}
128-
}
129-
}
160+
} // MC association and selection
161+
} // kink cand loop
162+
} // collision loop
163+
164+
// Loop over all generated particles to fill MC histograms
130165
for (const auto& mcPart : particlesMC) {
131166
if (std::abs(mcPart.pdgCode()) != 3112 || std::abs(mcPart.y()) > 0.5) {
132167
continue;
@@ -136,7 +171,7 @@ struct sigmaminustask {
136171
}
137172
bool hasSigmaDaughter = false;
138173
for (const auto& daughter : mcPart.daughters_as<aod::McParticles>()) {
139-
if (std::abs(daughter.pdgCode()) == 211) { // Sigma PDG code
174+
if (std::abs(daughter.pdgCode()) == 211) { // Pi PDG code
140175
hasSigmaDaughter = true;
141176
break; // Found a pi daughter, exit loop
142177
}
@@ -149,6 +184,7 @@ struct sigmaminustask {
149184
rSigmaMinus.fill(HIST("h2MassPtMCGen"), sigmaSign * mcPart.pt(), mcMass);
150185
}
151186
}
187+
152188
PROCESS_SWITCH(sigmaminustask, processMC, "MC processing", false);
153189
};
154190

0 commit comments

Comments
 (0)