@@ -163,6 +163,8 @@ struct nucleiInJets {
163163 Configurable<bool > useTOFVeto{" useTOFVeto" , false , " true: use TOF veto, false: no TOF veto" };
164164 Configurable<bool > isRequireHitsInITSLayers{" isRequireHitsInITSLayers" , true , " true: at least one hit in the its inner layes" };
165165 Configurable<bool > useMcC{" useMcC" , true , " use mcC" };
166+ Configurable<bool > usebkgSubractionMC{" usebkgSubractionMC" , true , " use rho-area background subtraction for detector-level matched MC jets" };
167+ Configurable<float > cfgjetPtBkgSubMinMC{" cfgjetPtBkgSubMinMC" , 10 .0f , " minimum detector-level matched MC jet pT after optional background subtraction" };
166168 Configurable<bool > useRapidityCutForPID{" useRapidityCutForPID" , false , " true: use rapidity cut for PID, false: no rapidity cut for PID" };
167169
168170 Configurable<bool > addpik{" addpik" , true , " add pion and kaon hist" };
@@ -245,12 +247,15 @@ struct nucleiInJets {
245247 const AxisSpec massHeAxis{binsMassHe, " " };
246248 const AxisSpec PtAxis{ptAxisConf, " " };
247249
248- jetHist.add (" hNEvents" , " hNEvents" , {HistType::kTH1D , {{6 , 0 .f , 6 .f }}});
250+ jetHist.add (" hNEvents" , " hNEvents" , {HistType::kTH1D , {{8 , 0 .f , 8 .f }}});
249251 jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (1 , " All" );
250252 jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (2 , " Skimmed" );
251253 jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (3 , " |Vz|<10" );
252- jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (4 , " Sel8+|Vz|<10" );
253- jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (5 , " nJets>0" );
254+ jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (4 , " Sel8" );
255+ jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (5 , " noSameBunchPileup" );
256+ jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (6 , " isGoodZvtxFT0vsPV" );
257+ jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (7 , " OccupancySel" );
258+ jetHist.get <TH1 >(HIST (" hNEvents" ))->GetXaxis ()->SetBinLabel (8 , " nJets>0" );
254259
255260 jetHist.add (" hNEventsInc" , " hNEventsInc" , {HistType::kTH1D , {{6 , 0 .f , 6 .f }}});
256261 jetHist.get <TH1 >(HIST (" hNEventsInc" ))->GetXaxis ()->SetBinLabel (1 , " All" );
@@ -424,9 +429,13 @@ struct nucleiInJets {
424429 jetHist.add <TH2 >(" tracks/antiKaon/h2TofNsigmaantiKaonVsPt_jet" , " h2TofNsigmaantiKaonVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
425430 }
426431 jetHist.add <TH2 >(" tracks/proton/h2TofNsigmaProtonVsPt_jet" , " h2TofNsigmaProtonVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
432+ jetHist.add <TH3 >(" tracks/proton/h3TofNsigmaProtonVsPtVsJetPtBkgSub_jet" , " h3TofNsigmaProtonVsPtVsJetPtBkgSub_jet; TofNsigma; #it{p}_{T} (GeV); jet #it{p}_{T} (Bkg Sub) (GeV)" , HistType::kTH3F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}, {PtJetAxis}});
427433 jetHist.add <TH2 >(" tracks/antiProton/h2TofNsigmaantiProtonVsPt_jet" , " h2TofNsigmaantiProtonVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
434+ jetHist.add <TH3 >(" tracks/antiProton/h3TofNsigmaantiProtonVsPtVsJetPtBkgSub_jet" , " h3TofNsigmaantiProtonVsPtVsJetPtBkgSub_jet; TofNsigma; #it{p}_{T} (GeV); jet #it{p}_{T} (Bkg Sub) (GeV)" , HistType::kTH3F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}, {PtJetAxis}});
428435 jetHist.add <TH2 >(" tracks/deuteron/h2TofNsigmaDeuteronVsPt_jet" , " h2TofNsigmaDeuteronVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
436+ jetHist.add <TH3 >(" tracks/deuteron/h3TofNsigmaDeuteronVsPtVsJetPtBkgSub_jet" , " h3TofNsigmaDeuteronVsPtVsJetPtBkgSub_jet; TofNsigma; #it{p}_{T} (GeV); jet #it{p}_{T} (Bkg Sub) (GeV)" , HistType::kTH3F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}, {PtJetAxis}});
429437 jetHist.add <TH2 >(" tracks/antiDeuteron/h2TofNsigmaantiDeuteronVsPt_jet" , " h2TofNsigmaantiDeuteronVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
438+ jetHist.add <TH3 >(" tracks/antiDeuteron/h3TofNsigmaantiDeuteronVsPtVsJetPtBkgSub_jet" , " h3TofNsigmaantiDeuteronVsPtVsJetPtBkgSub_jet; TofNsigma; #it{p}_{T} (GeV); jet #it{p}_{T} (Bkg Sub) (GeV)" , HistType::kTH3F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}, {PtJetAxis}});
430439 jetHist.add <TH2 >(" tracks/triton/h2TofNsigmaTritonVsPt_jet" , " h2TofNsigmaTritonVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
431440 jetHist.add <TH2 >(" tracks/antiTriton/h2TofNsigmaantiTritonVsPt_jet" , " h2TofNsigmaantiTritonVsPt_jet; TofNsigma; #it{p}_{T} (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
432441 jetHist.add <TH2 >(" tracks/helium/h2TofNsigmaHeliumVsPt_jet" , " h2TofNsigmaHeliumVsPt_jet; TofNsigma; #it{p}_{T}/z (GeV)" , HistType::kTH2F , {{100 , -5 , 5 }, {50 , 0 ., 5 .}});
@@ -1012,6 +1021,8 @@ struct nucleiInJets {
10121021 jetHist.fill (HIST (" tracks/proton/h3TOFmass2ProtonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassProton * MassProton, trk.pt (), jetPtBkgSub);
10131022 jetHist.fill (HIST (" tracks/deuteron/h3TOFmassDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
10141023 jetHist.fill (HIST (" tracks/deuteron/h3TOFmass2DeuteronVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt (), jetPtBkgSub);
1024+ jetHist.fill (HIST (" tracks/proton/h3TofNsigmaProtonVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaPr (), trk.pt (), jetPtBkgSub);
1025+ jetHist.fill (HIST (" tracks/deuteron/h3TofNsigmaDeuteronVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaDe (), trk.pt (), jetPtBkgSub);
10151026 jetHist.fill (HIST (" tracks/triton/h3TOFmassTritonVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
10161027 jetHist.fill (HIST (" tracks/triton/h3TOFmass2TritonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassTriton * MassTriton, trk.pt (), jetPtBkgSub);
10171028 jetHist.fill (HIST (" tracks/helium/h3TOFmassHeliumVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt () / 2.0 , jetPtBkgSub);
@@ -1030,6 +1041,7 @@ struct nucleiInJets {
10301041 if (backgroundRho > 0 ) {
10311042 jetHist.fill (HIST (" tracks/proton/h3TOFmassProtonVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
10321043 jetHist.fill (HIST (" tracks/proton/h3TOFmass2ProtonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassProton * MassProton, trk.pt (), jetPtBkgSub);
1044+ jetHist.fill (HIST (" tracks/proton/h3TofNsigmaProtonVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaPr (), trk.pt (), jetPtBkgSub);
10331045 }
10341046 jetHist.fill (HIST (" tracks/proton/h2TofNsigmaProtonVsPt_jet" ), trk.tofNSigmaPr (), trk.pt ());
10351047 jetHist.fill (HIST (" tracks/proton/h3TpcNsigmaTofNsigmaProtonVsPt_jet" ), trk.tpcNSigmaPr (), trk.tofNSigmaPr (), trk.pt ());
@@ -1040,6 +1052,7 @@ struct nucleiInJets {
10401052 if (backgroundRho > 0 ) {
10411053 jetHist.fill (HIST (" tracks/deuteron/h3TOFmassDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
10421054 jetHist.fill (HIST (" tracks/deuteron/h3TOFmass2DeuteronVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt (), jetPtBkgSub);
1055+ jetHist.fill (HIST (" tracks/deuteron/h3TofNsigmaDeuteronVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaDe (), trk.pt (), jetPtBkgSub);
10431056 }
10441057 jetHist.fill (HIST (" tracks/deuteron/h2TofNsigmaDeuteronVsPt_jet" ), trk.tofNSigmaDe (), trk.pt ());
10451058 jetHist.fill (HIST (" tracks/deuteron/h3TpcNsigmaTofNsigmaDeuteronVsPt_jet" ), trk.tpcNSigmaDe (), trk.tofNSigmaDe (), trk.pt ());
@@ -1202,6 +1215,8 @@ struct nucleiInJets {
12021215 jetHist.fill (HIST (" tracks/antiProton/h3TOFmass2antiProtonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassProton * MassProton, trk.pt (), jetPtBkgSub);
12031216 jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmassantiDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
12041217 jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmass2antiDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt (), jetPtBkgSub);
1218+ jetHist.fill (HIST (" tracks/antiProton/h3TofNsigmaantiProtonVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaPr (), trk.pt (), jetPtBkgSub);
1219+ jetHist.fill (HIST (" tracks/antiDeuteron/h3TofNsigmaantiDeuteronVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaDe (), trk.pt (), jetPtBkgSub);
12051220 jetHist.fill (HIST (" tracks/antiTriton/h3TOFmassantiTritonVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
12061221 jetHist.fill (HIST (" tracks/antiTriton/h3TOFmass2antiTritonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassTriton * MassTriton, trk.pt (), jetPtBkgSub);
12071222 jetHist.fill (HIST (" tracks/antiHelium/h3TOFmassantiHeliumVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt () / 2.0 , jetPtBkgSub);
@@ -1214,13 +1229,19 @@ struct nucleiInJets {
12141229 if (backgroundRho > 0 ) {
12151230 jetHist.fill (HIST (" tracks/antiProton/h3TOFmassantiProtonVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
12161231 jetHist.fill (HIST (" tracks/antiProton/h3TOFmass2antiProtonVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassProton * MassProton, trk.pt (), jetPtBkgSub);
1232+ jetHist.fill (HIST (" tracks/antiProton/h3TofNsigmaantiProtonVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaPr (), trk.pt (), jetPtBkgSub);
12171233 }
12181234 jetHist.fill (HIST (" tracks/antiProton/h2TofNsigmaantiProtonVsPt_jet" ), trk.tofNSigmaPr (), trk.pt ());
12191235 jetHist.fill (HIST (" tracks/antiProton/h3TpcNsigmaTofNsigmaantiProtonVsPt_jet" ), trk.tpcNSigmaPr (), trk.tofNSigmaPr (), trk.pt ());
12201236 }
12211237 if (std::abs (trk.tpcNSigmaDe ()) < cfgnTPCPIDDe) {
12221238 jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmassantiDeuteronVsPtVsJetPt_jet" ), massTOF, trk.pt (), jetPt);
12231239 jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmass2antiDeuteronVsPtVsJetPt_jet" ), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt (), jetPt);
1240+ if (backgroundRho > 0 ) {
1241+ jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmassantiDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF, trk.pt (), jetPtBkgSub);
1242+ jetHist.fill (HIST (" tracks/antiDeuteron/h3TOFmass2antiDeuteronVsPtVsJetPtBkgSub_jet" ), massTOF * massTOF - MassDeuteron * MassDeuteron, trk.pt (), jetPtBkgSub);
1243+ jetHist.fill (HIST (" tracks/antiDeuteron/h3TofNsigmaantiDeuteronVsPtVsJetPtBkgSub_jet" ), trk.tofNSigmaDe (), trk.pt (), jetPtBkgSub);
1244+ }
12241245 jetHist.fill (HIST (" tracks/antiDeuteron/h2TofNsigmaantiDeuteronVsPt_jet" ), trk.tofNSigmaDe (), trk.pt ());
12251246 jetHist.fill (HIST (" tracks/antiDeuteron/h3TpcNsigmaTofNsigmaantiDeuteronVsPt_jet" ), trk.tpcNSigmaDe (), trk.tofNSigmaDe (), trk.pt ());
12261247 }
@@ -1609,8 +1630,8 @@ struct nucleiInJets {
16091630 {
16101631 auto bc = collision.bc_as <aod::JBCs>();
16111632 initCCDB (bc);
1633+ jetHist.fill (HIST (" hNEvents" ), 0.5 );
16121634 if (applySkim) {
1613- jetHist.fill (HIST (" hNEvents" ), 0.5 );
16141635 bool zorroSelected = zorro.isSelected (bc.globalBC ());
16151636 if (!zorroSelected) {
16161637 return ;
@@ -1623,6 +1644,15 @@ struct nucleiInJets {
16231644 if (!jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" )))
16241645 return ;
16251646 jetHist.fill (HIST (" hNEvents" ), 3.5 );
1647+ if (selNoSameBunchPileup && !jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" NoSameBunchPileup" )))
1648+ return ;
1649+ jetHist.fill (HIST (" hNEvents" ), 4.5 );
1650+ if (selIsGoodZvtxFT0vsPV && !jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" IsGoodZvtxFT0vsPV" )))
1651+ return ;
1652+ jetHist.fill (HIST (" hNEvents" ), 5.5 );
1653+ if (useOccupancy && !isOccupancyAccepted (collision))
1654+ return ;
1655+ jetHist.fill (HIST (" hNEvents" ), 6.5 );
16261656 int nJets = 0 ;
16271657 std::vector<float > leadingJetWithPtEtaPhi (3 );
16281658 float leadingJetPt = -1 .0f ;
@@ -1655,7 +1685,7 @@ struct nucleiInJets {
16551685 jetHist.fill (HIST (" vertexZ" ), collision.posZ ());
16561686 if (nJets > 0 ) {
16571687 jetHist.fill (HIST (" jet/vertexZ" ), collision.posZ ());
1658- jetHist.fill (HIST (" hNEvents" ), 4 .5 );
1688+ jetHist.fill (HIST (" hNEvents" ), 7 .5 );
16591689 } else {
16601690 jetHist.fill (HIST (" jetOut/vertexZ" ), collision.posZ ());
16611691 }
@@ -1673,8 +1703,8 @@ struct nucleiInJets {
16731703 {
16741704 auto bc = collision.bc_as <aod::JBCs>();
16751705 initCCDB (bc);
1706+ jetHist.fill (HIST (" hNEvents" ), 0.5 );
16761707 if (applySkim) {
1677- jetHist.fill (HIST (" hNEvents" ), 0.5 );
16781708 bool zorroSelected = zorro.isSelected (bc.globalBC ());
16791709 if (!zorroSelected) {
16801710 return ;
@@ -1688,6 +1718,15 @@ struct nucleiInJets {
16881718 if (!jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" sel8" )))
16891719 return ;
16901720 jetHist.fill (HIST (" hNEvents" ), 3.5 );
1721+ if (selNoSameBunchPileup && !jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" NoSameBunchPileup" )))
1722+ return ;
1723+ jetHist.fill (HIST (" hNEvents" ), 4.5 );
1724+ if (selIsGoodZvtxFT0vsPV && !jetderiveddatautilities::selectCollision (collision, jetderiveddatautilities::initialiseEventSelectionBits (" IsGoodZvtxFT0vsPV" )))
1725+ return ;
1726+ jetHist.fill (HIST (" hNEvents" ), 5.5 );
1727+ if (useOccupancy && !isOccupancyAccepted (collision))
1728+ return ;
1729+ jetHist.fill (HIST (" hNEvents" ), 6.5 );
16911730 int nJets = 0 ;
16921731 std::vector<float > leadingJetWithPtEtaPhi (3 );
16931732 float leadingJetPt = -1 .0f ;
@@ -1720,7 +1759,7 @@ struct nucleiInJets {
17201759 jetHist.fill (HIST (" vertexZ" ), collision.posZ ());
17211760 if (nJets > 0 ) {
17221761 jetHist.fill (HIST (" jet/vertexZ" ), collision.posZ ());
1723- jetHist.fill (HIST (" hNEvents" ), 4 .5 );
1762+ jetHist.fill (HIST (" hNEvents" ), 7 .5 );
17241763 } else {
17251764 jetHist.fill (HIST (" jetOut/vertexZ" ), collision.posZ ());
17261765 }
@@ -2172,6 +2211,14 @@ struct nucleiInJets {
21722211
21732212 jetHist.fill (HIST (" recmatched/vertexZ" ), collision.posZ ());
21742213
2214+ // Event-wise random splitting for closure test: decide once per event
2215+ bool useDataLikeHist = (randUniform.Uniform (0 , 1 ) < 0.5 );
2216+ const float backgroundRho = collision.rho ();
2217+ const float jetArea = M_PI * cfgjetR * cfgjetR;
2218+ if (usebkgSubractionMC) {
2219+ jetHist.fill (HIST (" jet/h1BkgRho" ), backgroundRho);
2220+ }
2221+
21752222 std::vector<double > mcdJetPt{};
21762223 std::vector<double > mcdJetPhi{};
21772224 std::vector<double > mcdJetEta{};
@@ -2191,21 +2238,25 @@ struct nucleiInJets {
21912238 if (!mcpjet.has_matchedJetGeo ())
21922239 continue ;
21932240
2194- mcdJetPt.push_back (mcdjet.pt ());
2241+ const float mcdJetPtForResponse = usebkgSubractionMC ? mcdjet.pt () - backgroundRho * jetArea : mcdjet.pt ();
2242+ if (mcdJetPtForResponse < cfgjetPtBkgSubMinMC) {
2243+ continue ;
2244+ }
2245+ mcdJetPt.push_back (mcdJetPtForResponse);
21952246 mcdJetPhi.push_back (mcdjet.phi ());
21962247 mcdJetEta.push_back (mcdjet.eta ());
21972248 mcpJetPt.push_back (mcpjet.pt ());
21982249 mcpJetPhi.push_back (mcpjet.phi ());
21992250 mcpJetEta.push_back (mcpjet.eta ());
22002251
2201- jetHist.fill (HIST (" recmatched/hRecMatchedJetPt" ), mcpjet.pt (), mcpjet.pt () - mcdjet. pt () );
2252+ jetHist.fill (HIST (" recmatched/hRecMatchedJetPt" ), mcpjet.pt (), mcpjet.pt () - mcdJetPtForResponse );
22022253 jetHist.fill (HIST (" recmatched/hRecMatchedJetPhi" ), mcpjet.phi (), mcpjet.phi () - mcdjet.phi ());
22032254 jetHist.fill (HIST (" recmatched/hRecMatchedJetEta" ), mcpjet.eta (), mcpjet.eta () - mcdjet.eta ());
22042255
2205- jetHist.fill (HIST (" recmatched/hRecMatchedVsGenJetPtVsEta" ), mcdjet. pt () , mcdjet.eta ());
2206- jetHist.fill (HIST (" recmatched/hRecJetPt" ), mcdjet. pt () );
2256+ jetHist.fill (HIST (" recmatched/hRecMatchedVsGenJetPtVsEta" ), mcdJetPtForResponse , mcdjet.eta ());
2257+ jetHist.fill (HIST (" recmatched/hRecJetPt" ), mcdJetPtForResponse );
22072258 jetHist.fill (HIST (" recmatched/hGenJetPt" ), mcpjet.pt ());
2208- jetHist.fill (HIST (" recmatched/h2ResponseMatrix" ), mcdjet. pt () , mcpjet.pt ());
2259+ jetHist.fill (HIST (" recmatched/h2ResponseMatrix" ), mcdJetPtForResponse , mcpjet.pt ());
22092260 } // mcpJet
22102261 } // mcdJet
22112262
@@ -2219,7 +2270,7 @@ struct nucleiInJets {
22192270 LOGP (fatal, " Error: Index {} is out of range for vectors!" , indexJet);
22202271 }
22212272 if (useMcC) {
2222- if (randUniform. Uniform ( 0 , 1 ) < 0.5 )
2273+ if (useDataLikeHist )
22232274 jetHist.fill (HIST (" recmatched/h2ResponseMatrixLeadingJet" ), mcdJetPt.at (indexJet), mcpJetPt.at (indexJet));
22242275 else
22252276 jetHist.fill (HIST (" recmatched/mcC/h2ResponseMatrixLeadingJet" ), mcdJetPt.at (indexJet), mcpJetPt.at (indexJet));
@@ -2287,7 +2338,7 @@ struct nucleiInJets {
22872338 bool isTpcPassed (true ); // why is this always true?
22882339 jetHist.fill (HIST (" eff/recmatched/pt/PtParticleType" ), mcTrack.pt (), jetFlag, mapPDGToValue (mcTrack.pdgCode ()));
22892340 if (useMcC) {
2290- if (randUniform. Uniform ( 0 , 1 ) < 0.5 )
2341+ if (useDataLikeHist )
22912342 jetHist.fill (HIST (" eff/recmatched/mcC/pt/PtParticleType" ), track.pt (), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()));
22922343 else
22932344 jetHist.fill (HIST (" eff/recmatched/mcCSpectra/pt/PtParticleType" ), track.pt (), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()));
@@ -2306,7 +2357,7 @@ struct nucleiInJets {
23062357 if (jetFlagPerpCone) {
23072358 jetHist.fill (HIST (" eff/recmatched/perpCone/pt/PtParticleType" ), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()));
23082359 if (useMcC) {
2309- if (randUniform. Uniform ( 0 , 1 ) < 0.5 )
2360+ if (useDataLikeHist )
23102361 jetHist.fill (HIST (" eff/recmatched/perpCone/mcC/pt/PtParticleType" ), track.pt (), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()));
23112362 else
23122363 jetHist.fill (HIST (" eff/recmatched/perpCone/mcCSpectra/pt/PtParticleType" ), track.pt (), mcTrack.pt (), mapPDGToValue (mcTrack.pdgCode ()));
@@ -2391,6 +2442,9 @@ struct nucleiInJets {
23912442 return ;
23922443 jetHist.fill (HIST (" genmatched/vertexZ" ), collision.posZ ());
23932444
2445+ // Event-wise random splitting for closure test: decide once per event
2446+ bool useDataLikeHist = (randUniform.Uniform (0 , 1 ) < 0.5 );
2447+
23942448 std::vector<double > mcpJetPt{};
23952449 std::vector<double > mcpJetPhi{};
23962450 std::vector<double > mcpJetEta{};
@@ -2441,7 +2495,7 @@ struct nucleiInJets {
24412495 jetHist.fill (HIST (" genmatched/hRecMatchedJetEta" ), leadingMCPJet.eta (), leadingMCPJet.eta () - mcdjet.eta ());
24422496
24432497 if (useMcC) {
2444- if (randUniform. Uniform ( 0 , 1 ) < 0.5 ) {
2498+ if (useDataLikeHist ) {
24452499 jetHist.fill (HIST (" genmatched/hRecMatchedVsGenJetPt" ), mcdjet.pt (), leadingMCPJet.pt ());
24462500 } else {
24472501 jetHist.fill (HIST (" genmatched/mcC/hRecMatchedVsGenJetPt" ), mcdjet.pt (), leadingMCPJet.pt ());
0 commit comments