Skip to content

Commit 9cadc08

Browse files
committed
reduce code repetition using tpcSignalGeneric<>()
1 parent c0812f1 commit 9cadc08

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,7 @@ struct TreeWriterTpcV0 {
265265

266266
const double pseudoRndm = track.pt() * 1000. - static_cast<int64_t>(track.pt() * 1000);
267267
if (pseudoRndm < dwnSmplFactor) {
268-
float usedDedx{UndefValueFloat};
269-
if constexpr (DoUseCorrectedDeDx) {
270-
usedDedx = track.tpcSignalCorrected();
271-
} else {
272-
usedDedx = track.tpcSignal();
273-
}
268+
const float usedDedx = tpcSignalGeneric<DoUseCorrectedDeDx>(track);
274269
float tpcdEdxNorm{UndefValueFloat};
275270
if constexpr (ModeId != ModeStandard) {
276271
tpcdEdxNorm = existTrkQA ? trackQA.tpcdEdxNorm() : UndefValueFloat;
@@ -679,12 +674,7 @@ struct TreeWriterTpcTof {
679674

680675
const double pseudoRndm = track.pt() * 1000. - static_cast<int64_t>(track.pt() * 1000);
681676
if (pseudoRndm < dwnSmplFactor) {
682-
float usedEdx;
683-
if constexpr (DoCorrectDeDx) {
684-
usedEdx = track.tpcSignalCorrected();
685-
} else {
686-
usedEdx = track.tpcSignal();
687-
}
677+
const float usedEdx = tpcSignalGeneric<DoCorrectDeDx>(track);
688678
float tpcdEdxNorm{UndefValueFloat};
689679
if constexpr (ModeId != ModeStandard) {
690680
tpcdEdxNorm = existTrkQA ? trackQA.tpcdEdxNorm() : UndefValueFloat;

0 commit comments

Comments
 (0)