| [828] | 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: G4VPhysicsConstructor.hh,v 1.4 2006/06/29 21:13:32 gunter Exp $
|
|---|
| [850] | 28 | // GEANT4 tag $Name: HEAD $
|
|---|
| [828] | 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // ------------------------------------------------------------
|
|---|
| 32 | // GEANT 4 class header file
|
|---|
| 33 | // Class Description:
|
|---|
| 34 | // This class is an virtual class for constructing
|
|---|
| 35 | // particles and processes. This class objects will be
|
|---|
| 36 | // registered to G4VPhysicsList.
|
|---|
| 37 | //
|
|---|
| 38 | // User must implement following four virtual methods
|
|---|
| 39 | // in his own concrete class derived from this class.
|
|---|
| 40 | //
|
|---|
| 41 | // all necessary particle type will be instantiated
|
|---|
| 42 | // virtual void ConstructParticle();
|
|---|
| 43 | //
|
|---|
| 44 | // all physics processes will be instantiated and
|
|---|
| 45 | // registered to the process manager of each particle type
|
|---|
| 46 | // virtual void ConstructProcess();
|
|---|
| 47 | //
|
|---|
| 48 | //
|
|---|
| 49 | // -------------------------------------------
|
|---|
| 50 | // History
|
|---|
| 51 | // first version 12 Nov. 2000 by H.Kurashige
|
|---|
| 52 | // ------------------------------------------------------------
|
|---|
| 53 | #ifndef G4VPhysicsConstructor_h
|
|---|
| 54 | #define G4VPhysicsConstructor_h 1
|
|---|
| 55 |
|
|---|
| 56 | #include "globals.hh"
|
|---|
| 57 | #include "G4ios.hh"
|
|---|
| 58 | #include "G4ParticleTable.hh"
|
|---|
| 59 | class G4VPhysicsConstructor
|
|---|
| 60 | {
|
|---|
| 61 | public:
|
|---|
| 62 | G4VPhysicsConstructor(const G4String& ="");
|
|---|
| 63 | virtual ~G4VPhysicsConstructor(){};
|
|---|
| 64 |
|
|---|
| 65 | public: // with description
|
|---|
| 66 | // This method will be invoked in the Construct() method.
|
|---|
| 67 | // each particle type will be instantiated
|
|---|
| 68 | virtual void ConstructParticle()=0;
|
|---|
| 69 |
|
|---|
| 70 | // This method will be invoked in the Construct() method.
|
|---|
| 71 | // each physics process will be instantiated and
|
|---|
| 72 | // registered to the process manager of each particle type
|
|---|
| 73 | virtual void ConstructProcess()=0;
|
|---|
| 74 |
|
|---|
| 75 | public: // with description
|
|---|
| 76 | void SetPhysicsName(const G4String& ="");
|
|---|
| 77 | const G4String& GetPhysicsName() const;
|
|---|
| 78 |
|
|---|
| 79 | void SetVerboseLevel(G4int value);
|
|---|
| 80 | G4int GetVerboseLevel() const;
|
|---|
| 81 | // set/get controle flag for output message
|
|---|
| 82 | // 0: Silent
|
|---|
| 83 | // 1: Warning message
|
|---|
| 84 | // 2: More
|
|---|
| 85 | // verbose level is set equal to physics list when registered
|
|---|
| 86 |
|
|---|
| 87 | protected:
|
|---|
| 88 | G4int verboseLevel;
|
|---|
| 89 | G4String namePhysics;
|
|---|
| 90 |
|
|---|
| 91 | protected:
|
|---|
| 92 | // the particle table has the complete List of existing particle types
|
|---|
| 93 | G4ParticleTable* theParticleTable;
|
|---|
| 94 | G4ParticleTable::G4PTblDicIterator* theParticleIterator;
|
|---|
| 95 |
|
|---|
| 96 | };
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 | inline
|
|---|
| 100 | G4VPhysicsConstructor::G4VPhysicsConstructor(const G4String& name)
|
|---|
| 101 | :verboseLevel(0),namePhysics(name)
|
|---|
| 102 | {
|
|---|
| 103 | // pointer to the particle table
|
|---|
| 104 | theParticleTable = G4ParticleTable::GetParticleTable();
|
|---|
| 105 | theParticleIterator = theParticleTable->GetIterator();
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | inline void G4VPhysicsConstructor::SetVerboseLevel(G4int value)
|
|---|
| 109 | {
|
|---|
| 110 | verboseLevel = value;
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|
| 113 | inline G4int G4VPhysicsConstructor::GetVerboseLevel() const
|
|---|
| 114 | {
|
|---|
| 115 | return verboseLevel;
|
|---|
| 116 | }
|
|---|
| 117 |
|
|---|
| 118 | inline void G4VPhysicsConstructor::SetPhysicsName(const G4String& name)
|
|---|
| 119 | {
|
|---|
| 120 | namePhysics = name;
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | inline const G4String& G4VPhysicsConstructor::GetPhysicsName() const
|
|---|
| 124 | {
|
|---|
| 125 | return namePhysics;
|
|---|
| 126 | }
|
|---|
| 127 |
|
|---|
| 128 | #endif
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|