Geant4  10.01.p03
G4XmlAnalysisManager.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: G4XmlAnalysisManager.hh 83748 2014-09-12 12:13:37Z gcosmo $
27 
28 // The main manager for Xml analysis.
29 // It delegates most of functions to the object specific managers.
30 
31 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
32 
33 #ifndef G4XmlAnalysisManager_h
34 #define G4XmlAnalysisManager_h 1
35 
36 #include "G4VAnalysisManager.hh"
37 #include "globals.hh"
38 
39 #include "tools/histo/h1d"
40 #include "tools/histo/h2d"
41 #include "tools/histo/h3d"
42 #include "tools/histo/p1d"
43 #include "tools/histo/p2d"
44 #include "tools/waxml/ntuple"
45 
46 
47 class G4XmlFileManager;
48 class G4H1ToolsManager;
49 class G4H2ToolsManager;
50 class G4H3ToolsManager;
51 class G4P1ToolsManager;
52 class G4P2ToolsManager;
53 class G4XmlNtupleManager;
54 
56 {
57  public:
58  G4XmlAnalysisManager(G4bool isMaster = true);
60 
61  // static methods
63 
64  // Access methods
65  tools::histo::h1d* GetH1(G4int id, G4bool warn = true,
66  G4bool onlyIfActive = true) const;
67  tools::histo::h2d* GetH2(G4int id, G4bool warn = true,
68  G4bool onlyIfActive = true) const;
69  tools::histo::h3d* GetH3(G4int id, G4bool warn = true,
70  G4bool onlyIfActive = true) const;
71  tools::histo::p1d* GetP1(G4int id, G4bool warn = true,
72  G4bool onlyIfActive = true) const;
73  tools::histo::p2d* GetP2(G4int id, G4bool warn = true,
74  G4bool onlyIfActive = true) const;
75 
76  tools::waxml::ntuple* GetNtuple() const;
77  tools::waxml::ntuple* GetNtuple(G4int ntupleId) const;
78 
79  // Iterators
80  std::vector<tools::histo::h1d*>::iterator BeginH1();
81  std::vector<tools::histo::h1d*>::iterator EndH1();
82  std::vector<tools::histo::h1d*>::const_iterator BeginConstH1() const;
83  std::vector<tools::histo::h1d*>::const_iterator EndConstH1() const;
84 
85  std::vector<tools::histo::h2d*>::iterator BeginH2();
86  std::vector<tools::histo::h2d*>::iterator EndH2();
87  std::vector<tools::histo::h2d*>::const_iterator BeginConstH2() const;
88  std::vector<tools::histo::h2d*>::const_iterator EndConstH2() const;
89 
90  std::vector<tools::histo::h3d*>::iterator BeginH3();
91  std::vector<tools::histo::h3d*>::iterator EndH3();
92  std::vector<tools::histo::h3d*>::const_iterator BeginConstH3() const;
93  std::vector<tools::histo::h3d*>::const_iterator EndConstH3() const;
94 
95  std::vector<tools::histo::p1d*>::iterator BeginP1();
96  std::vector<tools::histo::p1d*>::iterator EndP1();
97  std::vector<tools::histo::p1d*>::const_iterator BeginConstP1() const;
98  std::vector<tools::histo::p1d*>::const_iterator EndConstP1() const;
99 
100  std::vector<tools::histo::p2d*>::iterator BeginP2();
101  std::vector<tools::histo::p2d*>::iterator EndP2();
102  std::vector<tools::histo::p2d*>::const_iterator BeginConstP2() const;
103  std::vector<tools::histo::p2d*>::const_iterator EndConstP2() const;
104 
105  std::vector<tools::waxml::ntuple*>::iterator BeginNtuple();
106  std::vector<tools::waxml::ntuple*>::iterator EndNtuple();
107  std::vector<tools::waxml::ntuple*>::const_iterator BeginConstNtuple() const;
108  std::vector<tools::waxml::ntuple*>::const_iterator EndConstNtuple() const;
109 
110  protected:
111  // virtual methods from base class
112  virtual G4bool OpenFileImpl(const G4String& fileName);
113  virtual G4bool WriteImpl();
114  virtual G4bool CloseFileImpl();
115 
116  private:
117  // static data members
120 
121  // methods
122  G4bool WriteH1();
123  G4bool WriteH2();
124  G4bool WriteH3();
125  G4bool WriteP1();
126  G4bool WriteP2();
129  G4bool Reset();
130 
131  // data members
139 
140 };
141 
142 #include "G4XmlAnalysisManager.icc"
143 
144 #endif
145 
static G4XmlAnalysisManager * fgMasterInstance
std::vector< tools::histo::p1d * >::const_iterator BeginConstP1() const
std::vector< tools::histo::p1d * >::iterator BeginP1()
G4XmlFileManager * fFileManager
virtual G4bool CloseFileImpl()
std::vector< tools::histo::p1d * >::iterator EndP1()
std::vector< tools::histo::p2d * >::iterator EndP2()
std::vector< tools::histo::p2d * >::iterator BeginP2()
std::vector< tools::waxml::ntuple * >::iterator EndNtuple()
std::vector< tools::histo::h3d * >::iterator EndH3()
G4H3ToolsManager * fH3Manager
static G4XmlAnalysisManager * Instance()
std::vector< tools::waxml::ntuple * >::const_iterator EndConstNtuple() const
G4H1ToolsManager * fH1Manager
std::vector< tools::histo::p2d * >::const_iterator EndConstP2() const
G4H2ToolsManager * fH2Manager
G4XmlAnalysisManager(G4bool isMaster=true)
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
static G4ThreadLocal G4XmlAnalysisManager * fgInstance
tools::waxml::ntuple * GetNtuple() const
std::vector< tools::histo::h3d * >::const_iterator BeginConstH3() const
virtual G4bool OpenFileImpl(const G4String &fileName)
G4P2ToolsManager * fP2Manager
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
bool G4bool
Definition: G4Types.hh:79
std::vector< tools::histo::h1d * >::const_iterator EndConstH1() const
std::vector< tools::histo::h1d * >::iterator BeginH1()
std::vector< tools::histo::h2d * >::iterator BeginH2()
tools::histo::p1d * GetP1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
std::vector< tools::waxml::ntuple * >::const_iterator BeginConstNtuple() const
std::vector< tools::histo::p2d * >::const_iterator BeginConstP2() const
G4XmlNtupleManager * fNtupleManager
G4P1ToolsManager * fP1Manager
std::vector< tools::histo::h2d * >::iterator EndH2()
std::vector< tools::histo::h2d * >::const_iterator BeginConstH2() const
tools::histo::h2d * GetH2(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
tools::histo::h3d * GetH3(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
std::vector< tools::histo::h3d * >::const_iterator EndConstH3() const
tools::histo::p2d * GetP2(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
std::vector< tools::histo::h1d * >::iterator EndH1()
std::vector< tools::histo::p1d * >::const_iterator EndConstP1() const
std::vector< tools::waxml::ntuple * >::iterator BeginNtuple()
std::vector< tools::histo::h3d * >::iterator BeginH3()
std::vector< tools::histo::h1d * >::const_iterator BeginConstH1() const
std::vector< tools::histo::h2d * >::const_iterator EndConstH2() const