Skip to content

Commit 48bdee6

Browse files
author
Zuzanna Chochulska
committed
Corrections for the PR part 5
1 parent de6f624 commit 48bdee6

1 file changed

Lines changed: 32 additions & 30 deletions

File tree

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ struct FemtoUniversePairTaskTrackPhi {
219219
{
220220
if (mom < ConfTrackPtPIDLimit) {
221221
return std::abs(nsigmaTPCPr) < ConfPIDProtonNsigmaTPC;
222-
} else if (mom > ConfTrackPtPIDLimit) {
222+
}
223+
if (mom > ConfTrackPtPIDLimit) {
223224
return std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPIDProtonNsigmaCombined;
224225
}
225226
return false;
@@ -230,45 +231,46 @@ struct FemtoUniversePairTaskTrackPhi {
230231
if (mom < 0.5) {
231232
return true;
232233
}
233-
if (mom > 0.5) {
234+
if (mom >= 0.5) {
234235
return std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPIDPionNsigmaReject || std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfPIDKaonNsigmaReject;
235-
} else {
236-
return false;
237236
}
237+
// this will never be reached but is needed to avoid compiler warnings
238+
return false;
238239
}
239240

240241
bool isKaonNSigma(float mom, bool hasTOF, float nsigmaTPCK, float nsigmaTOFK)
241242
{
242243
if (ConfTrackUseRun3PIDforKaons) {
243244
if (mom < 0.5) {
244245
return std::abs(nsigmaTPCK) < 3.0;
245-
} else if (mom >= 0.5) {
246-
if (hasTOF) // if TOF is available, use combine nsigma
247-
{
246+
}
247+
if (mom >= 0.5) {
248+
if (hasTOF) { // if TOF is available, use combine nsigma
248249
return std::hypot(nsigmaTOFK, nsigmaTPCK) < 3.0;
249-
} else // if TOF is not available, use TPC nsigma only
250+
}
251+
if (!hasTOF) // if TOF is not available, use TPC nsigma only
250252
{
251253
return std::abs(nsigmaTPCK) < 3.0;
252254
}
253255
}
254-
255-
else {
256-
return false;
257-
}
256+
return false;
258257
} else {
259258
if (mom < 0.3) { // 0.0-0.3
260259
return std::abs(nsigmaTPCK) < 3.0;
261-
} else if (mom < 0.45) { // 0.30 - 0.45
260+
}
261+
if (mom < 0.45) { // 0.30 - 0.45
262262
return std::abs(nsigmaTPCK) < 2.0;
263-
} else if (mom < 0.55) { // 0.45-0.55
263+
}
264+
if (mom < 0.55) { // 0.45-0.55
264265
return std::abs(nsigmaTPCK) < 1.0;
265-
} else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF)
266+
}
267+
if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF)
266268
return std::hypot(nsigmaTOFK, nsigmaTPCK) < 3.0;
267-
} else if (mom > 1.5) { // 1.5 -
269+
}
270+
if (mom > 1.5) { // 1.5 -
268271
return (std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0);
269-
} else {
270-
return false;
271272
}
273+
return false;
272274
}
273275
}
274276

@@ -277,21 +279,19 @@ struct FemtoUniversePairTaskTrackPhi {
277279
if (mom < 0.5) {
278280
return (std::abs(nsigmaTPCPi) < ConfPIDPionNsigmaReject) || (std::abs(nsigmaTPCPr) < ConfPIDProtonNsigmaReject);
279281
}
280-
if (mom > 0.5) {
282+
if (mom >= 0.5) {
281283
return (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPIDPionNsigmaReject) || (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPIDProtonNsigmaReject);
282-
} else {
283-
return false;
284284
}
285+
return false;
285286
}
286287

287288
bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
288289
{
289-
if (true) {
290-
if (mom < 0.5) {
291-
return (std::abs(nsigmaTPCPi) < ConfPIDPionNsigmaTPC);
292-
} else if (mom > 0.5) {
293-
return (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPIDPionNsigmaCombined);
294-
}
290+
if (mom < 0.5) {
291+
return (std::abs(nsigmaTPCPi) < ConfPIDPionNsigmaTPC);
292+
}
293+
if (mom >= 0.5) {
294+
return (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPIDPionNsigmaCombined);
295295
}
296296
return false;
297297
}
@@ -301,7 +301,7 @@ struct FemtoUniversePairTaskTrackPhi {
301301
if (mom < 0.5) {
302302
return (std::abs(nsigmaTPCK) < ConfPIDKaonNsigmaReject) || (std::abs(nsigmaTPCPr) < ConfPIDProtonNsigmaReject);
303303
}
304-
if (mom > 0.5) {
304+
if (mom >= 0.5) {
305305
return (std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfPIDKaonNsigmaReject) || (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPIDProtonNsigmaReject);
306306
} else {
307307
return false;
@@ -698,7 +698,8 @@ struct FemtoUniversePairTaskTrackPhi {
698698
registryMCtruth.fill(HIST("MCtruthPpos"), part.pt(), part.eta());
699699
registryMCtruth.fill(HIST("MCtruthPposPt"), part.pt());
700700
continue;
701-
} else if (pdgCode == kKPlus) {
701+
}
702+
if (pdgCode == kKPlus) {
702703
registryMCtruth.fill(HIST("MCtruthKp"), part.pt(), part.eta());
703704
registryMCtruth.fill(HIST("MCtruthKpPt"), part.pt());
704705
continue;
@@ -720,7 +721,8 @@ struct FemtoUniversePairTaskTrackPhi {
720721
registryMCtruth.fill(HIST("MCtruthKm"), part.pt(), part.eta());
721722
registryMCtruth.fill(HIST("MCtruthKmPt"), part.pt());
722723
continue;
723-
} else if (pdgCode == kProtonBar) {
724+
}
725+
if (pdgCode == kProtonBar) {
724726
registryMCtruth.fill(HIST("MCtruthPneg"), part.pt(), part.eta());
725727
registryMCtruth.fill(HIST("MCtruthPnegPt"), part.pt());
726728
continue;

0 commit comments

Comments
 (0)