1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
class G4VUserPhysicsList
{
public:
G4VUserPhysicsList();
virtual ~G4VUserPhysicsList();
// copy constructor and assignment operator
G4VUserPhysicsList(const G4VUserPhysicsList&);
G4VUserPhysicsList & operator=(const G4VUserPhysicsList&);
public:
virtual void ConstructParticle() = 0;
void Construct();
virtual void ConstructProcess() = 0;
protected:
void AddTransportation();
G4bool RegisterProcess(G4VProcess* process,
G4ParticleDefinition* particle);
public:
void UseCoupledTransportation(G4bool vl=true);
/////////////////////////////////////////////////////////////////
public:
virtual void SetCuts();
public:
void SetDefaultCutValue(G4double newCutValue);
G4double GetDefaultCutValue() const;
/////////////////////////////////////////////////////////////////////
public: // with description
// Invoke BuildPhysicsTable for all processes for all particles
// In case of "Retrieve" flag is ON, PhysicsTable will be
// retrieved from files
void BuildPhysicsTable();
// do PreparePhysicsTable for specified particle type
void PreparePhysicsTable(G4ParticleDefinition* );
// do BuildPhysicsTable for specified particle type
void BuildPhysicsTable(G4ParticleDefinition* );
// Store PhysicsTable together with both material and cut value
// information in files under the specified directory.
// (return true if files are sucessfully created)
G4bool StorePhysicsTable(const G4String& directory = ".");
// Return true if "Retrieve" flag is ON.
// (i.e. PhysicsTable will be retrieved from files)
G4bool IsPhysicsTableRetrieved() const;
G4bool IsStoredInAscii() const;
// Get directory path for physics table files.
const G4String& GetPhysicsTableDirectory() const;
// Set "Retrieve" flag
// Directory path can be set together.
// Null string (default) means directory is not changed
// from the current value
void SetPhysicsTableRetrieved(const G4String& directory = "");
void SetStoredInAscii();
// Reset "Retrieve" flag
void ResetPhysicsTableRetrieved();
void ResetStoredInAscii();
///////////////////////////////////////////////////////////////////////
public: // with description
// Print out the List of registered particles types
void DumpList() const;
public: // with description
// Request to print out information of cut values
// Printing will be performed when all tables are made
void DumpCutValuesTable(G4int flag =1);
// The following method actually trigger the print-out requested
// by the above method. This method must be invoked by RunManager
// at the proper moment.
void DumpCutValuesTableIfRequested();
public: // with description
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
// set/get controle flag for output message
// 0: Silent
// 1: Warning message
// 2: More
///////////////////////////////////////////////////////////////////////////
public: // with description
// "SetCutsWithDefault" method invokes default SetCuts method
// Note: Cut values will not be overwriten with this method
// Using default SetCuts method is recommended
// (i.e You do not need to implement SetCuts method)
void SetCutsWithDefault();
// Following are utility methods for SetCuts
// SetCutValue sets a cut value for a particle type for the default region
void SetCutValue(G4double aCut, const G4String& pname);
// GetCutValue sets a cut value for a particle type for the default region
G4double GetCutValue(const G4String& pname) const;
// SetCutValue sets a cut value for a particle type for a region
void SetCutValue(G4double aCut, const G4String& pname, const G4String& rname);
// Invoke SetCuts for specified particle for a region
// If the pointer to the region is NULL, the default region is used
// In case of "Retrieve" flag is ON,
// Cut values will be retrieved from files
void SetParticleCuts(G4double cut,G4ParticleDefinition* particle,G4Region* region=0);
void SetParticleCuts( G4double cut, const G4String& particleName, G4Region* region=0);
// Invoke SetCuts for all particles in a region
void SetCutsForRegion(G4double aCut, const G4String& rname);
// Following are utility methods are obsolete
void ResetCuts();
///////////////////////////////////////////////////////////////////
public:
// Get/SetApplyCuts gets/sets the flag for ApplyCuts
void SetApplyCuts(G4bool value, const G4String& name);
G4bool GetApplyCuts(const G4String& name) const;
///////////////////////////////////////////////////////////////////////////////
protected:
// do BuildPhysicsTable for make the integral schema
void BuildIntegralPhysicsTable(G4VProcess* ,G4ParticleDefinition* );
protected:
// Retrieve PhysicsTable from files for proccess belongng the particle.
// Normal BuildPhysics procedure of processes will be invoked,
// if it fails (in case of Process's RetrievePhysicsTable returns false)
virtual void RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory,
G4bool ascii = false);
/////////////////////////////////////////////////////////////////
protected:
// adds new ProcessManager to all particles in the Particle Table
// this routine is used in Construct()
void InitializeProcessManager();
public: // with description
// remove and delete ProcessManagers for all particles in tha Particle Table
// this routine is invoked from RunManager
void RemoveProcessManager();
public: // with description
// add process manager for particles created on-the-fly
void AddProcessManager(G4ParticleDefinition* newParticle,
G4ProcessManager* newManager = 0 );
/////////////////////////////////////////////////////////////////
public:
// check consistencies of list of particles
void CheckParticleList();
void DisableCheckParticleList();
////////////////////////////////////////////////////////////////////////
protected:
// the particle table has the complete List of existing particle types
G4ParticleTable* theParticleTable;
//G4ParticleTable::G4PTblDicIterator* theParticleIterator; //AND
protected:
// pointer to G4UserPhysicsListMessenger
//G4UserPhysicsListMessenger* theMessenger;
protected:
G4int verboseLevel;
protected:
// this is the default cut value for all particles
G4double defaultCutValue;
G4bool isSetDefaultCutValue;
protected:
// pointer to ProductionCutsTable
G4ProductionCutsTable* fCutsTable;
// flag to determine physics table will be build from file or not
G4bool fRetrievePhysicsTable;
G4bool fStoredInAscii;
G4bool fIsCheckedForRetrievePhysicsTable;
G4bool fIsRestoredCutValues;
// directory name for physics table files
G4String directoryPhysicsTable;
// flag for displaying the range cuts & energy thresholds
//G4int fDisplayThreshold;
// flag for Physics Table has been built
//G4bool fIsPhysicsTableBuilt;
// flag for CheckParticleList
G4bool fDisableCheckParticleList;
// PhysicsListHelper
//G4PhysicsListHelper* thePLHelper;
private:
enum { FixedStringLengthForStore = 32 };
//Changes for MT
protected:
G4int g4vuplInstanceID;
G4RUN_DLL static G4VUPLManager subInstanceManager;
public:
inline G4int GetInstanceID() const;
static const G4VUPLManager& GetSubInstanceManager();
//Used by Worker threads on the shared instance of
// PL to initialize workers
void InitializeWorker();
};
|