@@ -1518,22 +1518,30 @@ struct TableMaker {
15181518 }
15191519
15201520 // apply the cluster selections and fill the filtering tag and the stats histogram
1521- auto clusterFilteringTag = static_cast <uint64_t >(0 );
1521+ auto clusterTempFilterMap = static_cast <uint32_t >(0 );
15221522 int i = 0 ;
15231523 for (auto cut = fEMCalCuts .begin (); cut != fEMCalCuts .end (); cut++, i++) {
15241524 if ((*cut)->IsSelected (dqtablemaker_helpers::varValues ())) {
1525- clusterFilteringTag |= (static_cast <uint64_t >(1 ) << i);
1525+ clusterTempFilterMap |= (static_cast <uint32_t >(1 ) << i);
15261526 if (fConfigHistOutput .fConfigQA ) {
15271527 fHistMan ->FillHistClass (Form (" EMCalClusters_%s" , (*cut)->GetName ()), dqtablemaker_helpers::varValues ());
15281528 }
15291529 (dynamic_cast <TH1D *>(fStatsList ->At (kStatsEMCal )))->Fill (static_cast <float >(i));
15301530 }
15311531 }
15321532 // if cluster selections are specified, write only the clusters which fulfill at least one of them
1533- if (!fEMCalCuts .empty () && clusterFilteringTag == 0 ) {
1533+ if (!fEMCalCuts .empty () && clusterTempFilterMap == 0 ) {
15341534 continue ;
15351535 }
15361536 (dynamic_cast <TH1D *>(fStatsList ->At (kStatsEMCal )))->Fill (static_cast <float >(fEMCalCuts .size ()));
1537+ auto clusterFilteringTag = (static_cast <uint64_t >(clusterTempFilterMap) << VarManager::kEMCalClusterUserCutsBits );
1538+
1539+ // flag the clusters which have at least one matched track, such that a clean
1540+ // "EMCal only" cluster sample (e.g. for photons) can be selected on the skimmed data
1541+ auto clusterMatches = matchedTracks.sliceBy (emcalMatchedTracksPerCluster, cluster.globalIndex ());
1542+ if (clusterMatches.size () > 0 ) {
1543+ clusterFilteringTag |= (static_cast <uint64_t >(1 ) << VarManager::kEMCalClusterIsMatched );
1544+ }
15371545
15381546 outTables.emcal (skimIdx, clusterFilteringTag,
15391547 cluster.energy (), cluster.coreEnergy (), cluster.rawEnergy (),
@@ -1544,7 +1552,6 @@ struct TableMaker {
15441552 fEmcalIndexMap [cluster.globalIndex ()] = outTables.emcal .lastIndex ();
15451553
15461554 // record the track matches of this cluster; for each track keep only the closest cluster
1547- auto clusterMatches = matchedTracks.sliceBy (emcalMatchedTracksPerCluster, cluster.globalIndex ());
15481555 for (const auto & match : clusterMatches) {
15491556 float deltaEta = match.deltaEta ();
15501557 float deltaPhi = match.deltaPhi ();
0 commit comments