Skip to content

Commit 988dad5

Browse files
authored
Merge 308ac49 into sapling-pr-archive-ktf
2 parents 9906191 + 308ac49 commit 988dad5

File tree

11 files changed

+83
-25
lines changed

11 files changed

+83
-25
lines changed

Common/Utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ o2_add_library(CommonUtils
2626
src/DebugStreamer.cxx
2727
src/DLLoaderBase.cxx
2828
PUBLIC_LINK_LIBRARIES ROOT::Hist ROOT::Tree Boost::iostreams O2::CommonDataFormat O2::Headers
29-
FairLogger::FairLogger O2::MathUtils TBB::tbb)
29+
FairLogger::FairLogger O2::MathUtils TBB::tbb O2::GPUCommon)
3030

3131
o2_target_root_dictionary(CommonUtils
3232
HEADERS include/CommonUtils/TreeStream.h

Common/Utils/include/CommonUtils/StringUtils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include <sstream>
2121
#include <vector>
2222
#include <algorithm>
23-
#include <fmt/format.h>
24-
#include <Rtypes.h>
23+
#include "GPUCommonRtypes.h"
2524

2625
namespace o2
2726
{

Common/Utils/src/StringUtils.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
#include "CommonUtils/StringUtils.h"
1313
#include <cstdlib>
1414
#include <filesystem>
15+
#ifndef GPUCA_STANDALONE
1516
#include <TGrid.h>
17+
#include <fmt/format.h>
18+
#endif
1619
#include <unistd.h>
1720

1821
using namespace o2::utils;
@@ -77,6 +80,7 @@ std::string Str::getFullPath(const std::string_view p)
7780
return std::filesystem::canonical(std::string{p}).string();
7881
}
7982

83+
#ifndef GPUCA_STANDALONE
8084
std::string Str::rectifyDirectory(const std::string_view p)
8185
{
8286
std::string dir(p);
@@ -104,6 +108,7 @@ std::string Str::rectifyDirectory(const std::string_view p)
104108
}
105109
return dir;
106110
}
111+
#endif
107112

108113
// Create unique non-existing path name starting with prefix. Loose equivalent of boost::filesystem::unique_path()
109114
// The prefix can be either existing directory or just a string to add in front of the random part

Detectors/ITSMFT/ITS/tracking/src/TrackingInterface.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
377377
allTracks.emplace_back(trc);
378378
}
379379
}
380+
} else {
381+
for (auto& r : trackROFvec) { // reset data copied from the clusters
382+
r.setFirstEntry(0);
383+
r.setNEntries(0);
384+
}
380385
}
381386
LOGP(info, "ITSTracker pushed {} tracks and {} vertices", allTracks.size(), vertices.size());
382387
if (mIsMC) {

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,13 @@ void DataProcessingDevice::initPollers()
851851
continue;
852852
}
853853

854-
if (channelName.rfind("from_", 0) != 0) {
855-
LOGP(detail, "{} is not a DPL socket. Not polling.", channelName);
854+
if (channelName.rfind("from_", 0) != 0 && channelName != "metric-feedback") {
855+
LOGP(detail, "{} is not a DPL input socket. Not polling.", channelName);
856+
continue;
857+
}
858+
859+
if (channelName == "metric-feedback" && spec.name.rfind("internal-dpl-aod-reader", 0) != 0) {
860+
LOGP(detail, "{} is not a DPL input socket. Not polling.", channelName);
856861
continue;
857862
}
858863

Framework/Core/src/StepTHn.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,15 @@ void StepTHn::Fill(int iStep, int nParams, double positionAndWeight[])
441441
if (weight != 1.) {
442442
// initialize with already filled entries (which have been filled with weight == 1), in this case mSumw2 := mValues
443443
if (!mSumw2[iStep]) {
444-
mSumw2[iStep] = createArray();
444+
mSumw2[iStep] = createArray(mValues[iStep]);
445445
LOGF(info, "Created sumw2 container for step %d", iStep);
446446
}
447447
}
448448

449449
// TODO probably slow; add StepTHnT::add ?
450450
mValues[iStep]->SetAt(mValues[iStep]->GetAt(bin) + weight, bin);
451451
if (mSumw2[iStep]) {
452-
mSumw2[iStep]->SetAt(mSumw2[iStep]->GetAt(bin) + weight, bin);
452+
mSumw2[iStep]->SetAt(mSumw2[iStep]->GetAt(bin) + weight * weight, bin);
453453
}
454454
}
455455

