@@ -264,7 +264,6 @@ struct QaMatching {
264264 double matchScoreProd{-1 };
265265 double matchChi2Prod{-1 };
266266 int matchRankingProd{-1 };
267- int mftMchMatchAttempts{0 };
268267 MuonMatchType matchType{kMatchTypeUndefined };
269268 };
270269
@@ -991,19 +990,38 @@ struct QaMatching {
991990 {
992991 AxisSpec chi2Axis = {1000 , 0 , 1000 , " chi^{2}" };
993992 AxisSpec chi2AxisSmall = {200 , 0 , 100 , " chi^{2}" };
994- AxisSpec pAxis = {1000 , 0 , 100 , " p (GeV/c)" };
995- AxisSpec pTAxis = {100 , 0 , 10 , " p_{T} (GeV/c)" };
993+ AxisSpec pAxis = {50 , 0 , 100 , " p (GeV/c)" };
994+ AxisSpec pTAxis = {50 , 0 , 10 , " p_{T} (GeV/c)" };
996995 AxisSpec etaAxis = {100 , -4 , -2 , " #eta" };
997- AxisSpec phiAxis = {90 , -180 , 180 , " #phi (degrees)" };
996+ AxisSpec vzAxis = {20 , -10 , 10 , " vertex_{z} (cm)" };
997+ AxisSpec rAxis = {60 , 0 , 15 , " R_{track} (cm)" };
998+ AxisSpec mftNClusAxis = {6 , 5 , 11 , " # of MFT clusters" };
999+
9981000 std::string histPath = cfgIsMc.value ? " matching/MC/" : " matching/" ;
9991001
10001002 AxisSpec trackPositionXAtMftAxis = {100 , -15 , 15 , " MFT x (cm)" };
10011003 AxisSpec trackPositionYAtMftAxis = {100 , -15 , 15 , " MFT y (cm)" };
1002- registry.add ((histPath + " pairedMCHTracksAtMFT" ).c_str (), " Paired MCH tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1003- registry.add ((histPath + " pairedMFTTracksAtMFT" ).c_str (), " Paired MFT tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1004- registry.add ((histPath + " selectedMCHTracksAtMFT" ).c_str (), " Selected MCH tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1005- registry.add ((histPath + " selectedMCHTracksAtMFTTrue" ).c_str (), " Selected MCH tracks position at MFT end - true" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1006- registry.add ((histPath + " selectedMCHTracksAtMFTFake" ).c_str (), " Selected MCH tracks position at MFT end - fake" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1004+ registry.add ((histPath + " taggedMCHTracksAtMFT" ).c_str (), " Tagged MCH tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1005+ if (cfgIsMc.value ) {
1006+ registry.add ((histPath + " pairedMCHTracksAtMFT" ).c_str (), " Paired MCH tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1007+ registry.add ((histPath + " pairedMFTTracksAtMFT" ).c_str (), " Paired MFT tracks position at MFT end" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1008+ registry.add ((histPath + " taggedMCHTracksAtMFTTrue" ).c_str (), " Tagged MCH tracks position at MFT end - true" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1009+ registry.add ((histPath + " taggedMCHTracksAtMFTFake" ).c_str (), " Tagged MCH tracks position at MFT end - fake" , {HistType::kTH2F , {trackPositionXAtMftAxis, trackPositionYAtMftAxis}});
1010+ }
1011+
1012+ registry.add ((histPath + " muonTracksVsMchKine" ).c_str (), " Muon tracks vs. MCH kine" , {HistType::kTHnSparseF , {etaAxis, pTAxis, vzAxis}});
1013+ registry.add ((histPath + " muonTracksVsMchKineAtVertex" ).c_str (), " Muon tracks vs. MCH kine at vertex" , {HistType::kTHnSparseF , {etaAxis, pTAxis, vzAxis}});
1014+
1015+ registry.add ((histPath + " muonTracksRadiusAtMftFront" ).c_str (), " Muon tracks radius at MFT front" , {HistType::kTHnSparseF , {rAxis, vzAxis, pAxis}});
1016+ registry.add ((histPath + " muonTracksRadiusAtMftBack" ).c_str (), " Muon tracks radius at MFT back" , {HistType::kTHnSparseF , {rAxis, vzAxis, pAxis}});
1017+
1018+ if (cfgIsMc.value ) {
1019+ registry.add ((histPath + " muonTracksPairedVsMchKine" ).c_str (), " Paired muon tracks vs. MCH kine" , {HistType::kTHnSparseF , {etaAxis, pTAxis, vzAxis, mftNClusAxis}});
1020+ registry.add ((histPath + " muonTracksPairedVsMchKineAtVertex" ).c_str (), " Paired muon tracks vs. MCH kine at vertex" , {HistType::kTHnSparseF , {etaAxis, pTAxis, vzAxis, mftNClusAxis}});
1021+
1022+ registry.add ((histPath + " muonTracksRadiusPairedAtMftFront" ).c_str (), " Paired muon tracks radius at MFT front" , {HistType::kTHnSparseF , {rAxis, vzAxis, pAxis}});
1023+ registry.add ((histPath + " muonTracksRadiusPairedAtMftBack" ).c_str (), " Paired muon tracks radius at MFT back" , {HistType::kTHnSparseF , {rAxis, vzAxis, pAxis}});
1024+ }
10071025
10081026 fChi2MatchingPlotter = std::make_unique<MatchingPlotter>(histPath + " Prod/" , ®istryMatching, configQas.cfgCreatePdgMomHistograms , cfgMftTrackMultiplicityMax, cfgNCandidatesMax, cfgIsMc.value );
10091027 int registryIndex = 0 ;
@@ -2999,6 +3017,62 @@ struct QaMatching {
29993017 registry.get <TH1 >(HIST (" tracksMultiplicityMFT" ))->Fill (collisionInfo.mftTracks .size ());
30003018 registry.get <TH1 >(HIST (" tracksMultiplicityMCH" ))->Fill (collisionInfo.mchTracks .size ());
30013019
3020+ for (const auto & element : collisionInfo.mchTracks ) {
3021+ auto mchIndex = element.first ;
3022+ auto const & mchTrack = muonTracks.rawIteratorAt (mchIndex);
3023+ auto mchTrackAtVertex = VarManager::PropagateMuon (mchTrack, collision, VarManager::kToVertex );
3024+
3025+ float mchEta = mchTrack.eta ();
3026+ float mchPt = mchTrack.pt ();
3027+ float mchP = mchTrack.p ();
3028+ float mchEtaAtVertex = mchTrackAtVertex.getEta ();
3029+ float mchPtAtVertex = mchTrackAtVertex.getPt ();
3030+
3031+ float zMftFront = o2::mft::constants::mft::LayerZCoordinate ()[0 ];
3032+ float zMftBack = o2::mft::constants::mft::LayerZCoordinate ()[9 ];
3033+ auto mchTrackAtMftFront = propagateToZMch (mchTrackAtVertex, zMftFront);
3034+ auto mchTrackAtMftBack = propagateToZMch (mchTrackAtVertex, zMftBack);
3035+
3036+ float rAtMftFront = std::hypot (mchTrackAtMftFront.getX (), mchTrackAtMftFront.getY ());
3037+ float rAtMftBack = std::hypot (mchTrackAtMftBack.getX (), mchTrackAtMftBack.getY ());
3038+
3039+ if (isMC) {
3040+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksVsMchKine" ))->Fill (mchEta, mchPt, collision.posZ ());
3041+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksVsMchKineAtVertex" ))->Fill (mchEtaAtVertex, mchPtAtVertex, collision.posZ ());
3042+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksRadiusAtMftFront" ))->Fill (rAtMftFront, collision.posZ (), mchP);
3043+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksRadiusAtMftBack" ))->Fill (rAtMftBack, collision.posZ (), mchP);
3044+ } else {
3045+ registry.get <THnSparse>(HIST (" matching/muonTracksVsMchKine" ))->Fill (mchEta, mchPt, collision.posZ ());
3046+ registry.get <THnSparse>(HIST (" matching/muonTracksVsMchKineAtVertex" ))->Fill (mchEtaAtVertex, mchPtAtVertex, collision.posZ ());
3047+ registry.get <THnSparse>(HIST (" matching/muonTracksRadiusAtMftFront" ))->Fill (rAtMftFront, collision.posZ (), mchP);
3048+ registry.get <THnSparse>(HIST (" matching/muonTracksRadiusAtMftBack" ))->Fill (rAtMftBack, collision.posZ (), mchP);
3049+ }
3050+
3051+ if (isMC) {
3052+ auto matchablePair = getMatchablePairForMch (mchIndex, collisionInfo.matchablePairs );
3053+ if (!matchablePair) {
3054+ continue ;
3055+ }
3056+ auto const & mftTrack = mftTracks.rawIteratorAt (matchablePair.value ().second );
3057+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksPairedVsMchKine" ))->Fill (mchEta, mchPt, collision.posZ (), mftTrack.nClusters ());
3058+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksPairedVsMchKineAtVertex" ))->Fill (mchEtaAtVertex, mchPtAtVertex, collision.posZ (), mftTrack.nClusters ());
3059+
3060+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksRadiusPairedAtMftFront" ))->Fill (rAtMftFront, collision.posZ (), mchP);
3061+ registry.get <THnSparse>(HIST (" matching/MC/muonTracksRadiusPairedAtMftBack" ))->Fill (rAtMftBack, collision.posZ (), mchP);
3062+
3063+ if (mftTrackCovs.count (mftTrack.globalIndex ()) < 1 ) {
3064+ continue ;
3065+ }
3066+ auto const & mftTrackCov = mftCovs.rawIteratorAt (mftTrackCovs[mftTrack.globalIndex ()]);
3067+
3068+ // extrapolate the tracks to the matching plane
3069+ auto mftTrackAtMftBack = propagateToZMft (fwdToTrackPar (mftTrack, mftTrackCov), zMftBack);
3070+
3071+ registry.get <TH2 >(HIST (" matching/MC/pairedMCHTracksAtMFT" ))->Fill (mchTrackAtMftBack.getX (), mchTrackAtMftBack.getY ());
3072+ registry.get <TH2 >(HIST (" matching/MC/pairedMFTTracksAtMFT" ))->Fill (mftTrackAtMftBack.getX (), mftTrackAtMftBack.getY ());
3073+ }
3074+ }
3075+
30023076 int matchingMethodCounter{0 };
30033077
30043078 // -------------------------------
@@ -3012,29 +3086,6 @@ struct QaMatching {
30123086
30133087 // -------------------------------
30143088 // Tagged muons
3015- for (const auto & [mchIndex, mftIndex] : collisionInfo.matchablePairs ) {
3016- auto const & mchTrack = muonTracks.rawIteratorAt (mchIndex);
3017- if (!mchTrack.has_collision ())
3018- continue ;
3019- auto collision = collisions.rawIteratorAt (mchTrack.collisionId ());
3020-
3021- auto const & mftTrack = mftTracks.rawIteratorAt (mftIndex);
3022- if (mftTrackCovs.count (mftTrack.globalIndex ()) < 1 ) {
3023- continue ;
3024- }
3025- auto const & mftTrackCov = mftCovs.rawIteratorAt (mftTrackCovs[mftTrack.globalIndex ()]);
3026-
3027- auto mchTrackAtVertex = VarManager::PropagateMuon (mchTrack, collision, VarManager::kToVertex );
3028-
3029- // extrapolate to the matching plane
3030- auto z = o2::mft::constants::mft::LayerZCoordinate ()[9 ];
3031- auto mchTrackProp = propagateToZMch (mchTrackAtVertex, z);
3032- auto mftTrackProp = propagateToZMft (fwdToTrackPar (mftTrack, mftTrackCov), z);
3033-
3034- registry.get <TH2 >(HIST (" matching/MC/pairedMCHTracksAtMFT" ))->Fill (mchTrackProp.getX (), mchTrackProp.getY ());
3035- registry.get <TH2 >(HIST (" matching/MC/pairedMFTTracksAtMFT" ))->Fill (mftTrackProp.getX (), mftTrackProp.getY ());
3036- }
3037-
30383089 MatchingCandidates taggedMatchingCandidates;
30393090 for (const auto & [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates ) {
30403091 if (std::find (taggedMuons.begin (), taggedMuons.end (), mchIndex) != taggedMuons.end ()) {
0 commit comments