Skip to content

Commit 3a0e9f1

Browse files
authored
use brace and reduce if condition
1 parent 7e4da8e commit 3a0e9f1

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,23 @@ struct HfCorrelatorHfeHadrons {
214214
double ptHadron = -999;
215215
double etaHadron = -999;
216216
double phiHadron = -999;
217-
if (eTrack.isEmcal()) {
218-
// EMCal electron
219-
if (requireEmcal) {
217+
// EMCal electron
218+
if (eTrack.isEmcal() && requireEmcal) {
219+
acceptElectron = true;
220+
} else if (!eTrack.isEmcal() && !requireEmcal) {
221+
222+
// Apply sigma cut
223+
if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl && eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin &&
224+
eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) {
225+
registry.fill(HIST("hTofnSigmaVsP"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack());
226+
registry.fill(HIST("hTpcnSigmaVsP"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack());
220227
acceptElectron = true;
221228
}
222-
} else {
223-
// Non-EMCal electron
224-
if (!requireEmcal) {
225-
// Apply sigma cut
226-
if (std::abs(eTrack.tofNSigmaElTrack()) < tofNSigmaEl) {
227-
if (eTrack.tpcNSigmaElTrack() > tpcNsigmaElectronMin && eTrack.tpcNSigmaElTrack() < tpcNsigmaElectronMax) {
228-
registry.fill(HIST("hTofnSigmaVsP"), eTrack.tofNSigmaElTrack(), eTrack.ptTrack());
229-
registry.fill(HIST("hTpcnSigmaVsP"), eTrack.tpcNSigmaElTrack(), eTrack.ptTrack());
230-
acceptElectron = true;
231-
}
232-
}
233-
}
234229
}
235230

236-
if (!acceptElectron)
231+
if (!acceptElectron) {
237232
continue; // skip electron if not passing criteria
233+
}
238234

239235
registry.fill(HIST("hptElectron"), ptElectron);
240236
int nElectronLS = 0;

0 commit comments

Comments
 (0)