@@ -1784,7 +1784,13 @@ struct FlowDecorrelation {
17841784 }
17851785 }
17861786
1787- if (cfgSelCollByNch && (mcParticles.size () < cfgGeneralCuts.cfgCutMultMin || mcParticles.size () >= cfgGeneralCuts.cfgCutMultMax )) {
1787+ int tpcMult = 0 ;
1788+ for (const auto & track : mcParticles) {
1789+ if (std::abs (track.eta ()) < cfgMcTrue.cfgEtaTpcCut )
1790+ tpcMult += 1 ;
1791+ }
1792+
1793+ if (cfgSelCollByNch && (tpcMult < cfgGeneralCuts.cfgCutMultMin || tpcMult >= cfgGeneralCuts.cfgCutMultMax )) {
17881794 return ;
17891795 }
17901796 if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgGeneralCuts.cfgCutCentMin || cent >= cfgGeneralCuts.cfgCutCentMax )) {
@@ -1794,7 +1800,7 @@ struct FlowDecorrelation {
17941800 registry.fill (HIST (" MCTrue/MCeventcount" ), SameEvent); // because its same event i put it in the 1 bin
17951801 if (!cfgCentTableUnavailable)
17961802 registry.fill (HIST (" MCTrue/MCCentrality" ), cent);
1797- registry.fill (HIST (" MCTrue/MCNch" ), mcParticles. size () );
1803+ registry.fill (HIST (" MCTrue/MCNch" ), tpcMult );
17981804 registry.fill (HIST (" MCTrue/MCzVtx" ), mcCollision.posZ ());
17991805 for (const auto & mcParticle : mcParticles) {
18001806 if (mcParticle.isPhysicalPrimary ()) {
@@ -1804,12 +1810,12 @@ struct FlowDecorrelation {
18041810 }
18051811 }
18061812 if (cfgMcTrue.cfgUseCFStepAll ) {
1807- same->fillEvent (mcParticles. size () , CorrelationContainer::kCFStepAll );
1813+ same->fillEvent (tpcMult , CorrelationContainer::kCFStepAll );
18081814 fillMCCorrelations<CorrelationContainer::kCFStepAll >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f , kFT0C );
18091815 }
18101816
18111817 registry.fill (HIST (" MCTrue/MCeventcount" ), 2.5 );
1812- same->fillEvent (mcParticles. size () , CorrelationContainer::kCFStepTrackedOnlyPrim );
1818+ same->fillEvent (tpcMult , CorrelationContainer::kCFStepTrackedOnlyPrim );
18131819 fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f , kFT0C );
18141820 }
18151821 PROCESS_SWITCH (FlowDecorrelation, processMcSameTpcFt0c, " Process MC same event" , false );
@@ -1818,8 +1824,12 @@ struct FlowDecorrelation {
18181824 {
18191825 auto getTracksSize = [&mcParticles, this ](FilteredMcCollisions::iterator const & mcCollision) {
18201826 auto associatedTracks = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), this ->cache );
1821- auto mult = associatedTracks.size ();
1822- return mult;
1827+ int tpcMult = 0 ;
1828+ for (const auto & track : associatedTracks) {
1829+ if (std::abs (track.eta ()) < cfgMcTrue.cfgEtaTpcCut )
1830+ tpcMult += 1 ;
1831+ }
1832+ return tpcMult;
18231833 };
18241834
18251835 using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, o2::aod::mccollision::PosZ, decltype (getTracksSize)>;
@@ -1831,22 +1841,20 @@ struct FlowDecorrelation {
18311841 for (auto it = pairs.begin (); it != pairs.end (); it++) {
18321842 auto & [collision1, tracks1, collision2, tracks2] = *it;
18331843
1834- if (cfgSelCollByNch && (tracks1.size () < cfgGeneralCuts.cfgCutMultMin || tracks1.size () >= cfgGeneralCuts.cfgCutMultMax ))
1835- continue ;
1836-
1837- if (cfgSelCollByNch && (tracks2.size () < cfgGeneralCuts.cfgCutMultMin || tracks2.size () >= cfgGeneralCuts.cfgCutMultMax ))
1838- continue ;
1839-
1840- auto groupedCollisions = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1841-
1842- float cent = -1 ;
1844+ auto groupedCollisions1 = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1845+ auto groupedCollisions2 = collisions.sliceBy (collisionPerMCCollision, collision2.globalIndex ());
1846+ float cent1 = -1 ;
1847+ float cent2 = -1 ;
18431848 if (!cfgCentTableUnavailable) {
1844- for (const auto & collision : groupedCollisions) {
1845- cent = getCentrality (collision);
1849+ for (const auto & collision : groupedCollisions1) {
1850+ cent1 = getCentrality (collision);
1851+ }
1852+ for (const auto & collision : groupedCollisions2) {
1853+ cent2 = getCentrality (collision);
18461854 }
18471855 }
18481856
1849- if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgGeneralCuts.cfgCutCentMin || cent >= cfgGeneralCuts.cfgCutCentMax ))
1857+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && ((cent1 < cfgGeneralCuts.cfgCutCentMin || cent1 >= cfgGeneralCuts.cfgCutCentMax ) || (cent2 < cfgGeneralCuts. cfgCutCentMin || cent2 >= cfgGeneralCuts. cfgCutCentMax ) ))
18501858 continue ;
18511859
18521860 registry.fill (HIST (" MCTrue/MCeventcount" ), MixedEvent); // fill the mixed event in the 3 bin
@@ -1874,7 +1882,13 @@ struct FlowDecorrelation {
18741882 }
18751883 }
18761884
1877- if (cfgSelCollByNch && (mcParticles.size () < cfgGeneralCuts.cfgCutMultMin || mcParticles.size () >= cfgGeneralCuts.cfgCutMultMax )) {
1885+ int tpcMult = 0 ;
1886+ for (const auto & track : mcParticles) {
1887+ if (std::abs (track.eta ()) < cfgMcTrue.cfgEtaTpcCut )
1888+ tpcMult += 1 ;
1889+ }
1890+
1891+ if (cfgSelCollByNch && (tpcMult < cfgGeneralCuts.cfgCutMultMin || tpcMult >= cfgGeneralCuts.cfgCutMultMax )) {
18781892 return ;
18791893 }
18801894 if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgGeneralCuts.cfgCutCentMin || cent >= cfgGeneralCuts.cfgCutCentMax )) {
@@ -1884,7 +1898,7 @@ struct FlowDecorrelation {
18841898 registry.fill (HIST (" MCTrue/MCeventcount" ), SameEvent); // because its same event i put it in the 1 bin
18851899 if (!cfgCentTableUnavailable)
18861900 registry.fill (HIST (" MCTrue/MCCentrality" ), cent);
1887- registry.fill (HIST (" MCTrue/MCNch" ), mcParticles. size () );
1901+ registry.fill (HIST (" MCTrue/MCNch" ), tpcMult );
18881902 registry.fill (HIST (" MCTrue/MCzVtx" ), mcCollision.posZ ());
18891903 for (const auto & mcParticle : mcParticles) {
18901904 if (mcParticle.isPhysicalPrimary ()) {
@@ -1894,12 +1908,12 @@ struct FlowDecorrelation {
18941908 }
18951909 }
18961910 if (cfgMcTrue.cfgUseCFStepAll ) {
1897- same->fillEvent (mcParticles. size () , CorrelationContainer::kCFStepAll );
1911+ same->fillEvent (tpcMult , CorrelationContainer::kCFStepAll );
18981912 fillMCCorrelations<CorrelationContainer::kCFStepAll >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f , kFT0A );
18991913 }
19001914
19011915 registry.fill (HIST (" MCTrue/MCeventcount" ), 2.5 );
1902- same->fillEvent (mcParticles. size () , CorrelationContainer::kCFStepTrackedOnlyPrim );
1916+ same->fillEvent (tpcMult , CorrelationContainer::kCFStepTrackedOnlyPrim );
19031917 fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f , kFT0A );
19041918 }
19051919 PROCESS_SWITCH (FlowDecorrelation, processMcSameTpcFt0a, " Process MC same event" , false );
@@ -1908,8 +1922,12 @@ struct FlowDecorrelation {
19081922 {
19091923 auto getTracksSize = [&mcParticles, this ](FilteredMcCollisions::iterator const & mcCollision) {
19101924 auto associatedTracks = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), this ->cache );
1911- auto mult = associatedTracks.size ();
1912- return mult;
1925+ int tpcMult = 0 ;
1926+ for (const auto & track : associatedTracks) {
1927+ if (std::abs (track.eta ()) < cfgMcTrue.cfgEtaTpcCut )
1928+ tpcMult += 1 ;
1929+ }
1930+ return tpcMult;
19131931 };
19141932
19151933 using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, o2::aod::mccollision::PosZ, decltype (getTracksSize)>;
@@ -1927,16 +1945,20 @@ struct FlowDecorrelation {
19271945 if (cfgSelCollByNch && (tracks2.size () < cfgGeneralCuts.cfgCutMultMin || tracks2.size () >= cfgGeneralCuts.cfgCutMultMax ))
19281946 continue ;
19291947
1930- auto groupedCollisions = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1931-
1932- float cent = -1 ;
1948+ auto groupedCollisions1 = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1949+ auto groupedCollisions2 = collisions.sliceBy (collisionPerMCCollision, collision2.globalIndex ());
1950+ float cent1 = -1 ;
1951+ float cent2 = -1 ;
19331952 if (!cfgCentTableUnavailable) {
1934- for (const auto & collision : groupedCollisions) {
1935- cent = getCentrality (collision);
1953+ for (const auto & collision : groupedCollisions1) {
1954+ cent1 = getCentrality (collision);
1955+ }
1956+ for (const auto & collision : groupedCollisions2) {
1957+ cent2 = getCentrality (collision);
19361958 }
19371959 }
19381960
1939- if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgGeneralCuts.cfgCutCentMin || cent >= cfgGeneralCuts.cfgCutCentMax ))
1961+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && ((cent1 < cfgGeneralCuts.cfgCutCentMin || cent1 >= cfgGeneralCuts.cfgCutCentMax ) || (cent2 < cfgGeneralCuts. cfgCutCentMin || cent2 >= cfgGeneralCuts. cfgCutCentMax ) ))
19401962 continue ;
19411963
19421964 registry.fill (HIST (" MCTrue/MCeventcount" ), MixedEvent); // fill the mixed event in the 3 bin
0 commit comments