ATLAS Offline Software
Static Public Member Functions | Friends | List of all members
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 41 of file StandaloneDataIO.h.

Member Function Documentation

◆ read_geometry()

static 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 47 of file StandaloneDataIO.h.

50  {
51  std::ifstream in(file.native(), std::ios_base::binary);
52  geo.binary_input(in);
53  if (in.fail())
54  {
55  report_error(file, "reading geometry", report);
56  return ErrorState::ReadError;
57  }
58  in.close();
59  return ErrorState::OK;
60  }

◆ read_noise()

static 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 62 of file StandaloneDataIO.h.

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

◆ write_geometry()

static 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 77 of file StandaloneDataIO.h.

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

◆ write_noise()

static 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 93 of file StandaloneDataIO.h.

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

Friends And Related Function Documentation

◆ StandaloneDataIO

friend struct StandaloneDataIO
friend

Definition at line 43 of file StandaloneDataIO.h.


The documentation for this struct was generated from the following file:
StandaloneDataIO::ErrorState::WriteError
@ WriteError
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
checkTP.report
report
Definition: checkTP.py:127
StandaloneDataIO::ErrorState::OK
@ OK
file
TFile * file
Definition: tile_monitor.h:29
StandaloneDataIO::ErrorState::ReadError
@ ReadError
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
StandaloneDataIO::report_error
static void report_error(const std::filesystem::path &file, const std::string &kind, const bool really_report=false)
Definition: StandaloneDataIO.h:31
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380