Skip to content

Commit 6a60abc

Browse files
authored
Merge 0d7c376 into sapling-pr-archive-ktf
2 parents f85ac19 + 0d7c376 commit 6a60abc

File tree

4 files changed

+44
-16
lines changed

4 files changed

+44
-16
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,20 @@ std::unique_ptr<o2::framework::ServiceRegistry> createRegistry()
28352835
return std::make_unique<o2::framework::ServiceRegistry>();
28362836
}
28372837

2838+
void describeDataProcessorSpec(std::ostream& stream, DataProcessorSpec const& spec)
2839+
{
2840+
stream << spec.name;
2841+
if (!spec.labels.empty()) {
2842+
stream << "(";
2843+
bool first = false;
2844+
for (auto& label : spec.labels) {
2845+
stream << (first ? "" : ",") << label.value;
2846+
first = true;
2847+
}
2848+
stream << ")";
2849+
}
2850+
}
2851+
28382852
// This is a toy executor for the workflow spec
28392853
// What it needs to do is:
28402854
//
@@ -3059,18 +3073,22 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
30593073
edges.emplace_back(i, j);
30603074
if (both) {
30613075
std::ostringstream str;
3076+
describeDataProcessorSpec(str, physicalWorkflow[i]);
3077+
str << " has circular dependency with ";
3078+
describeDataProcessorSpec(str, physicalWorkflow[j]);
3079+
str << ":\n";
30623080
for (auto x : {i, j}) {
30633081
str << physicalWorkflow[x].name << ":\n";
30643082
str << "inputs:\n";
30653083
for (auto& input : physicalWorkflow[x].inputs) {
3066-
str << "- " << input << "\n";
3084+
str << "- " << input << " " << (int)input.lifetime << "\n";
30673085
}
30683086
str << "outputs:\n";
30693087
for (auto& output : physicalWorkflow[x].outputs) {
3070-
str << "- " << output << "\n";
3088+
str << "- " << output << " " << (int)output.lifetime << "\n";
30713089
}
30723090
}
3073-
throw std::runtime_error(physicalWorkflow[i].name + " has circular dependency with " + physicalWorkflow[j].name + ":\n" + str.str());
3091+
throw std::runtime_error(str.str());
30743092
}
30753093
}
30763094
}

GPU/GPUTracking/Standalone/cmake/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ if [[ $GPUCA_STANDALONE_CI == 1 ]]; then
1313
set(ENABLE_HIP 1)
1414
set(ENABLE_OPENCL 1)
1515
set(GPUCA_CONFIG_ONNX 1)
16-
set(GPUCA_BUILD_EVENT_DISPLAY_VULKAN 0)
17-
set(GPUCA_BUILD_EVENT_DISPLAY_WAYLAND 0)
1816
set(GPUCA_BUILD_EVENT_DISPLAY_QT 0)
1917
set(GPUCA_CONFIG_WERROR 1)
2018
EOF

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ inline float GPUQA::GetMCLabelWeight(const mcLabel_t& label) { return 1; }
234234
inline bool GPUQA::mcPresent() { return !mConfig.noMC && mTracking && mClNative && mClNative->clustersMCTruth && mMCInfos.size(); }
235235
uint32_t GPUQA::GetMCLabelCol(const mcLabel_t& label) const { return !label.isValid() ? 0 : (mMCEventOffset[label.getSourceID()] + label.getEventID()); }
236236
GPUQA::mcLabelI_t GPUQA::GetMCTrackLabel(uint32_t trackId) const { return trackId >= mTrackMCLabels.size() ? MCCompLabel() : mTrackMCLabels[trackId]; }
237+
bool GPUQA::CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2) { return l1.compare(l2) >= 0; }
237238
#define TRACK_EXPECTED_REFERENCE_X 78
238239
#else
239240
inline GPUQA::mcLabelI_t::mcLabelI_t(const GPUQA::mcLabel_t& l) : track(l.fMCID) {}
@@ -263,6 +264,7 @@ inline int32_t GPUQA::AbsLabelID(int32_t id) { return id >= 0 ? id : (-id - 2);
263264
inline bool GPUQA::mcPresent() { return !mConfig.noMC && mTracking && GetNMCLabels() && GetNMCTracks(0); }
264265
uint32_t GPUQA::GetMCLabelCol(const mcLabel_t& label) const { return 0; }
265266
GPUQA::mcLabelI_t GPUQA::GetMCTrackLabel(uint32_t trackId) const { return trackId >= mTrackMCLabels.size() ? mcLabelI_t() : mTrackMCLabels[trackId]; }
267+
bool GPUQA::CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2) { return AbsLabelID(l1) == AbsLabelID(l2); }
266268
#define TRACK_EXPECTED_REFERENCE_X TRACK_EXPECTED_REFERENCE_X_DEFAULT
267269
#endif
268270
template <class T>
@@ -1660,7 +1662,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
16601662

