Skip to content

Commit b5b44df

Browse files
[PWGDQ] Flag the skimmed EMCal clusters which are matched to tracks]
1 parent 5c4a272 commit b5b44df

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

PWGDQ/Core/VarManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ class VarManager : public TObject
194194
kMuonIsPropagated = 7 // whether the muon was propagated already
195195
};
196196

197+
enum EMCalClusterFilteringBits {
198+
kEMCalClusterIsMatched = 0, // cluster has at least one matched track (from EMCALMatchedTracks)
199+
kEMCalClusterUserCutsBits = 1 // first bit for the user EMCal cluster selections
200+
};
201+
197202
public:
198203
enum Variables {
199204
kNothing = -1,

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)