4747#include < THnSparse.h>
4848
4949#include < algorithm>
50+ #include < array>
5051#include < cinttypes>
5152#include < cmath>
5253#include < cstddef>
@@ -151,6 +152,7 @@ struct JetCrossSectionEfficiency {
151152 static constexpr float ConfigSwitchHigh = 9998 .0f ;
152153 static constexpr float BrokenPtHardSentinel = 1 .0f ;
153154 static constexpr int MinITSClustersForOccupancy = 5 ;
155+ static constexpr int NumberOfHasCollSelectionConditionDiagnostics = 5 ;
154156 static constexpr int HasCollQaMaxCount = 500 ;
155157 static constexpr int HasCollQaMaxDeltaGlobalBC = 100000 ;
156158 static constexpr int64_t NoOtherTruthCollision = -1 ;
@@ -370,6 +372,8 @@ struct JetCrossSectionEfficiency {
370372
371373 if (isSel8FullPbPb) {
372374 AxisSpec axisPbPbTruthSelectionOnly = {PbPbTruthSelectionOnlyNBins, 0.5 , static_cast <double >(PbPbTruthSelectionOnlyNBins) + 0.5 , " event selection (PbPb truth-only)" };
375+ AxisSpec selectionConditionAxis = {NumberOfHasCollSelectionConditionDiagnostics, 0.5 , static_cast <double >(NumberOfHasCollSelectionConditionDiagnostics) + 0.5 , " selection condition" };
376+ AxisSpec hasCollSelectionStateAxis = {4 , 0.5 , 4.5 , " hasColl and selection-condition state" };
373377 std::vector<std::string> timeRangeOnlyLabels = {" INEL" , " +RCT_pass" , " +kTVX(truth)" , " +kNoTFB(truth)" , " +kNoITSROFB(truth)" , " +kNoCollInTimeRangeStandard(truth)" , " +hasColl" , " +|zReco|<10" , " +noSplit" };
374378 std::vector<std::string> rofOnlyLabels = {" INEL" , " +RCT_pass" , " +kTVX(truth)" , " +kNoTFB(truth)" , " +kNoITSROFB(truth)" , " +kNoCollInRofStandard(truth)" , " +hasColl" , " +|zReco|<10" , " +noSplit" };
375379
@@ -390,6 +394,19 @@ struct JetCrossSectionEfficiency {
390394 {HistType::kTH1F , {axisPbPbTruthSelectionOnly}});
391395 setAxisLabels (registry.get <TH2 >(HIST (" h2_jet_pt_part_eventselection_bcBitsFirst_rofOnly_truth" ))->GetYaxis (), rofOnlyLabels);
392396 setAxisLabels (registry.get <TH1 >(HIST (" h_mccollisions_eventselection_bcBitsFirst_rofOnly_truth" ))->GetXaxis (), rofOnlyLabels);
397+
398+ registry.add (" h2_mccollisions_selection_bit_vs_has_coll_state" ,
399+ " weighted MC collisions after common RCT+TVX baseline with valid PbPb truth-proxy evaluation;selection condition;hasColl and selection-condition state" ,
400+ {HistType::kTH2F , {selectionConditionAxis, hasCollSelectionStateAxis}});
401+ registry.add (" h2_mcpjets_selection_bit_vs_has_coll_state" ,
402+ " weighted selected MCP jets after common RCT+TVX baseline with valid PbPb truth-proxy evaluation;selection condition;hasColl and selection-condition state" ,
403+ {HistType::kTH2F , {selectionConditionAxis, hasCollSelectionStateAxis}});
404+ std::vector<std::string> selectionConditionLabels = {" kNoTimeFrameBorder" , " kNoITSROFrameBorder" , " kNoSameBunchPileup (truth proxy)" , " kNoCollInTimeRangeStandard (truth proxy)" , " kNoCollInRofStandard (truth proxy)" };
405+ std::vector<std::string> hasCollSelectionStateLabels = {" noColl, fail" , " noColl, pass" , " hasColl, fail" , " hasColl, pass" };
406+ setAxisLabels (registry.get <TH2 >(HIST (" h2_mccollisions_selection_bit_vs_has_coll_state" ))->GetXaxis (), selectionConditionLabels);
407+ setAxisLabels (registry.get <TH2 >(HIST (" h2_mccollisions_selection_bit_vs_has_coll_state" ))->GetYaxis (), hasCollSelectionStateLabels);
408+ setAxisLabels (registry.get <TH2 >(HIST (" h2_mcpjets_selection_bit_vs_has_coll_state" ))->GetXaxis (), selectionConditionLabels);
409+ setAxisLabels (registry.get <TH2 >(HIST (" h2_mcpjets_selection_bit_vs_has_coll_state" ))->GetYaxis (), hasCollSelectionStateLabels);
393410 }
394411 }
395412
@@ -1369,11 +1386,12 @@ struct JetCrossSectionEfficiency {
13691386 bool passesNoTFBTruth = truthBC.selection_bit (aod::evsel::kNoTimeFrameBorder );
13701387 bool passesNoITSROFBTruth = truthBC.selection_bit (aod::evsel::kNoITSROFrameBorder );
13711388
1372- bool truthNoSBP = true ;
1373- if (applySBP) {
1389+ bool truthNoSBPDiagnostic = true ;
1390+ if (applySBP || isSel8FullPbPb ) {
13741391 auto sameBC = allMcCollisions.sliceBy (mcCollsPerBC, mccollision.bcId ());
1375- truthNoSBP = (sameBC.size () == 1 );
1392+ truthNoSBPDiagnostic = (sameBC.size () == 1 );
13761393 }
1394+ bool truthNoSBP = applySBP ? truthNoSBPDiagnostic : true ;
13771395
13781396 bool hasRecoColl = (collisions.size () >= 1 );
13791397 bool passesZvtxCutReco = false ;
@@ -1398,6 +1416,38 @@ struct JetCrossSectionEfficiency {
13981416 }
13991417
14001418 bool passesRct = applyRCT ? (truthBC.rct_raw () & rctMask) == 0 : true ;
1419+ float weight = mccollision.weight ();
1420+
1421+ if (isSel8FullPbPb && passesRct && passesTVXTruth && truthPbPbSelections.valid ) {
1422+ // The five selection conditions are evaluated independently on the same RCT+TVX
1423+ // baseline with valid PbPb truth-proxy evaluation.
1424+ const std::array<bool , NumberOfHasCollSelectionConditionDiagnostics> selectionConditionPasses = {
1425+ passesNoTFBTruth,
1426+ passesNoITSROFBTruth,
1427+ truthNoSBPDiagnostic,
1428+ truthPbPbSelections.noCollInTimeRangeStandard ,
1429+ truthPbPbSelections.noCollInRofStandard };
1430+ for (size_t conditionIndex = 0 ; conditionIndex < selectionConditionPasses.size (); ++conditionIndex) {
1431+ const int hasCollSelectionState = (hasRecoColl ? 3 : 1 ) + (selectionConditionPasses[conditionIndex] ? 1 : 0 );
1432+ registry.fill (HIST (" h2_mccollisions_selection_bit_vs_has_coll_state" ), static_cast <double >(conditionIndex + 1 ), hasCollSelectionState, weight);
1433+ }
1434+
1435+ float pTHatDiagnostic = computePtHat (mccollision);
1436+ if (pTHatDiagnostic >= pTHatAbsoluteMin) {
1437+ for (const auto & jet : jets) {
1438+ if (!jetfindingutilities::isInEtaAcceptance (jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) ||
1439+ jet.pt () < jetPtMin || jet.pt () > pTHatMaxMCP * pTHatDiagnostic ||
1440+ !isAcceptedJet<aod::JetParticles>(jet)) {
1441+ continue ;
1442+ }
1443+ for (size_t conditionIndex = 0 ; conditionIndex < selectionConditionPasses.size (); ++conditionIndex) {
1444+ const int hasCollSelectionState = (hasRecoColl ? 3 : 1 ) + (selectionConditionPasses[conditionIndex] ? 1 : 0 );
1445+ registry.fill (HIST (" h2_mcpjets_selection_bit_vs_has_coll_state" ), static_cast <double >(conditionIndex + 1 ), hasCollSelectionState, weight);
1446+ }
1447+ }
1448+ }
1449+ }
1450+
14011451 std::vector<bool > pass = {true , passesRct, passesTVXTruth,
14021452 applyTFB ? passesNoTFBTruth : true ,
14031453 applyROFB ? passesNoITSROFBTruth : true };
@@ -1414,8 +1464,6 @@ struct JetCrossSectionEfficiency {
14141464 pass.push_back (passesZvtxCutReco);
14151465 pass.push_back (hasRecoColl && noSplitPass);
14161466
1417- float weight = mccollision.weight ();
1418-
14191467 int sMaxTimeRangeOnly = 0 ;
14201468 int sMaxRofOnly = 0 ;
14211469 if (isSel8FullPbPb) {
0 commit comments