Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4Hdf5AnalysisManager.hh
이 파일의 문서화 페이지로 가기
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$
27 
28 // The main manager for Hdf5 analysis.
29 // It delegates most of functions to the object specific managers.
30 
31 // Author: Ivana Hrivnacova, 20/07/2017 (ivana@ipno.in2p3.fr)
32 
33 #ifndef G4Hdf5AnalysisManager_h
34 #define G4Hdf5AnalysisManager_h 1
35 
37 #include "globals.hh"
38 
39 #include "tools/hdf5/ntuple"
40 
41 #include <memory>
42 
43 class G4Hdf5FileManager;
45 
47 {
48  public:
49  explicit G4Hdf5AnalysisManager(G4bool isMaster = true);
51 
52  // static methods
54  static G4bool IsInstance();
55 
56  // Access methods
58  tools::hdf5::ntuple* GetNtuple(G4int ntupleId) const;
59 
60  // Iterators
61  std::vector<tools::hdf5::ntuple*>::iterator BeginNtuple();
62  std::vector<tools::hdf5::ntuple*>::iterator EndNtuple();
63  std::vector<tools::hdf5::ntuple*>::const_iterator BeginConstNtuple() const;
64  std::vector<tools::hdf5::ntuple*>::const_iterator EndConstNtuple() const;
65 
66  protected:
67  // virtual methods from base class
68  virtual G4bool OpenFileImpl(const G4String& fileName) final;
69  virtual G4bool WriteImpl() final;
70  virtual G4bool CloseFileImpl() final;
71  virtual G4bool IsOpenFileImpl() const final;
72 
73  private:
74  // constants
75  static constexpr unsigned int fgkDefaultBasketSize = 32000;
76 
77  // static data members
80 
81  // methods
82  template <typename T>
83  G4bool WriteHn(const std::vector<T*>& htVector,
84  const std::vector<G4HnInformation*>& hnVector,
85  const G4String& directoryName,
86  const G4String& hnType);
87  template <typename T>
88  G4bool WritePn(const std::vector<T*>& htVector,
89  const std::vector<G4HnInformation*>& hnVector,
90  const G4String& directoryName,
91  const G4String& hnType);
93  G4bool WriteH1();
94  G4bool WriteH2();
95  G4bool WriteH3();
96  G4bool WriteP1();
97  G4bool WriteP2();
98  G4bool Reset();
99 
100  // data members
102  std::shared_ptr<G4Hdf5FileManager> fFileManager;
103 };
104 
105 #include "G4Hdf5AnalysisManager.icc"
106 
107 #endif
108 
std::vector< tools::hdf5::ntuple * >::const_iterator EndConstNtuple() const
virtual G4bool OpenFileImpl(const G4String &fileName) final
G4Hdf5NtupleManager * fNtupleManager
TTree * ntuple
std::vector< tools::hdf5::ntuple * >::const_iterator BeginConstNtuple() const
#define G4ThreadLocal
Definition: tls.hh:69
virtual G4bool CloseFileImpl() final
static constexpr unsigned int fgkDefaultBasketSize
bool G4bool
Definition: G4Types.hh:79
G4Hdf5AnalysisManager(G4bool isMaster=true)
std::shared_ptr< G4Hdf5FileManager > fFileManager
int G4int
Definition: G4Types.hh:78
G4bool WriteHn(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, const G4String &directoryName, const G4String &hnType)
tools::hdf5::ntuple * GetNtuple() const
static G4Hdf5AnalysisManager * fgMasterInstance
virtual G4bool WriteImpl() final
std::vector< tools::hdf5::ntuple * >::iterator BeginNtuple()
static G4Hdf5AnalysisManager * Instance()
virtual G4bool IsOpenFileImpl() const final
std::vector< tools::hdf5::ntuple * >::iterator EndNtuple()
G4bool WritePn(const std::vector< T * > &htVector, const std::vector< G4HnInformation * > &hnVector, const G4String &directoryName, const G4String &hnType)
static G4ThreadLocal G4Hdf5AnalysisManager * fgInstance