16611663
if (mQATasks & taskTrackStatistics) {
16621664
// Fill track statistic histograms
1663-
std::vector<std::array<float, 2>> clusterAttachCounts;
1665+
std::vector<std::array<float, 3>> clusterAttachCounts;
16641666
if (mcAvail) {
16651667
clusterAttachCounts.resize(GetNMCLabels(), {0.f, 0.f});
16661668
}
@@ -1691,17 +1693,23 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
16911693
if (cl.state & GPUTPCGMMergedTrackHit::flagReject) {
16921694
continue;
16931695
}
1694-
bool labelOk = false;
1695-
if (mTrackMCLabels[i].isValid() && !mTrackMCLabels[i].isFake()) {
1696+
bool labelOk = false, labelOkNonFake = false;
1697+
const mcLabelI_t& trkLabel = mTrackMCLabels[i];
1698+
if (trkLabel.isValid() && !trkLabel.isNoise()) {
16961699
for (int32_t l = 0; l < GetMCLabelNID(cl.num); l++) {
1697-
if (GetMCLabel(cl.num, l) == mTrackMCLabels[i]) {
1700+
const mcLabelI_t& clLabel = GetMCLabel(cl.num, l);
1701+
if (clLabel.isValid() && !clLabel.isNoise() && CompareIgnoreFake(trkLabel, clLabel)) {
16981702
labelOk = true;
1703+
if (!trkLabel.isFake()) {
1704+
labelOkNonFake = true;
1705+
}
16991706
break;
17001707
}
17011708
}
17021709
}
1703-
clusterAttachCounts[cl.num][0] += (float)labelOk / rowClCount;
1704-
clusterAttachCounts[cl.num][1] += 1.0f;
1710+
clusterAttachCounts[cl.num][0] += 1.0f;
1711+
clusterAttachCounts[cl.num][1] += (float)labelOk / rowClCount;
1712+
clusterAttachCounts[cl.num][2] += (float)labelOkNonFake / rowClCount;
17051713
}
17061714
}
17071715
}
@@ -1721,13 +1729,15 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
17211729
}
17221730
}
17231731
if (mcAvail) {
1724-
double clusterAttachNormalizedCount = 0;
1732+
double clusterAttachNormalizedCount = 0, clusterAttachNormalizedCountNonFake = 0;
17251733
for (uint32_t i = 0; i < clusterAttachCounts.size(); i++) {
1726-
if (clusterAttachCounts[i][1]) {
1727-
clusterAttachNormalizedCount += clusterAttachCounts[i][0] / clusterAttachCounts[i][1];
1734+
if (clusterAttachCounts[i][0]) {
1735+
clusterAttachNormalizedCount += clusterAttachCounts[i][1] / clusterAttachCounts[i][0];
1736+
clusterAttachNormalizedCountNonFake += clusterAttachCounts[i][2] / clusterAttachCounts[i][0];
17281737
}
17291738
}
17301739
mClusterCounts.nCorrectlyAttachedNormalized = clusterAttachNormalizedCount;
1740+
mClusterCounts.nCorrectlyAttachedNormalizedNonFake = clusterAttachNormalizedCountNonFake;
17311741
clusterAttachCounts.clear();
17321742
}
17331743

@@ -2901,7 +2911,8 @@ int32_t GPUQA::DoClusterCounts(uint64_t* attachClusterCounts, int32_t mode)
29012911
PrintClusterCount(mode, num, "Fake Protect (< 40 MeV)", mClusterCounts.nFakeProtect40, mClusterCounts.nBelow40);
29022912
}
29032913
if (mcPresent() && (mQATasks & taskTrackStatistics)) {
2904-
PrintClusterCount(mode, num, "Correctly Attached non-fake normalized", mClusterCounts.nCorrectlyAttachedNormalized, mClusterCounts.nTotal);
2914+
PrintClusterCount(mode, num, "Correctly Attached all-trk normalized", mClusterCounts.nCorrectlyAttachedNormalized, mClusterCounts.nTotal);
2915+
PrintClusterCount(mode, num, "Correctly Attached non-fake normalized", mClusterCounts.nCorrectlyAttachedNormalizedNonFake, mClusterCounts.nTotal);
29052916
}
29062917
return num;
29072918
}

GPU/GPUTracking/qa/GPUQA.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class GPUQA
226226
float GetMCLabelWeight(uint32_t i, uint32_t j);
227227
float GetMCLabelWeight(const mcLabels_t& label, uint32_t j);
228228
float GetMCLabelWeight(const mcLabel_t& label);
229+
static bool CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2);
229230
const auto& GetClusterLabels();
230231
bool mcPresent();
231232

@@ -290,7 +291,7 @@ class GPUQA
290291
TLegend* mLClust[N_CLS_TYPE];
291292

292293
struct counts_t {
293-
int64_t nRejected = 0, nTube = 0, nTube200 = 0, nLoopers = 0, nLowPt = 0, n200MeV = 0, nPhysics = 0, nProt = 0, nUnattached = 0, nTotal = 0, nHighIncl = 0, nAbove400 = 0, nFakeRemove400 = 0, nFullFakeRemove400 = 0, nBelow40 = 0, nFakeProtect40 = 0, nMergedLooper = 0, nCorrectlyAttachedNormalized = 0;
294+
int64_t nRejected = 0, nTube = 0, nTube200 = 0, nLoopers = 0, nLowPt = 0, n200MeV = 0, nPhysics = 0, nProt = 0, nUnattached = 0, nTotal = 0, nHighIncl = 0, nAbove400 = 0, nFakeRemove400 = 0, nFullFakeRemove400 = 0, nBelow40 = 0, nFakeProtect40 = 0, nMergedLooper = 0, nCorrectlyAttachedNormalized = 0, nCorrectlyAttachedNormalizedNonFake = 0;
294295
double nUnaccessible = 0;
295296
} mClusterCounts;
296297

0 commit comments

Comments
 (0)