Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VPhysicsConstructor.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 //
27 // $Id$
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 class header file
32 // Class Description:
33 // This class is an virtual class for constructing
34 // particles and processes. This class objects will be
35 // registered to G4VPhysicsList.
36 //
37 // User must implement following four virtual methods
38 // in his own concrete class derived from this class.
39 //
40 // all necessary particle type will be instantiated
41 // virtual void ConstructParticle();
42 //
43 // all physics processes will be instantiated and
44 // registered to the process manager of each particle type
45 // virtual void ConstructProcess();
46 //
47 // Only one physics constructor can be registered to
48 // Modular Physics List for each "physics_type".
49 // Physics constructors with same "physics_type" can be
50 // replaced by using the method of
51 // G4VModularPhysicsList::ReplacePhysics()
52 //
53 //
54 // -------------------------------------------
55 // History
56 // first version 12 Nov. 2000 by H.Kurashige
57 // Add physicsType 14 Mar. 2011 by H.Kurashige
58 // Add RegisterProcess 1 May 2011 by H.Kurashige
59 // ------------------------------------------------------------
60 #ifndef G4VPhysicsConstructor_h
61 #define G4VPhysicsConstructor_h 1
62 
63 #include "globals.hh"
64 #include "G4ios.hh"
65 #include "G4ParticleTable.hh"
66 #include "G4PhysicsListHelper.hh"
67 
69 {
70  public: // with description
71 
72  G4VPhysicsConstructor(const G4String& ="");
73  G4VPhysicsConstructor(const G4String& name, G4int physics_type);
74  virtual ~G4VPhysicsConstructor();
75 
76  virtual void ConstructParticle()=0;
77  // This method will be invoked in the Construct() method.
78  // each particle type will be instantiated
79 
80  virtual void ConstructProcess()=0;
81  // This method will be invoked in the Construct() method.
82  // each physics process will be instantiated and
83  // registered to the process manager of each particle type
84 
85  inline void SetPhysicsName(const G4String& ="");
86  inline const G4String& GetPhysicsName() const;
87 
88  inline void SetPhysicsType(G4int);
89  inline G4int GetPhysicsType() const;
90 
91  inline void SetVerboseLevel(G4int value);
92  inline G4int GetVerboseLevel() const;
93  // set/get controle flag for output message
94  // 0: Silent
95  // 1: Warning message
96  // 2: More
97  // verbose level is set equal to physics list when registered
98 
99  protected:
100 
101  inline G4bool RegisterProcess(G4VProcess* process,
102  G4ParticleDefinition* particle);
103  // Register a process to the particle type
104  // according to the ordering parameter table
105  // 'true' is returned if the process is registerd successfully
106 
107  protected:
111 
114  // the particle table has the complete List of existing particle types
115 
117 };
118 
119 // Inlined methods
120 
122 {
124 }
125 
127 {
128  return verboseLevel;
129 }
130 
132 {
133  namePhysics = name;
134 }
135 
137 {
138  return namePhysics;
139 }
140 
142 {
143  if (val>0) typePhysics = val;
144 }
145 
147 {
148  return typePhysics;
149 }
150 
151 inline
153  G4ParticleDefinition* particle)
154 {
155  return thePLHelper->RegisterProcess(process, particle);
156 }
157 #endif
158 
159 
160 
161