@@ -50,7 +50,10 @@ struct JetOutlierQATask {
5050
5151 HistogramRegistry registry;
5252
53- Preslice<aod::JetTracks> perCol = aod::jtrack::collisionId;
53+ using JetParticlesWithOriginal = soa::Join<aod::JetParticles, aod::JMcParticlePIs>;
54+
55+ Preslice<aod::JetTracks> perColTrack = aod::jtrack::collisionId;
56+ Preslice<soa::Join<aod::JetMcCollisions, aod::JMcCollisionPIs>> perColParticle = aod::jmccollision::mcCollisionId;
5457 Preslice<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetEventWeights>> perColJets = aod::jet::collisionId;
5558 Preslice<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets, aod::ChargedMCDetectorLevelJetEventWeights>> perColJetsMatched = aod::jet::collisionId;
5659
@@ -185,19 +188,43 @@ struct JetOutlierQATask {
185188 registry.add (" h_track_phi_accepted" , " track phi accepted;#varphi_{track} (rad);entries" , {HistType::kTH1F , {{160 , -1.0 , 7.0 }}});
186189 registry.add (" h_track_pt_eta_accepted" , " track pt vs eta accepted;p_{T,track} (GeV/#it{c});#eta_{track};entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {100 , -5 , 5 }}});
187190 registry.add (" h_track_pt_phi_accepted" , " track pt vs phi accepted;p_{T,track} (GeV/#it{c});#varphi_{track} (rad);entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {160 , -1.0 , 7.0 }}});
188- // track checks based on collisions/particle association
191+ registry.add (" h_track_pt_accepted_no_JJ_outlier" , " track pT with no JJ outlier" , {HistType::kTH1F , {{300 , 0 , 300 }}});
192+ registry.add (" h_track_pt_eta_accepted_no_JJ_outlier" , " track pT vs eta with no JJ outlier;p_{T,track} (GeV/#it{c});#eta_{track};entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {100 , -5 , 5 }}});
193+ registry.add (" h_track_pt_phi_accepted_no_JJ_outlier" , " track pT vs phi with no JJ outlier;p_{T,track} (GeV/#it{c});#varphi_{track} (rad);entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {160 , -1.0 , 7.0 }}});
194+ registry.add (" h_track_pt_with_JJ_outlier" , " track pT with JJ outlier" , {HistType::kTH1F , {{300 , 0 , 300 }}});
195+ registry.add (" h_track_pt_eta_with_JJ_outlier" , " track pT vs eta with JJ outlier;p_{T,track} (GeV/#it{c});#eta_{track};entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {100 , -5 , 5 }}});
196+ registry.add (" h_track_pt_phi_with_JJ_outlier" , " track pT vs phi with JJ outlier;p_{T,track} (GeV/#it{c});#varphi_{track} (rad);entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {160 , -1.0 , 7.0 }}});
197+ registry.add (" h_track_pt_with_MB_outlier" , " track pT with MB outlier" , {HistType::kTH1F , {{300 , 0 , 300 }}});
198+ registry.add (" h_track_pt_eta_with_MB_outlier" , " track pT vs eta with MB outlier;p_{T,track} (GeV/#it{c});#eta_{track};entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {100 , -5 , 5 }}});
199+ registry.add (" h_track_pt_phi_with_MB_outlier" , " track pT vs phi with MB outlier;p_{T,track} (GeV/#it{c});#varphi_{track} (rad);entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {160 , -1.0 , 7.0 }}});
200+
189201 registry.add (" h_track_pt_no_collision" , " track pt no collision;p_{T,track} (GeV/#it{c});entries" , {HistType::kTH1F , {{300 , 0 , 300 }}});
190202 registry.add (" h_track_pt_collision" , " track pt collision;p_{T,track} (GeV/#it{c});entries" , {HistType::kTH1F , {{300 , 0 , 300 }}});
191203 registry.add (" h2_track_pt_pt_hat_no_particle" , " track pt vs pt hat no particle;p_{T,track} (GeV/#it{c});#hat{p}_{T} (GeV/#it{c});entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {600 , 0 , 600 }}});
192204 registry.add (" h2_track_pt_pt_hat_particle" , " track pt vs pt hat particle;p_{T,track} (GeV/#it{c});#hat{p}_{T} (GeV/#it{c});entries" , {HistType::kTH2F , {{300 , 0 , 300 }, {600 , 0 , 600 }}});
193205
194- registry.add (" h_track_pt_outlier" , " weight track pt" , {HistType::kTH1F , {{200 , 0 ., 200 . }}});
195- registry.add (" h2_pt_hat_track_pt" , " track; #hat{#it{p}_{T}} (GeV/#it{c});#it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{600 , 0 , 600 }, {150 , 0 , 300 }}});
196- registry.add (" h2_pt_hat_track_pt_outlier" , " track; #hat{#it{p}_{T}} (GeV/#it{c});#it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{600 , 0 , 600 }, {150 , 0 , 300 }}});
206+ registry.add (" h_track_pt_outlier" , " weight track pt" , {HistType::kTH1F , {{300 , 0 , 300 }}});
207+ registry.add (" h2_pt_hat_track_pt" , " track; #hat{#it{p}_{T}} (GeV/#it{c});#it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{600 , 0 , 600 }, {300 , 0 , 300 }}});
208+ registry.add (" h2_pt_hat_track_pt_outlier" , " track; #hat{#it{p}_{T}} (GeV/#it{c});#it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{600 , 0 , 600 }, {300 , 0 , 300 }}});
197209 registry.add (" h2_neighbour_pt_hat_outlier" , " neighbour; distance from collision; #hat{#it{p}_{T}} (GeV/#it{c})" , {HistType::kTH2F , {{15 , -7.5 , 7.5 }, {600 , 0 , 600 }}});
198210 registry.add (" h2_neighbour_track_pt_outlier" , " neighbour; distance from collision; #it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{15 , -7.5 , 7.5 }, {200 , 0 , 100 }}});
199211 registry.add (" h2_neighbour_pt_hat_all" , " neighbour; distance from collision; #hat{#it{p}_{T}} (GeV/#it{c})" , {HistType::kTH2F , {{15 , -7.5 , 7.5 }, {600 , 0 , 600 }}});
200212 registry.add (" h2_neighbour_track_pt_all" , " neighbour; distance from collision; #it{p}_{T,track} (GeV/#it{c})" , {HistType::kTH2F , {{15 , -7.5 , 7.5 }, {200 , 0 , 100 }}});
213+
214+ registry.add (" h_track_pt_outlier_same_collision" , " weight track pt same collision" , {HistType::kTH1F , {{300 , 0 , 300 }}});
215+ registry.add (" h_track_pt_outlier_different_collision_JJ" , " weight track pt different jet-jet collision" , {HistType::kTH1F , {{300 , 0 , 300 }}});
216+ registry.add (" h_track_pt_outlier_different_collision_MB" , " weight track pt different MB collision" , {HistType::kTH1F , {{300 , 0 , 300 }}});
217+
218+ registry.add (" h2_outlier_event_Ntracks_different_selected_JJ" , " number of selected tracks from different jet-jet events" , {HistType::kTH2F , {{600 , 0 , 600 }, {200 , 0 , 200 }}});
219+ registry.add (" h2_outlier_event_Ntracks_different_selected_MB" , " number of selected tracks from different MB events" , {HistType::kTH2F , {{600 , 0 , 600 }, {200 , 0 , 200 }}});
220+ registry.add (" h2_outlier_event_Ntracks_same_selected_JJ" , " number of selected tracks from same jet-jet events" , {HistType::kTH2F , {{600 , 0 , 600 }, {200 , 0 , 200 }}});
221+ registry.add (" h2_outlier_event_tracks_frac_different_JJ" , " fraction of tracks from different jet-jet events" , {HistType::kTH2F , {{600 , 0 , 600 }, {100 , 0 , 1 }}});
222+ registry.add (" h2_outlier_event_tracks_frac_different_MB" , " fraction of tracks from different MB events" , {HistType::kTH2F , {{600 , 0 , 600 }, {100 , 0 , 1 }}});
223+ registry.add (" h2_outlier_event_tracks_frac_different_selected_JJ" , " fraction of selected tracks from different jet-jet events" , {HistType::kTH2F , {{600 , 0 , 600 }, {100 , 0 , 1 }}});
224+ registry.add (" h2_outlier_event_tracks_frac_different_selected_MB" , " fraction of selected tracks from different MB events" , {HistType::kTH2F , {{600 , 0 , 600 }, {100 , 0 , 1 }}});
225+ registry.add (" h2_outlier_collision_ID_difference" , " difference in collision ID between outlier collision and analysed collision" , {HistType::kTH2F , {{600 , 0 , 600 }, {200 , -100 , 100 }}});
226+ registry.add (" h_DeltaZ_Outlier" , " Delta Z between outlier collision and analysed collision" , {HistType::kTH1F , {{1200 , -30 , 30 }}});
227+ registry.add (" h2_DeltaZ_Outlier_difference" , " Delta Z between outlier collision and analysed collision vs difference in collision ID" , {HistType::kTH2F , {{1200 , -30 , 30 }, {200 , -100 , 100 }}});
201228 }
202229 }
203230
@@ -458,8 +485,10 @@ struct JetOutlierQATask {
458485 PROCESS_SWITCH (JetOutlierQATask, processCollisionsBC, " jet finder QA outliers" , false );
459486
460487 void processTracksBC (soa::Filtered<soa::Join<aod::JetCollisions, aod::JMcCollisionLbs, aod::JCollisionBCs>> const & collisions,
488+ soa::Join<aod::JetMcCollisions, aod::JMcCollisionPIs> const &,
461489 aod::JetMcCollisions const & collisionsMC,
462- aod::JetTracksMCD const & tracks)
490+ aod::JetTracksMCD const & tracks,
491+ JetParticlesWithOriginal const &)
463492 {
464493 //
465494 // track-based outlier checks
@@ -501,8 +530,10 @@ struct JetOutlierQATask {
501530 }
502531 float weight = collision.weight ();
503532 float pTHat = collision.mcCollision ().ptHard ();
504- const auto tracksColl = tracks.sliceBy (perCol, collision.globalIndex ());
533+ bool isOutlierEventDifferentJJCollision = false ;
534+ bool isOutlierEventDifferentMBCollision = false ;
505535
536+ const auto tracksColl = tracks.sliceBy (perColTrack, collision.globalIndex ());
506537 // fill track histograms for all collisions
507538 for (auto const & track : tracksColl) {
508539 if (!jetderiveddatautilities::selectTrack (track, trackSelection)) {
@@ -525,10 +556,9 @@ struct JetOutlierQATask {
525556 } else {
526557 registry.fill (HIST (" h2_track_pt_pt_hat_particle" ), track.pt (), collision.mcCollision ().ptHard (), weight);
527558 }
528-
529559 // check outlier tracks and neighbouring collisions
530560 registry.fill (HIST (" h2_pt_hat_track_pt" ), pTHat, track.pt ());
531- if (track.pt () > 1.5 * pTHat) { // high weight outlier track
561+ if (track.pt () > pTHatMaxMCDOutlier * pTHat) { // high weight outlier track
532562 registry.fill (HIST (" h_track_pt_outlier" ), track.pt ());
533563 registry.fill (HIST (" h2_pt_hat_track_pt_outlier" ), pTHat, track.pt ());
534564 for (auto const & collisionOutlier : collisions) { // find collisions closeby
@@ -540,6 +570,86 @@ struct JetOutlierQATask {
540570 registry.fill (HIST (" h2_neighbour_track_pt_outlier" ), float (diffColl + 0.1 ), track.pt (), eventWeightOutlier);
541571 }
542572 }
573+ // now match tracks to their MC particle, check the MC collision ID of this particle, and
574+ // check what fraction of tracks in this event are associated to this MC collision
575+ int nMBdifferent = 0 ;
576+ int nMBdifferentSelected = 0 ;
577+ int nJJdifferent = 0 ;
578+ int nJJdifferentSelected = 0 ;
579+ int nJJsame = 0 ;
580+ int nJJsameSelected = 0 ;
581+ int mcCollisionIDcoll = collision.mcCollisionId (); // Get the corresponding MC collision ID from the reco collision
582+ // LOG(info) << "--- Loop over tracks in outlier event with pT/pThat = " << track.pt() / pTHat << "---";
583+ // LOG(info) << "N tracks in outlier event = " << tracksColl.size() << " pTHat = " << pTHat << " collisionID = " << collision.globalIndex() << " mcCollisionID = " << collision.mcCollisionId();
584+ for (auto const & trackOutlier : tracksColl) {
585+ if (!trackOutlier.has_mcParticle ()) {
586+ continue ;
587+ }
588+ bool isTrackSelected = false ;
589+ if (jetderiveddatautilities::selectTrack (trackOutlier, trackSelection)) {
590+ isTrackSelected = true ;
591+ }
592+ auto mcParticle = trackOutlier.mcParticle_as <JetParticlesWithOriginal>();
593+ auto collisionMC = collisionsMC.sliceBy (perColParticle, mcParticle.mcCollisionId ());
594+ if (collisionMC.size () == 0 ) {
595+ LOG (info) << " no collision found for mcCollisionID = " << mcParticle.mcCollisionId ();
596+ continue ;
597+ }
598+ int mcCollisionIDtrack = mcParticle.mcCollisionId (); // Get the corresponding MC collision ID
599+ int subGenID = collisionMC.begin ().subGeneratorId ();
600+ if (mcCollisionIDtrack == mcCollisionIDcoll) {
601+ nJJsame++;
602+ if (isTrackSelected) {
603+ registry.fill (HIST (" h_track_pt_outlier_same_collision" ), trackOutlier.pt ());
604+ nJJsameSelected++;
605+ }
606+ } else {
607+ if (subGenID == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) { // MB-gap
608+ nMBdifferent++;
609+ if (isTrackSelected) {
610+ registry.fill (HIST (" h_track_pt_outlier_different_collision_MB" ), trackOutlier.pt ());
611+ nMBdifferentSelected++;
612+ }
613+ } else { // jet-jet
614+ nJJdifferent++;
615+ if (isTrackSelected) {
616+ registry.fill (HIST (" h_track_pt_outlier_different_collision_JJ" ), trackOutlier.pt ());
617+ nJJdifferentSelected++;
618+ }
619+ }
620+ }
621+ }
622+ // LOG(info) << "nJJsame = " << nJJsame << " nJJdifferent = " << nJJdifferent << " nMBdifferent = " << nMBdifferent;
623+ // LOG(info) << "nJJsameSelected = " << nJJsameSelected << " nJJdifferentSelected = " << nJJdifferentSelected << " nMBdifferentSelected = " << nMBdifferentSelected;
624+ registry.fill (HIST (" h2_outlier_event_Ntracks_different_selected_JJ" ), pTHat, nJJdifferentSelected);
625+ registry.fill (HIST (" h2_outlier_event_Ntracks_different_selected_MB" ), pTHat, nMBdifferentSelected);
626+ registry.fill (HIST (" h2_outlier_event_Ntracks_same_selected_JJ" ), pTHat, nJJsameSelected);
627+ registry.fill (HIST (" h2_outlier_event_tracks_frac_different_selected_MB" ), pTHat, float (nMBdifferentSelected) / float (nJJdifferentSelected + nJJsameSelected + nMBdifferentSelected));
628+ registry.fill (HIST (" h2_outlier_event_tracks_frac_different_JJ" ), pTHat, float (nJJdifferent) / float (nJJdifferent + nJJsame + nMBdifferent));
629+ registry.fill (HIST (" h2_outlier_event_tracks_frac_different_MB" ), pTHat, float (nMBdifferent) / float (nJJdifferent + nJJsame + nMBdifferent));
630+ registry.fill (HIST (" h2_outlier_event_tracks_frac_different_selected_JJ" ), pTHat, float (nJJdifferentSelected) / float (nJJdifferentSelected + nJJsameSelected + nMBdifferentSelected));
631+ registry.fill (HIST (" h2_outlier_event_tracks_frac_different_selected_MB" ), pTHat, float (nMBdifferentSelected) / float (nJJdifferentSelected + nJJsameSelected + nMBdifferentSelected));
632+ // now check where outlier comes from
633+ auto mcParticleOutlier = track.mcParticle_as <JetParticlesWithOriginal>();
634+ auto collisionMCOutlier = collisionsMC.sliceBy (perColParticle, mcParticleOutlier.mcCollisionId ());
635+ if (collisionMCOutlier.size () != 1 ) {
636+ LOG (info) << " size of collision outlier not expected" ;
637+ return ;
638+ }
639+ int mcCollisionIDOutlier = mcParticleOutlier.mcCollisionId ();
640+ int subGenIDOutlier = collisionMCOutlier.begin ().subGeneratorId ();
641+ int outlierCollisionIDDifference = mcCollisionIDOutlier - mcCollisionIDcoll;
642+ // LOG(info) <<"outlier comes from " << (mcCollisionIDOutlier == mcCollisionIDcoll ? "same" : "different") << " event which is a " << (subGenIDOutlier == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap ? " MB-gap" : " jet-jet") << " collision with mcCollisionID = " << mcCollisionIDOutlier;
643+ registry.fill (HIST (" h2_outlier_collision_ID_difference" ), pTHat, float (outlierCollisionIDDifference));
644+ // if outlier comes from different collision, check which type and set flags
645+ if (mcCollisionIDOutlier != mcCollisionIDcoll && subGenIDOutlier != jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
646+ isOutlierEventDifferentJJCollision = true ;
647+ float deltaZ = collisionMCOutlier.begin ().posZ () - collision.mcCollision ().posZ ();
648+ registry.fill (HIST (" h_DeltaZ_Outlier" ), deltaZ);
649+ registry.fill (HIST (" h2_DeltaZ_Outlier_difference" ), deltaZ, float (outlierCollisionIDDifference));
650+ } else if (mcCollisionIDOutlier != mcCollisionIDcoll && subGenIDOutlier == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap) {
651+ isOutlierEventDifferentMBCollision = true ;
652+ }
543653 }
544654 // all
545655 for (auto const & collisionOutlier : collisions) { // find collisions closeby
@@ -579,6 +689,20 @@ struct JetOutlierQATask {
579689 registry.fill (HIST (" h_track_phi_accepted" ), track.phi (), weight);
580690 registry.fill (HIST (" h_track_pt_eta_accepted" ), track.pt (), track.eta (), weight);
581691 registry.fill (HIST (" h_track_pt_phi_accepted" ), track.pt (), track.phi (), weight);
692+ if (!isOutlierEventDifferentJJCollision) {
693+ registry.fill (HIST (" h_track_pt_accepted_no_JJ_outlier" ), track.pt (), weight);
694+ registry.fill (HIST (" h_track_pt_eta_accepted_no_JJ_outlier" ), track.pt (), track.eta (), weight);
695+ registry.fill (HIST (" h_track_pt_phi_accepted_no_JJ_outlier" ), track.pt (), track.phi (), weight);
696+ } else {
697+ registry.fill (HIST (" h_track_pt_with_JJ_outlier" ), track.pt (), weight);
698+ registry.fill (HIST (" h_track_pt_eta_with_JJ_outlier" ), track.pt (), track.eta (), weight);
699+ registry.fill (HIST (" h_track_pt_phi_with_JJ_outlier" ), track.pt (), track.phi (), weight);
700+ }
701+ if (isOutlierEventDifferentMBCollision) {
702+ registry.fill (HIST (" h_track_pt_with_MB_outlier" ), track.pt (), weight);
703+ registry.fill (HIST (" h_track_pt_eta_with_MB_outlier" ), track.pt (), track.eta (), weight);
704+ registry.fill (HIST (" h_track_pt_phi_with_MB_outlier" ), track.pt (), track.phi (), weight);
705+ }
582706 }
583707 }
584708 }
0 commit comments