@@ -147,6 +147,7 @@ struct Kstarqa {
147147 ConfigurableAxis configThnAxisPOL{" configThnAxisPOL" , {20 , -1.0 , 1.0 }, " Costheta axis" };
148148 ConfigurableAxis invMassKstarAxis{" invMassKstarAxis" , {300 , 0 .7f , 1 .3f }, " Kstar invariant mass axis" };
149149 ConfigurableAxis ptAxisKstar{" ptAxisKstar" , {200 , 0 .0f , 20 .0f }, " Kstar pT axis" };
150+ ConfigurableAxis binsImpactPar{" binsImpactPar" , {100 , 0 , 25 }, " Binning of the impact parameter axis" };
150151
151152 // Event plane configurables
152153 Configurable<bool > boostDaugter1{" boostDaugter1" , false , " Boost daughter Kaon in the COM frame" };
@@ -167,6 +168,7 @@ struct Kstarqa {
167168 AxisSpec invmassAxis = {invMassKstarAxis, " Invariant mass (GeV/#it{c}^{2})" };
168169 AxisSpec thnAxisPOL{configThnAxisPOL, " cos(#theta)" };
169170 AxisSpec multiplicityAxis = {binsMultPlot, " Multiplicity Axis" };
171+ AxisSpec impactParAxis = {binsImpactPar, " Impact Parameter (cm)" };
170172
171173 // Histograms
172174 // Event selection
@@ -256,12 +258,22 @@ struct Kstarqa {
256258 hInvMass.add (" h1genmass" , " Invariant mass of generated kstar meson" , kTH1F , {invmassAxis});
257259 hInvMass.add (" h1GenMult" , " Multiplicity generated" , kTH1F , {multiplicityAxis});
258260 hInvMass.add (" h1RecMult" , " Multiplicity reconstructed" , kTH1F , {multiplicityAxis});
261+ hInvMass.add (" h1KSRecsplit" , " KS meson Rec split" , kTH1F , {{100 , 0 .0f , 10 .0f }});
262+ hInvMass.add (" MCcorrections/hSignalLossDenominator" , " Kstar generated before event selection" , kTH2F , {{ptAxis}, {impactParAxis}});
263+ hInvMass.add (" MCcorrections/hSignalLossNumerator" , " Kstar generated after event selection" , kTH2F , {{ptAxis}, {impactParAxis}});
264+ // hInvMass.add("hAllGenCollisionsImpact", "All generated collisions vs impact parameter", kTH1F, {multiplicityAxis});
265+ hInvMass.add (" hAllGenCollisions" , " All generated events" , kTH1F , {multiplicityAxis});
266+ hInvMass.add (" hAllGenCollisions1Rec" , " All gen events with at least one rec event" , kTH1F , {multiplicityAxis});
267+ hInvMass.add (" hAllKstarGenCollisisons" , " All generated Kstar in events with rapidity in 0.5" , kTH2F , {{multiplicityAxis}, {ptAxis}});
268+ hInvMass.add (" hAllKstarGenCollisisons1Rec" , " All generated Kstar in events with at least one rec event in rapidity in 0.5" , kTH2F , {{multiplicityAxis}, {ptAxis}});
269+ hInvMass.add (" hAllRecCollisions" , " All reconstructed events" , kTH2F , {{multiplicityAxis}});
270+ hInvMass.add (" MCcorrections/hImpactParameterRec" , " Impact parameter in reconstructed MC" , kTH1F , {{impactParAxis}});
271+ hInvMass.add (" MCcorrections/hImpactParameterGen" , " Impact parameter in generated MC" , kTH1F , {{impactParAxis}});
272+ hInvMass.add (" MCcorrections/hImpactParametervsMultiplicity" , " Impact parameter vs multiplicity in reconstructed MC" , kTH1F , {{impactParAxis}, {multiplicityAxis}});
259273 rEventSelection.add (" events_check_data" , " No. of events in the data" , kTH1I , {{20 , 0 , 20 }});
260274 rEventSelection.add (" events_check" , " No. of events in the generated MC" , kTH1I , {{20 , 0 , 20 }});
261275 rEventSelection.add (" events_checkrec" , " No. of events in the reconstructed MC" , kTH1I , {{20 , 0 , 20 }});
262- hInvMass.add (" h1KSRecsplit" , " KS meson Rec split" , kTH1F , {{100 , 0 .0f , 10 .0f }});
263- hInvMass.add (" kstargenBeforeEvtSel" , " Kstar generated before event selection" , kTH1F , {ptAxis});
264- hInvMass.add (" kstargenAfterEvtSel" , " Kstar generated after event selection" , kTH1F , {ptAxis});
276+ rEventSelection.add (" hOccupancy" , " Occupancy distribution" , kTH1F , {{1000 , 0 , 15000 }});
265277
266278 // Multplicity distribution
267279 if (cQAevents) {
@@ -750,9 +762,11 @@ struct Kstarqa {
750762 if (!selectionEvent (collision, true )) {
751763 return ;
752764 }
753-
754765 rEventSelection.fill (HIST (" events_check_data" ), 3.5 );
755766
767+ int occupancy = collision.trackOccupancyInTimeRange ();
768+ rEventSelection.fill (HIST (" hOccupancy" ), occupancy);
769+
756770 multiplicity = -1 ;
757771
758772 if (cSelectMultEstimator == 0 ) {
@@ -993,6 +1007,12 @@ struct Kstarqa {
9931007 std::vector<int64_t > selectedEvents (collisions.size ());
9941008 int nevts = 0 ;
9951009 multiplicity = -1.0 ;
1010+ // float impactParameter = mcCollision.impactParameter();
1011+
1012+ // if (mcCollision.isInelGt0()) {
1013+ // return;
1014+ // }
1015+
9961016 for (const auto & collision : collisions) {
9971017 // if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > selectionConfig.cutzvertex) {
9981018 if (std::abs (collision.mcCollision ().posZ ()) > selectionConfig.cutzvertex ) {
@@ -1019,15 +1039,24 @@ struct Kstarqa {
10191039 multiplicity = collision.centFT0M ();
10201040 hInvMass.fill (HIST (" h1GenMult" ), multiplicity);
10211041 selectedEvents[nevts++] = collision.mcCollision_as <aod::McCollisions>().globalIndex ();
1042+ int occupancy = collision.trackOccupancyInTimeRange ();
1043+ rEventSelection.fill (HIST (" hOccupancy" ), occupancy);
10221044 }
10231045 selectedEvents.resize (nevts);
10241046 rEventSelection.fill (HIST (" events_check" ), 3.5 );
10251047
1026- const auto evtReconstructedAndSelected = std::find (selectedEvents.begin (), selectedEvents.end (), mcCollision.globalIndex ()) != selectedEvents.end ();
1048+ for (const auto & mcParticle : mcParticles) {
1049+ if (std::abs (mcParticle.y ()) < 0.5 && std::abs (mcParticle.pdgCode ()) == o2::constants::physics::kK0Star892 ) {
1050+ hInvMass.fill (HIST (" hAllKstarGenCollisisons" ), multiplicity, mcParticle.pt ());
1051+ }
1052+ }
10271053
1054+ const auto evtReconstructedAndSelected = std::find (selectedEvents.begin (), selectedEvents.end (), mcCollision.globalIndex ()) != selectedEvents.end ();
1055+ hInvMass.fill (HIST (" hAllGenCollisions" ), multiplicity);
10281056 if (!cAllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection
10291057 return ;
10301058 }
1059+ hInvMass.fill (HIST (" hAllGenCollisions1Rec" ), multiplicity);
10311060 rEventSelection.fill (HIST (" events_check" ), 4.5 );
10321061
10331062 for (const auto & mcParticle : mcParticles) {
@@ -1040,6 +1069,7 @@ struct Kstarqa {
10401069 continue ;
10411070 }
10421071 rEventSelection.fill (HIST (" events_check" ), 6.5 );
1072+ hInvMass.fill (HIST (" hAllKstarGenCollisisons1Rec" ), multiplicity, mcParticle.pt ());
10431073
10441074 auto kDaughters = mcParticle.daughters_as <aod::McParticles>();
10451075 if (kDaughters .size () != 2 ) {
@@ -1073,43 +1103,41 @@ struct Kstarqa {
10731103 }
10741104 }
10751105 PROCESS_SWITCH (Kstarqa, processGen, " Process Generated" , false );
1076- /*
1077- void processEvtLossSigLossMC(aod::McCollisions::iterator const&, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
1078- {
1079-
1080- bool isSel = false;
1081- // auto multiplicity1 = -999.;
1082- for (const auto& RecCollision : recCollisions) {
1083- if (!selectionEvent(RecCollision, false))
1084- continue;
10851106
1086- // if (cSelectMultEstimator == 0) {
1087- // multiplicity1 = RecCollision.centFT0M();
1088- // } else if (cSelectMultEstimator == 1) {
1089- // multiplicity1 = RecCollision.centFT0A();
1090- // } else if (cSelectMultEstimator == 2) {
1091- // multiplicity1 = RecCollision.centFT0C();
1092- // } else {
1093- // multiplicity1 = RecCollision.centFT0M();
1094- // }
1095-
1096- isSel = true;
1097- }
1107+ void processEvtLossSigLossMC (aod::McCollisions::iterator const & mcCollision, aod::McParticles const & mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
1108+ {
1109+ auto impactPar = mcCollision.impactParameter ();
1110+ hInvMass.fill (HIST (" MCcorrections/hImpactParameterGen" ), impactPar);
10981111
1099- // Generated MC
1100- for (const auto& mcPart : mcParticles) {
1101- if (std::abs(mcPart.y()) >= 0.5 || std::abs(mcPart.pdgCode()) != o2::constants::physics::kK0Star892)
1102- continue;
1112+ bool isSelectedEvent = false ;
1113+ auto multiplicity1 = -999 .;
1114+ for (const auto & RecCollision : recCollisions) {
1115+ if (!selectionEvent (RecCollision, false ))
1116+ continue ;
1117+ multiplicity1 = RecCollision.centFT0M ();
1118+ isSelectedEvent = true ;
1119+ }
11031120
1104- // signal loss estimation
1105- hInvMass.fill(HIST("kstargenBeforeEvtSel"), mcPart.pt());
1106- if (isSel) {
1107- hInvMass.fill(HIST("kstargenAfterEvtSel"), mcPart.pt());
1108- }
1109- } // end loop on gen particles
1121+ // Event loss
1122+ if (isSelectedEvent) {
1123+ hInvMass.fill (HIST (" MCcorrections/hImpactParameterRec" ), impactPar);
1124+ hInvMass.fill (HIST (" MCcorrections/hImpactParametervsMultiplicity" ), impactPar, multiplicity1);
11101125 }
1111- PROCESS_SWITCH(Kstarqa, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false);
1112- */
1126+
1127+ // Generated MC
1128+ for (const auto & mcPart : mcParticles) {
1129+ if (std::abs (mcPart.y ()) >= 0.5 || std::abs (mcPart.pdgCode ()) != o2::constants::physics::kK0Star892 )
1130+ continue ;
1131+
1132+ // signal loss estimation
1133+ hInvMass.fill (HIST (" MCcorrections/hSignalLossDenominator" ), mcPart.pt (), impactPar);
1134+ if (isSelectedEvent) {
1135+ hInvMass.fill (HIST (" MCcorrections/hSignalLossNumerator" ), mcPart.pt (), impactPar);
1136+ }
1137+ } // end loop on gen particles
1138+ }
1139+ PROCESS_SWITCH (Kstarqa, processEvtLossSigLossMC, " Process Signal Loss, Event Loss" , false );
1140+
11131141 void processRec (EventCandidatesMC::iterator const & collision, TrackCandidatesMC const & tracks, aod::McParticles const &, aod::McCollisions const & /* mcCollisions*/ )
11141142 {
11151143
@@ -1123,6 +1151,8 @@ struct Kstarqa {
11231151 if (selectionConfig.isINELgt0 && !collision.isInelGt0 ()) {
11241152 return ;
11251153 }
1154+ multiplicity = collision.centFT0M ();
1155+ hInvMass.fill (HIST (" hAllRecCollisions" ), multiplicity);
11261156
11271157 // if (std::abs(collision.mcCollision().posZ()) > selectionConfig.cutzvertex || !collision.sel8()) {
11281158 if (std::abs (collision.mcCollision ().posZ ()) > selectionConfig.cutzvertex ) {
0 commit comments