GPU/GPUTracking/DataTypes/CalibdEdxTrackTopologyPol.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef GPUCA_NO_VC
12+
#ifndef GPUCA_STANDALONE
1313
#include "Rtypes.h"
14+
#include "TFile.h"
1415
#endif
1516
#include "CalibdEdxTrackTopologyPol.h"
1617

1718
#include <cstddef>
1819
#include <string_view>
19-
#if !defined(GPUCA_STANDALONE)
20-
#include "TFile.h"
21-
#endif
2220

2321
using namespace o2::tpc;
2422

GPU/GPUTracking/Standalone/cmake/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ EOF
1919
fi
2020
cmake -DCMAKE_INSTALL_PREFIX=../ $1/GPU/GPUTracking/Standalone
2121
make ${JOBS+-j $JOBS} install
22+
if [[ $GPUCA_STANDALONE_CI == 1 ]]; then
23+
cat >> config.cmake << "EOF"
24+
set(ENABLE_CUDA 0)
25+
set(ENABLE_HIP 0)
26+
set(ENABLE_OPENCL 0)
27+
set(GPUCA_CONFIG_ONNX 0)
28+
set(GPUCA_CONFIG_VC 0)
29+
set(GPUCA_CONFIG_FMT 0)
30+
set(GPUCA_CONFIG_ROOT 0)
31+
EOF
32+
make ${JOBS+-j $JOBS} install
33+
fi
2234
popd

GPU/GPUTracking/display/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ endif()
3232

3333
if(Vulkan_FOUND)
3434
string(FIND "${Vulkan_VERSION}" "." vulkan_dot_index)
35-
if(NOT ${Vulkan_VERSION} VERSION_GREATER_EQUAL "1.3.0" OR dot_index EQUAL -1 OR Vulkan_GLSLC_EXECUTABLE STREQUAL "Vulkan_GLSLC_EXECUTABLE-NOTFOUND")
35+
if(NOT ${Vulkan_VERSION} VERSION_GREATER_EQUAL "1.3.0" OR vulkan_dot_index EQUAL -1 OR Vulkan_GLSLC_EXECUTABLE STREQUAL "Vulkan_GLSLC_EXECUTABLE-NOTFOUND")
3636
set(Vulkan_FOUND 0)
3737
endif()
3838
endif()

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,10 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
16601660

