Geant4  10.02.p02
G4ParameterManager.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: G4ParameterManager.hh 91012 2015-06-15 10:38:07Z ihrivnac $
27 
28 // The common implementation of analysis manager classes.
29 
30 // Author: Ivana Hrivnacova, 07/09/2015 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4ParameterManager_h
33 #define G4ParameterManager_h 1
34 
35 #include "G4Parameter.hh"
37 #include "globals.hh"
38 
39 #include <map>
40 #include <vector>
41 
43 class G4VParameter;
44 
46 {
47  public:
48  G4ParameterManager(G4bool isMaster = true);
49  virtual ~G4ParameterManager();
50 
51  // static methods
52  static G4ParameterManager* Instance();
53 
54  // Methods
55 
56  // Requirements for parameter type:
57  // Must have defined operators: +, ==, +=, *=
58  template <typename T>
59  void CreateParameter(const G4String& name, T value,
61 
62  template <typename T>
63  void RegisterParameter(G4Parameter<T>& parameter);
64 
65  template <typename T>
66  G4Parameter<T>* GetParameter(const G4String& name, G4bool warn = true) const;
67 
68  // Handling user defined parameters
69  void RegisterParameter(G4VParameter* parameter);
70  G4VParameter* GetParameter(const G4String& name, G4bool warn = true) const;
71 
72 
73  // Iterators not (yet) provided
74 
75  // Methods for merging
76  //G4bool MergeImpl(tools::histo::hmpi* hmpi);
77  void Merge();
78  void Reset();
79 
80  private:
81  // static data members
84 
85  // data members
87  std::map<G4String, G4VParameter*> fMap;
88  std::vector<G4VParameter*> fParametersToDelete;
89  };
90 
91 #include "G4ParameterManager.icc"
92 
93 #endif
94 
G4String name
Definition: TRTMaterials.hh:40
static G4ParameterManager * fgMasterInstance
static G4ParameterManager * Instance()
#define G4ThreadLocal
Definition: tls.hh:89
std::vector< G4VParameter * > fParametersToDelete
const G4AnalysisManagerState fState
void CreateParameter(const G4String &name, T value, G4MergeMode mergeMode=G4MergeMode::kAddition)
bool G4bool
Definition: G4Types.hh:79
std::map< G4String, G4VParameter * > fMap
static G4ThreadLocal G4ParameterManager * fgInstance
G4MergeMode
Definition: G4MergeMode.hh:37
G4Parameter< T > * GetParameter(const G4String &name, G4bool warn=true) const
G4ParameterManager(G4bool isMaster=true)
void RegisterParameter(G4Parameter< T > &parameter)