@@ -78,6 +78,7 @@ struct Kstarqa {
7878 struct : ConfigurableGroup {
7979 // Configurables for event selections
8080 Configurable<bool > isINELgt0{" isINELgt0" , true , " INEL>0 selection" };
81+ Configurable<bool > isSel8{" isSel8" , false , " Event selection sel8" };
8182 Configurable<bool > isTriggerTVX{" isTriggerTVX" , false , " TriggerTVX" };
8283 Configurable<bool > isGoodZvtxFT0vsPV{" isGoodZvtxFT0vsPV" , false , " IsGoodZvtxFT0vsPV" };
8384 Configurable<bool > isApplyOccCut{" isApplyOccCut" , true , " Apply occupancy cut" };
@@ -346,13 +347,16 @@ struct Kstarqa {
346347 hInvMass.add (" hAllKstarGenCollisisons1Rec" , " All generated Kstar in events with at least one rec event in rapidity in 0.5" , kTH2F , {{multiplicityAxis}, {ptAxis}});
347348 hInvMass.add (" hAllRecCollisions" , " All reconstructed events" , kTH1F , {multiplicityAxis});
348349 hInvMass.add (" hAllRecCollisionsCalib" , " All reconstructed events" , kTH1F , {multiplicityAxis});
350+ hInvMass.add (" sigEvLossFromGenRec/MultiplicityGen" , " Multiplicity in generated MC" , kTH1F , {multiplicityAxis});
351+ hInvMass.add (" sigEvLossFromGenRec/MultiplicityRec" , " Multiplicity in generated MC with at least 1 reconstruction" , kTH1F , {multiplicityAxis});
352+ hInvMass.add (" sigEvLossFromGenRec/hSignalLossDenominator" , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {multiplicityAxis}});
353+ hInvMass.add (" sigEvLossFromGenRec/hSignalLossNumerator" , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {multiplicityAxis}});
349354
350355 if (doprocessEvtLossSigLossMC || doprocessEvtLossSigLossMCPhi) {
351356 hInvMass.add (" MCcorrections/hSignalLossDenominator" , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {multiplicityAxis}});
352357 hInvMass.add (" MCcorrections/hSignalLossNumerator" , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {multiplicityAxis}});
353358 hInvMass.add (" MCcorrections/hImpactParameterRec" , " Impact parameter in reconstructed MC" , kTH1F , {impactParAxis});
354359 hInvMass.add (" MCcorrections/MultiplicityRec" , " Multiplicity in generated MC with at least 1 reconstruction" , kTH1F , {multiplicityAxis});
355- hInvMass.add (" MCcorrections/MultiplicityRec2" , " Multiplicity in reconstructed MC" , kTH1F , {multiplicityAxis});
356360 hInvMass.add (" MCcorrections/hImpactParameterGen" , " Impact parameter in generated MC" , kTH1F , {impactParAxis});
357361 hInvMass.add (" MCcorrections/MultiplicityGen" , " Multiplicity in generated MC" , kTH1F , {multiplicityAxis});
358362 hInvMass.add (" MCcorrections/hImpactParametervsMultiplicity" , " Impact parameter vs multiplicity in reconstructed MC" , kTH2F , {{impactParAxis}, {multiplicityAxis}});
@@ -377,8 +381,13 @@ struct Kstarqa {
377381 hGenEvents->GetYaxis ()->SetBinLabel (2 , " Generated events with Mc collision V_{z} cut" );
378382 hGenEvents->GetYaxis ()->SetBinLabel (3 , " Generated events with Mc INEL>0" );
379383 hGenEvents->GetYaxis ()->SetBinLabel (4 , " Generated events with at least one reconstructed event" );
384+
380385 hInvMass.add (" CorrFactors/h2dGenKstar" , " Centrality vs p_{T}" , kTH2D , {{101 , 0 .0f , 101 .0f }, ptAxis});
381386 hInvMass.add (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" , " MC centrality vs centrality vs p_{T}" , kTH3D , {axisNch, {101 , 0 .0f , 101 .0f }, ptAxis});
387+ hInvMass.add (" CorrFactors/hSignalLossDenominator" , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {axisNch}});
388+ hInvMass.add (" CorrFactors/hSignalLossNumerator" , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {axisNch}});
389+ hInvMass.add (" CorrFactors/MultiplicityRec" , " Multiplicity in generated MC with at least 1 reconstruction" , kTH1F , {axisNch});
390+ hInvMass.add (" CorrFactors/MultiplicityGen" , " Multiplicity in generated MC" , kTH1F , {axisNch});
382391 }
383392
384393 rEventSelection.add (" tracksCheckData" , " No. of events in the data" , kTH1I , {{10 , 0 , 10 }});
@@ -446,7 +455,7 @@ struct Kstarqa {
446455 if (fillHist)
447456 rEventSelection.fill (HIST (" hEventCut" ), 1 );
448457
449- if (!collision.sel8 ())
458+ if (selectionConfig. isSel8 && !collision.sel8 ())
450459 return false ;
451460 if (fillHist)
452461 rEventSelection.fill (HIST (" hEventCut" ), 2 );
@@ -1605,15 +1614,23 @@ struct Kstarqa {
16051614 }
16061615 }
16071616
1608- const auto evtReconstructedAndSelected = std::find (selectedEvents.begin (), selectedEvents.end (), mcCollision.globalIndex ()) != selectedEvents.end ();
1609- hInvMass.fill (HIST (" hAllGenCollisions" ), multiplicity);
1610- if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
1617+ if (std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex ) {
16111618 return ;
16121619 }
1620+
1621+ const auto evtReconstructedAndSelected = std::find (selectedEvents.begin (), selectedEvents.end (), mcCollision.globalIndex ()) != selectedEvents.end ();
1622+ hInvMass.fill (HIST (" hAllGenCollisions" ), multiplicity);
1623+ // if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
1624+ // return;
1625+ // }
16131626 double genMultiplicity = mcCollision.centFT0M ();
1614- hInvMass.fill (HIST (" h1GenMult2" ), genMultiplicity);
1615- hInvMass.fill (HIST (" hAllGenCollisions1Rec" ), multiplicity);
1616- rEventSelection.fill (HIST (" eventsCheckGen" ), 3.5 );
1627+ hInvMass.fill (HIST (" sigEvLossFromGenRec/MultiplicityGen" ), genMultiplicity);
1628+ if (evtReconstructedAndSelected) {
1629+ hInvMass.fill (HIST (" sigEvLossFromGenRec/MultiplicityRec" ), genMultiplicity);
1630+ hInvMass.fill (HIST (" h1GenMult2" ), genMultiplicity);
1631+ hInvMass.fill (HIST (" hAllGenCollisions1Rec" ), multiplicity);
1632+ rEventSelection.fill (HIST (" eventsCheckGen" ), 3.5 );
1633+ }
16171634
16181635 for (const auto & mcParticle : mcParticles) {
16191636
@@ -1631,7 +1648,8 @@ struct Kstarqa {
16311648 if (std::abs (mcParticle.pdgCode ()) != o2::constants::physics::kK0Star892 ) {
16321649 continue ;
16331650 }
1634- hInvMass.fill (HIST (" hAllKstarGenCollisisons1Rec" ), multiplicity, mcParticle.pt ());
1651+ if (evtReconstructedAndSelected)
1652+ hInvMass.fill (HIST (" hAllKstarGenCollisisons1Rec" ), multiplicity, mcParticle.pt ());
16351653
16361654 auto kDaughters = mcParticle.daughters_as <aod::McParticles>();
16371655 if (kDaughters .size () != selectionConfig.noOfDaughters ) {
@@ -1656,11 +1674,15 @@ struct Kstarqa {
16561674 }
16571675 if (passkaon && passpion) {
16581676 mother = daughter1 + daughter2; // Kstar meson
1659- hInvMass.fill (HIST (" hk892GenpT" ), mcParticle.pt (), multiplicity);
1660- hInvMass.fill (HIST (" hk892GenpT2" ), mother.Pt (), multiplicity);
1661- hInvMass.fill (HIST (" hk892GenpTCalib1" ), mcParticle.pt (), genMultiplicity);
1662- hInvMass.fill (HIST (" hk892GenpTCalib2" ), mother.Pt (), genMultiplicity);
1663- hInvMass.fill (HIST (" h1genmass" ), mother.M ());
1677+ hInvMass.fill (HIST (" sigEvLossFromGenRec/hSignalLossDenominator" ), mother.Pt (), genMultiplicity);
1678+ if (evtReconstructedAndSelected) {
1679+ hInvMass.fill (HIST (" hk892GenpT" ), mcParticle.pt (), multiplicity);
1680+ hInvMass.fill (HIST (" hk892GenpT2" ), mother.Pt (), multiplicity);
1681+ hInvMass.fill (HIST (" hk892GenpTCalib1" ), mcParticle.pt (), genMultiplicity);
1682+ hInvMass.fill (HIST (" hk892GenpTCalib2" ), mother.Pt (), genMultiplicity);
1683+ hInvMass.fill (HIST (" h1genmass" ), mother.M ());
1684+ hInvMass.fill (HIST (" sigEvLossFromGenRec/hSignalLossNumerator" ), mother.Pt (), genMultiplicity);
1685+ }
16641686 }
16651687 }
16661688 }
@@ -1669,17 +1691,18 @@ struct Kstarqa {
16691691 void processEvtLossSigLossMC (EventMCGenerated::iterator const & mcCollision, aod::McParticles const & mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
16701692 // void processEvtLossSigLossMC(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
16711693 {
1672- auto multiplicityRec = -1 ;
1694+ // auto multiplicityRec = -1;
16731695 bool isSelectedEvent = false ;
16741696 auto multiplicity1 = -999 .;
1697+
16751698 for (const auto & RecCollision : recCollisions) {
16761699 if (!RecCollision.has_mcCollision ())
16771700 continue ;
16781701 if (!selectionEvent (RecCollision, false )) // don't fill event cut histogram
16791702 continue ;
1680- // multiplicity1 = RecCollision.centFT0M();
1681- const auto & mcCollisionRec = RecCollision.mcCollision_as <EventMCGenerated>();
1682- multiplicityRec = mcCollisionRec.centFT0M ();
1703+
1704+ // const auto& mcCollisionRec = RecCollision.mcCollision_as<EventMCGenerated>();
1705+ // multiplicityRec = mcCollisionRec.centFT0M();
16831706
16841707 if (cSelectMultEstimator == kFT0M ) {
16851708 multiplicity1 = RecCollision.centFT0M ();
@@ -1719,7 +1742,6 @@ struct Kstarqa {
17191742 if (isSelectedEvent) {
17201743 hInvMass.fill (HIST (" MCcorrections/hImpactParameterRec" ), impactPar);
17211744 hInvMass.fill (HIST (" MCcorrections/MultiplicityRec" ), multiplicityGen);
1722- hInvMass.fill (HIST (" MCcorrections/MultiplicityRec2" ), multiplicityRec);
17231745 hInvMass.fill (HIST (" MCcorrections/hImpactParametervsMultiplicity" ), impactPar, multiplicity1);
17241746 }
17251747
@@ -1738,20 +1760,26 @@ struct Kstarqa {
17381760
17391761 void processEvSigLossFactors (McCollisionMults::iterator const & mcCollision, soa::SmallGroups<EventCandidatesMC> const & collisions, LabeledTracks const &, aod::McParticles const & mcParticles)
17401762 {
1741- hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), mcCollision.multMCNParticlesEta08 (), 0.5 );
1763+ auto multiplicityNch = -1 ;
1764+ multiplicityNch = mcCollision.multMCNParticlesEta05 ();
1765+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 0.5 );
17421766
1743- if (std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex )
1767+ if (selectionConfig. checkVzEvSigLoss && std::abs (mcCollision.posZ ()) > selectionConfig.cutzvertex )
17441768 return ;
17451769
1746- hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), mcCollision. multMCNParticlesEta08 () , 1.5 );
1770+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch , 1.5 );
17471771
17481772 if (selectionConfig.isINELgt0 && !mcCollision.isInelGt0 ()) {
17491773 return ;
17501774 }
1751- hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), mcCollision.multMCNParticlesEta08 (), 2.5 );
1775+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch, 2.5 );
1776+
1777+ float multiplicity = -1.0 ;
1778+ bool isSelectedEvent = false ;
17521779
1753- float multiplicity = 100 .5f ;
17541780 for (auto const & collision : collisions) {
1781+ if (!collision.has_mcCollision ())
1782+ continue ;
17551783 if (!selectionEvent (collision, false )) // don't fill event cut histogram
17561784 continue ;
17571785
@@ -1766,10 +1794,18 @@ struct Kstarqa {
17661794 } else {
17671795 multiplicity = collision.centFT0M (); // default
17681796 }
1797+ isSelectedEvent = true ;
17691798 }
17701799
1771- hInvMass.fill (HIST (" CorrFactors/hMultiplicityVsMultMC" ), multiplicity, mcCollision.multMCNParticlesEta08 ());
1800+ // auto multiplicityGen = -1;
1801+ // multiplicityGen = mcCollision.centFT0M();
1802+
1803+ hInvMass.fill (HIST (" CorrFactors/hMultiplicityVsMultMC" ), multiplicity, multiplicityNch);
17721804 hInvMass.fill (HIST (" CorrFactors/hNrecInGen" ), collisions.size ());
1805+ hInvMass.fill (HIST (" CorrFactors/MultiplicityGen" ), multiplicityNch);
1806+ if (isSelectedEvent) {
1807+ hInvMass.fill (HIST (" CorrFactors/MultiplicityRec" ), multiplicityNch);
1808+ }
17731809
17741810 for (const auto & mcParticle : mcParticles) {
17751811
@@ -1814,15 +1850,19 @@ struct Kstarqa {
18141850 mother = daughter1 + daughter2; // Kstar meson
18151851
18161852 hInvMass.fill (HIST (" CorrFactors/h2dGenKstar" ), multiplicity, mother.Pt ());
1817- hInvMass.fill (HIST (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" ), mcCollision.multMCNParticlesEta08 (), multiplicity, mother.Pt ());
1853+ hInvMass.fill (HIST (" CorrFactors/h3dGenKstarVsMultMCVsMultiplicity" ), multiplicityNch, multiplicity, mother.Pt ());
1854+ hInvMass.fill (HIST (" CorrFactors/hSignalLossDenominator" ), mother.pt (), multiplicityNch);
1855+ if (isSelectedEvent) {
1856+ hInvMass.fill (HIST (" CorrFactors/hSignalLossNumerator" ), mother.pt (), multiplicityNch);
1857+ }
18181858 }
18191859 }
18201860 }
18211861
18221862 if (collisions.size () == 0 )
18231863 return ;
18241864
1825- hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), mcCollision. multMCNParticlesEta08 () , 3.5 );
1865+ hInvMass.fill (HIST (" CorrFactors/hGenEvents" ), multiplicityNch , 3.5 );
18261866 }
18271867 PROCESS_SWITCH (Kstarqa, processEvSigLossFactors, " Process Event and Signal loss" , false );
18281868
@@ -2131,7 +2171,7 @@ struct Kstarqa {
21312171 hInvMass.fill (HIST (" hAllRecCollisions" ), multiplicity);
21322172 hInvMass.fill (HIST (" hAllRecCollisionsCalib" ), multiplicityRec);
21332173
2134- if (!selectionEvent (collision, false )) { // don't fill event cut histogram
2174+ if (!selectionEvent (collision, true )) { // don't fill event cut histogram
21352175 return ;
21362176 }
21372177
@@ -3011,7 +3051,7 @@ struct Kstarqa {
30113051 }
30123052
30133053 auto impactPar = mcCollision.impactParameter ();
3014- auto multiplicityRec = -1 ;
3054+ // auto multiplicityRec = -1;
30153055 auto multiplicityGen = -1 ;
30163056 multiplicityGen = mcCollision.centFT0M ();
30173057 hInvMass.fill (HIST (" MCcorrections/hImpactParameterGen" ), impactPar);
@@ -3025,8 +3065,8 @@ struct Kstarqa {
30253065 if (!selectionEvent (RecCollision, false )) // don't fill event cut histogram
30263066 continue ;
30273067 // multiplicity1 = RecCollision.centFT0M();
3028- const auto & mcCollisionRec = RecCollision.mcCollision_as <EventMCGenerated>();
3029- multiplicityRec = mcCollisionRec.centFT0M ();
3068+ // const auto& mcCollisionRec = RecCollision.mcCollision_as<EventMCGenerated>();
3069+ // multiplicityRec = mcCollisionRec.centFT0M();
30303070
30313071 if (cSelectMultEstimator == kFT0M ) {
30323072 multiplicity1 = RecCollision.centFT0M ();
@@ -3039,15 +3079,13 @@ struct Kstarqa {
30393079 } else {
30403080 multiplicity1 = RecCollision.centFT0M (); // default
30413081 }
3042-
30433082 isSelectedEvent = true ;
30443083 }
30453084
30463085 // Event loss
30473086 if (isSelectedEvent) {
30483087 hInvMass.fill (HIST (" MCcorrections/hImpactParameterRec" ), impactPar);
30493088 hInvMass.fill (HIST (" MCcorrections/MultiplicityRec" ), multiplicityGen);
3050- hInvMass.fill (HIST (" MCcorrections/MultiplicityRec2" ), multiplicityRec);
30513089 hInvMass.fill (HIST (" MCcorrections/hImpactParametervsMultiplicity" ), impactPar, multiplicity1);
30523090 }
30533091
0 commit comments