@@ -1100,6 +1100,10 @@ struct TaskPi0FlowEMC {
11001100 // Pi0 from EMCal
11011101 void processEMCal (CollsWithQvecs const & collisions, EMCalPhotons const & clusters, MinMTracks const & matchedPrims, MinMSTracks const & matchedSeconds)
11021102 {
1103+ if (clusters.size () <= 0 ) {
1104+ LOG (info) << " Skipping DF because there are not photons!" ;
1105+ return ;
1106+ }
11031107 EMBitFlags flags (clusters.size ());
11041108 fEMCCut .AreSelectedRunning (flags, clusters, matchedPrims, matchedSeconds, ®istry);
11051109
@@ -1149,6 +1153,10 @@ struct TaskPi0FlowEMC {
11491153 // Pi0 from EMCal
11501154 void processEMCalMixed (FilteredCollsWithQvecs const & collisions, EMCalPhotons const & clusters, MinMTracks const & matchedPrims, MinMSTracks const & matchedSeconds)
11511155 {
1156+ if (clusters.size () <= 0 ) {
1157+ LOG (info) << " Skipping DF because there are not photons!" ;
1158+ return ;
1159+ }
11521160 EMBitFlags flags (clusters.size ());
11531161 fEMCCut .AreSelectedRunning (flags, clusters, matchedPrims, matchedSeconds);
11541162 energyCorrectionFactor = 1 .f ;
@@ -1244,11 +1252,19 @@ struct TaskPi0FlowEMC {
12441252 // PCM-EMCal same event
12451253 void processEMCalPCMC (CollsWithQvecs const & collisions, EMCalPhotons const & clusters, PCMPhotons const & photons, aod::V0Legs const &, MinMTracks const & matchedPrims, MinMSTracks const & matchedSeconds)
12461254 {
1255+ if (clusters.size () <= 0 && photons.size () <= 0 ) {
1256+ LOG (info) << " Skipping DF because there are not photons!" ;
1257+ return ;
1258+ }
12471259 EMBitFlags emcFlags (clusters.size ());
1248- fEMCCut .AreSelectedRunning (emcFlags, clusters, matchedPrims, matchedSeconds, ®istry);
1260+ if (clusters.size () > 0 ) {
1261+ fEMCCut .AreSelectedRunning (emcFlags, clusters, matchedPrims, matchedSeconds, ®istry);
1262+ }
12491263
12501264 EMBitFlags v0flags (photons.size ());
1251- fV0PhotonCut .AreSelectedRunning <decltype (photons), aod::V0Legs>(v0flags, photons, ®istry);
1265+ if (photons.size () > 0 ) {
1266+ fV0PhotonCut .AreSelectedRunning <decltype (photons), aod::V0Legs>(v0flags, photons, ®istry);
1267+ }
12521268
12531269 energyCorrectionFactor = 1 .f ;
12541270 if (cfgDoReverseScaling.value ) {
@@ -1333,6 +1349,11 @@ struct TaskPi0FlowEMC {
13331349 // PCM-EMCal mixed event
13341350 void processEMCalPCMMixed (CollsWithQvecs const & collisions, EMCalPhotons const & clusters, PCMPhotons const & pcmPhotons, aod::V0Legs const &, MinMTracks const & matchedPrims, MinMSTracks const & matchedSeconds)
13351351 {
1352+ if (clusters.size () <= 0 && pcmPhotons.size () <= 0 ) {
1353+ LOG (info) << " Skipping DF because there are not photons!" ;
1354+ return ;
1355+ }
1356+
13361357 using BinningTypeMixed = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C, emevent::EP2FT0C<emevent::Q2xFT0C, emevent::Q2yFT0C>>;
13371358 BinningTypeMixed binningOnPositions{{mixingConfig.cfgVtxBins , mixingConfig.cfgCentBins , mixingConfig.cfgEPBins }, true };
13381359
@@ -1342,10 +1363,14 @@ struct TaskPi0FlowEMC {
13421363
13431364 energyCorrectionFactor = 1 .f ;
13441365 EMBitFlags emcFlags (clusters.size ());
1345- fEMCCut .AreSelectedRunning (emcFlags, clusters, matchedPrims, matchedSeconds);
1366+ if (clusters.size () > 0 ) {
1367+ fEMCCut .AreSelectedRunning (emcFlags, clusters, matchedPrims, matchedSeconds, ®istry);
1368+ }
13461369
13471370 EMBitFlags v0flags (pcmPhotons.size ());
1348- fV0PhotonCut .AreSelectedRunning <decltype (pcmPhotons), aod::V0Legs>(v0flags, pcmPhotons);
1371+ if (pcmPhotons.size () > 0 ) {
1372+ fV0PhotonCut .AreSelectedRunning <decltype (pcmPhotons), aod::V0Legs>(v0flags, pcmPhotons, ®istry);
1373+ }
13491374
13501375 for (const auto & [c1, photonEMC, c2, photonPCM] : pairPCMEMC) {
13511376 if (!(fEMEventCut .IsSelected (c1)) || !(fEMEventCut .IsSelected (c2))) {
@@ -1417,6 +1442,10 @@ struct TaskPi0FlowEMC {
14171442 // Pi0 from EMCal
14181443 void processM02 (CollsWithQvecs const & collisions, EMCalPhotons const & clusters, MinMTracks const & matchedPrims, MinMSTracks const & matchedSeconds)
14191444 {
1445+ if (clusters.size () <= 0 ) {
1446+ LOG (info) << " Skipping DF because there are not photons!" ;
1447+ return ;
1448+ }
14201449 EMBitFlags emcFlags (clusters.size ());
14211450 fEMCCut .AreSelectedRunning (emcFlags, clusters, matchedPrims, matchedSeconds);
14221451
@@ -1493,6 +1522,10 @@ struct TaskPi0FlowEMC {
14931522 // Pi0 from EMCal
14941523 void processPCM (CollsWithQvecs const & collisions, PCMPhotons const & photons, aod::V0Legs const &)
14951524 {
1525+ if (photons.size () <= 0 ) {
1526+ LOG (info) << " Skipping DF because there are not photons!" ;
1527+ return ;
1528+ }
14961529 EMBitFlags v0flags (photons.size ());
14971530 fV0PhotonCut .AreSelectedRunning <decltype (photons), aod::V0Legs>(v0flags, photons, ®istry);
14981531 for (const auto & collision : collisions) {
@@ -1546,6 +1579,11 @@ struct TaskPi0FlowEMC {
15461579 void processPCMMixed (FilteredCollsWithQvecs const & collisions, PCMPhotons const & pcmPhotons, aod::V0Legs const &)
15471580 {
15481581
1582+ if (pcmPhotons.size () <= 0 ) {
1583+ LOG (info) << " Skipping DF because there are not photons!" ;
1584+ return ;
1585+ }
1586+
15491587 using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C, emevent::EP2FT0C<emevent::Q2xFT0C, emevent::Q2yFT0C>>;
15501588 BinningType binningMixedEvent{{mixingConfig.cfgVtxBins , mixingConfig.cfgCentBins , mixingConfig.cfgEPBins }, true };
15511589
0 commit comments