@@ -78,8 +78,8 @@ auto static constexpr KminFt0cCell = 96;
7878auto static constexpr TotFt0Channels = 208 ;
7979AxisSpec axisEvent{15 , 0.5 , 15.5 , " #Event" , " EventAxis" };
8080auto static constexpr KminCharge = 3 .0f ;
81- static constexpr std::string_view species[] = {" Pi" , " Ka" , " Pr" , " K0s " , " L0s " };
82- static constexpr std::array<int , 5 > speciesIds{kPiPlus , kKPlus , kProton , kK0Short , kLambda0 };
81+ static constexpr std::string_view species[] = {" Pi" , " Ka" , " Pr" };
82+ static constexpr std::array<int , 3 > speciesIds{kPiPlus , kKPlus , kProton };
8383
8484enum KindOfV0 {
8585 kLambda = 0 ,
@@ -178,13 +178,13 @@ struct LongrangeMaker {
178178 Configurable<std::vector<double >> tofNsigmaPidCut{" tofNsigmaPidCut" , std::vector<double >{1.5 , 1.5 , 1.5 , -1.5 , -1.5 , -1.5 }, " TOF n-sigma cut for pions_posNsigma, kaons_posNsigma, protons_posNsigma, pions_negNsigma, kaons_negNsigma, protons_negNsigma" };
179179 Configurable<float > cfgTofPidPtCut{" cfgTofPidPtCut" , 0 .3f , " Minimum pt to use TOF N-sigma" };
180180 Configurable<bool > isUseItsPid{" isUseItsPid" , false , " Use ITS PID for particle identification" };
181- Configurable<int > isUseDataLikeMult{ " isUseDataLikeMult " , 0 , " Data like mult/cent classification" };
181+ Configurable<bool > isUseCentEst{ " isUseCentEst " , false , " Centrality based classification" };
182182
183183 ConfigurableAxis vtxHistBin{" vtxHistBin" , {20 , -10 , 10 }, " " };
184184 ConfigurableAxis multHistBin{" multHistBin" , {100 , 0 , 100 }, " " };
185185 ConfigurableAxis etaHistBin{" etaHistBin" , {20 , -1 , 1 }, " " };
186186 ConfigurableAxis ptHistBin{" ptHistBin" , {10 , 0 , 10 }, " " };
187- ConfigurableAxis speciesHistBin{" speciesHistBin" , {6 , 0.5 , 6 .5 }, " " };
187+ ConfigurableAxis speciesHistBin{" speciesHistBin" , {4 , 0.5 , 4 .5 }, " " };
188188
189189 Service<o2::ccdb::BasicCCDBManager> ccdb;
190190 Service<o2::framework::O2DatabasePDG> pdg;
@@ -252,8 +252,8 @@ struct LongrangeMaker {
252252 axisGen->SetBinLabel (i + 1 , species[i].data ());
253253 axisRec->SetBinLabel (i + 1 , species[i].data ());
254254 }
255- axisGen->SetBinLabel (6 , " Other" );
256- axisRec->SetBinLabel (6 , " Other" );
255+ axisGen->SetBinLabel (4 , " Other" );
256+ axisRec->SetBinLabel (4 , " Other" );
257257 }
258258
259259 myTrackFilter = getGlobalTrackSelectionRun3ITSMatch (TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default);
@@ -735,43 +735,37 @@ struct LongrangeMaker {
735735 return ;
736736 }
737737 auto multiplicity = 0 ;
738- for (const auto & particle : mcparticles) {
739- if (!isGenPartSelected (particle) || std::abs (particle.eta ()) > cfgtrksel.cfgEtaCut || particle.pt () < cfgtrksel.cfgPtCutMin || particle.pt () > cfgtrksel.cfgPtCutMult )
738+ bool atLeastOne = false ;
739+ for (const auto & RecCol : RecCols) {
740+ if (!isEventSelected (RecCol))
740741 continue ;
741- multiplicity++;
742- }
743- if (isUseDataLikeMult > 0 ) {
744- for (const auto & RecCol : RecCols) {
745- if (!isEventSelected (RecCol)) {
746- continue ;
747- }
748- if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut ) {
749- continue ;
750- }
751- if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
752- continue ;
753- }
742+ if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut )
743+ continue ;
744+ if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ())
745+ continue ;
746+ if (isUseCentEst) {
754747 multiplicity = selColCent (RecCol);
748+ } else {
749+ auto recTracksPart = RecTracks.sliceBy (perColMidtrack, RecCol.globalIndex ());
750+ multiplicity = countNTracks (recTracksPart);
755751 }
752+ atLeastOne = true ;
756753 }
757-
758754 for (const auto & particle : mcparticles) {
759- if (!isGenPartSelected (particle) || std::abs (particle.eta ()) > cfgtrksel.cfgEtaCut || particle.pt () < cfgtrksel.cfgPtCutMin || particle.pt () > cfgtrksel.cfgPtCutMult )
755+ if (!isGenPartSelected (particle) || std::abs (particle.eta ()) > cfgtrksel.cfgEtaCut || particle.pt () < cfgtrksel.cfgPtCutMin || particle.pt () > cfgtrksel.cfgPtCutMax )
760756 continue ;
761- auto pos = std::distance (speciesIds.begin (), std::find (speciesIds.begin (), speciesIds.end (), particle.pdgCode ())) + 1 ;
762- histos.fill (HIST (" hGenMCdndpt" ), mcCollision.posZ (), multiplicity, particle.eta (), particle.pt (), pos);
757+ if (atLeastOne) {
758+ auto pos = std::distance (speciesIds.begin (), std::find (speciesIds.begin (), speciesIds.end (), particle.pdgCode ())) + 1 ;
759+ histos.fill (HIST (" hGenMCdndpt" ), mcCollision.posZ (), multiplicity, particle.eta (), particle.pt (), pos);
760+ }
763761 }
764-
765762 for (const auto & RecCol : RecCols) {
766- if (!isEventSelected (RecCol)) {
763+ if (!isEventSelected (RecCol))
767764 continue ;
768- }
769- if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut ) {
765+ if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut )
770766 continue ;
771- }
772- if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
767+ if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ())
773768 continue ;
774- }
775769 auto recTracksPart = RecTracks.sliceBy (perColMidtrack, RecCol.globalIndex ());
776770 for (const auto & track : recTracksPart) {
777771 if (!track.isGlobalTrack ())
@@ -790,50 +784,43 @@ struct LongrangeMaker {
790784 }
791785 }
792786 }
793-
794787 void processMFTtrackEff (ColMCTrueTable::iterator const & mcCollision, ColMCRecTable const & RecCols,
795- MftTrkMCRecTable const & mfttracks, aod::McParticles const & mcparticles)
788+ TrksMCRecTable const & RecTracks, MftTrkMCRecTable const & mfttracks,
789+ aod::McParticles const & mcparticles)
796790 {
797791 if (std::abs (mcCollision.posZ ()) >= cfgevtsel.cfgVtxCut ) {
798792 return ;
799793 }
800794 auto multiplicity = 0 ;
801- for (const auto & particle : mcparticles) {
802- if (!isGenPartSelected (particle) || std::abs (particle.eta ()) > cfgtrksel.cfgEtaCut || particle.pt () < cfgtrksel.cfgPtCutMin || particle.pt () > cfgtrksel.cfgPtCutMult )
795+ bool atLeastOne = false ;
796+ for (const auto & RecCol : RecCols) {
797+ if (!isEventSelected (RecCol))
803798 continue ;
804- multiplicity++;
805- }
806- if (isUseDataLikeMult > 0 ) {
807- for (const auto & RecCol : RecCols) {
808- if (!isEventSelected (RecCol)) {
809- continue ;
810- }
811- if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut ) {
812- continue ;
813- }
814- if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
815- continue ;
816- }
799+ if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut )
800+ continue ;
801+ if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ())
802+ continue ;
803+ if (isUseCentEst) {
817804 multiplicity = selColCent (RecCol);
805+ } else {
806+ auto recTracksPart = RecTracks.sliceBy (perColMidtrack, RecCol.globalIndex ());
807+ multiplicity = countNTracks (recTracksPart);
818808 }
809+ atLeastOne = true ;
819810 }
820-
821811 for (const auto & particle : mcparticles) {
822812 if (!isGenPartSelected (particle) || particle.eta () > cfgmfttrksel.cfigMftEtaMax || particle.eta () < cfgmfttrksel.cfigMftEtaMin || particle.pt () < cfgmfttrksel.cfgMftPtCutMin || particle.pt () > cfgmfttrksel.cfgMftPtCutMax )
823813 continue ;
824- histos.fill (HIST (" hGenMCdndpt" ), mcCollision.posZ (), multiplicity, particle.eta (), particle.pt (), 1.0 );
814+ if (atLeastOne)
815+ histos.fill (HIST (" hGenMCdndpt" ), mcCollision.posZ (), multiplicity, particle.eta (), particle.pt (), 1.0 );
825816 }
826-
827817 for (const auto & RecCol : RecCols) {
828- if (!isEventSelected (RecCol)) {
818+ if (!isEventSelected (RecCol))
829819 continue ;
830- }
831- if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut ) {
820+ if (std::abs (RecCol.posZ ()) >= cfgevtsel.cfgVtxCut )
832821 continue ;
833- }
834- if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ()) {
822+ if (cfgevtsel.isApplyBestCollIndex && RecCol.globalIndex () != mcCollision.bestCollisionIndex ())
835823 continue ;
836- }
837824 auto recTracksPart = mfttracks.sliceBy (perColMfttrack, RecCol.globalIndex ());
838825 for (const auto & track : recTracksPart) {
839826 if (!isMftTrackSelected (track))
0 commit comments