60static constexpr uint32_t DUMP_HEADER_SIZE = 4;
61static constexpr char DUMP_HEADER[DUMP_HEADER_SIZE + 1] =
"CAv1";
74 fwrite(DUMP_HEADER, 1, DUMP_HEADER_SIZE, fp);
83 std::pair<const char*, size_t> tmp = {
buffer.data(),
buffer.size()};
84 DumpData(fp, &tmp.first, &tmp.second, InOutPointerType::CLUSTER_NATIVE_MC);
114 std::vector<std::array<char, TPCZSHDR::TPC_ZS_PAGE_SIZE>> pages(total);
115 char*
ptr = pages[0].data();
128 if (
DumpData(fp, &
ptr, &total, InOutPointerType::TPC_ZS)) {
129 fwrite(&counts,
sizeof(counts), 1, fp);
134 throw std::runtime_error(
"Cannot dump non-flat compressed clusters");
170 char buf[DUMP_HEADER_SIZE + 1] =
"";
171 size_t r = fread(
buf, 1, DUMP_HEADER_SIZE, fp);
172 if (strncmp(DUMP_HEADER,
buf, DUMP_HEADER_SIZE)) {
173 GPUError(
"Invalid file header");
178 r = fread(&geo,
sizeof(geo), 1, fp);
188 int32_t nClustersTotal = 0;
194 std::pair<const char*, size_t> tmp = {
nullptr, 0};
196 mIOMem.
clusterNativeMCView = std::make_unique<ConstMCLabelContainerView>(gsl::span<const char>(tmp.first, tmp.first + tmp.second));
224 r = fread(&counts,
sizeof(counts), 1, fp);
260 size_t fptr = ftell(fp);
261 fseek(fp, 0, SEEK_END);
262 size_t fend = ftell(fp);
265 GPUError(
"Error reading data file, reading incomplete");
271 ptrClusterData[
i][
j].
id = nClustersTotal++;
272 if ((uint32_t)ptrClusterData[
i][
j].
amp >= 25 * 1024) {
273 GPUError(
"Invalid cluster charge, truncating (%d >= %d)", (int32_t)ptrClusterData[
i][
j].amp, 25 * 1024);
274 ptrClusterData[
i][
j].
amp = 25 * 1024 - 1;
279 GPUError(
"Invalid raw cluster charge, truncating (%d >= %d)", (int32_t)ptrRawClusters[
i][
j].GetCharge(), 25 * 1024);
283 GPUError(
"Invalid raw cluster charge max, truncating (%d >= %d)", (int32_t)ptrRawClusters[
i][
j].GetQMax(), 1024);
295 if (
processors()->calibObjects.fastTransform !=
nullptr) {
297 f +=
"tpctransform.dump";
300 if (
processors()->calibObjects.fastTransformRef !=
nullptr) {
302 f +=
"tpctransformref.dump";
305 if (
processors()->calibObjects.fastTransformMShape !=
nullptr) {
307 f +=
"tpctransformmshape.dump";
310 if (
processors()->calibObjects.fastTransformHelper !=
nullptr) {
312 f +=
"tpctransformhelper.dump";
315 if (
processors()->calibObjects.tpcPadGain !=
nullptr) {
317 f +=
"tpcpadgaincalib.dump";
320 if (
processors()->calibObjects.tpcZSLinkMapping !=
nullptr) {
322 f +=
"tpczslinkmapping.dump";
325 if (
processors()->calibObjects.dEdxCalibContainer !=
nullptr) {
327 f +=
"dEdxCalibContainer.dump";
330 if (
processors()->calibObjects.matLUT !=
nullptr) {
335 if (
processors()->calibObjects.trdGeometry !=
nullptr) {
337 f +=
"trdgeometry.dump";
346 f +=
"tpctransform.dump";
350 f +=
"tpctransformref.dump";
354 f +=
"tpctransformmshape.dump";
358 f +=
"tpctransformhelper.dump";
366 f +=
"tpcpadgaincalib.dump";
370 f +=
"tpczslinkmapping.dump";
374 f +=
"dEdxCalibContainer.dump";
379 mMatLUTU = ReadFlatObjectFromFile<o2::base::MatLayerCylSet>(
f.c_str());
382 f +=
"trdgeometry.dump";
383 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)
GPUReconstruction::GeometryType GeometryType
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