00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // ------------------------------------------------------------ 00028 // GEANT 4 class header file 00029 // Class Description: 00030 // This class is a helper class for physics lists to register processes 00031 // according to the ordering parameter table 00032 // This class is a singleton 00033 // ------------------------------------------- 00034 // History 00035 // first version 29 Apr. 2011 by H.Kurashige 00036 // ------------------------------------------------------------ 00037 00038 #ifndef G4PhysicsListHelper_h 00039 #define G4PhysicsListHelper_h 1 00040 #include "globals.hh" 00041 #include "G4ios.hh" 00042 #include <vector> 00043 00044 #include "G4ParticleTable.hh" 00045 #include "G4ParticleDefinition.hh" 00046 #include "G4PhysicsListOrderingParameter.hh" 00047 00048 class G4VProcess; 00049 00050 class G4PhysicsListHelper 00051 { 00052 private: 00053 // Hide constructor and destructor 00054 G4PhysicsListHelper(); 00055 virtual ~G4PhysicsListHelper(); 00056 00057 public: // with description 00058 // This method gives the ponter to the physics list helper 00059 static G4PhysicsListHelper* GetPhysicsListHelper(); 00060 00061 //Register a process to the particle type 00062 // according to the ordering parameter table 00063 // 'true' is returned if the process is registerd successfully 00064 G4bool RegisterProcess(G4VProcess* process, 00065 G4ParticleDefinition* particle); 00066 00067 // User must invoke this method in his ConstructProcess() 00068 // implementation in order to insures particle transportation. 00069 void AddTransportation(); 00070 00071 // Set flag for using CoupledTransportation 00072 void UseCoupledTransportation(G4bool vl=true); 00073 00075 public: 00076 // check consistencies of list of particles 00077 void CheckParticleList() const; 00078 00080 public: 00081 // Dump OrdingParameterTable 00082 void DumpOrdingParameterTable(G4int subType = -1) const; 00083 G4PhysicsListOrderingParameter GetOrdingParameter(G4int subType) const; 00084 00085 private: 00086 void ReadOrdingParameterTable(); 00087 void ReadInDefaultOrderingParameter(); 00088 00090 public: // with description 00091 void SetVerboseLevel(G4int value); 00092 G4int GetVerboseLevel() const; 00093 // set/get controle flag for output message 00094 // 0: Silent 00095 // 1: Warning message 00096 // 2: More 00097 00099 private: 00100 static G4PhysicsListHelper* pPLHelper; 00101 00102 // the particle table has the complete List of existing particle types 00103 G4ParticleTable* theParticleTable; 00104 G4ParticleTable::G4PTblDicIterator* theParticleIterator; 00105 00106 G4bool useCoupledTransportation; 00107 G4VProcess* theTransportationProcess; 00108 00109 G4int verboseLevel; 00110 00111 private: 00112 typedef std::vector<G4PhysicsListOrderingParameter> G4OrdParamTable; 00113 G4OrdParamTable* theTable; 00114 G4int sizeOfTable; 00115 G4String ordParamFileName; 00116 }; 00117 00118 00119 inline 00120 void G4PhysicsListHelper::UseCoupledTransportation(G4bool vl) 00121 { 00122 useCoupledTransportation = vl; 00123 } 00124 00125 inline 00126 void G4PhysicsListHelper::SetVerboseLevel(G4int value) 00127 { 00128 verboseLevel = value; 00129 } 00130 00131 inline 00132 G4int G4PhysicsListHelper::GetVerboseLevel() const 00133 { 00134 return verboseLevel; 00135 } 00136 00137 00138 #endif 00139