@@ -348,11 +348,22 @@ struct UpcRhoAnalysis {
348348 }
349349
350350 if (context.mOptions .get <bool >(" processResolution" )) {
351+ // collision matching
351352 rResolution.add (" MC/resolution/collisions/hMatch" , " ;matched;counts" , kTH1D , {{2 , -0.5 , 1.5 }});
353+ // track matching and resolutions
352354 rResolution.add (" MC/resolution/tracks/hMatch" , " ;matched;counts" , kTH1D , {{2 , -0.5 , 1.5 }});
353355 rResolution.add (" MC/resolution/tracks/hPt" , " ;#it{p}_{T, reco} - #it{p}_{T, true} (GeV/#it{c});counts" , kTH1D , {{200 , -1.0 , 1.0 }});
354356 rResolution.add (" MC/resolution/tracks/hEta" , " ;#it{#eta}_{reco} - #it{#eta}_{true};counts" , kTH1D , {{200 , -0.2 , 0.2 }});
355357 rResolution.add (" MC/resolution/tracks/hPhi" , " ;#it{#phi}_{reco} - #it{#phi}_{true} (rad);counts" , kTH1D , {{200 , -0.2 , 0.2 }});
358+ // dipion system resolutions (1D and 2D)
359+ rResolution.add (" MC/resolution/system/1D/hM" , " ;#it{m}_{reco} - #it{m}_{true} (GeV/#it{c}^{2});counts" , kTH1D , {{200 , -1.0 , 1.0 }});
360+ rResolution.add (" MC/resolution/system/2D/hMVsM" , " ;#it{m}_{true} (GeV/#it{c}^{2});#it{m}_{reco} (GeV/#it{c}^{2});counts" , kTH2D , {mAxis , mAxis });
361+ rResolution.add (" MC/resolution/system/1D/hPt" , " ;#it{p}_{T, reco} - #it{p}_{T, true} (GeV/#it{c});counts" , kTH1D , {{200 , -1.0 , 1.0 }});
362+ rResolution.add (" MC/resolution/system/2D/hPtVsPt" , " ;#it{p}_{T, true} (GeV/#it{c});#it{p}_{T, reco} (GeV/#it{c});counts" , kTH2D , {ptAxis, ptAxis});
363+ rResolution.add (" MC/resolution/system/1D/hY" , " ;#it{y}_{reco} - #it{y}_{true};counts" , kTH1D , {{200 , -0.2 , 0.2 }});
364+ rResolution.add (" MC/resolution/system/2D/hYVsY" , " ;#it{y}_{true};#it{y}_{reco};counts" , kTH2D , {yAxis, yAxis});
365+ rResolution.add (" MC/resolution/system/1D/hDeltaPhi" , " ;#Delta#it{#phi}_{reco} - #Delta#it{#phi}_{true} (rad);counts" , kTH1D , {{1000 , -0.5 , 0.5 }});
366+ rResolution.add (" MC/resolution/system/2D/hDeltaPhiVsDeltaPhi" , " ;#Delta#it{#phi}_{true} (rad);#Delta#it{#phi}_{reco} (rad);counts" , kTH2D , {deltaPhiAxis, deltaPhiAxis});
356367 }
357368 }
358369
@@ -1069,6 +1080,11 @@ struct UpcRhoAnalysis {
10691080 if (!collision.has_udMcCollision ())
10701081 return ;
10711082 rResolution.fill (HIST (" MC/resolution/collisions/hMatch" ), 1 );
1083+
1084+ std::vector<decltype (tracks.begin ().udMcParticle ())> trueTracks;
1085+ std::vector<decltype (tracks.begin ())> recoTracks;
1086+ std::vector<ROOT::Math::PxPyPzMVector> truePionLVs, recoPionLVs;
1087+
10721088 for (const auto & track : tracks) {
10731089 rResolution.fill (HIST (" MC/resolution/tracks/hMatch" ), 0 );
10741090 if (!track.has_udMcParticle ())
@@ -1078,7 +1094,27 @@ struct UpcRhoAnalysis {
10781094 rResolution.fill (HIST (" MC/resolution/tracks/hPt" ), pt (track.px (), track.py ()) - pt (mcParticle.px (), mcParticle.py ()));
10791095 rResolution.fill (HIST (" MC/resolution/tracks/hEta" ), eta (track.px (), track.py (), track.pz ()) - eta (mcParticle.px (), mcParticle.py (), mcParticle.pz ()));
10801096 rResolution.fill (HIST (" MC/resolution/tracks/hPhi" ), phi (track.px (), track.py ()) - phi (mcParticle.px (), mcParticle.py ()));
1097+ if (std::abs (mcParticle.pdgCode ()) != kPiPlus && !mcParticle.isPhysicalPrimary ())
1098+ continue ;
1099+ truePionLVs.push_back (ROOT::Math::PxPyPzMVector (mcParticle.px (), mcParticle.py (), mcParticle.pz (), o2::constants::physics::MassPionCharged));
1100+ trueTracks.push_back (mcParticle);
1101+ recoPionLVs.push_back (ROOT::Math::PxPyPzMVector (track.px (), track.py (), track.pz (), o2::constants::physics::MassPionCharged));
1102+ recoTracks.push_back (track);
10811103 }
1104+ if (truePionLVs.size () != 2 || recoPionLVs.size () != 2 )
1105+ return ;
1106+ ROOT::Math::PxPyPzMVector trueSystem = reconstructSystem (truePionLVs);
1107+ const float trueDeltaPhi = getPhiChargeMC (trueTracks, truePionLVs);
1108+ ROOT::Math::PxPyPzMVector recoSystem = reconstructSystem (recoPionLVs);
1109+ const float recoDeltaPhi = getPhiCharge (recoTracks, recoPionLVs);
1110+ rResolution.fill (HIST (" MC/resolution/system/1D/hM" ), recoSystem.M () - trueSystem.M ());
1111+ rResolution.fill (HIST (" MC/resolution/system/2D/hMVsM" ), trueSystem.M (), recoSystem.M ());
1112+ rResolution.fill (HIST (" MC/resolution/system/1D/hPt" ), recoSystem.Pt () - trueSystem.Pt ());
1113+ rResolution.fill (HIST (" MC/resolution/system/2D/hPtVsPt" ), trueSystem.Pt (), recoSystem.Pt ());
1114+ rResolution.fill (HIST (" MC/resolution/system/1D/hY" ), recoSystem.Rapidity () - trueSystem.Rapidity ());
1115+ rResolution.fill (HIST (" MC/resolution/system/2D/hYVsY" ), trueSystem.Rapidity (), recoSystem.Rapidity ());
1116+ rResolution.fill (HIST (" MC/resolution/system/1D/hDeltaPhi" ), recoDeltaPhi - trueDeltaPhi);
1117+ rResolution.fill (HIST (" MC/resolution/system/2D/hDeltaPhiVsDeltaPhi" ), trueDeltaPhi, recoDeltaPhi);
10821118 }
10831119 PROCESS_SWITCH (UpcRhoAnalysis, processResolution, " check resolution of kinematic variables" , false );
10841120
0 commit comments