Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 5 Detectors/TPC/workflow/include/TPCWorkflow/CATrackerSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum struct Operation {
OutputCAClusters, // publish the clusters produced by CA clusterer
OutputCompClusters, // publish CompClusters container
OutputCompClustersFlat, // publish CompClusters container
OutputQA, // Ship QA histograms to QC
ProcessMC, // process MC labels
SendClustersPerSector, // Send clusters and clusters mc labels per sector
Noop, // skip argument on the constructor
Expand Down Expand Up @@ -88,6 +89,9 @@ struct Config {
case Operation::OutputCAClusters:
outputCAClusters = true;
break;
case Operation::OutputQA:
outputQA = true;
break;
case Operation::ProcessMC:
processMC = true;
break;
Expand Down Expand Up @@ -116,6 +120,7 @@ struct Config {
bool outputCompClusters = false;
bool outputCompClustersFlat = false;
bool outputCAClusters = false;
bool outputQA = false;
bool processMC = false;
bool sendClustersPerSector = false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum struct OutputType { Digits,
DisableWriter,
SendClustersPerSector,
ZSRaw,
QA,
};

using CompletionPolicyData = std::vector<framework::InputSpec>;
Expand Down
28 changes: 28 additions & 0 deletions 28 Detectors/TPC/workflow/src/CATrackerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "DetectorsRaw/HBFUtils.h"
#include "TPCBase/RDHUtils.h"
#include "GPUO2InterfaceConfiguration.h"
#include "GPUO2InterfaceQA.h"
#include "TPCCFCalibration.h"
#include "GPUDisplayBackend.h"
#ifdef GPUCA_BUILD_EVENT_DISPLAY
Expand All @@ -65,6 +66,10 @@
#include "GPUReconstructionConvert.h"
#include "DetectorsRaw/RDHUtils.h"
#include <TStopwatch.h>
#include <TObjArray.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TH1D.h>

using namespace o2::framework;
using namespace o2::header;
Expand Down Expand Up @@ -96,6 +101,8 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
std::unique_ptr<TPCFastTransform> fastTransform;
std::unique_ptr<TPCdEdxCalibrationSplines> dEdxSplines;
std::unique_ptr<TPCCFCalibration> tpcCalibration;
std::unique_ptr<GPUSettingsQA> qaConfig;
std::unique_ptr<GPUO2InterfaceQA> qa;
std::vector<int> clusterOutputIds;
unsigned long outputBufferSize = 0;
unsigned long tpcSectorMask = 0;
Expand Down Expand Up @@ -154,6 +161,12 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
LOG(INFO) << "GPU device number selected from pipeline id: " << myId << " / " << idMax;
}
config.configProcessing.runMC = specconfig.processMC;
if (specconfig.outputQA) {
if (!config.configProcessing.runQA) {
config.configQA.forQC = true;
}
config.configProcessing.runQA = true;
}
config.configReconstruction.NWaysOuter = true;
config.configInterface.outputToExternalBuffers = true;

Expand Down Expand Up @@ -232,6 +245,10 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
if (tracker->initialize(config) != 0) {
throw std::invalid_argument("GPUCATracking initialization failed");
}
if (specconfig.outputQA) {
processAttributes->qaConfig.reset(new GPUSettingsQA(config.configQA));
processAttributes->qa = std::make_unique<GPUO2InterfaceQA>(processAttributes->qaConfig.get());
}
timer.Stop();
timer.Reset();
}
Expand Down Expand Up @@ -689,6 +706,14 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
}
}
}
if (specconfig.outputQA) {
TObjArray out;
std::vector<TH1F> copy1 = *outputRegions.qa.hist1; // Internally, this will also be used as output, so we need a non-const copy
std::vector<TH2F> copy2 = *outputRegions.qa.hist2;
std::vector<TH1D> copy3 = *outputRegions.qa.hist3;
processAttributes->qa->postprocess(copy1, copy2, copy3, out);
pc.outputs().snapshot({gDataOriginTPC, "TRACKINGQA", 0, Lifetime::Timeframe}, out);
}
timer.Stop();
LOG(INFO) << "TPC CATracker time for this TF " << timer.CpuTime() - cput << " s";
};
Expand Down Expand Up @@ -789,6 +814,9 @@ DataProcessorSpec getCATrackerSpec(CompletionPolicyData* policyData, ca::Config
}
}
}
if (specconfig.outputQA) {
outputSpecs.emplace_back(gDataOriginTPC, "TRACKINGQA", 0, Lifetime::Timeframe);
}
return std::move(outputSpecs);
};

