Skip to content

Commit 1d34818

Browse files
pnwkwshahor02
authored andcommitted
Only show the track count for requested track types
1 parent a360414 commit 1d34818

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

EventVisualisation/Workflow/include/EveWorkflow/O2DPLDisplay.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class TPCFastTransform;
4646
class O2DPLDisplaySpec : public o2::framework::Task
4747
{
4848
public:
49+
static constexpr auto allowedTracks = "ITS,TPC,MFT,MCH,ITS-TPC,ITS-TPC-TOF,TPC-TRD,ITS-TPC-TRD,MID,PHS,EMC";
50+
static constexpr auto allowedClusters = "ITS,TPC,MFT,MCH,TRD,TOF,MID,TRD,PHS,EMC";
51+
4952
O2DPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask,
5053
o2::dataformats::GlobalTrackID::mask_t clMask,
5154
std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, const std::string& jsonPath,

EventVisualisation/Workflow/src/O2DPLDisplay.cxx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,17 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc)
132132
auto endTime = std::chrono::high_resolution_clock::now();
133133
LOGP(info, "Visualization of TF:{} at orbit {} took {} s.", dh->tfCounter, dh->firstTForbit, std::chrono::duration_cast<std::chrono::microseconds>(endTime - currentTime).count() * 1e-6);
134134

135-
std::array<std::string, GID::Source::NSources> sourceStats;
135+
std::vector<std::string> sourceStats;
136+
sourceStats.reserve(GID::Source::NSources);
136137

137138
for (int i = 0; i < GID::Source::NSources; i++) {
138-
sourceStats[i] = fmt::format("{}/{} {}", helper.mEvent.getSourceTrackCount(static_cast<GID::Source>(i)), helper.mTotalTracks.at(i), GID::getSourceName(i));
139+
if (mTrkMask[i]) {
140+
sourceStats.emplace_back(fmt::format("{}/{} {}", helper.mEvent.getSourceTrackCount(static_cast<GID::Source>(i)), helper.mTotalTracks.at(i), GID::getSourceName(i)));
141+
}
139142
}
140143

141144
LOGP(info, "JSON saved: {}", save ? "YES" : "NO");
142-
LOGP(info, "Tracks: {}", fmt::join(sourceStats, ","));
145+
LOGP(info, "Tracks: {}", fmt::join(sourceStats, ", "));
143146
}
144147

145148
void O2DPLDisplaySpec::endOfStream(EndOfStreamContext& ec)
@@ -195,8 +198,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
195198
int numberOfFiles = cfgc.options().get<int>("number-of_files");
196199
int numberOfTracks = cfgc.options().get<int>("number-of_tracks");
197200

198-
GID::mask_t allowedTracks = GID::getSourcesMask("ITS,TPC,MFT,MCH,ITS-TPC,ITS-TPC-TOF,TPC-TRD,ITS-TPC-TRD,MID,PHS,EMC");
199-
GID::mask_t allowedClusters = GID::getSourcesMask("ITS,TPC,MFT,MCH,TRD,TOF,MID,TRD,PHS,EMC");
201+
GID::mask_t allowedTracks = GID::getSourcesMask(O2DPLDisplaySpec::allowedTracks);
202+
GID::mask_t allowedClusters = GID::getSourcesMask(O2DPLDisplaySpec::allowedClusters);
200203

201204
GlobalTrackID::mask_t srcTrk = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("display-tracks")) & allowedTracks;
202205
GlobalTrackID::mask_t srcCl = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("display-clusters")) & allowedClusters;

0 commit comments

Comments
 (0)