@@ -267,6 +267,16 @@ struct HfTaskCorrelationDsHadrons {
267267 }
268268 }
269269
270+ bool isSelectedCandidate (const int & ptBinD, const float & bdtScorePrompt, const float & bdtScoreBkg)
271+ {
272+
273+ if (ptBinD == -1 || bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
274+ return false ;
275+ } else {
276+ return true ;
277+ }
278+ }
279+
270280 void processData (DsHadronPairWithMl const & pairEntries,
271281 aod::DsCandRecoInfo const & candidates)
272282 {
@@ -277,13 +287,10 @@ struct HfTaskCorrelationDsHadrons {
277287 float bdtScoreBkg = candidate.mlScoreBkg ();
278288 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
279289
280- if (ptBinD == - 1 ) {
290+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
281291 continue ;
282292 }
283293
284- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
285- continue ;
286- }
287294 double efficiencyWeightD = 1 .;
288295 if (applyEfficiency) {
289296 efficiencyWeightD = 1 . / efficiencyD->at (o2::analysis::findBin (binsPtEfficiencyD, ptD));
@@ -311,13 +318,10 @@ struct HfTaskCorrelationDsHadrons {
311318 int poolBin = pairEntry.poolBin ();
312319 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
313320
314- if (ptBinD == - 1 ) {
321+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
315322 continue ;
316323 }
317324
318- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
319- continue ;
320- }
321325 if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) {
322326 continue ;
323327 }
@@ -363,13 +367,10 @@ struct HfTaskCorrelationDsHadrons {
363367 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
364368 bool isDsPrompt = candidate.isPrompt ();
365369
366- if (ptBinD == - 1 ) {
370+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
367371 continue ;
368372 }
369373
370- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
371- continue ;
372- }
373374 double efficiencyWeightD = 1 .;
374375 if (applyEfficiency) {
375376 efficiencyWeightD = 1 . / efficiencyD->at (o2::analysis::findBin (binsPtEfficiencyD, ptD));
@@ -406,13 +407,10 @@ struct HfTaskCorrelationDsHadrons {
406407 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
407408 bool isPhysicalPrimary = pairEntry.isPhysicalPrimary ();
408409
409- if (ptBinD == - 1 ) {
410+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
410411 continue ;
411412 }
412413
413- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
414- continue ;
415- }
416414 if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) {
417415 continue ;
418416 }
@@ -504,13 +502,10 @@ struct HfTaskCorrelationDsHadrons {
504502 int poolBin = pairEntry.poolBin ();
505503 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
506504
507- if (ptBinD == - 1 ) {
505+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
508506 continue ;
509507 }
510508
511- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
512- continue ;
513- }
514509 if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) {
515510 continue ;
516511 }
@@ -607,13 +602,10 @@ struct HfTaskCorrelationDsHadrons {
607602 int ptBinD = o2::analysis::findBin (binsPtD, ptD);
608603 bool isPhysicalPrimary = pairEntry.isPhysicalPrimary ();
609604
610- if (ptBinD == - 1 ) {
605+ if (! isSelectedCandidate ( ptBinD, bdtScorePrompt, bdtScoreBkg) ) {
611606 continue ;
612607 }
613608
614- if (bdtScorePrompt < mlOutputPromptMin->at (ptBinD) || bdtScorePrompt > mlOutputPromptMax->at (ptBinD) || bdtScoreBkg > mlOutputBkg->at (ptBinD)) {
615- continue ;
616- }
617609 if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) {
618610 continue ;
619611 }
0 commit comments