@@ -2318,9 +2318,8 @@ struct AntinucleiInJets {
23182318 // Calculate weights
23192319 double weightJet = recoJetPtWeight;
23202320 if (applyReweighting) {
2321- double pt = mcparticle.pt ();
2322- if (pt >= antiprotonsInsideJets->GetXaxis ()->GetXmin () && pt < antiprotonsInsideJets->GetXaxis ()->GetXmax ()) {
2323- int ipt = antiprotonsInsideJets->FindBin (pt);
2321+ if (mcparticle.pt () >= antiprotonsInsideJets->GetXaxis ()->GetXmin () && mcparticle.pt () < antiprotonsInsideJets->GetXaxis ()->GetXmax ()) {
2322+ int ipt = antiprotonsInsideJets->FindBin (mcparticle.pt ());
23242323 weightJet *= antiprotonsInsideJets->GetBinContent (ipt);
23252324 }
23262325 }
@@ -2361,11 +2360,9 @@ struct AntinucleiInJets {
23612360
23622361 // Calculate weight
23632362 double weightJetAntid = recoJetPtWeight;
2364-
23652363 if (applyReweighting) {
2366- double pt = mcparticle.pt ();
2367- if (pt >= antideuteronsInsideJets->GetXaxis ()->GetXmin () && pt < antideuteronsInsideJets->GetXaxis ()->GetXmax ()) {
2368- int ipt = antideuteronsInsideJets->FindBin (pt);
2364+ if (mcparticle.pt () >= antideuteronsInsideJets->GetXaxis ()->GetXmin () && mcparticle.pt () < antideuteronsInsideJets->GetXaxis ()->GetXmax ()) {
2365+ int ipt = antideuteronsInsideJets->FindBin (mcparticle.pt ());
23692366 weightJetAntid *= antideuteronsInsideJets->GetBinContent (ipt);
23702367 }
23712368 }
@@ -2444,9 +2441,8 @@ struct AntinucleiInJets {
24442441 // Calculate weights
24452442 double weightUe = recoJetPtWeight;
24462443 if (applyReweighting) {
2447- double pt = mcparticle.pt ();
2448- if (pt >= antiprotonsPerpCone->GetXaxis ()->GetXmin () && pt < antiprotonsPerpCone->GetXaxis ()->GetXmax ()) {
2449- int ipt = antiprotonsPerpCone->FindBin (pt);
2444+ if (mcparticle.pt () >= antiprotonsPerpCone->GetXaxis ()->GetXmin () && mcparticle.pt () < antiprotonsPerpCone->GetXaxis ()->GetXmax ()) {
2445+ int ipt = antiprotonsPerpCone->FindBin (mcparticle.pt ());
24502446 weightUe *= antiprotonsPerpCone->GetBinContent (ipt);
24512447 }
24522448 }
@@ -2514,10 +2510,12 @@ struct AntinucleiInJets {
25142510 continue ;
25152511
25162512 // Calculate weight
2517- double weightUeAntid (1.0 );
2518- if (applyReweighting && mcparticle.pt () < antideuteronsPerpCone->GetXaxis ()->GetXmax ()) {
2519- int ipt = antideuteronsPerpCone->FindBin (mcparticle.pt ());
2520- weightUeAntid = antideuteronsPerpCone->GetBinContent (ipt) * recoJetPtWeight;
2513+ double weightUeAntid = recoJetPtWeight;
2514+ if (applyReweighting) {
2515+ if (mcparticle.pt () >= antideuteronsPerpCone->GetXaxis ()->GetXmin () && mcparticle.pt () < antideuteronsPerpCone->GetXaxis ()->GetXmax ()) {
2516+ int ipt = antideuteronsPerpCone->FindBin (mcparticle.pt ());
2517+ weightUeAntid *= antideuteronsPerpCone->GetBinContent (ipt);
2518+ }
25212519 }
25222520
25232521 // Fill histograms (TPC and TOF) only for selected candidates
0 commit comments