Geant4  10.03
G4XmlNtupleManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4XmlNtupleManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
27 
28 // Manager class for Xml ntuples
29 //
30 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4XmlNtupleManager_h
33 #define G4XmlNtupleManager_h 1
34 
35 #include "G4TNtupleManager.hh"
36 #include "globals.hh"
37 
38 #include "tools/waxml/ntuple"
39 
40 #include <vector>
41 #include <memory>
42 
43 class G4XmlFileManager;
44 
45 class G4XmlNtupleManager : public G4TNtupleManager<tools::waxml::ntuple>
46 {
47  friend class G4XmlAnalysisManager;
48 
49  public:
50  explicit G4XmlNtupleManager(const G4AnalysisManagerState& state);
52 
53  private:
54  // Types alias
55  using NtupleType = tools::waxml::ntuple;
57 
58  // Functions specific to the output type
59  //
60 
61  // Set methods
62  void SetFileManager(std::shared_ptr<G4XmlFileManager> fileManager);
63 
64  // Access to ntuple vector (needed for Write())
65  const std::vector<NtupleDescriptionType*>& GetNtupleDescriptionVector() const;
66 
67  // Methods from the templated base class
68  //
69  virtual void CreateTNtuple(
70  NtupleDescriptionType* ntupleDescription,
71  const G4String& name, const G4String& title) final;
72  virtual void CreateTNtupleFromBooking(
73  NtupleDescriptionType* ntupleDescription) final;
74 
75  virtual void FinishTNtuple(
76  NtupleDescriptionType* ntupleDescription) final;
77 
78  // data members
79  //
80  std::shared_ptr<G4XmlFileManager> fFileManager;
81 };
82 
83 // inline functions
84 
85 inline void
86 G4XmlNtupleManager::SetFileManager(std::shared_ptr<G4XmlFileManager> fileManager)
87 { fFileManager = fileManager; }
88 
89 inline const std::vector<G4TNtupleDescription<tools::waxml::ntuple>*>&
91 { return fNtupleDescriptionVector; }
92 
93 
94 #endif
95 
const std::vector< NtupleDescriptionType * > & GetNtupleDescriptionVector() const
std::vector< G4TNtupleDescription< tools::waxml::ntuple > * > fNtupleDescriptionVector
const char * name(G4int ptype)
virtual void CreateTNtuple(NtupleDescriptionType *ntupleDescription, const G4String &name, const G4String &title) final
void SetFileManager(std::shared_ptr< G4XmlFileManager > fileManager)
std::shared_ptr< G4XmlFileManager > fFileManager
virtual void CreateTNtupleFromBooking(NtupleDescriptionType *ntupleDescription) final
G4XmlNtupleManager(const G4AnalysisManagerState &state)
tools::waxml::ntuple NtupleType
virtual void FinishTNtuple(NtupleDescriptionType *ntupleDescription) final