@@ -2691,168 +2691,160 @@ struct Phik0shortanalysis {
26912691
26922692 PROCESS_SWITCH (Phik0shortanalysis, processPhiK0SPionMCClosure2D, " Process function for Phi-K0S and Phi-Pion Correlations in MCClosure2D" , false );
26932693
2694- void processAllPartMCReco (SimCollisions const & collisions , FullMCTracks const & fullMCTracks, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const & mcParticles)
2694+ void processAllPartMCReco (SimCollisions::iterator const & collision , FullMCTracks const & fullMCTracks, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const & mcParticles)
26952695 {
2696- for (const auto & collision : collisions) {
2697- if (!acceptEventQA<true >(collision, false ))
2698- continue ;
2696+ if (!acceptEventQA<true >(collision, false ))
2697+ return ;
26992698
2700- if (!collision.has_mcCollision ())
2701- continue ;
2699+ if (!collision.has_mcCollision ())
2700+ return ;
27022701
2703- const auto & mcCollision = collision.mcCollision_as <MCCollisions>();
2704- float genmultiplicity = mcCollision.centFT0M ();
2702+ const auto & mcCollision = collision.mcCollision_as <MCCollisions>();
2703+ float genmultiplicity = mcCollision.centFT0M ();
27052704
2706- // Defining positive and negative tracks for phi reconstruction
2707- auto posThisColl = posMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2708- auto negThisColl = negMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2705+ // Defining positive and negative tracks for phi reconstruction
2706+ auto posThisColl = posMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2707+ auto negThisColl = negMCTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
27092708
2710- for (const auto & track1 : posThisColl) { // loop over all selected tracks
2711- if (!selectionTrackResonance<true >(track1, false ) || !selectionPIDKaonpTdependent (track1))
2712- continue ; // topological and PID selection
2709+ for (const auto & track1 : posThisColl) { // loop over all selected tracks
2710+ if (!selectionTrackResonance<true >(track1, false ) || !selectionPIDKaonpTdependent (track1))
2711+ continue ; // topological and PID selection
27132712
2714- auto track1ID = track1.globalIndex ();
2713+ auto track1ID = track1.globalIndex ();
27152714
2716- if (!track1.has_mcParticle ())
2717- continue ;
2718- auto mcTrack1 = track1.mcParticle_as <aod::McParticles>();
2719- if (mcTrack1.pdgCode () != PDG_t::kKPlus || !mcTrack1.isPhysicalPrimary ())
2720- continue ;
2715+ if (!track1.has_mcParticle ())
2716+ continue ;
2717+ auto mcTrack1 = track1.mcParticle_as <aod::McParticles>();
2718+ if (mcTrack1.pdgCode () != PDG_t::kKPlus || !mcTrack1.isPhysicalPrimary ())
2719+ continue ;
27212720
2722- for (const auto & track2 : negThisColl) {
2723- if (!selectionTrackResonance<true >(track2, false ) || !selectionPIDKaonpTdependent (track2))
2724- continue ; // topological and PID selection
2721+ for (const auto & track2 : negThisColl) {
2722+ if (!selectionTrackResonance<true >(track2, false ) || !selectionPIDKaonpTdependent (track2))
2723+ continue ; // topological and PID selection
27252724
2726- auto track2ID = track2.globalIndex ();
2727- if (track2ID == track1ID)
2728- continue ; // condition to avoid double counting of pair
2725+ auto track2ID = track2.globalIndex ();
2726+ if (track2ID == track1ID)
2727+ continue ; // condition to avoid double counting of pair
27292728
2730- if (!track2.has_mcParticle ())
2731- continue ;
2732- auto mcTrack2 = track2.mcParticle_as <aod::McParticles>();
2733- if (mcTrack2.pdgCode () != PDG_t::kKMinus || !mcTrack2.isPhysicalPrimary ())
2734- continue ;
2729+ if (!track2.has_mcParticle ())
2730+ continue ;
2731+ auto mcTrack2 = track2.mcParticle_as <aod::McParticles>();
2732+ if (mcTrack2.pdgCode () != PDG_t::kKMinus || !mcTrack2.isPhysicalPrimary ())
2733+ continue ;
27352734
2736- float pTMother = -1 .0f ;
2737- float yMother = -1 .0f ;
2738- bool isMCMotherPhi = false ;
2739- for (const auto & motherOfMcTrack1 : mcTrack1.mothers_as <aod::McParticles>()) {
2740- for (const auto & motherOfMcTrack2 : mcTrack2.mothers_as <aod::McParticles>()) {
2741- if (motherOfMcTrack1.pdgCode () != motherOfMcTrack2.pdgCode ())
2742- continue ;
2743- if (motherOfMcTrack1.globalIndex () != motherOfMcTrack2.globalIndex ())
2744- continue ;
2745- if (motherOfMcTrack1.pdgCode () != o2::constants::physics::Pdg::kPhi )
2746- continue ;
2735+ float pTMother = -1 .0f ;
2736+ float yMother = -1 .0f ;
2737+ bool isMCMotherPhi = false ;
2738+ for (const auto & motherOfMcTrack1 : mcTrack1.mothers_as <aod::McParticles>()) {
2739+ for (const auto & motherOfMcTrack2 : mcTrack2.mothers_as <aod::McParticles>()) {
2740+ if (motherOfMcTrack1.pdgCode () != motherOfMcTrack2.pdgCode ())
2741+ continue ;
2742+ if (motherOfMcTrack1.globalIndex () != motherOfMcTrack2.globalIndex ())
2743+ continue ;
2744+ if (motherOfMcTrack1.pdgCode () != o2::constants::physics::Pdg::kPhi )
2745+ continue ;
27472746
2748- pTMother = motherOfMcTrack1.pt ();
2749- yMother = motherOfMcTrack1.y ();
2750- isMCMotherPhi = true ;
2751- }
2747+ pTMother = motherOfMcTrack1.pt ();
2748+ yMother = motherOfMcTrack1.y ();
2749+ isMCMotherPhi = true ;
27522750 }
2753-
2754- if (!isMCMotherPhi)
2755- continue ;
2756- if (pTMother < minPhiPt || std::abs (yMother) > cfgYAcceptance)
2757- continue ;
2758-
2759- mcPhiHist.fill (HIST (" h3PhiMCRecoNewProc" ), genmultiplicity, pTMother, yMother);
27602751 }
2761- }
27622752
2763- // Defining V0s in the collision
2764- auto v0sThisColl = V0s.sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
2765-
2766- for (const auto & v0 : v0sThisColl) {
2767- if (!v0.has_mcParticle ())
2753+ if (!isMCMotherPhi)
27682754 continue ;
2769-
2770- auto v0mcparticle = v0.mcParticle ();
2771- if (v0mcparticle.pdgCode () != PDG_t::kK0Short || !v0mcparticle.isPhysicalPrimary ())
2755+ if (pTMother < minPhiPt || std::abs (yMother) > cfgYAcceptance)
27722756 continue ;
27732757
2774- const auto & posDaughterTrack = v0.posTrack_as <V0DauMCTracks>();
2775- const auto & negDaughterTrack = v0.negTrack_as <V0DauMCTracks>();
2758+ mcPhiHist.fill (HIST (" h3PhiMCRecoNewProc" ), genmultiplicity, pTMother, yMother);
2759+ }
2760+ }
27762761
2777- if (!selectionV0 (v0, posDaughterTrack, negDaughterTrack))
2778- continue ;
2779- if (v0Configs.cfgFurtherV0Selection && !furtherSelectionV0 (v0, collision))
2780- continue ;
2781- if (std::abs (v0mcparticle.y ()) > cfgYAcceptance)
2782- continue ;
2762+ for (const auto & v0 : V0s) {
2763+ if (!v0.has_mcParticle ())
2764+ continue ;
27832765
2784- mcK0SHist.fill (HIST (" h3K0SMCRecoNewProc" ), genmultiplicity, v0mcparticle.pt (), v0mcparticle.y ());
2785- }
2766+ auto v0mcparticle = v0.mcParticle ();
2767+ if (v0mcparticle.pdgCode () != PDG_t::kK0Short || !v0mcparticle.isPhysicalPrimary ())
2768+ continue ;
27862769
2787- // Defining tracks in the collision
2788- auto mcTracksThisColl = fullMCTracks. sliceByCached (aod::track::collisionId, collision. globalIndex (), cache );
2770+ const auto & posDaughterTrack = v0. posTrack_as <V0DauMCTracks>();
2771+ const auto & negDaughterTrack = v0. negTrack_as <V0DauMCTracks>( );
27892772
2790- for (const auto & track : mcTracksThisColl) {
2791- // Pion selection
2792- if (!selectionPion<false , true >(track, false ))
2793- continue ;
2773+ if (!selectionV0 (v0, posDaughterTrack, negDaughterTrack))
2774+ continue ;
2775+ if (v0Configs.cfgFurtherV0Selection && !furtherSelectionV0 (v0, collision))
2776+ continue ;
2777+ if (std::abs (v0mcparticle.y ()) > cfgYAcceptance)
2778+ continue ;
27942779
2795- if (!track. has_mcParticle ())
2796- continue ;
2780+ mcK0SHist. fill ( HIST ( " h3K0SMCRecoNewProc " ), genmultiplicity, v0mcparticle. pt (), v0mcparticle. y ());
2781+ }
27972782
2798- auto mcTrack = track.mcParticle_as <aod::McParticles>();
2799- if (std::abs (mcTrack.pdgCode ()) != PDG_t::kPiPlus )
2800- continue ;
2783+ for (const auto & track : fullMCTracks) {
2784+ // Pion selection
2785+ if (!selectionPion<false , true >(track, false ))
2786+ continue ;
28012787
2802- if (std::abs (mcTrack. y ()) > cfgYAcceptance )
2803- continue ;
2788+ if (!track. has_mcParticle () )
2789+ continue ;
28042790
2805- // Primary pion selection
2806- if (mcTrack.isPhysicalPrimary ()) {
2807- mcPionHist.fill (HIST (" h3RecMCDCAxyPrimPi" ), track.pt (), track.dcaXY ());
2808- } else {
2809- if (mcTrack.getProcess () == 4 ) { // Selection of secondary pions from weak decay
2810- mcPionHist.fill (HIST (" h3RecMCDCAxySecWeakDecayPi" ), track.pt (), track.dcaXY ());
2811- } else { // Selection of secondary pions from material interactions
2812- mcPionHist.fill (HIST (" h3RecMCDCAxySecMaterialPi" ), track.pt (), track.dcaXY ());
2813- }
2814- continue ;
2791+ auto mcTrack = track.mcParticle_as <aod::McParticles>();
2792+ if (std::abs (mcTrack.pdgCode ()) != PDG_t::kPiPlus )
2793+ continue ;
2794+
2795+ if (std::abs (mcTrack.y ()) > cfgYAcceptance)
2796+ continue ;
2797+
2798+ // Primary pion selection
2799+ if (mcTrack.isPhysicalPrimary ()) {
2800+ mcPionHist.fill (HIST (" h3RecMCDCAxyPrimPi" ), track.pt (), track.dcaXY ());
2801+ } else {
2802+ if (mcTrack.getProcess () == 4 ) { // Selection of secondary pions from weak decay
2803+ mcPionHist.fill (HIST (" h3RecMCDCAxySecWeakDecayPi" ), track.pt (), track.dcaXY ());
2804+ } else { // Selection of secondary pions from material interactions
2805+ mcPionHist.fill (HIST (" h3RecMCDCAxySecMaterialPi" ), track.pt (), track.dcaXY ());
28152806 }
2807+ continue ;
2808+ }
28162809
2817- mcPionHist.fill (HIST (" h3PiMCRecoNewProc" ), genmultiplicity, mcTrack.pt (), mcTrack.y ());
2810+ mcPionHist.fill (HIST (" h3PiMCRecoNewProc" ), genmultiplicity, mcTrack.pt (), mcTrack.y ());
28182811
2819- if (track.pt () >= trackConfigs.pTToUseTOF && !track.hasTOF ())
2820- continue ;
2812+ if (track.pt () >= trackConfigs.pTToUseTOF && !track.hasTOF ())
2813+ continue ;
28212814
2822- mcPionHist.fill (HIST (" h3PiMCReco2NewProc" ), genmultiplicity, mcTrack.pt (), mcTrack.y ());
2823- }
2815+ mcPionHist.fill (HIST (" h3PiMCReco2NewProc" ), genmultiplicity, mcTrack.pt (), mcTrack.y ());
2816+ }
28242817
2825- // Defining McParticles in the collision
2826- auto mcParticlesThisColl = mcParticles.sliceByCached (aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), cache);
2818+ // Defining McParticles in the collision
2819+ auto mcParticlesThisColl = mcParticles.sliceByCached (aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), cache);
28272820
2828- for (const auto & mcParticle : mcParticlesThisColl) {
2829- if (std::abs (mcParticle.y ()) > cfgYAcceptance)
2830- continue ;
2821+ for (const auto & mcParticle : mcParticlesThisColl) {
2822+ if (std::abs (mcParticle.y ()) > cfgYAcceptance)
2823+ continue ;
28312824
2832- // Phi selection
2833- if (mcParticle.pdgCode () != o2::constants::physics::Pdg::kPhi )
2834- continue ;
2835- if (mcParticle.pt () < minPhiPt)
2836- continue ;
2825+ // Phi selection
2826+ if (mcParticle.pdgCode () != o2::constants::physics::Pdg::kPhi )
2827+ continue ;
2828+ if (mcParticle.pt () < minPhiPt)
2829+ continue ;
28372830
2838- mcPhiHist.fill (HIST (" h3PhiMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
2831+ mcPhiHist.fill (HIST (" h3PhiMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
28392832
2840- // K0S selection
2841- if (mcParticle.pdgCode () != PDG_t::kK0Short )
2842- continue ;
2843- if (!mcParticle.isPhysicalPrimary () || mcParticle.pt () < v0Configs.v0SettingMinPt )
2844- continue ;
2833+ // K0S selection
2834+ if (mcParticle.pdgCode () != PDG_t::kK0Short )
2835+ continue ;
2836+ if (!mcParticle.isPhysicalPrimary () || mcParticle.pt () < v0Configs.v0SettingMinPt )
2837+ continue ;
28452838
2846- mcK0SHist.fill (HIST (" h3K0SMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
2839+ mcK0SHist.fill (HIST (" h3K0SMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
28472840
2848- // Pion selection
2849- if (std::abs (mcParticle.pdgCode ()) != PDG_t::kPiPlus )
2850- continue ;
2851- if (!mcParticle.isPhysicalPrimary () || mcParticle.pt () < trackConfigs.cMinPionPtcut )
2852- continue ;
2841+ // Pion selection
2842+ if (std::abs (mcParticle.pdgCode ()) != PDG_t::kPiPlus )
2843+ continue ;
2844+ if (!mcParticle.isPhysicalPrimary () || mcParticle.pt () < trackConfigs.cMinPionPtcut )
2845+ continue ;
28532846
2854- mcPionHist.fill (HIST (" h3PiMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
2855- }
2847+ mcPionHist.fill (HIST (" h3PiMCGenAssocRecoCheckNewProc" ), genmultiplicity, mcParticle.pt (), mcParticle.y ());
28562848 }
28572849 }
28582850
0 commit comments