File indexing completed on 2026-11-07 10:20:32
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010 #include <string>
0011 #include <lardataobj/Simulation/SimEnergyDeposit.h>
0012
0013 #include "corecel/Macros.hh"
0014 #include "corecel/Types.hh"
0015 #include "corecel/cont/Array.hh" // IWYU pragma: keep
0016
0017 #include "SimEnergyDepositData.hh"
0018
0019 class TTree;
0020 class TFile;
0021 class TDirectory;
0022
0023 namespace celeritas
0024 {
0025
0026
0027
0028
0029
0030
0031 class LarDataReader
0032 {
0033 public:
0034
0035
0036 using VecSimEdep = std::vector<sim::SimEnergyDeposit>;
0037 using VecOpDetCenter = std::vector<Real3>;
0038
0039
0040 public:
0041
0042 explicit LarDataReader(std::string name);
0043 ~LarDataReader();
0044 CELER_DELETE_COPY_MOVE(LarDataReader);
0045
0046
0047 size_type num_events() const;
0048
0049
0050 VecSimEdep read_event(size_type event_id) const;
0051
0052
0053 std::string detector_name() const;
0054
0055
0056 VecOpDetCenter optical_detector_centers() const;
0057
0058
0059
0060
0061 char const* data_dir_name() const { return "data"; }
0062
0063
0064 char const* detector_info_tree_name() const { return "detector_info"; }
0065
0066
0067 char const* optical_detectors_tree_name() const
0068 {
0069 return "optical_detectors";
0070 }
0071
0072
0073 char const* sim_data_tree_name() const { return "sim_energy_deposits"; }
0074
0075
0076 private:
0077 std::unique_ptr<TFile> root_file_;
0078 std::unique_ptr<TDirectory> data_dir_;
0079 std::unique_ptr<TTree> sim_tree_;
0080 SimEnergyDepositData sim_edep_data_;
0081 };
0082
0083
0084 }