@@ -369,7 +369,7 @@ struct Kstarqa {
369369 hInvMass.add (" MCcorrections/hKstarGenAfterEvtSel" , " K*0 after event selections" , kTH2F , {ptAxis, impactParAxis});
370370 }
371371
372- if (doprocessEvSigLossFactors) {
372+ if (doprocessEvSigLossFactors || doprocessEvSigLossFactorsPhi ) {
373373 hInvMass.add (" CorrFactors/hMultiplicityVsMultMC" , " Event centrality vs MC centrality" , kTH2F , {{101 , 0 .0f , 101 .0f }, axisNch});
374374 hInvMass.add (" CorrFactors/hEventCentrality" , " Event centrality" , kTH1F , {{101 , 0 , 101 }});
375375 hInvMass.add (" CorrFactors/hNrecInGen" , " Number of collisions in MC" , kTH1F , {{4 , -0.5 , 3.5 }});
@@ -382,8 +382,8 @@ struct Kstarqa {
382382
383383 hInvMass.add (" CorrFactors/h2dGenKstar" , " Centrality vs p_{T}" , kTH2D , {{101 , 0 .0f , 101 .0f }, ptAxis});
384384 hInvMass.add (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" , " MC centrality vs centrality vs p_{T}" , kTH3D , {axisNch, {101 , 0 .0f , 101 .0f }, ptAxis});
385- hInvMass.add (" CorrFactors/hSignalLossDenominator " , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {axisNch}});
386- hInvMass.add (" CorrFactors/hSignalLossNumerator " , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {axisNch}});
385+ hInvMass.add (" CorrFactors/hSignalLoss1 " , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {axisNch}});
386+ hInvMass.add (" CorrFactors/hSignalLoss2 " , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {axisNch}});
387387 hInvMass.add (" CorrFactors/MultiplicityRec" , " Multiplicity in generated MC with at least 1 reconstruction" , kTH1F , {axisNch});
388388 hInvMass.add (" CorrFactors/MultiplicityGen" , " Multiplicity in generated MC" , kTH1F , {axisNch});
389389 }
@@ -425,7 +425,8 @@ struct Kstarqa {
425425 hGenTracks->GetXaxis ()->SetBinLabel (1 , " All events" );
426426 hGenTracks->GetXaxis ()->SetBinLabel (2 , " INELgt0+vtz" );
427427 hGenTracks->GetXaxis ()->SetBinLabel (3 , " INELgt0" );
428- hGenTracks->GetXaxis ()->SetBinLabel (4 , " Event Reconstructed" );
428+ hGenTracks->GetXaxis ()->SetBinLabel (4 , " All Collisions" );
429+ hGenTracks->GetXaxis ()->SetBinLabel (5 , " Event Reconstructed" );
429430
430431 // Multplicity distribution
431432 if (cQAevents) {
@@ -1676,6 +1677,8 @@ struct Kstarqa {
16761677 rEventSelection.fill (HIST (" eventsCheckGen" ), 2.5 );
16771678
16781679 for (const auto & collision : collisions) {
1680+ rEventSelection.fill (HIST (" eventsCheckGen" ), 3.5 );
1681+
16791682 if (!selectionEvent (collision, false )) { // don't fill event cut histogram
16801683 continue ;
16811684 }
@@ -1722,7 +1725,7 @@ struct Kstarqa {
17221725 hInvMass.fill (HIST (" sigEvLossFromGenRec/MultiplicityRec" ), genMultiplicity);
17231726 hInvMass.fill (HIST (" h1GenMult2" ), genMultiplicity);
17241727 hInvMass.fill (HIST (" hAllGenCollisions1Rec" ), multiplicity);
1725- rEventSelection.fill (HIST (" eventsCheckGen" ), 3 .5 );
1728+ rEventSelection.fill (HIST (" eventsCheckGen" ), 4 .5 );
17261729 }
17271730
17281731 for (const auto & mcParticle : mcParticles) {
@@ -1821,7 +1824,7 @@ struct Kstarqa {
18211824 return ;
18221825 }
18231826
1824- if (selectionConfig.checkVzEvSigLoss && (std::abs (mcCollision.posZ ()) >= selectionConfig.cutzvertex )) {
1827+ if (selectionConfig.checkVzEvSigLoss && (std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex )) {
18251828 return ;
18261829 }
18271830
@@ -1944,9 +1947,9 @@ struct Kstarqa {
19441947
19451948 hInvMass.fill (HIST (" CorrFactors/h2dGenKstar" ), multiplicity, mother.Pt ());
19461949 hInvMass.fill (HIST (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" ), multiplicityNch, multiplicity, mother.Pt ());
1947- hInvMass.fill (HIST (" CorrFactors/hSignalLossDenominator " ), mother.pt (), multiplicityNch);
1950+ hInvMass.fill (HIST (" CorrFactors/hSignalLoss1 " ), mother.pt (), multiplicityNch);
19481951 if (isSelectedEvent) {
1949- hInvMass.fill (HIST (" CorrFactors/hSignalLossNumerator " ), mother.pt (), multiplicityNch);
1952+ hInvMass.fill (HIST (" CorrFactors/hSignalLoss2 " ), mother.pt (), multiplicityNch);
19501953 }
19511954 }
19521955 }
@@ -2723,6 +2726,8 @@ struct Kstarqa {
27232726 rEventSelection.fill (HIST (" eventsCheckGen" ), 2.5 );
27242727
27252728 for (const auto & collision : collisions) {
2729+ rEventSelection.fill (HIST (" eventsCheckGen" ), 3.5 );
2730+
27262731 if (!selectionEvent (collision, false )) { // don't fill event cut histogram
27272732 continue ;
27282733 }
@@ -2762,7 +2767,7 @@ struct Kstarqa {
27622767 double genMultiplicity = mcCollision.centFT0M ();
27632768 hInvMass.fill (HIST (" h1GenMult2" ), genMultiplicity);
27642769 hInvMass.fill (HIST (" hAllGenCollisions1Rec" ), multiplicity);
2765- rEventSelection.fill (HIST (" eventsCheckGen" ), 3 .5 );
2770+ rEventSelection.fill (HIST (" eventsCheckGen" ), 4 .5 );
27662771
27672772 for (const auto & mcParticle : mcParticles) {
27682773
@@ -2815,6 +2820,114 @@ struct Kstarqa {
28152820 }
28162821 PROCESS_SWITCH (Kstarqa, processGenPhi, " Process Generated for Phi meson" , false );
28172822
2823+ void processEvSigLossFactorsPhi (McCollisionMults::iterator const & mcCollision, soa::SmallGroups<EventCandidatesMC> const & collisions, LabeledTracks const &, aod::McParticles const & mcParticles)
2824+ {
2825+ auto multiplicityNch = -1 ;
2826+ multiplicityNch = mcCollision.multMCNParticlesEta05 ();
2827+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 0.5 );
2828+
2829+ if (selectionConfig.checkVzEvSigLoss && std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex )
2830+ return ;
2831+
2832+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 1.5 );
2833+
2834+ if (selectionConfig.isINELgt0 && !mcCollision.isInelGt0 ()) {
2835+ return ;
2836+ }
2837+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 2.5 );
2838+
2839+ float multiplicity = -1.0 ;
2840+ bool isSelectedEvent = false ;
2841+
2842+ for (auto const & collision : collisions) {
2843+ if (!collision.has_mcCollision ())
2844+ continue ;
2845+ if (!selectionEvent (collision, false )) // don't fill event cut histogram
2846+ continue ;
2847+
2848+ if (cSelectMultEstimator == kFT0M ) {
2849+ multiplicity = collision.centFT0M ();
2850+ } else if (cSelectMultEstimator == kFT0A ) {
2851+ multiplicity = collision.centFT0A ();
2852+ } else if (cSelectMultEstimator == kFT0C ) {
2853+ multiplicity = collision.centFT0C ();
2854+ } else if (cSelectMultEstimator == kFV0A ) {
2855+ multiplicity = collision.centFV0A ();
2856+ } else {
2857+ multiplicity = collision.centFT0M (); // default
2858+ }
2859+ isSelectedEvent = true ;
2860+ }
2861+
2862+ // auto multiplicityGen = -1;
2863+ // multiplicityGen = mcCollision.centFT0M();
2864+
2865+ hInvMass.fill (HIST (" CorrFactors/hMultiplicityVsMultMC" ), multiplicity, multiplicityNch);
2866+ hInvMass.fill (HIST (" CorrFactors/hNrecInGen" ), collisions.size ());
2867+ hInvMass.fill (HIST (" CorrFactors/MultiplicityGen" ), multiplicityNch);
2868+ if (isSelectedEvent) {
2869+ hInvMass.fill (HIST (" CorrFactors/MultiplicityRec" ), multiplicityNch);
2870+ }
2871+
2872+ for (const auto & mcParticle : mcParticles) {
2873+
2874+ if (std::abs (mcParticle.y ()) >= selectionConfig.rapidityMotherData )
2875+ continue ;
2876+
2877+ if (std::abs (mcParticle.pdgCode ()) == o2::constants::physics::kPhi ) {
2878+
2879+ auto kDaughters = mcParticle.daughters_as <aod::McParticles>();
2880+ if (kDaughters .size () != selectionConfig.noOfDaughters ) {
2881+ continue ;
2882+ }
2883+
2884+ bool hasPos = false ;
2885+ bool hasNeg = false ;
2886+
2887+ auto passkaon = false ;
2888+ auto passpion = false ;
2889+ for (const auto & kCurrentDaughter : kDaughters ) {
2890+ // if (!kCurrentDaughter.isPhysicalPrimary())
2891+ // continue;
2892+
2893+ int pdgDau = kCurrentDaughter .pdgCode ();
2894+ int sign = (pdgDau > 0 ) - (pdgDau < 0 );
2895+
2896+ if (sign > 0 )
2897+ hasPos = true ;
2898+ if (sign < 0 )
2899+ hasNeg = true ;
2900+
2901+ if (kCurrentDaughter .pdgCode () == PDG_t::kKPlus ) {
2902+ passkaon = true ;
2903+ daughter1 = ROOT::Math::PxPyPzMVector (kCurrentDaughter .px (), kCurrentDaughter .py (), kCurrentDaughter .pz (), massKa);
2904+
2905+ } else if (kCurrentDaughter .pdgCode () == PDG_t::kKMinus ) {
2906+ passpion = true ;
2907+ daughter2 = ROOT::Math::PxPyPzMVector (kCurrentDaughter .px (), kCurrentDaughter .py (), kCurrentDaughter .pz (), massKa);
2908+ }
2909+ }
2910+
2911+ if ((passkaon && passpion) && (hasPos && hasNeg)) {
2912+ mother = daughter1 + daughter2; // Kstar meson
2913+
2914+ hInvMass.fill (HIST (" CorrFactors/h2dGenKstar" ), multiplicity, mother.Pt ());
2915+ hInvMass.fill (HIST (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" ), multiplicityNch, multiplicity, mother.Pt ());
2916+ hInvMass.fill (HIST (" CorrFactors/hSignalLoss1" ), mother.pt (), multiplicityNch);
2917+ if (isSelectedEvent) {
2918+ hInvMass.fill (HIST (" CorrFactors/hSignalLoss2" ), mother.pt (), multiplicityNch);
2919+ }
2920+ }
2921+ }
2922+ }
2923+
2924+ if (collisions.size () == 0 )
2925+ return ;
2926+
2927+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 3.5 );
2928+ }
2929+ PROCESS_SWITCH (Kstarqa, processEvSigLossFactorsPhi, " Process Event and Signal loss" , false );
2930+
28182931 void processRecPhi (EventCandidatesMC::iterator const & collision, TrackCandidatesMC const & tracks, aod::McParticles const &, EventMCGenerated const &)
28192932 {
28202933
@@ -3093,7 +3206,7 @@ struct Kstarqa {
30933206 return ;
30943207 }
30953208
3096- if (selectionConfig.checkVzEvSigLoss && (std::abs (mcCollision.posZ ()) >= selectionConfig.cutzvertex )) {
3209+ if (selectionConfig.checkVzEvSigLoss && (std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex )) {
30973210 return ;
30983211 }
30993212
0 commit comments