ATLAS Offline Software
StandaloneDataIO.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 //
4 // Dear emacs, this is -*- c++ -*-
5 //
6 
7 #ifndef CALORECGPU_STANDALONEDATAIO_H
8 #define CALORECGPU_STANDALONEDATAIO_H
9 
10 #include "Helpers.h"
11 
12 #include "CUDAFriendlyClasses.h"
13 
14 #include <fstream>
15 #include <string>
16 #include <map>
17 #include <set>
18 #include <iomanip>
19 
20 #include <filesystem>
21 
23 {
24  enum class ErrorState
25  {
26  OK = 0, ReadError, WriteError
27  };
28 
29  protected:
30 
31  inline static void report_error(const std::filesystem::path & file, const std::string & kind, const bool really_report = false)
32  {
33  if (really_report)
34  {
35  std::cerr << "ERROR: when " << kind << " from '" << file << "'." << std::endl;
36  }
37  }
38 
39  public:
40 
42  {
43  friend struct StandaloneDataIO;
44 
45  public:
46 
49  const bool report = false)
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  }
61 
64  const bool report = false)
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  }
76 
79  const bool report = false)
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  }
92 
95  const bool report = false)
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  }
108  };
109 
111  {
112  friend struct StandaloneDataIO;
113 
114  public:
117  const bool report = false)
118  {
119  clusters.allocate();
120 
121  std::ifstream in(file.native(), std::ios_base::binary);
122 
123  in.read((char *) & (clusters->number), sizeof(int));
124 
125  if (in.fail() || clusters->number < 0 || clusters->number > CaloRecGPU::NMaxClusters)
126  {
127  report_error(file, "reading clusters", report);
128  return ErrorState::ReadError;
129  }
130 
131  in.read((char *) clusters->clusterEnergy, sizeof(float) * clusters->number);
132  in.read((char *) clusters->clusterEt, sizeof(float) * clusters->number);
133  in.read((char *) clusters->clusterEta, sizeof(float) * clusters->number);
134  in.read((char *) clusters->clusterPhi, sizeof(float) * clusters->number);
135  in.read((char *) clusters->seedCellID, sizeof(int) * clusters->number);
136 
137  if (in.fail())
138  {
139  report_error(file, "reading clusters", report);
140  return ErrorState::ReadError;
141  }
142 
143  in.close();
144 
145  return ErrorState::OK;
146 
147  }
148 
151  const bool report = false)
152  {
153  std::ifstream in(file.native(), std::ios_base::binary);
154  cell_info.binary_input(in);
155  if (in.fail())
156  {
157  report_error(file, "reading cell info", report);
158  return ErrorState::ReadError;
159  }
160  in.close();
161  return ErrorState::OK;
162  }
163 
166  const bool report = false)
167  {
168  std::ifstream in(file.native(), std::ios_base::binary);
169  cell_state.binary_input(in);
170  if (in.fail())
171  {
172  report_error(file, "reading cell state", report);
173  return ErrorState::ReadError;
174  }
175  in.close();
176  return ErrorState::OK;
177  }
178 
181  const bool report = false)
182  {
183  file.replace_extension(".clusterinfo");
184  std::ofstream out(file, std::ios_base::binary);
185 
186  out.write((char *) & (clusters->number), sizeof(int));
187  out.write((char *) clusters->clusterEnergy, sizeof(float) * clusters->number);
188  out.write((char *) clusters->clusterEt, sizeof(float) * clusters->number);
189  out.write((char *) clusters->clusterEta, sizeof(float) * clusters->number);
190  out.write((char *) clusters->clusterPhi, sizeof(float) * clusters->number);
191  out.write((char *) clusters->seedCellID, sizeof(int) * clusters->number);
192 
193  if (out.fail())
194  {
195  report_error(file, "writing clusters", report);
196  return ErrorState::WriteError;
197  }
198  out.close();
199  return ErrorState::OK;
200  }
201 
204  const bool report = false)
205  {
206  file.replace_extension(".cellinfo");
207  std::ofstream out(file, std::ios_base::binary);
208  cell_info.binary_output(out);
209  if (out.fail())
210  {
211  report_error(file, "writing cell info", report);
212  return ErrorState::WriteError;
213  }
214  out.close();
215  return ErrorState::OK;
216  }
217 
220  const bool report = false)
221  {
222  file.replace_extension(".cellstate");
223  std::ofstream out(file, std::ios_base::binary);
224  cell_state.binary_output(out);
225  if (out.fail())
226  {
227  report_error(file, "writing cell state", report);
228  return ErrorState::WriteError;
229  }
230  out.close();
231  return ErrorState::OK;
232  }
233 
234  };
235 
236  protected:
237 
238  inline static bool create_or_check_folder(const std::filesystem::path & folder, const bool output_errors = true)
239  {
241  {
242  if (!std::filesystem::create_directory(folder))
243  {
244  if (output_errors)
245  {
246  std::cout << "ERROR: folder '" << folder << "' could not be created." << std::endl;
247  }
248  return false;
249  }
250  }
251  else if (!std::filesystem::is_directory(folder))
252  {
253  if (output_errors)
254  {
255  std::cout << "ERROR: folder '" << folder << "' is not a valid folder." << std::endl;
256  }
257  return false;
258  }
259  return true;
260  }
261 
262  public:
263 
264  inline static ErrorState prepare_folder_for_output(const std::filesystem::path & folder, const bool output_errors = true)
265  {
266  if (!create_or_check_folder(folder, output_errors))
267  {
268  return ErrorState::WriteError;
269  }
270  return ErrorState::OK;
271  }
272 
273  inline static std::string build_filename( const std::string & prefix,
274  const std::string & text,
275  const std::string & suffix,
276  const std::string & ext )
277  {
278  return prefix + (prefix.size() > 0 ? "_" : "") + text +
279  (suffix.size() > 0 ? "_" : "") + suffix + "." + ext;
280  }
281 
282  inline static std::string build_filename( const std::string & prefix,
283  const size_t event_number,
284  const std::string & suffix,
285  const std::string & ext,
286  const unsigned int num_width = 9 )
287  {
288  std::ostringstream event_ID_format;
289  event_ID_format << std::setfill('0') << std::setw(num_width) << event_number;
290  const std::string event_ID = event_ID_format.str();
291  return build_filename(prefix, event_ID, suffix, ext);
292  }
293 
294 
298  const std::string & prefix = "",
299  const std::string & suffix = "",
300  const bool output_errors = true)
301  {
302  if (!create_or_check_folder(folder, output_errors))
303  {
304  return ErrorState::WriteError;
305  }
306 
307  auto filename = [&] (const std::string & text, const std::string & ext)
308  {
309  return folder / build_filename(prefix, text, suffix, ext);
310  };
311 
313  {
314  return ErrorState::WriteError;
315  }
317  {
318  return ErrorState::WriteError;
319  }
320  return ErrorState::OK;
321  }
322 
323  inline static ErrorState save_event_to_folder(const size_t event_number,
328  const std::string & prefix = "",
329  const std::string & suffix = "",
330  const unsigned int num_width = 9,
331  const bool output_errors = true)
332  {
333  if (!create_or_check_folder(folder, output_errors))
334  {
335  return ErrorState::WriteError;
336  }
337 
338  std::ostringstream event_ID_format;
339  event_ID_format << std::setfill('0') << std::setw(num_width) << event_number;
340  const std::string event_ID = event_ID_format.str();
341 
342  auto filename = [&] (const std::string & ext)
343  {
344  return folder / build_filename(prefix, event_ID, suffix, ext);
345  };
346 
347  if (EventInformation::write_cell_info(filename("cellinfo"), cell_info) != ErrorState::OK)
348  {
349  return ErrorState::WriteError;
350  }
351  if (EventInformation::write_cell_state(filename("cellstate"), cell_state) != ErrorState::OK)
352  {
353  return ErrorState::WriteError;
354  }
356  {
357  return ErrorState::WriteError;
358  }
359  return ErrorState::OK;
360  }
361 
362  inline static ErrorState save_cell_state_to_folder(const size_t event_number,
365  const std::string & prefix = "",
366  const std::string & suffix = "",
367  const unsigned int num_width = 9,
368  const bool output_errors = true)
369  {
370  if (!create_or_check_folder(folder, output_errors))
371  {
372  return ErrorState::WriteError;
373  }
374 
375  std::ostringstream event_ID_format;
376  event_ID_format << std::setfill('0') << std::setw(num_width) << event_number;
377  const std::string event_ID = event_ID_format.str();
378 
379  auto filename = [&] (const std::string & ext)
380  {
381  return folder / build_filename(prefix, event_ID, suffix, ext);
382  };
383 
384  if (EventInformation::write_cell_state(filename("cellstate"), cell_state) != ErrorState::OK)
385  {
386  return ErrorState::WriteError;
387  }
388  return ErrorState::OK;
389  }
390 
391  inline static ErrorState save_cell_info_to_folder(const size_t event_number,
394  const std::string & prefix = "",
395  const std::string & suffix = "",
396  const unsigned int num_width = 9,
397  const bool output_errors = true)
398  {
399  if (!create_or_check_folder(folder, output_errors))
400  {
401  return ErrorState::WriteError;
402  }
403 
404  std::ostringstream event_ID_format;
405  event_ID_format << std::setfill('0') << std::setw(num_width) << event_number;
406  const std::string event_ID = event_ID_format.str();
407 
408  auto filename = [&] (const std::string & ext)
409  {
410  return folder / build_filename(prefix, event_ID, suffix, ext);
411  };
412 
413  if (EventInformation::write_cell_info(filename("cellinfo"), cell_info) != ErrorState::OK)
414  {
415  return ErrorState::WriteError;
416  }
417  return ErrorState::OK;
418  }
419 
420  inline static ErrorState save_clusters_to_folder(const size_t event_number,
423  const std::string & prefix = "",
424  const std::string & suffix = "",
425  const unsigned int num_width = 9,
426  const bool output_errors = true)
427  {
428  if (!create_or_check_folder(folder, output_errors))
429  {
430  return ErrorState::WriteError;
431  }
432 
433  std::ostringstream event_ID_format;
434  event_ID_format << std::setfill('0') << std::setw(num_width) << event_number;
435  const std::string event_ID = event_ID_format.str();
436 
437  auto filename = [&] (const std::string & ext)
438  {
439  return folder / build_filename(prefix, event_ID, suffix, ext);
440  };
441 
443  {
444  return ErrorState::WriteError;
445  }
446  return ErrorState::OK;
447  }
448 
449  struct FolderLoad
450  {
451  std::map<std::string, CaloRecGPU::Helpers::CPU_object<CaloRecGPU::GeometryArr>> geometry;
452  std::map<std::string, CaloRecGPU::Helpers::CPU_object<CaloRecGPU::CellNoiseArr>> noise;
453  std::map<std::string, CaloRecGPU::Helpers::CPU_object<CaloRecGPU::ClusterInfoArr>> cluster_info;
454  std::map<std::string, CaloRecGPU::Helpers::CPU_object<CaloRecGPU::CellInfoArr>> cell_info;
455  std::map<std::string, CaloRecGPU::Helpers::CPU_object<CaloRecGPU::CellStateArr>> cell_state;
456  };
457 
464  {
465  bool load_cluster_info = false,
467  load_cell_info = false,
468  load_geometry = false,
469  load_noise = false;
470 
471  static constexpr FolderLoadOptions None()
472  {
473  FolderLoadOptions ret;
474  return ret;
475  //By design, all options are initialized as false...
476  }
477  static constexpr FolderLoadOptions All()
478  {
479  FolderLoadOptions ret{true, true, true, true, true};
480  return ret;
481  }
482  };
483 
484 
488  template <class F>
489  inline static FolderLoad load_folder_filter(F && filter_function,
490  //Receives a std::string (the filename),
491  //returns `true` if the file should be filtered out.
493  int max_events = -1,
495  const bool output_messages = true)
496  {
497  FolderLoad ret;
498  if (!std::filesystem::is_directory(folder))
499  {
500  if (output_messages)
501  {
502  std::cout << "ERROR: '" << folder << "' is not a valid folder." << std::endl;
503  }
504  return ret;
505  }
506  std::set<std::string> read_one_part_of_v1_cells;
507  int event_count = 0;
508  for (const std::filesystem::path & file : std::filesystem::directory_iterator(folder))
509  {
510  if ( max_events > 0 && event_count >= max_events &&
511  ret.geometry.size() > 0 && ret.noise.size() > 0 )
512  {
513  break;
514  }
515 
516  const bool can_load_events = (max_events < 0) || (event_count < max_events);
517  const std::string filename = file.stem().native();
518 
519  if (filter_function(filename))
520  {
521  continue;
522  }
523 
524  auto check_error = [&](const ErrorState & es, const std::string & str)
525  {
526  if (es == ErrorState::OK)
527  {
528  return false;
529  }
530  if (output_messages)
531  {
532  std::cout << "ERROR: '" << file << "' is not a valid " << str << " file (" << (int) es << ")." << std::endl;
533  }
534  return true;
535  };
536 
537  auto output_loading_message = [&](const std::string & str)
538  {
539  if (output_messages)
540  {
541  std::cout << "Loaded " << str << " from '" << file << "'." << std::endl;
542  }
543  };
544 
545  if (file.extension() == ".geometry")
546  {
547  if (!flo.load_geometry)
548  {
549  continue;
550  }
552  if (check_error(ConstantInformation::read_geometry(file, tempgeo), "geometry"))
553  {
554  continue;
555  }
556  ret.geometry[filename] = std::move(tempgeo);
557  output_loading_message("geometry");
558  }
559  else if (file.extension() == ".cellstate")
560  {
561  if (!flo.load_cell_state || !can_load_events)
562  {
563  continue;
564  }
566  if (check_error(EventInformation::read_cell_state(file, tempcellstate), "cell state"))
567  {
568  continue;
569  }
570  ret.cell_state[filename] = std::move(tempcellstate);
571  output_loading_message("cell state");
572  if ((ret.cluster_info.count(filename) > 0 || !flo.load_cluster_info) &&
573  (ret.cell_info.count(filename) > 0 || !flo.load_cell_info))
574  {
575  ++event_count;
576  }
577  }
578  else if (file.extension() == ".cellinfo")
579  {
580  if (!flo.load_cell_info || !can_load_events)
581  {
582  continue;
583  }
585  if (check_error(EventInformation::read_cell_info(file, tempcellinfo), "cell info"))
586  {
587  continue;
588  }
589  ret.cell_info[filename] = std::move(tempcellinfo);
590  output_loading_message("cell info");
591  if ((ret.cluster_info.count(filename) > 0 || !flo.load_cluster_info) &&
592  (ret.cell_state.count(filename) > 0 || !flo.load_cell_state))
593  {
594  ++event_count;
595  }
596  }
597  else if (file.extension() == ".clusterinfo")
598  {
599  if (!flo.load_cluster_info || !can_load_events)
600  {
601  continue;
602  }
604  if (check_error(EventInformation::read_cluster_info(file, tempclu), "cluster info"))
605  {
606  continue;
607  }
608  ret.cluster_info[filename] = std::move(tempclu);
609  output_loading_message("cluster info");
610  if ((ret.cell_state.count(filename) > 0 || !flo.load_cell_state) &&
611  (ret.cell_info.count(filename) > 0 || !flo.load_cell_info))
612  {
613  ++event_count;
614  }
615  }
616  else if (file.extension() == ".noise")
617  {
618  if (!flo.load_noise)
619  {
620  continue;
621  }
623  if (check_error(ConstantInformation::read_noise(file, tempnois), "noise"))
624  {
625  continue;
626  }
627  ret.noise[filename] = std::move(tempnois);
628  output_loading_message("noise");
629  }
630  }
631  return ret;
632  }
633 
635  int max_events = -1,
637  const bool output_messages = true)
638  {
639  return load_folder_filter([&](const std::string &)
640  {
641  return false;
642  },
643  folder, max_events, flo, output_messages);
644  }
645 
646 };
647 
648 
649 #endif //CALORECGPU_STANDALONEDATAIO_H
StandaloneDataIO::build_filename
static std::string build_filename(const std::string &prefix, const std::string &text, const std::string &suffix, const std::string &ext)
Definition: StandaloneDataIO.h:273
StandaloneDataIO::save_constants_to_folder
static ErrorState save_constants_to_folder(const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const std::string &prefix="", const std::string &suffix="", const bool output_errors=true)
Definition: StandaloneDataIO.h:295
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
StandaloneDataIO::ErrorState::WriteError
@ WriteError
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
StandaloneDataIO::EventInformation::write_cell_info
static ErrorState write_cell_info(std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const bool report=false)
Definition: StandaloneDataIO.h:202
CaloRecGPU::Helpers::SimpleHolder
Holds one objects of type \T in memory context Context.
Definition: Calorimeter/CaloRecGPU/CaloRecGPU/Helpers.h:1070
StandaloneDataIO::FolderLoadOptions::load_noise
bool load_noise
Definition: StandaloneDataIO.h:469
StandaloneDataIO::save_event_to_folder
static ErrorState save_event_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > &clusters, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
Definition: StandaloneDataIO.h:323
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
checkTP.report
report
Definition: checkTP.py:127
StandaloneDataIO::ConstantInformation
Definition: StandaloneDataIO.h:42
StandaloneDataIO
Definition: StandaloneDataIO.h:23
StandaloneDataIO::EventInformation::read_cluster_info
static ErrorState read_cluster_info(const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > &clusters, const bool report=false)
Definition: StandaloneDataIO.h:115
StandaloneDataIO::ConstantInformation::read_noise
static ErrorState read_noise(const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const bool report=false)
Definition: StandaloneDataIO.h:62
StandaloneDataIO::FolderLoadOptions::None
static constexpr FolderLoadOptions None()
Definition: StandaloneDataIO.h:471
StandaloneDataIO::FolderLoad::cluster_info
std::map< std::string, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > > cluster_info
Definition: StandaloneDataIO.h:453
python.TrigInDetArtSteps.max_events
max_events
Definition: TrigInDetArtSteps.py:30
StandaloneDataIO::ErrorState::OK
@ OK
StandaloneDataIO::EventInformation::write_cell_state
static ErrorState write_cell_state(std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const bool report=false)
Definition: StandaloneDataIO.h:218
StandaloneDataIO::load_folder
static FolderLoad load_folder(const std::filesystem::path &folder, int max_events=-1, const FolderLoadOptions &flo=FolderLoadOptions::None(), const bool output_messages=true)
Definition: StandaloneDataIO.h:634
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
file
TFile * file
Definition: tile_monitor.h:29
MakeFileForMJB.ext
string ext
Definition: Moriond2016/MakeFileForMJB.py:41
StandaloneDataIO::FolderLoadOptions::load_cluster_info
bool load_cluster_info
Definition: StandaloneDataIO.h:465
StandaloneDataIO::FolderLoad::cell_state
std::map< std::string, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > > cell_state
Definition: StandaloneDataIO.h:455
StandaloneDataIO::load_folder_filter
static FolderLoad load_folder_filter(F &&filter_function, const std::filesystem::path &folder, int max_events=-1, const FolderLoadOptions &flo=FolderLoadOptions::None(), const bool output_messages=true)
Definition: StandaloneDataIO.h:489
StandaloneDataIO::EventInformation::write_cluster_info
static ErrorState write_cluster_info(std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > &clusters, const bool report=false)
Definition: StandaloneDataIO.h:179
StandaloneDataIO::FolderLoadOptions::load_cell_state
bool load_cell_state
Definition: StandaloneDataIO.h:466
StandaloneDataIO::ConstantInformation::read_geometry
static ErrorState read_geometry(const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const bool report=false)
Definition: StandaloneDataIO.h:47
StandaloneDataIO::ErrorState
ErrorState
Definition: StandaloneDataIO.h:25
StandaloneDataIO::FolderLoad
Definition: StandaloneDataIO.h:450
StandaloneDataIO::build_filename
static std::string build_filename(const std::string &prefix, const size_t event_number, const std::string &suffix, const std::string &ext, const unsigned int num_width=9)
Definition: StandaloneDataIO.h:282
StandaloneDataIO::save_cell_state_to_folder
static ErrorState save_cell_state_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
Definition: StandaloneDataIO.h:362
StandaloneDataIO::prepare_folder_for_output
static ErrorState prepare_folder_for_output(const std::filesystem::path &folder, const bool output_errors=true)
Definition: StandaloneDataIO.h:264
StandaloneDataIO::FolderLoad::geometry
std::map< std::string, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > > geometry
Definition: StandaloneDataIO.h:451
StandaloneDataIO::FolderLoadOptions::load_geometry
bool load_geometry
Definition: StandaloneDataIO.h:468
StandaloneDataIO::EventInformation::read_cell_info
static ErrorState read_cell_info(const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const bool report=false)
Definition: StandaloneDataIO.h:149
StandaloneDataIO::create_or_check_folder
static bool create_or_check_folder(const std::filesystem::path &folder, const bool output_errors=true)
Definition: StandaloneDataIO.h:238
StandaloneDataIO::FolderLoad::cell_info
std::map< std::string, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > > cell_info
Definition: StandaloneDataIO.h:454
StandaloneDataIO::FolderLoad::noise
std::map< std::string, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > > noise
Definition: StandaloneDataIO.h:452
StandaloneDataIO::save_cell_info_to_folder
static ErrorState save_cell_info_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellInfoArr > &cell_info, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
Definition: StandaloneDataIO.h:391
StandaloneDataIO::ConstantInformation::write_noise
static ErrorState write_noise(std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellNoiseArr > &noise, const bool report=false)
Definition: StandaloneDataIO.h:93
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
StandaloneDataIO::EventInformation
Definition: StandaloneDataIO.h:111
StandaloneDataIO::ErrorState::ReadError
@ ReadError
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
StandaloneDataIO::EventInformation::read_cell_state
static ErrorState read_cell_state(const std::filesystem::path &file, CaloRecGPU::Helpers::CPU_object< CaloRecGPU::CellStateArr > &cell_state, const bool report=false)
Definition: StandaloneDataIO.h:164
CaloRecGPU::NMaxClusters
constexpr int NMaxClusters
Definition: BaseDefinitions.h:28
CUDAFriendlyClasses.h
F
#define F(x, y, z)
Definition: MD5.cxx:112
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
StandaloneDataIO::save_clusters_to_folder
static ErrorState save_clusters_to_folder(const size_t event_number, const std::filesystem::path &folder, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::ClusterInfoArr > &clusters, const std::string &prefix="", const std::string &suffix="", const unsigned int num_width=9, const bool output_errors=true)
Definition: StandaloneDataIO.h:420
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
StandaloneDataIO::FolderLoadOptions::All
static constexpr FolderLoadOptions All()
Definition: StandaloneDataIO.h:477
StandaloneDataIO::FolderLoadOptions::load_cell_info
bool load_cell_info
Definition: StandaloneDataIO.h:467
str
Definition: BTagTrackIpAccessor.cxx:11
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
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
StandaloneDataIO::FolderLoadOptions
Definition: StandaloneDataIO.h:464
Helpers.h
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
StandaloneDataIO::ConstantInformation::write_geometry
static ErrorState write_geometry(std::filesystem::path file, const CaloRecGPU::Helpers::CPU_object< CaloRecGPU::GeometryArr > &geo, const bool report=false)
Definition: StandaloneDataIO.h:77