Skip to content

Commit 8e4b78e

Browse files
dajones2alibuild
andauthored
[PWGJE] Adding RTC selections and more QA histograms (#14421)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 82c6799 commit 8e4b78e

File tree

1 file changed

+42
-51
lines changed

1 file changed

+42
-51
lines changed

PWGJE/Tasks/jetHadronRecoil.cxx

Lines changed: 42 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct JetHadronRecoil {
8282
Configurable<bool> skipMBGapEvents{"skipMBGapEvents", false, "flag to choose to reject min. bias gap events; jet-level rejection applied at the jet finder level, here rejection is applied for collision and track process functions"};
8383
Configurable<bool> outlierRejectEvent{"outlierRejectEvent", true, "where outliers are found, reject event (true) or just reject the single track/jet (false)"};
8484
Configurable<bool> doSumw{"doSumw", false, "enable sumw2 for weighted histograms"};
85+
Configurable<bool> applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"};
8586

8687
TRandom3* rand = new TRandom3(0);
8788

@@ -204,9 +205,11 @@ struct JetHadronRecoil {
204205
if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWithRhoSubtraction || doprocessJetsMCPMCDMatchedWeighted || doprocessJetsMCPMCDMatchedWeightedWithRhoSubtraction || doprocessRecoilJetsMCPMCDMatched || doprocessRecoilJetsMCPMCDMatchedWeighted || doprocessRecoilJetsMCPMCDMatchedWeightedWithRhoSubtraction) {
205206
registry.add("hPtMatched", "p_{T} matching;p_{T,det};p_{T,part}", {HistType::kTH2F, {ptAxisDet, ptAxisPart}}, doSumw);
206207
registry.add("hPhiMatched", "#phi matching;#phi_{det};#phi_{part}", {HistType::kTH2F, {phiAxisDet, phiAxisPart}}, doSumw);
207-
registry.add("hPhiMatched2d", "#phi matching 2d;#phi;p_{T}", {HistType::kTH2F, {phiAxisPart, ptAxisPart}}, doSumw);
208+
registry.add("hPhiMatchedPt", "#phi matching 2d;#phi;p_{T}", {HistType::kTH2F, {{400, 0, 400}, phiAxisPart}}, doSumw);
208209
registry.add("hDeltaRMatched", "#DeltaR matching;#DeltaR_{det};#DeltaR_{part}", {HistType::kTH2F, {dRAxisDet, dRAxisPart}}, doSumw);
209210
registry.add("hPtMatched1d", "p_{T} matching 1d;p_{T,part}", {HistType::kTH1F, {{400, 0, 400}}}, doSumw);
211+
registry.add("hPtTruth2D", "p_{T} truth 2d;p_{T,part};dphip", {HistType::kTH2F, {{400, 0, 400}, phiAxisPart}}, doSumw);
212+
registry.add("hPtTruth1D", "p_{T} truth 1d;p_{T,part}", {HistType::kTH1F, {{400, 0, 400}}}, doSumw);
210213
registry.add("hDeltaRMatched1d", "#DeltaR matching 1d;#DeltaR_{part}", {HistType::kTH1F, {dRAxisPart}}, doSumw);
211214
registry.add("hPtResolution", "p_{T} resolution;p_{T,part};Relative Resolution", {HistType::kTH2F, {ptAxisPart, {100, -5.0, 5.0}}}, doSumw);
212215
registry.add("hPhiResolution", "#phi resolution;#p_{T,part};Resolution", {HistType::kTH2F, {ptAxisPart, {100, -7.0, 7.0}}}, doSumw);
@@ -626,9 +629,10 @@ struct JetHadronRecoil {
626629
}
627630
}
628631

629-
double dR = getWTAaxisDifference(jetTag, particles);
632+
registry.fill(HIST("hPtTruth1D"), jetTag.pt(), weight);
630633

631-
if (jetTag.has_matchedJetGeo() && jetTag.has_matchedJetPt()) {
634+
double dR = getWTAaxisDifference(jetTag, particles);
635+
if (jetTag.has_matchedJetGeo()) {
632636
for (const auto& jetBase : jetTag.template matchedJetGeo_as<std::decay_t<T>>()) {
633637
if (jetBase.pt() > pTHatMaxMCD * pTHat) {
634638
if (outlierRejectEvent) {
@@ -701,32 +705,31 @@ struct JetHadronRecoil {
701705

702706
float dphip = RecoDecay::constrainAngle(jetTag.phi() - phiTT);
703707
double dRp = getWTAaxisDifference(jetTag, particles);
704-
705-
if (jetTag.has_matchedJetGeo() && jetTag.has_matchedJetPt()) {
708+
registry.fill(HIST("hPtTruth1D"), jetTag.pt(), weight);
709+
registry.fill(HIST("hPtTruth2D"), jetTag.pt(), dphip, weight);
710+
if (jetTag.has_matchedJetGeo()) {
706711
for (const auto& jetBase : jetTag.template matchedJetGeo_as<std::decay_t<T>>()) {
707-
if (jetTag.template matchedJetGeo_first_as<std::decay_t<T>>().globalIndex() == jetTag.template matchedJetPt_first_as<std::decay_t<T>>().globalIndex()) {
708-
if (jetBase.pt() > pTHatMaxMCD * pTHat) {
709-
if (outlierRejectEvent) {
710-
return;
711-
} else {
712-
continue;
713-
}
712+
if (jetBase.pt() > pTHatMaxMCD * pTHat) {
713+
if (outlierRejectEvent) {
714+
return;
715+
} else {
716+
continue;
714717
}
718+
}
715719

716-
float dphi = RecoDecay::constrainAngle(jetBase.phi() - phiTT);
717-
double dR = getWTAaxisDifference(jetBase, tracks);
718-
registry.fill(HIST("hPhiMatched"), dphi, dphip, weight);
719-
registry.fill(HIST("hPhiMatched2d"), jetTag.phi(), jetTag.pt(), weight);
720-
registry.fill(HIST("hPhiResolution"), jetTag.pt(), dphip - dphi, weight);
721-
registry.fill(HIST("hFullMatching"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), dphi, dphip, dR, dRp, weight);
722-
if ((std::abs(dphip - o2::constants::math::PI) < 0.6)) {
723-
registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight);
724-
registry.fill(HIST("hDeltaRMatched1d"), dRp, weight);
725-
registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight);
726-
registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight);
727-
registry.fill(HIST("hDeltaRMatched"), dR, dRp, weight);
728-
registry.fill(HIST("hDeltaRResolution"), jetTag.pt(), dRp - dR, weight);
729-
}
720+
float dphi = RecoDecay::constrainAngle(jetBase.phi() - phiTT);
721+
double dR = getWTAaxisDifference(jetBase, tracks);
722+
registry.fill(HIST("hPhiMatched"), dphi, dphip, weight);
723+
registry.fill(HIST("hPhiMatchedPt"), jetTag.pt(), dphip, weight);
724+
registry.fill(HIST("hPhiResolution"), jetTag.pt(), dphip - dphi, weight);
725+
registry.fill(HIST("hFullMatching"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), dphi, dphip, dR, dRp, weight);
726+
registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight);
727+
if ((std::abs(dphip - o2::constants::math::PI) < 0.6)) {
728+
registry.fill(HIST("hDeltaRMatched1d"), dRp, weight);
729+
registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight);
730+
registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight);
731+
registry.fill(HIST("hDeltaRMatched"), dR, dRp, weight);
732+
registry.fill(HIST("hDeltaRResolution"), jetTag.pt(), dRp - dR, weight);
730733
}
731734
}
732735
}
@@ -768,10 +771,7 @@ struct JetHadronRecoil {
768771
soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const& jets,
769772
soa::Filtered<soa::Join<aod::JetTracks, aod::JTrackExtras, aod::JMcTrackLbs>> const& tracks)
770773
{
771-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
772-
return;
773-
}
774-
if (skipMBGapEvents && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
774+
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) {
775775
return;
776776
}
777777
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
@@ -793,10 +793,7 @@ struct JetHadronRecoil {
793793
soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const& jets,
794794
soa::Filtered<soa::Join<aod::JetTracks, aod::JTrackExtras, aod::JMcTrackLbs>> const& tracks)
795795
{
796-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
797-
return;
798-
}
799-
if (skipMBGapEvents && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
796+
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) {
800797
return;
801798
}
802799
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
@@ -818,10 +815,7 @@ struct JetHadronRecoil {
818815
soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const& jets,
819816
soa::Filtered<soa::Join<aod::JetTracks, aod::JTrackExtras, aod::JMcTrackLbs>> const& tracks)
820817
{
821-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
822-
return;
823-
}
824-
if (skipMBGapEvents && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
818+
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) {
825819
return;
826820
}
827821
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
@@ -843,10 +837,7 @@ struct JetHadronRecoil {
843837
soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const& jets,
844838
soa::Filtered<soa::Join<aod::JetTracks, aod::JTrackExtras, aod::JMcTrackLbs>> const& tracks)
845839
{
846-
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) {
847-
return;
848-
}
849-
if (skipMBGapEvents && collision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
840+
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) {
850841
return;
851842
}
852843
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
@@ -871,7 +862,7 @@ struct JetHadronRecoil {
871862
if (std::abs(mccollision.posZ()) > vertexZCut) {
872863
return;
873864
}
874-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
865+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
875866
return;
876867
}
877868
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -901,7 +892,7 @@ struct JetHadronRecoil {
901892
if (std::abs(mccollision.posZ()) > vertexZCut) {
902893
return;
903894
}
904-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
895+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
905896
return;
906897
}
907898
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -933,7 +924,7 @@ struct JetHadronRecoil {
933924
if (std::abs(mccollision.posZ()) > vertexZCut) {
934925
return;
935926
}
936-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
927+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
937928
return;
938929
}
939930
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -965,7 +956,7 @@ struct JetHadronRecoil {
965956
if (std::abs(mccollision.posZ()) > vertexZCut) {
966957
return;
967958
}
968-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
959+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
969960
return;
970961
}
971962
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -997,7 +988,7 @@ struct JetHadronRecoil {
997988
if (std::abs(mccollision.posZ()) > vertexZCut) {
998989
return;
999990
}
1000-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
991+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
1001992
return;
1002993
}
1003994
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -1029,7 +1020,7 @@ struct JetHadronRecoil {
10291020
if (std::abs(mccollision.posZ()) > vertexZCut) {
10301021
return;
10311022
}
1032-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
1023+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
10331024
return;
10341025
}
10351026
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -1061,7 +1052,7 @@ struct JetHadronRecoil {
10611052
if (std::abs(mccollision.posZ()) > vertexZCut) {
10621053
return;
10631054
}
1064-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
1055+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
10651056
return;
10661057
}
10671058
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -1093,7 +1084,7 @@ struct JetHadronRecoil {
10931084
if (std::abs(mccollision.posZ()) > vertexZCut) {
10941085
return;
10951086
}
1096-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
1087+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
10971088
return;
10981089
}
10991090
if (mccollision.ptHard() < pTHatMinEvent) {
@@ -1125,7 +1116,7 @@ struct JetHadronRecoil {
11251116
if (std::abs(mccollision.posZ()) > vertexZCut) {
11261117
return;
11271118
}
1128-
if (skipMBGapEvents && mccollision.getSubGeneratorId() == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
1119+
if (!jetderiveddatautilities::selectMcCollision(mccollision, skipMBGapEvents, applyRCTSelections)) {
11291120
return;
11301121
}
11311122
if (mccollision.ptHard() < pTHatMinEvent) {

0 commit comments

Comments
 (0)