Expand Down
3 changes: 2 additions & 1 deletion 3 Detectors/TPC/workflow/src/RecoWorkflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const std::unordered_map<std::string, OutputType> OutputMap{
{"disable-writer", OutputType::DisableWriter},
{"send-clusters-per-sector", OutputType::SendClustersPerSector},
{"zsraw", OutputType::ZSRaw},
};
{"qa", OutputType::QA}};

framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vector<int> const& tpcSectors, std::vector<int> const& laneConfiguration,
bool propagateMC, unsigned nLanes, std::string const& cfgInput, std::string const& cfgOutput,
Expand Down Expand Up @@ -442,6 +442,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
produceCompClusters ? ca::Operation::OutputCompClusters : ca::Operation::Noop,
runClusterEncoder ? ca::Operation::OutputCompClustersFlat : ca::Operation::Noop,
isEnabled(OutputType::SendClustersPerSector) ? ca::Operation::SendClustersPerSector : ca::Operation::Noop,
isEnabled(OutputType::QA) ? ca::Operation::OutputQA : ca::Operation::Noop,
isEnabled(OutputType::Clusters) && (caClusterer || decompressTPC) ? ca::Operation::OutputCAClusters : ca::Operation::Noop,
},
tpcSectors));
Expand Down
2 changes: 1 addition & 1 deletion 2 Detectors/TPC/workflow/src/tpc-reco-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)

