58static constexpr uint32_t DUMP_HEADER_SIZE = 4;
59static constexpr char DUMP_HEADER[DUMP_HEADER_SIZE + 1] =
"CAv1";
72 fwrite(DUMP_HEADER, 1, DUMP_HEADER_SIZE, fp);
81 std::pair<const char*, size_t> tmp = {
buffer.data(),
buffer.size()};
82 DumpData(fp, &tmp.first, &tmp.second, InOutPointerType::CLUSTER_NATIVE_MC);
112 std::vector<std::array<char, TPCZSHDR::TPC_ZS_PAGE_SIZE>> pages(total);
113 char*
ptr = pages[0].data();
126 if (
DumpData(fp, &
ptr, &total, InOutPointerType::TPC_ZS)) {
127 fwrite(&counts,
sizeof(counts), 1, fp);
132 throw std::runtime_error(
"Cannot dump non-flat compressed clusters");
168 char buf[DUMP_HEADER_SIZE + 1] =
"";
169 size_t r = fread(
buf, 1, DUMP_HEADER_SIZE, fp);
170 if (strncmp(DUMP_HEADER,
buf, DUMP_HEADER_SIZE)) {
171 GPUError(
"Invalid file header");
176 r = fread(&geo,
sizeof(geo), 1, fp);
186 int32_t nClustersTotal = 0;
192 std::pair<const char*, size_t> tmp = {
nullptr, 0};
194 mIOMem.
clusterNativeMCView = std::make_unique<ConstMCLabelContainerView>(gsl::span<const char>(tmp.first, tmp.first + tmp.second));
222 r = fread(&counts,
sizeof(counts), 1, fp);
258 size_t fptr = ftell(fp);
259 fseek(fp, 0, SEEK_END);
260 size_t fend = ftell(fp);
263 GPUError(
"Error reading data file, reading incomplete");
269 ptrClusterData[
i][
j].
id = nClustersTotal++;
270 if ((uint32_t)ptrClusterData[
i][
j].
amp >= 25 * 1024) {
271 GPUError(
"Invalid cluster charge, truncating (%d >= %d)", (int32_t)ptrClusterData[
i][
j].amp, 25 * 1024);
272 ptrClusterData[
i][
j].
amp = 25 * 1024 - 1;
277 GPUError(
"Invalid raw cluster charge, truncating (%d >= %d)", (int32_t)ptrRawClusters[
i][
j].GetCharge(), 25 * 1024);
281 GPUError(
"Invalid raw cluster charge max, truncating (%d >= %d)", (int32_t)ptrRawClusters[
i][
j].GetQMax(), 1024);
293 if (
processors()->calibObjects.fastTransform !=
nullptr) {
295 f +=
"tpctransform.dump";
298 if (
processors()->calibObjects.fastTransformRef !=
nullptr) {
300 f +=
"tpctransformref.dump";
303 if (
processors()->calibObjects.fastTransformMShape !=
nullptr) {
305 f +=
"tpctransformmshape.dump";
308 if (
processors()->calibObjects.fastTransformHelper !=
nullptr) {
310 f +=
"tpctransformhelper.dump";
313 if (
processors()->calibObjects.tpcPadGain !=
nullptr) {
315 f +=
"tpcpadgaincalib.dump";
318 if (
processors()->calibObjects.tpcZSLinkMapping !=
nullptr) {
320 f +=
"tpczslinkmapping.dump";
323 if (
processors()->calibObjects.dEdxCalibContainer !=
nullptr) {
325 f +=
"dEdxCalibContainer.dump";
328 if (
processors()->calibObjects.matLUT !=
nullptr) {
333 if (
processors()->calibObjects.trdGeometry !=
nullptr) {
335 f +=
"trdgeometry.dump";
344 f +=
"tpctransform.dump";
348 f +=
"tpctransformref.dump";
352 f +=
"tpctransformmshape.dump";
356 f +=
"tpctransformhelper.dump";
364 f +=
"tpcpadgaincalib.dump";
368 f +=
"tpczslinkmapping.dump";
372 f +=
"dEdxCalibContainer.dump";
377 mMatLUTU = ReadFlatObjectFromFile<o2::base::MatLayerCylSet>(
f.c_str());
380 f +=
"trdgeometry.dump";
381 mTRDGeometryU = ReadStructFromFile<o2::trd::GeometryFlat>(
f.c_str());
Definition of container class for dE/dx corrections.
Helper class to access correction maps.
Online TRD tracker based on extrapolated TPC tracks.
Used for storing the MC labels for the TRD tracklets.
TRD Tracklet word for GPU tracker - 32bit tracklet info + half chamber ID + index.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definitions of TPC Zero Suppression Data Headers.
std::unique_ptr< o2::base::MatLayerCylSet > mMatLUTU
std::unique_ptr< TPCFastTransform > mTPCFastTransformMShapeU
void ReadSettings(const char *dir="") override
std::unique_ptr< CorrectionMapsHelper > mTPCFastTransformHelperU
std::unique_ptr< TPCFastTransform > mTPCFastTransformRefU
void DumpData(const char *filename)
std::unique_ptr< TPCPadGainCalib > mTPCPadGainCalibU
std::unique_ptr< o2::tpc::CalibdEdxContainer > mdEdxCalibContainerU
std::unique_ptr< o2::trd::GeometryFlat > mTRDGeometryU
std::unique_ptr< TPCZSLinkMapping > mTPCZSLinkMappingU
std::unique_ptr< TPCFastTransform > mTPCFastTransformU
GPUTrackingInOutPointers & mIOPtrs
struct o2::gpu::GPUChainTracking::InOutMemory mIOMem
int32_t ReadData(const char *filename)
void DumpSettings(const char *dir="") override
GPUConstantMem * processors()
void DumpStructToFile(const T *obj, const char *file)
static constexpr int32_t NSECTORS
void DumpFlatObjectToFile(const T *obj, const char *file)
static constexpr GeometryType geometryType
static constexpr const char *const GEOMETRY_TYPE_NAMES[]
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLuint GLenum GLsizei const GLchar * buf
Global TPC definitions and constants.
void SetQMax(uint16_t qmax)
void SetCharge(uint16_t charge)
S< o2::trd::GeometryFlat >::type * trdGeometry
S< o2::tpc::CalibdEdxContainer >::type * dEdxCalibContainer
S< TPCZSLinkMapping >::type * tpcZSLinkMapping
S< TPCFastTransform >::type * fastTransform
S< TPCPadGainCalib >::type * tpcPadGain
S< o2::base::MatLayerCylSet >::type * matLUT
S< TPCFastTransform >::type * fastTransformRef
S< TPCFastTransform >::type * fastTransformMShape
std::unique_ptr< o2::tpc::Digit[]> tpcDigits[NSECTORS]
std::unique_ptr< char[]> clusterNativeMC
std::unique_ptr< char[]> tpcCompressedClusters
std::unique_ptr< GPUTPCMCInfo[]> mcInfosTPC
std::unique_ptr< char[]> tpcDigitsMC[NSECTORS]
std::unique_ptr< GPUTRDTrackletWord[]> trdTracklets
std::unique_ptr< o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel >[]> tpcDigitMCView
std::unique_ptr< GPUTPCMCInfoCol[]> mcInfosTPCCol
std::unique_ptr< GPUTPCGMMergedTrackHit[]> mergedTrackHits
std::unique_ptr< int32_t[]> trdTrackletIdxFirst
std::unique_ptr< GPUTPCGMMergedTrack[]> mergedTracks
std::unique_ptr< AliHLTTPCClusterMCLabel[]> mcLabelsTPC
std::unique_ptr< o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > > clusterNativeMCView
std::unique_ptr< GPUTrackingInOutDigits > digitMap
std::unique_ptr< GPUTPCClusterData[]> clusterData[NSECTORS]
std::unique_ptr< o2::tpc::ClusterNative[]> clustersNative
std::unique_ptr< GPUTPCDigitsMCInput > tpcDigitMCMap
InOutMemory & operator=(InOutMemory &&)
std::unique_ptr< float[]> trdTriggerTimes
std::unique_ptr< GPUTPCTrack[]> sectorTracks[NSECTORS]
std::unique_ptr< GPUTRDSpacePoint[]> trdSpacePoints
std::unique_ptr< GPUTrackingInOutZS > tpcZSmeta
std::unique_ptr< uint8_t[]> trdTrigRecMask
std::unique_ptr< o2::tpc::ClusterNativeAccess > clusterNativeAccess
std::unique_ptr< AliHLTTPCRawCluster[]> rawClusters[NSECTORS]
std::unique_ptr< GPUTPCHitId[]> sectorClusters[NSECTORS]
std::unique_ptr< GPUSettingsTF[]> settingsTF
std::unique_ptr< char[]> tpcZSpagesChar
std::unique_ptr< GPUTRDTrackGPU[]> trdTracks
std::unique_ptr< GPUTrackingInOutZS::GPUTrackingInOutZSMeta > tpcZSmeta2
GPUCalibObjectsConst calibObjects
const o2::tpc::Digit * tpcDigits[NSECTORS]
size_t nTPCDigits[NSECTORS]
const GPUTPCDigitsMCInput * tpcDigitsMC
const int32_t * trdTrackletIdxFirst
const GPUTPCHitId * sectorClusters[NSECTORS]
const o2::tpc::ClusterNativeAccess * clustersNative
const GPUTPCMCInfo * mcInfosTPC
uint32_t nClusterData[NSECTORS]
uint32_t nRawClusters[NSECTORS]
const o2::tpc::CompressedClustersFlat * tpcCompressedClusters
const AliHLTTPCClusterMCLabel * mcLabelsTPC
uint32_t nSectorClusters[NSECTORS]
const GPUTRDSpacePoint * trdSpacePoints
const GPUTPCTrack * sectorTracks[NSECTORS]
const GPUTRDTrackGPU * trdTracks
const GPUSettingsTF * settingsTF
const GPUTRDTrackletWord * trdTracklets
const GPUTrackingInOutZS * tpcZS
const AliHLTTPCRawCluster * rawClusters[NSECTORS]
const GPUTPCClusterData * clusterData[NSECTORS]
uint32_t nSectorTracks[NSECTORS]
uint32_t nMergedTrackHits
const float * trdTriggerTimes
const uint8_t * trdTrigRecMask
const GPUTPCGMMergedTrackHit * mergedTrackHits
const GPUTrackingInOutDigits * tpcPackedDigits
uint32_t nTRDTriggerRecords
const GPUTPCMCInfoCol * mcInfosTPCCol
const GPUTPCGMMergedTrack * mergedTracks
uint32_t count[NSECTORS][NENDPOINTS]
const void *const * zsPtr[NENDPOINTS]
uint32_t count[NENDPOINTS]
const uint32_t * nZSPtr[NENDPOINTS]
GPUTrackingInOutZSSector sector[NSECTORS]
static constexpr uint32_t NENDPOINTS
unsigned int nClusters[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
const o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > * clustersMCTruth
unsigned int nClustersTotal
const ClusterNative * clustersLinear
const CompressedClusters * ptrForward
static constexpr size_t TPC_ZS_PAGE_SIZE