Skip to content

Commit e93b001

Browse files
committed
fix PID, remove obsolete comments, disable LOG msgs
1 parent 40cddda commit e93b001

File tree

1 file changed

+41
-45
lines changed

1 file changed

+41
-45
lines changed

PWGLF/Tasks/cascadecorrelations.cxx

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCo
5151
using FullTracksExtWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
5252
using FullTracksExtIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
5353

54-
// Let's try to add a column to the cascdataext table: IsSelected.
55-
// In the future this will probably also be a way to tell Xi's and Omega's apart
54+
// Add a column to the cascdataext table: IsSelected.
55+
// 0 = not selected, 1 = Xi, 2 = Omega
5656
namespace o2::aod
5757
{
5858
namespace cascadeflags
@@ -64,8 +64,6 @@ DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //!
6464
using CascDataExtSelected = soa::Join<CascDataExt, CascadeFlags>;
6565
} // namespace o2::aod
6666

67-
// Should we make a separate struct with "cascadeSelector" here?
68-
// The process function of this would then produce the CascadeFlags table.
6967
struct cascadeSelector {
7068
Produces<aod::CascadeFlags> cascflags;
7169

@@ -93,13 +91,9 @@ struct cascadeSelector {
9391
auto posTrack = v0data.posTrack_as<FullTracksExtIUWithPID>();
9492
auto negTrack = v0data.negTrack_as<FullTracksExtIUWithPID>();
9593

96-
// Bachelor check: Regardless of sign, should be pion (Xi)
97-
if (TMath::Abs(bachTrack.tpcNSigmaPi()) > 3) {
98-
cascflags(0);
99-
continue;
100-
}
101-
102-
if (casc.sign() < 0) { // FIXME: only Xi for now, implement Omega's TODO
94+
// PID
95+
// Lambda check
96+
if (casc.sign() < 0) {
10397
// Proton check:
10498
if (TMath::Abs(posTrack.tpcNSigmaPr()) > 3) {
10599
cascflags(0);
@@ -111,45 +105,55 @@ struct cascadeSelector {
111105
continue;
112106
}
113107
} else {
114-
// //Proton check:
115-
// if (TMath::Abs(posTrack.tpcNSigmaPr()) > 3) {
116-
// cascflags(0);
117-
// continue;
118-
// }
119-
// //Pion check:
120-
// if (TMath::Abs(negTrack.tpcNSigmaPi()) > 3) {
121-
// cascflags(0);
122-
// continue;
123-
// }
108+
//Proton check:
109+
if (TMath::Abs(negTrack.tpcNSigmaPr()) > 3) {
110+
cascflags(0);
111+
continue;
112+
}
113+
//Pion check:
114+
if (TMath::Abs(posTrack.tpcNSigmaPi()) > 3) {
115+
cascflags(0);
116+
continue;
117+
}
124118
}
125-
// if we reach here, candidate is good!
126-
cascflags(1);
119+
// Bachelor check
120+
if (TMath::Abs(bachTrack.tpcNSigmaPi()) < 3) {
121+
if (TMath::Abs(bachTrack.tpcNSigmaKa()) < 3) {
122+
// TODO: ambiguous! ignore for now
123+
cascflags(0);
124+
continue;
125+
}
126+
cascflags(1);
127+
continue;
128+
} else if (TMath::Abs(bachTrack.tpcNSigmaKa()) < 3) {
129+
cascflags(2);
130+
continue;
131+
}
132+
// if we reach here, the bachelor was neither pion nor kaon
133+
cascflags(0);
127134
} // cascade loop
128135
} // process
129136
}; // struct
130137

131138
struct cascadeCorrelations {
132-
// Basic checks
133139
HistogramRegistry registry{
134140
"registry",
135141
{
136142
{"hMassXiMinus", "hMassXiMinus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
137143
{"hMassXiPlus", "hMassXiPlus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
138144
{"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
139145
{"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
140-
141146
{"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2 * PI, "#varphi"}}}},
142-
143147
{"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
144148
{"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
145149
},
146150
};
147151

148-
Filter Selector = aod::cascadeflags::isSelected > 0;
152+
Filter Selector = aod::cascadeflags::isSelected > 0; // TODO: treat Omega's and Xi's differently
149153

150154
void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, soa::Filtered<aod::CascDataExtSelected> const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&)
151155
{
152-
// some QA on the cascades
156+
// Some QA on the cascades
153157
for (auto& casc : Cascades) {
154158

155159
auto v0 = casc.v0_as<o2::aod::V0sLinked>();
@@ -159,15 +163,9 @@ struct cascadeCorrelations {
159163
auto v0data = v0.v0Data();
160164

161165
if (casc.sign() < 0) { // FIXME: could be done better...
162-
// Check if we don't use the same pion twice in single cascade reco
163-
if (casc.bachelorId() == v0data.negTrackId())
164-
LOGF(info, "autocorrelation in neg cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
165166
registry.fill(HIST("hMassXiMinus"), casc.mXi());
166167
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega());
167168
} else {
168-
// Check if we don't use the same pion twice in single cascade reco
169-
if (casc.bachelorId() == v0data.posTrackId())
170-
LOGF(info, "autocorrelation in pos cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
171169
registry.fill(HIST("hMassXiPlus"), casc.mXi());
172170
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega());
173171
}
@@ -184,18 +182,16 @@ struct cascadeCorrelations {
184182
auto v0data0 = lambda0.v0Data();
185183
auto v0data1 = lambda1.v0Data();
186184

187-
LOGF(info, "Found a cascade pair!"); // casc table doesn't have global indices, makes no sense to print them (will just be numbered like 0,1,2,...)
188185
double phi0 = RecoDecay::phi(c0.px(), c0.py());
189186
double phi1 = RecoDecay::phi(c1.px(), c1.py());
190187
double dphi = std::fmod(phi0 - phi1 + 2.5 * PI, 2 * PI) - 0.5 * PI;
191-
if (c0.sign() * c1.sign() < 0) { // OS
188+
if (c0.sign() * c1.sign() < 0) { // opposite-sign
192189
registry.fill(HIST("hDeltaPhiOS"), dphi);
193-
} else { // SS
194-
// Let's see if we have many autocorrelations?
195-
// Should only be prevalent in SS due to pions, lambda's
196-
// Let's first check if the lambda's aren't the same:
190+
} else { // same-sign
191+
// make sure to check for autocorrelations - only possible in same-sign correlations
192+
// TODO: make QA histo to quantify autocorrelations
197193
if (v0data0.v0Id() == v0data1.v0Id()) {
198-
LOGF(info, "same v0 in SS correlation! %d %d", v0data0.v0Id(), v0data1.v0Id());
194+
// LOGF(info, "same v0 in SS correlation! %d %d", v0data0.v0Id(), v0data1.v0Id());
199195
continue;
200196
}
201197
int bachId0 = c0.bachelorId();
@@ -205,22 +201,22 @@ struct cascadeCorrelations {
205201
int posId1 = v0data1.posTrackId();
206202
int negId1 = v0data1.negTrackId();
207203
if (bachId0 == bachId1) {
208-
LOGF(info, "same bachelor in SS correlation! %d %d", bachId0, bachId1);
204+
// LOGF(info, "same bachelor in SS correlation! %d %d", bachId0, bachId1);
209205
continue;
210206
}
211207
// check for same tracks in v0's of cascades
212208
if (negId0 == negId1 || posId0 == posId1) {
213-
LOGF(info, "cascades have a v0-track in common in SS correlation!");
209+
// LOGF(info, "cascades have a v0-track in common in SS correlation!");
214210
continue;
215211
}
216212
if (c0.sign() < 0) { // min cascade
217213
if (negId0 == bachId1 || negId1 == bachId0) {
218-
LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!");
214+
// LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!");
219215
continue;
220216
}
221217
} else { // pos cascade
222218
if (posId0 == bachId1 || posId1 == bachId0) {
223-
LOGF(info, "bach of casc == v0-pion of other casc in pos SS correlation!");
219+
// LOGF(info, "bach of casc == v0-pion of other casc in pos SS correlation!");
224220
continue;
225221
}
226222
}

0 commit comments

Comments
 (0)