BLPhysics.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BLPHYSICS_HH
00020 #define BLPHYSICS_HH
00021
00022 #include "globals.hh"
00023 #include "G4VUserPhysicsList.hh"
00024 #include "G4ProcessTable.hh"
00025
00026 enum BLSetValue { FORCE_ON, FORCE_OFF, NORMAL };
00027
00028
00029
00030
00031
00032
00033
00034 class BLPhysics {
00035 protected:
00036 bool stochasticsEnabled;
00037 G4double minRangeCut;
00038 public:
00039
00040 BLPhysics() { stochasticsEnabled = true; minRangeCut = 1.0*mm; }
00041
00042
00043 virtual ~BLPhysics() { }
00044
00045
00046
00047
00048
00049 virtual void setDoStochastics(BLSetValue value, G4bool quiet=false) = 0;
00050
00051
00052 virtual G4VUserPhysicsList *getPhysicsList() = 0;
00053
00054
00055
00056 bool getStochasticsEnabled() { return stochasticsEnabled; }
00057
00058
00059 G4double getRangeCut() { return minRangeCut; }
00060
00061
00062 bool isStochasticProcess(G4VProcess *process)
00063 { return isStochasticProcess(process->GetProcessName()); }
00064
00065
00066
00067
00068
00069 bool isStochasticProcess(G4String name) {
00070 if(name.find("Trans") < name.size()) return false;
00071 if(name.find("Ioni") < name.size()) return false;
00072 if(name.find("Limiter") < name.size()) return false;
00073 if(name.find("BLCMD") < name.size()) return false;
00074 return true;
00075 }
00076
00077
00078
00079 void setProcessEnable(G4String pattern, bool onoff) {
00080 G4ProcessTable *pt = G4ProcessTable::GetProcessTable();
00081 std::vector<G4String> &pnv = *pt->GetNameList();
00082 for(unsigned i=0; i<pnv.size(); ++i) {
00083 G4String name = pnv[i];
00084 if(name.find(pattern) >= name.size()) continue;
00085 pt->SetProcessActivation(name,onoff);
00086 }
00087 }
00088 };
00089
00090 #endif // BLPHYSICS_HH