ATLAS Offline Software
Loading...
Searching...
No Matches
StandaloneDataIO::ConstantInformation Struct Reference

#include <StandaloneDataIO.h>

Collaboration diagram for StandaloneDataIO::ConstantInformation:

Static Public Member Functions

static ErrorState read_geometry (const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const bool report=false)
static ErrorState read_noise (const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const bool report=false)
static ErrorState write_geometry (std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const bool report=false)
static ErrorState write_noise (std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const bool report=false)

Friends

struct StandaloneDataIO

Detailed Description

Definition at line 42 of file StandaloneDataIO.h.

Member Function Documentation

◆ read_geometry()

ErrorState StandaloneDataIO::ConstantInformation::read_geometry ( const std::filesystem::path & file,
CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > & geo,
const bool report = false )
inlinestatic

Definition at line 48 of file StandaloneDataIO.h.

51 {
52 std::ifstream in(file.native(), std::ios_base::binary);
53 geo.binary_input(in);
54 if (in.fail())
55 {
56 report_error(file, "reading geometry", report);
58 }
59 in.close();
60 return ErrorState::OK;
61 }
static void report_error(const std::filesystem::path &file, const std::string &kind, const bool really_report=false)
TFile * file

◆ read_noise()

ErrorState StandaloneDataIO::ConstantInformation::read_noise ( const std::filesystem::path & file,
CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > & noise,
const bool report = false )
inlinestatic

Definition at line 63 of file StandaloneDataIO.h.

66 {
67 std::ifstream in(file.native(), std::ios_base::binary);
68 noise.binary_input(in);
69 if (in.fail())
70 {
71 report_error(file, "reading noise", report);
73 }
74 in.close();
75 return ErrorState::OK;
76 }

◆ write_geometry()

ErrorState StandaloneDataIO::ConstantInformation::write_geometry ( std::filesystem::path file,
const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > & geo,
const bool report = false )
inlinestatic

Definition at line 78 of file StandaloneDataIO.h.

81 {
82 file.replace_extension(".geometry");
83 std::ofstream out(file, std::ios_base::binary);
84 geo.binary_output(out);
85 if (out.fail())
86 {
87 report_error(file, "writing geometry", report);
89 }
90 out.close();
91 return ErrorState::OK;
92 }

◆ write_noise()

ErrorState StandaloneDataIO::ConstantInformation::write_noise ( std::filesystem::path file,
const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > & noise,
const bool report = false )
inlinestatic

Definition at line 94 of file StandaloneDataIO.h.

97 {
98 file.replace_extension(".noise");
99 std::ofstream out(file, std::ios_base::binary);
100 noise.binary_output(out);
101 if (out.fail())
102 {
103 report_error(file, "writing noise", report);
105 }
106 out.close();
107 return ErrorState::OK;
108 }

◆ StandaloneDataIO

friend struct StandaloneDataIO
friend

Definition at line 44 of file StandaloneDataIO.h.


The documentation for this struct was generated from the following file: