File indexing completed on 2025-01-18 09:59:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef G4XmlNtupleManager_h
0032 #define G4XmlNtupleManager_h 1
0033
0034 #include "G4TNtupleManager.hh"
0035 #include "globals.hh"
0036
0037 #include "tools/waxml/ntuple"
0038
0039 #include <memory>
0040 #include <string_view>
0041 #include <utility>
0042 #include <vector>
0043
0044
0045 using XmlNtupleDescription = G4TNtupleDescription<tools::waxml::ntuple, std::ofstream>;
0046
0047 class G4XmlFileManager;
0048
0049 class G4XmlNtupleManager : public G4TNtupleManager<tools::waxml::ntuple,
0050 std::ofstream>
0051 {
0052 friend class G4XmlAnalysisManager;
0053 friend class G4XmlNtupleFileManager;
0054
0055 public:
0056 explicit G4XmlNtupleManager(const G4AnalysisManagerState& state);
0057 G4XmlNtupleManager() = delete;
0058 ~G4XmlNtupleManager() override = default;
0059
0060 private:
0061
0062
0063
0064
0065 void SetFileManager(std::shared_ptr<G4XmlFileManager> fileManager);
0066
0067
0068 const std::vector<XmlNtupleDescription*>& GetNtupleDescriptionVector() const;
0069
0070
0071
0072 void CreateTNtupleFromBooking(XmlNtupleDescription* ntupleDescription) final;
0073
0074 void FinishTNtuple(XmlNtupleDescription* ntupleDescription, G4bool fromBooking) final;
0075
0076
0077 static constexpr std::string_view fkClass { "G4XmNtupleManager" };
0078
0079
0080 std::shared_ptr<G4XmlFileManager> fFileManager { nullptr };
0081 };
0082
0083
0084
0085 inline void
0086 G4XmlNtupleManager::SetFileManager(std::shared_ptr<G4XmlFileManager> fileManager)
0087 {
0088 fFileManager = std::move(fileManager);
0089 }
0090
0091 inline const std::vector<G4TNtupleDescription<tools::waxml::ntuple, std::ofstream>*>&
0092 G4XmlNtupleManager::GetNtupleDescriptionVector() const
0093 { return fNtupleDescriptionVector; }
0094
0095
0096 #endif
0097