@@ -420,10 +420,23 @@ struct AntinucleiInJets {
420420 return false ;
421421 }
422422
423- double getCorrectedPt (double ptRec)
423+ double getCorrectedPt (double ptRec, TH2* responseMatrix )
424424 {
425- // to be developed
426- return ptRec;
425+
426+ int binX = responseMatrix->GetXaxis ()->FindBin (ptRec);
427+ TH1D* proj = responseMatrix->ProjectionY (" proj" , binX, binX);
428+
429+ // add a protection in case the projection is empty
430+ if (proj->GetEntries () == 0 ) {
431+ delete proj;
432+ return ptRec;
433+ }
434+
435+ double deltaPt = proj->GetRandom ();
436+ double ptGen = ptRec + deltaPt;
437+ delete proj;
438+
439+ return ptGen;
427440 }
428441
429442 void getReweightingHistograms (o2::framework::Service<o2::ccdb::BasicCCDBManager> const & ccdbObj, TString filepath, TString histname_antip_jet, TString histname_antip_ue)
@@ -520,7 +533,8 @@ struct AntinucleiInJets {
520533 // jet pt must be larger than threshold
521534 auto jetForSub = jet;
522535 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
523- if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
536+ // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
537+ if (jetMinusBkg.pt () < minJetPt)
524538 continue ;
525539 isAtLeastOneJetSelected = true ;
526540
@@ -752,7 +766,8 @@ struct AntinucleiInJets {
752766 double ptJetAfterSub = jetForSub.pt ();
753767 registryQC.fill (HIST (" jetPtDifference" ), ptJetAfterSub - ptJetBeforeSub);
754768
755- if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
769+ // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
770+ if (jetMinusBkg.pt () < minJetPt)
756771 continue ;
757772 njetsHighPt++;
758773 registryQC.fill (HIST (" sumPtJet" ), jet.pt ());
@@ -1111,7 +1126,8 @@ struct AntinucleiInJets {
11111126 // jet pt must be larger than threshold
11121127 auto jetForSub = jet;
11131128 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
1114- if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
1129+ // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
1130+ if (jetMinusBkg.pt () < minJetPt)
11151131 continue ;
11161132
11171133 // perpendicular cone
@@ -1286,7 +1302,8 @@ struct AntinucleiInJets {
12861302 // jet pt must be larger than threshold
12871303 auto jetForSub = jet;
12881304 fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
1289- if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
1305+ // if (getCorrectedPt(jetMinusBkg.pt()) < minJetPt) // while fixing the response matrix
1306+ if (jetMinusBkg.pt () < minJetPt)
12901307 continue ;
12911308
12921309 // get jet constituents
0 commit comments