@@ -86,6 +86,8 @@ struct Kstarqa {
8686 Configurable<bool > onlyTOFHIT{" onlyTOFHIT" , false , " accept only TOF hit tracks at high pt" };
8787 Configurable<bool > onlyTPC{" onlyTPC" , true , " only TPC tracks" };
8888 Configurable<int > cRotations{" cRotations" , 3 , " Number of random rotations in the rotational background" };
89+ Configurable<int > cSelectMultEstimator{" cSelectMultEstimator" , 0 , " Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C" };
90+ Configurable<bool > applyRecMotherRapidity{" applyRecMotherRapidity" , true , " Apply rapidity cut on reconstructed mother track" };
8991
9092 // Configurables for track selections
9193 Configurable<int > rotationalCut{" rotationalCut" , 10 , " Cut value (Rotation angle pi - pi/cut and pi + pi/cut)" };
@@ -203,7 +205,7 @@ struct Kstarqa {
203205 hInvMass.add (" hk892GenpT2" , " pT distribution of True MC K(892)0" , kTHnSparseF , {ptAxis, multiplicityAxis});
204206 hInvMass.add (" h1KstarRecMass" , " Invariant mass of kstar meson" , kTH1F , {invmassAxis});
205207 hInvMass.add (" h2KstarRecpt1" , " pT of kstar meson" , kTHnSparseF , {ptAxis, multiplicityAxis, invmassAxis});
206- hInvMass.add (" h2KstarRecpt2" , " pT of generated kstar meson" , kTHnSparseF , {ptAxis, multiplicityAxis});
208+ hInvMass.add (" h2KstarRecpt2" , " pT of generated kstar meson" , kTHnSparseF , {ptAxis, multiplicityAxis, invmassAxis });
207209 hInvMass.add (" h1genmass" , " Invariant mass of generated kstar meson" , kTH1F , {invmassAxis});
208210 hInvMass.add (" h1GenMult" , " Multiplicity generated" , kTH1F , {multiplicityAxis});
209211 hInvMass.add (" h1RecMult" , " Multiplicity reconstructed" , kTH1F , {multiplicityAxis});
@@ -579,7 +581,16 @@ struct Kstarqa {
579581 rEventSelection.fill (HIST (" events_check_data" ), 3.5 );
580582
581583 multiplicity = -1 ;
582- multiplicity = collision.centFT0M ();
584+
585+ if (cSelectMultEstimator == 0 ) {
586+ multiplicity = collision.centFT0M ();
587+ } else if (cSelectMultEstimator == 1 ) {
588+ multiplicity = collision.centFT0A ();
589+ } else if (cSelectMultEstimator == 2 ) {
590+ multiplicity = collision.centFT0C ();
591+ } else {
592+ multiplicity = collision.multFT0M ();
593+ }
583594
584595 // Fill the event counter
585596 if (cQAevents) {
@@ -690,76 +701,58 @@ struct Kstarqa {
690701 ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {2000 , 0 , 10000 }, " TPC multiplicity axis for ME mixing" };
691702
692703 // using BinningTypeTPCMultiplicity = ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultTPC>;
693- // using BinningTypeCentralityM = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
704+ using BinningTypeCentralityM = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
694705 using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0M>;
706+ using BinningTypeFT0A = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0A>;
695707
696708 BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicity}, true };
697- // BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true};
709+ BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true };
710+ BinningTypeFT0A binningOnFT0A{{axisVertex, axisMultiplicity}, true };
698711
699712 SameKindPair<EventCandidates, TrackCandidates, BinningTypeVertexContributor> pair1{binningOnPositions, cfgNoMixedEvents, -1 , &cache};
700- // SameKindPair<EventCandidates, TrackCandidates, BinningTypeCentralityM> pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache};
713+ SameKindPair<EventCandidates, TrackCandidates, BinningTypeCentralityM> pair2{binningOnCentrality, cfgNoMixedEvents, -1 , &cache};
714+ SameKindPair<EventCandidates, TrackCandidates, BinningTypeFT0A> pair3{binningOnFT0A, cfgNoMixedEvents, -1 , &cache};
701715
702716 void processME (EventCandidates const &, TrackCandidates const &)
703717 {
704- for (const auto & [c1, tracks1, c2, tracks2] : pair1) {
705-
706- if (!c1.sel8 ()) {
707- continue ;
708- }
709- if (!c2.sel8 ()) {
710- continue ;
711- }
712-
713- if (timFrameEvsel && (!c1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c2.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !c1.selection_bit (aod::evsel::kNoITSROFrameBorder ) || !c2.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
714- continue ;
715- }
716-
717- if (cTVXEvsel && (!c1.selection_bit (aod::evsel::kIsTriggerTVX ) || !c2.selection_bit (aod::evsel::kIsTriggerTVX ))) {
718- return ;
719- }
720-
721- if (rctCut.requireRCTFlagChecker && !rctChecker (c1)) {
722- continue ;
723- }
724- if (rctCut.requireRCTFlagChecker && !rctChecker (c2)) {
725- continue ;
726- }
727-
728- multiplicity = c1.centFT0M ();
729-
730- for (const auto & [t1, t2] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
731-
732- if (!selectionTrack (t1)) // Kaon
718+ // Map estimator to pair and multiplicity accessor
719+ auto runMixing = [&](auto & pair, auto multiplicityGetter) {
720+ for (const auto & [c1, tracks1, c2, tracks2] : pair) {
721+ if (!c1.sel8 () || !c2.sel8 ())
733722 continue ;
734- if (!selectionTrack (t2)) // Pion
735- continue ;
736- if (!selectionPID (t1, 1 )) // Kaon
737- continue ;
738- if (!selectionPID (t2, 0 )) // Pion
723+
724+ if (rctCut.requireRCTFlagChecker && (!rctChecker (c1) || !rctChecker (c2)))
739725 continue ;
740726
741- // if (cMID) {
742- // if (cMIDselectionPID(t1, 0)) // misidentified as pion
743- // continue;
744- // if (cMIDselectionPID(t1, 2)) // misidentified as proton
745- // continue;
746- // if (cMIDselectionPID(t2, 1)) // misidentified as kaon
747- // continue;
748- // }
727+ multiplicity = multiplicityGetter (c1);
749728
750- daughter1 = ROOT::Math::PxPyPzMVector (t1.px (), t1.py (), t1.pz (), massKa);
751- daughter2 = ROOT::Math::PxPyPzMVector (t2.px (), t2.py (), t2.pz (), massPi);
752- mother = daughter1 + daughter2; // Kstar meson
729+ for (const auto & [t1, t2] : o2::soa::combinations (
730+ o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
731+ if (!selectionTrack (t1) || !selectionTrack (t2))
732+ continue ;
733+ if (!selectionPID (t1, 1 ) || !selectionPID (t2, 0 ))
734+ continue ;
753735
754- isMix = true ;
736+ daughter1 = ROOT::Math::PxPyPzMVector (t1.px (), t1.py (), t1.pz (), massKa);
737+ daughter2 = ROOT::Math::PxPyPzMVector (t2.px (), t2.py (), t2.pz (), massPi);
738+ mother = daughter1 + daughter2;
755739
756- // if (std::abs(kstar.Rapidity()) < 0.5) {
757- // fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix);
740+ isMix = true ;
758741
759- if (std::abs (mother.Rapidity ()) < 0.5 ) {
760- fillInvMass (daughter1, daughter2, mother, multiplicity, isMix, t1, t2);
742+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
743+ fillInvMass (daughter1, daughter2, mother, multiplicity, isMix, t1, t2);
744+ }
761745 }
762746 }
747+ };
748+
749+ // Call mixing based on selected estimator
750+ if (cSelectMultEstimator == 0 ) {
751+ runMixing (pair1, [](const auto & c) { return c.centFT0M (); });
752+ } else if (cSelectMultEstimator == 1 ) {
753+ runMixing (pair2, [](const auto & c) { return c.centFT0A (); });
754+ } else if (cSelectMultEstimator == 2 ) {
755+ runMixing (pair3, [](const auto & c) { return c.centFT0C (); });
763756 }
764757 }
765758
@@ -1017,13 +1010,14 @@ struct Kstarqa {
10171010 daughter2 = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massPi);
10181011 mother = daughter1 + daughter2; // Kstar meson
10191012
1020- if (mother.Rapidity () >= 0 ) {
1013+ hInvMass.fill (HIST (" h2KstarRecpt2" ), mothertrack1.pt (), multiplicity, TMath::Sqrt (mothertrack1.e () * mothertrack1.e () - mothertrack1.p () * mothertrack1.p ()));
1014+
1015+ if (applyRecMotherRapidity && mother.Rapidity () >= 0 ) {
10211016 continue ;
10221017 }
10231018
10241019 hInvMass.fill (HIST (" h1KstarRecMass" ), mother.M ());
10251020 hInvMass.fill (HIST (" h2KstarRecpt1" ), mother.Pt (), multiplicity, mother.M ());
1026- hInvMass.fill (HIST (" h2KstarRecpt2" ), mothertrack1.pt (), multiplicity);
10271021 }
10281022 }
10291023 }
0 commit comments