@@ -92,6 +92,7 @@ struct JetSpectraEseTask {
9292 Configurable<float > pTHatMaxMCD{" pTHatMaxMCD" , 999.0 , " maximum fraction of hard scattering for jet acceptance in detector MC" };
9393 Configurable<float > pTHatMaxMCP{" pTHatMaxMCP" , 999.0 , " maximum fraction of hard scattering for jet acceptance in particle MC" };
9494 Configurable<float > pTHatExponent{" pTHatExponent" , 6.0 , " exponent of the event weight for the calculation of pTHat" };
95+ Configurable<float > pTHatAbsoluteMin{" pTHatAbsoluteMin" , -99 .0f , " minimum value of pTHat" };
9596
9697 Configurable<bool > fLeadJetPtCut {" fLeadJetPtCut" , false , " Flag for leading jet pT cut" };
9798 Configurable<float > leadJetPtMin{" leadJetPtMin" , 20.0 , " minimum leading jet pT cut" };
@@ -540,9 +541,13 @@ struct JetSpectraEseTask {
540541 registry.add (" h3CentdeltapTRndmConePhi_localrhovsphi" , " centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}" , {HistType::kTH3F , {{100 , 0.0 , 100.0 }, {400 , -200.0 , 200.0 }, {dPhiAxis}}});
541542 registry.add (" h3CentdeltapTRndmConePhi_rhovsphi" , " centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}" , {HistType::kTH3F , {{100 , 0.0 , 100.0 }, {400 , -200.0 , 200.0 }, {dPhiAxis}}});
542543 }
544+ // Normalize MC spectra with hUsedEventWeights bin 1 content, not GetEntries().
543545 if (doprocessMCParticleLevel) {
544546 LOGF (info, " JetSpectraEseTask::init() - MC Particle level" );
545547 registry.add (" mcp/hEventCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10.0 }}});
548+ registry.add (" mcp/hUsedEventWeights" , " Used MC collisions;Used events;Sum of event weights" , {HistType::kTH1D , {{1 , 0.0 , 1.0 }}});
549+ registry.get <TH1 >(HIST (" mcp/hUsedEventWeights" ))->Sumw2 ();
550+ registry.get <TH1 >(HIST (" mcp/hUsedEventWeights" ))->GetXaxis ()->SetBinLabel (1 , " Sum of weights of used events" );
546551 registry.add (" mcp/hCentralitySel" , " ;centr;entries" , {HistType::kTH1F , {{centAxis}}});
547552 // registry.add("mcp/hJetSparse", ";Centrality;#it{p}_{T,jet part}; #eta; #phi", {HistType::kTHnSparseF, {{centAxis}, {jetPtAxis}, {etaAxis}, {phiAxis}}});
548553 registry.add (" mcp/hJetSparse" , " ;Centrality;#it{p}_{T,jet part}; #eta; #phi" , {HistType::kTHnSparseF , {{centAxis}, {jetPtAxis}, {etaAxis}, {phiAxis}}});
@@ -560,6 +565,9 @@ struct JetSpectraEseTask {
560565 if (doprocessMCDetectorLevel) {
561566 LOGF (info, " JetSpectraEseTask::init() - MC Detector level" );
562567 registry.add (" mcd/hEventCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10.0 }}});
568+ registry.add (" mcd/hUsedEventWeights" , " Used reconstructed collisions;Used events;Sum of event weights" , {HistType::kTH1D , {{1 , 0.0 , 1.0 }}});
569+ registry.get <TH1 >(HIST (" mcd/hUsedEventWeights" ))->Sumw2 ();
570+ registry.get <TH1 >(HIST (" mcd/hUsedEventWeights" ))->GetXaxis ()->SetBinLabel (1 , " Sum of weights of used events" );
563571 registry.add (" mcd/hCentralitySel" , " ;centr;entries" , {HistType::kTH1F , {{centAxis}}});
564572 // registry.add("mcd/hJetPt", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}});
565573 // registry.add("mcd/hJetSparse", ";Centrality;#it{p}_{T,jet det}; #eta; #phi", {HistType::kTHnSparseF, {{centAxis}, {jetPtAxis}, {etaAxis}, {phiAxis}}});
@@ -582,6 +590,9 @@ struct JetSpectraEseTask {
582590
583591 registry.add (" mcm/hMCEventCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10.0 }}});
584592 registry.add (" mcm/hMCDMatchedEventCounter" , " event status;event status;entries" , {HistType::kTH1F , {{10 , 0.0 , 10.0 }}});
593+ registry.add (" mcm/hUsedEventWeights" , " Used reconstructed collisions with exactly one reconstructed collision per MC collision;Used events;Sum of event weights" , {HistType::kTH1D , {{1 , 0.0 , 1.0 }}});
594+ registry.get <TH1 >(HIST (" mcm/hUsedEventWeights" ))->Sumw2 ();
595+ registry.get <TH1 >(HIST (" mcm/hUsedEventWeights" ))->GetXaxis ()->SetBinLabel (1 , " Sum of weights of used events" );
585596 registry.add (" mcm/hCentralityAnalyzed" , " ;Centrality;entries" , {HistType::kTH1F , {{centAxis}}});
586597
587598 registry.add (" mcm/hMatchedJetsPtDelta" , " #it{p}_{T,jet part}; det - part" , {HistType::kTH2F , {{jetPtAxis}, {100 , -20 ., 20.0 }}});
@@ -1184,14 +1195,18 @@ struct JetSpectraEseTask {
11841195 registry.fill (HIST (" mcp/hCentralitySel" ), centrality);
11851196 const float eventWeight = cfgUseMCEventWeights ? mcCollision.weight () : 1 .0f ;
11861197 const float pTHat = getPTHat (eventWeight);
1198+ if (!(pTHat < pTHatAbsoluteMin)) {
1199+ registry.fill (HIST (" mcp/hUsedEventWeights" ), 0.5 , eventWeight);
1200+ }
11871201 jetLoopMCP<aod::JetParticles>(jets, centrality, mcCollision.rho (), eventWeight, pTHat);
11881202 }
11891203 PROCESS_SWITCH (JetSpectraEseTask, processMCParticleLevel, " jets on particle level MC" , false );
11901204
11911205 void processMCDetectorLevel (soa::Filtered<soa::Join<aod::JetCollisionsMCD, aod::BkgChargedRhos>>::iterator const & collision,
11921206 ChargedMCDJets const & mcdjets,
11931207 aod::JetTracks const &,
1194- aod::JetParticles const &)
1208+ aod::JetParticles const &,
1209+ aod::JetMcCollisions const &)
11951210 {
11961211 float counter{0 .5f };
11971212 registry.fill (HIST (" mcd/hEventCounter" ), counter++);
@@ -1212,6 +1227,15 @@ struct JetSpectraEseTask {
12121227 auto centrality = cfgisPbPb ? getCentrality (collision) : -1 ;
12131228
12141229 registry.fill (HIST (" mcd/hCentralitySel" ), centrality);
1230+ float eventWeight = 1 .0f ;
1231+ if (cfgUseMCEventWeights) {
1232+ // The jet weight producer uses the same MC weight, stored as zero for collisions without an MC association.
1233+ eventWeight = collision.has_mcCollision () ? collision.mcCollision_as <aod::JetMcCollisions>().weight () : 0 .0f ;
1234+ }
1235+ const float pTHat = getPTHat (eventWeight);
1236+ if (!(pTHat < pTHatAbsoluteMin)) {
1237+ registry.fill (HIST (" mcd/hUsedEventWeights" ), 0.5 , eventWeight);
1238+ }
12151239 jetLoopMCD<aod::JetTracks>(mcdjets, centrality, collision.rho ());
12161240 }
12171241 PROCESS_SWITCH (JetSpectraEseTask, processMCDetectorLevel, " jets on detector level" , false );
@@ -1264,6 +1288,9 @@ struct JetSpectraEseTask {
12641288 registry.fill (HIST (" mcm/hCentralityAnalyzed" ), centrality);
12651289 float eventWeight = cfgUseMCEventWeights ? mcCol.weight () : 1.0 ;
12661290 float pTHat = getPTHat (eventWeight);
1291+ if (!(pTHat < pTHatAbsoluteMin)) {
1292+ registry.fill (HIST (" mcm/hUsedEventWeights" ), 0.5 , eventWeight);
1293+ }
12671294 matchedJetLoop<JetMCPTable, aod::JetTracks>(mcdjets.sliceBy (mcdjetsPerJCollision, collision.globalIndex ()), centrality, collision.rho (), mcCol.rho (), eventWeight, pTHat);
12681295
12691296 registry.fill (HIST (" mcm/hMCDMatchedEventCounter" ), secCount++);
@@ -1914,6 +1941,9 @@ struct JetSpectraEseTask {
19141941 weight = jet.eventWeight ();
19151942 }
19161943 const float pTHat = getPTHat (weight);
1944+ if (pTHat < pTHatAbsoluteMin) {
1945+ continue ;
1946+ }
19171947 if (jet.pt () > pTHatMaxMCD * pTHat) {
19181948 continue ;
19191949 }
@@ -1924,6 +1954,9 @@ struct JetSpectraEseTask {
19241954 template <typename JTracks, typename Jets>
19251955 void jetLoopMCP (const Jets& jets, const float & centrality, const float & rho, float weight = 1 .0f , float pTHat = 999 .0f )
19261956 {
1957+ if (pTHat < pTHatAbsoluteMin) {
1958+ return ;
1959+ }
19271960 bool mcLevelIsParticleLevel = true ;
19281961 for (const auto & jet : jets) {
19291962 if (!jetfindingutilities::isInEtaAcceptance (jet, cfgJetEta->at (0 ), cfgJetEta->at (1 ), trackCuts.trackEtaMin , trackCuts.trackEtaMax )) {
@@ -1946,6 +1979,9 @@ struct JetSpectraEseTask {
19461979 template <typename MCPTab, typename JTracks, typename Jets>
19471980 void matchedJetLoop (const Jets& jets, const float & centrality, const float & rho, const float & rho2, float weight = 1.0 , float pTHat = 999.0 )
19481981 {
1982+ if (pTHat < pTHatAbsoluteMin) {
1983+ return ;
1984+ }
19491985 for (const auto & jet : jets) {
19501986 if (!jetfindingutilities::isInEtaAcceptance (jet, cfgJetEta->at (0 ), cfgJetEta->at (1 ), trackCuts.trackEtaMin , trackCuts.trackEtaMax )) {
19511987 continue ;
0 commit comments