16611661
if (mQATasks & taskTrackStatistics) {
16621662
// Fill track statistic histograms
1663+
std::vector<std::array<float, 2>> clusterAttachCounts;
1664+
if (mcAvail) {
1665+
clusterAttachCounts.resize(GetNMCLabels(), {0.f, 0.f});
1666+
}
16631667
for (uint32_t i = 0; i < nReconstructedTracks; i++) {
16641668
const GPUTPCGMMergedTrack& track = mTracking->mIOPtrs.mergedTracks[i];
16651669
if (!track.OK()) {
@@ -1668,21 +1672,38 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
16681672
mTracks->Fill(1.f / fabsf(track.GetParam().GetQPt()));
16691673
mNCl[0]->Fill(track.NClustersFitted());
16701674
uint32_t nClCorrected = 0;
1671-
int32_t lastSector = -1, lastRow = -1;
16721675
const auto& trackClusters = mTracking->mIOPtrs.mergedTrackHits;
1673-
for (uint32_t j = 0; j < track.NClusters(); j++) {
1674-
if (trackClusters[track.FirstClusterRef() + j].state & GPUTPCGMMergedTrackHit::flagReject) {
1675-
continue;
1676+
uint32_t jNext = 0;
1677+
for (uint32_t j = 0; j < track.NClusters(); j = jNext) {
1678+
uint32_t rowClCount = !(trackClusters[track.FirstClusterRef() + j].state & GPUTPCGMMergedTrackHit::flagReject);
1679+
for (jNext = j + 1; j < track.NClusters(); jNext++) {
1680+
if (trackClusters[track.FirstClusterRef() + j].sector != trackClusters[track.FirstClusterRef() + jNext].sector || trackClusters[track.FirstClusterRef() + j].row != trackClusters[track.FirstClusterRef() + jNext].row) {
1681+
break;
1682+
}
1683+
rowClCount += !(trackClusters[track.FirstClusterRef() + jNext].state & GPUTPCGMMergedTrackHit::flagReject);
16761684
}
1677-
if (trackClusters[track.FirstClusterRef() + j].sector == lastSector && trackClusters[track.FirstClusterRef() + j].row == lastRow) {
1678-
continue;
1685+
if (trackClusters[track.FirstClusterRef() + j].leg == trackClusters[track.FirstClusterRef() + track.NClusters() - 1].leg && rowClCount) {
1686+
nClCorrected++;
16791687
}
1680-
if (trackClusters[track.FirstClusterRef() + j].leg != trackClusters[track.FirstClusterRef() + track.NClusters() - 1].leg) {
1681-
continue;
1688+
if (mcAvail && rowClCount) {
1689+
for (uint32_t k = j; k < jNext; k++) {
1690+
const auto& cl = trackClusters[track.FirstClusterRef() + k];
1691+
if (cl.state & GPUTPCGMMergedTrackHit::flagReject) {
1692+
continue;
1693+
}
1694+
bool labelOk = false;
1695+
if (mTrackMCLabels[i].isValid() && !mTrackMCLabels[i].isFake()) {
1696+
for (int32_t l = 0; l < GetMCLabelNID(cl.num); l++) {
1697+
if (GetMCLabel(cl.num, l) == mTrackMCLabels[i]) {
1698+
labelOk = true;
1699+
break;
1700+
}
1701+
}
1702+
}
1703+
clusterAttachCounts[cl.num][0] += (float)labelOk / rowClCount;
1704+
clusterAttachCounts[cl.num][1] += 1.0f;
1705+
}
16821706
}
1683-
nClCorrected++;
1684-
lastSector = trackClusters[track.FirstClusterRef() + j].sector;
1685-
lastRow = trackClusters[track.FirstClusterRef() + j].sector;
16861707
}
16871708
mNCl[1]->Fill(nClCorrected);
16881709
}
@@ -1699,6 +1720,16 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
16991720
}
17001721
}
17011722
}
1723+
if (mcAvail) {
1724+
double clusterAttachNormalizedCount = 0;
1725+
for (uint32_t i = 0; i < clusterAttachCounts.size(); i++) {
1726+
if (clusterAttachCounts[i][1]) {
1727+
clusterAttachNormalizedCount += clusterAttachCounts[i][0] / clusterAttachCounts[i][1];
1728+
}
1729+
}
1730+
mClusterCounts.nCorrectlyAttachedNormalized = clusterAttachNormalizedCount;
1731+
clusterAttachCounts.clear();
1732+
}
17021733

17031734
if (QA_TIMING || (mTracking && mTracking->GetProcessingSettings().debugLevel >= 3)) {
17041735
GPUInfo("QA Time: Fill track statistics:\t%6.0f us", timer.GetCurrentElapsedTime(true) * 1e6);
@@ -2824,7 +2855,7 @@ void GPUQA::PrintClusterCount(int32_t mode, int32_t& num, const char* name, uint
28242855
createHist(mHistClusterCount[num], name2, name, 1000, 0, mConfig.histMaxNClusters, 1000, 0, 100);
28252856
} else if (mode == 0) {
28262857
if (normalization && mConfig.enableLocalOutput) {
2827-
printf("\t%35s: %'12" PRIu64 " (%6.2f%%)\n", name, n, 100.f * n / normalization);
2858+
printf("\t%40s: %'12" PRIu64 " (%6.2f%%)\n", name, n, 100.f * n / normalization);
28282859
}
28292860
if (mConfig.clusterRejectionHistograms) {
28302861
float ratio = 100.f * n / std::max<uint64_t>(normalization, 1);
@@ -2869,6 +2900,9 @@ int32_t GPUQA::DoClusterCounts(uint64_t* attachClusterCounts, int32_t mode)
28692900
PrintClusterCount(mode, num, "Tracks < 40 MeV", mClusterCounts.nBelow40, mClusterCounts.nTotal);
28702901
PrintClusterCount(mode, num, "Fake Protect (< 40 MeV)", mClusterCounts.nFakeProtect40, mClusterCounts.nBelow40);
28712902
}
2903+
if (mcPresent() && (mQATasks & taskTrackStatistics)) {
2904+
PrintClusterCount(mode, num, "Correctly Attached non-fake normalized", mClusterCounts.nCorrectlyAttachedNormalized, mClusterCounts.nTotal);
2905+
}
28722906
return num;
28732907
}
28742908

0 commit comments

Comments
 (0)