std::vector<ConfigParamSpec> options{
{"input-type", VariantType::String, "digits", {"digitizer, digits, zsraw, clustershw, clustersnative, compressed-clusters, compressed-clusters-ctf"}},
{"output-type", VariantType::String, "tracks", {"digits, zsraw, clustershw, clustersnative, tracks, compressed-clusters, encoded-clusters, disable-writer, send-clusters-per-sector"}},
{"output-type", VariantType::String, "tracks", {"digits, zsraw, clustershw, clustersnative, tracks, compressed-clusters, encoded-clusters, disable-writer, send-clusters-per-sector, qa"}},
{"no-ca-clusterer", VariantType::Bool, false, {"Use HardwareClusterer instead of clusterer of GPUCATracking"}},
{"disable-mc", VariantType::Bool, false, {"disable sending of MC information"}},
//{"tpc-sectors", VariantType::String, "0-35", {"TPC sector range, e.g. 5-7,8,9"}},
Expand Down
3 changes: 2 additions & 1 deletion 3 GPU/GPUTracking/Base/GPUSettingsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ AddOption(prefetchTPCpageScan, int, 0, "", 0, "Prefetch Data for TPC page scan i
AddOption(debugLevel, int, -1, "debug", 'd', "Set debug level (-1 = silend)")
AddOption(allocDebugLevel, int, 0, "allocDebug", 0, "Some debug output for memory allocations (without messing with normal debug level)")
AddOption(runQA, bool, false, "qa", 'q', "Enable tracking QA", message("Running QA: %s"))
AddOption(QAnoMC, bool, false, "", 0, "Force running QA without MC labels even if present")
AddOption(runCompressionStatistics, bool, false, "compressionStat", 0, "Run statistics and verification for cluster compression")
AddOption(forceMemoryPoolSize, unsigned long, 1, "memSize", 0, "Force size of allocated GPU / page locked host memory", min(0ul))
AddOption(forceHostMemoryPoolSize, unsigned long, 0, "hostMemSize", 0, "Force size of allocated host page locked host memory (overriding memSize)", min(0ul))
Expand Down Expand Up @@ -160,6 +159,8 @@ AddOption(writeMCLabels, bool, false, "", 0, "Store mc labels to file for later
AddOptionVec(matchMCLabels, const char*, "", 0, "Read labels from files and match them, only process tracks where labels differ")
AddOption(matchDisplayMinPt, float, 0, "", 0, "Minimum Pt of a matched track to be displayed")
AddOption(writeRootFiles, bool, false, "", 0, "Create ROOT canvas files")
AddOption(noMC, bool, false, "", 0, "Force running QA without MC labels even if present")
AddOption(forQC, bool, false, "", 0, "Do not write output files but ship histograms for QC")
AddShortcut("compare", 0, "--QAinput", "Compare QA histograms", "--qa", "--QAinputHistogramsOnly")
AddHelp("help", 'h')
EndConfig()
Expand Down
4 changes: 2 additions & 2 deletions 4 GPU/GPUTracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ set(HDRS_INSTALL

# Sources only for O2
if(ALIGPU_BUILD_TYPE STREQUAL "O2")
set(SRCS ${SRCS} Interface/GPUO2Interface.cxx Interface/GPUO2InterfaceRefit.cxx Interface/GPUO2InterfaceConfigurableParam.cxx)
set(HDRS_CINT_O2 ${HDRS_CINT_O2} Interface/GPUO2Interface.h Interface/GPUO2InterfaceRefit.h Interface/GPUO2InterfaceConfigurableParam.h dEdx/TPCdEdxCalibrationSplines.h)
set(SRCS ${SRCS} Interface/GPUO2Interface.cxx Interface/GPUO2InterfaceRefit.cxx Interface/GPUO2InterfaceQA.cxx Interface/GPUO2InterfaceConfigurableParam.cxx)
set(HDRS_CINT_O2 ${HDRS_CINT_O2} Interface/GPUO2Interface.h Interface/GPUO2InterfaceRefit.h Interface/GPUO2InterfaceQA.h Interface/GPUO2InterfaceConfigurableParam.h dEdx/TPCdEdxCalibrationSplines.h)
set(HDRS_CINT_O2_ADDITIONAL Base/GPUSettings.h Base/GPUSettingsList.h) # Manual depencies for ROOT dictionary generation
endif()

Expand Down
1 change: 1 addition & 0 deletions 1 GPU/GPUTracking/GPUTrackingLinkDef_O2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#pragma link C++ class o2::gpu::GPUTPCO2Interface + ;
#pragma link C++ class o2::gpu::GPUTPCO2InterfaceRefit + ;
#pragma link C++ class o2::gpu::GPUO2InterfaceQA + ;
#pragma link C++ class o2::gpu::TPCdEdxCalibrationSplines + ;
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsO2 + ;
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsRec + ;
Expand Down
6 changes: 6 additions & 0 deletions 6 GPU/GPUTracking/Interface/GPUO2Interface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "GPUOutputControl.h"
#include "GPUO2InterfaceConfiguration.h"
#include "GPUParam.inc"
#include "GPUQA.h"
#include <iostream>
#include <fstream>
#ifdef WITH_OPENMP
Expand Down Expand Up @@ -159,6 +160,11 @@ int GPUTPCO2Interface::RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceO
outputs->clustersNative.size = mOutputClustersNative->EndOfSpace ? 0 : (mChain->mIOPtrs.clustersNative->nClustersTotal * sizeof(*mChain->mIOPtrs.clustersNative->clustersLinear));
outputs->tpcTracks.size = mOutputCompressedClusters->EndOfSpace ? 0 : (size_t)((char*)mOutputCompressedClusters->OutputPtr - (char*)mOutputCompressedClusters->OutputBase);
}
if (mConfig->configQA.forQC) {
outputs->qa.hist1 = &mChain->GetQA()->getHistograms1D();
outputs->qa.hist2 = &mChain->GetQA()->getHistograms2D();
outputs->qa.hist3 = &mChain->GetQA()->getHistograms1Dd();
}
*data = mChain->mIOPtrs;

nEvent++;
Expand Down
11 changes: 11 additions & 0 deletions 11 GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include "GPUHostDataTypes.h"
#include "DataFormatsTPC/Constants.h"

class TH1F;
class TH1D;
class TH2F;

namespace o2
{
namespace tpc
Expand All @@ -57,11 +61,18 @@ struct GPUInterfaceOutputRegion {
std::function<void*(size_t)> allocator = nullptr;
};

struct GPUInterfaceQAOutputs {
const std::vector<TH1F>* hist1;
const std::vector<TH2F>* hist2;
const std::vector<TH1D>* hist3;
};

struct GPUInterfaceOutputs {
GPUInterfaceOutputRegion compressedClusters;
GPUInterfaceOutputRegion clustersNative;
GPUInterfaceOutputRegion tpcTracks;
GPUInterfaceOutputRegion clusterLabels;
GPUInterfaceQAOutputs qa;
};

// Full configuration structure with all available settings of GPU...
Expand Down
32 changes: 32 additions & 0 deletions 32 GPU/GPUTracking/Interface/GPUO2InterfaceQA.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file GPUO2InterfaceQA.cxx
/// \author David Rohr

#include "GPUQA.h"
#include "GPUO2InterfaceQA.h"

using namespace o2::gpu;
using namespace o2::tpc;

GPUO2InterfaceQA::GPUO2InterfaceQA(const GPUSettingsQA* config) : mQA(new GPUQA(nullptr, config))
{
}

GPUO2InterfaceQA::~GPUO2InterfaceQA() = default;

int GPUO2InterfaceQA::postprocess(std::vector<TH1F>& in1, std::vector<TH2F>& in2, std::vector<TH1D>& in3, TObjArray& out)
{
if (mQA->loadHistograms(in1, in2, in3)) {
return 1;
}
return mQA->DrawQAHistograms(&out);
}
54 changes: 54 additions & 0 deletions 54 GPU/GPUTracking/Interface/GPUO2InterfaceQA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file GPUO2InterfaceQA.h
/// \author David Rohr

#ifndef GPUO2INTERFACEQA_H
#define GPUO2INTERFACEQA_H

// Some defines denoting that we are compiling for O2
#ifndef HAVE_O2HEADERS
#define HAVE_O2HEADERS
#endif
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#include <memory>
#include <vector>

class TH1F;
class TH1D;
class TH2F;
class TObjArray;

namespace o2::gpu
{
class GPUQA;
class GPUSettingsQA;
class GPUO2InterfaceQA
{
public:
GPUO2InterfaceQA(const GPUSettingsQA* config = nullptr);
~GPUO2InterfaceQA();

// Input might be modified, so we assume non-const. If it is const, a copy should be created before.
int postprocess(std::vector<TH1F>& in1, std::vector<TH2F>& in2, std::vector<TH1D>& in3, TObjArray& out);

private:
std::unique_ptr<GPUQA> mQA;
};
} // namespace o2::gpu

#endif
8 changes: 4 additions & 4 deletions 8 GPU/GPUTracking/Standalone/display/GPUDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ namespace GPUCA_NAMESPACE::gpu
extern GPUSettingsStandalone configStandalone;
}
#endif
static const GPUSettingsDisplay& GPUDisplay_GetConfig(GPUChainTracking* rec)
static const GPUSettingsDisplay& GPUDisplay_GetConfig(GPUChainTracking* chain)
{
#if !defined(GPUCA_STANDALONE)
static GPUSettingsDisplay defaultConfig;
if (rec->mConfigDisplay) {
return *((const GPUSettingsDisplay*)rec->mConfigDisplay);
if (chain->mConfigDisplay) {
return *((const GPUSettingsDisplay*)chain->mConfigDisplay);
} else {
return defaultConfig;
}
Expand All @@ -99,7 +99,7 @@ static const GPUSettingsDisplay& GPUDisplay_GetConfig(GPUChainTracking* rec)
#endif
}

GPUDisplay::GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* rec, GPUQA* qa) : mBackend(backend), mChain(rec), mConfig(GPUDisplay_GetConfig(rec)), mQA(qa), mMerger(rec->GetTPCMerger()) { backend->mDisplay = this; }
GPUDisplay::GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* chain, GPUQA* qa) : mBackend(backend), mChain(chain), mConfig(GPUDisplay_GetConfig(chain)), mQA(qa), mMerger(chain->GetTPCMerger()) { backend->mDisplay = this; }

const GPUParam& GPUDisplay::param() { return mChain->GetParam(); }
const GPUTPCTracker& GPUDisplay::sliceTracker(int iSlice) { return mChain->GetTPCSliceTrackers()[iSlice]; }
Expand Down
4 changes: 2 additions & 2 deletions 4 GPU/GPUTracking/Standalone/display/GPUDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace gpu
class GPUDisplay
{
public:
GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* rec, GPUQA* qa) {}
GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* chain, GPUQA* qa) {}
~GPUDisplay() = default;
GPUDisplay(const GPUDisplay&) = delete;

Expand Down Expand Up @@ -94,7 +94,7 @@ struct GPUParam;
class GPUDisplay
{
public:
GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* rec, GPUQA* qa);
GPUDisplay(GPUDisplayBackend* backend, GPUChainTracking* chain, GPUQA* qa);
~GPUDisplay() = default;
GPUDisplay(const GPUDisplay&) = delete;

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.