53 : useCoupledTransportation(false),
54 theTransportationProcess(0),
102 bool isPositron =
false;
103 bool isGamma =
false;
104 bool isProton =
false;
105 bool isGenericIon =
false;
106 bool isAnyIon =
false;
107 bool isAnyChargedBaryon =
false;
108 bool isEmProc =
false;
118 for (
int idx=0; idx<list->
size(); idx++){
124 if ( name ==
"e-") isElectron =
true;
125 else if ( name ==
"e+") isPositron =
true;
126 else if ( name ==
"gamma") isGamma =
true;
127 else if ( name ==
"GenericIon") isGenericIon =
true;
128 else if ( name ==
"proton") isProton =
true;
131 if ( particle->
GetPDGCharge() != 0.0 ) isAnyChargedBaryon =
true;
135 if (!isEmProc)
return;
140 bool isEmBasic = isElectron || isPositron || isGamma;
141 bool isMissingEmBasic = !isElectron || !isPositron || !isGamma;
142 if (isEmBasic && isMissingEmBasic) {
144 if (!isElectron) missingName +=
"e- ";
145 if (!isPositron) missingName +=
"e+ ";
146 if (!isGamma) missingName +=
"gamma ";
150 G4cout <<
"G4PhysicsListHelper::CheckParticleList: " 151 << missingName <<
" do not exist " <<
G4endl;
152 G4cout <<
" These particle are necessary for basic EM processes" 156 G4Exception(
"G4PhysicsListHelper::CheckParticleList",
158 "Missing EM basic particle");
164 if (!isProton && isAnyChargedBaryon) {
169 G4cout <<
"G4PhysicsListHelper::CheckParticleList: " 170 << missingName <<
" does not exist "<<
G4endl;
171 G4cout <<
" Proton is necessary for EM baryon processes" <<
G4endl;
174 missingName +=
" should be created ";
175 G4Exception(
"G4PhysicsListHelper::CheckParticleList",
183 if (!isGenericIon && isAnyIon) {
188 G4cout <<
"G4PhysicsListHelper::CheckParticleList: " 189 << missingName <<
" does not exist "<<
G4endl;
190 G4cout <<
" GenericIon should be created if any ion is necessary" <<
G4endl;
193 G4Exception(
"G4PhysicsListHelper::CheckParticleList",
195 "Missing GenericIon");
209 G4int verboseLevelTransport = 0;
213 G4cout <<
"G4PhysicsListHelper::AddTransportation() "<<
G4endl;
225 G4cout <<
" G4PhysicsListHelper::AddTransportation()" 226 <<
"--- G4CoupledTransportation is used " 241 if ( pmanager == 0) {
245 G4cout <<
"G4PhysicsListHelper::AddTransportation " 246 <<
" : No Process Manager for " 250 G4Exception(
"G4PhysicsListHelper::AddTransportation",
252 "No process manager");
270 G4bool readInFile =
false;
273 if( getenv(
"G4ORDPARAMTABLE") ){
277 G4cout <<
"G4PhysicsListHelper::ReadOrdingParameterTable :" 288 G4cout <<
"G4PhysicsListHelper::ReadOrdingParameterTable " 292 G4Exception(
"G4PhysicsListHelper::ReadOrdingParameterTable",
294 "Fail to open ordering paramter table ");
330 G4cout <<
"G4PhysicsListHelper::ReadOrdingParameterTable " 334 G4Exception(
"G4PhysicsListHelper::ReadOrdingParameterTable",
336 "The ordering parameter table is empty ");
350 G4cout <<
"G4PhysicsListHelper::DumpOrdingParameterTable " 357 G4cout <<
"G4PhysicsListHelper::DumpOrdingParameterTable : " 360 <<
" ProcessType" <<
" SubType" 361 <<
" AtRest" <<
" AlongStep" <<
" PostStep" 362 <<
" Duplicable" <<
G4endl;
369 << std::setw(15) << tmp->
ordering[0]
370 << std::setw(15) << tmp->
ordering[1]
371 << std::setw(15) << tmp->
ordering[2];
389 G4cout <<
"G4PhysicsListHelper::GetOrderingParameter : " 419 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 424 G4Exception(
"G4PhysicsListHelper::RegisterPorcess",
426 "No Ordering Parameter Table");
436 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 437 << pName <<
" Process Type = " << pType
438 <<
" SubType = "<< pSubType
445 if ((pType <1)||(pSubType<1)) {
448 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 450 <<
" has illegal Process Type = " << pType
451 <<
" SubType = "<< pSubType <<
G4endl;
454 G4Exception(
"G4PhysicsListHelper::RegisterPorcess",
456 "No Matching process Type/SubType");
462 G4bool duplicable =
false;
477 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 479 <<
" with type/subtype =" 480 << pType <<
"/" << pSubType
481 <<
" is not reigstered in OrdingParameterTable " 485 G4Exception(
"G4PhysicsListHelper::RegisterPorcess",
487 "No Matching process Type/SubType");
493 if ( pManager == 0) {
497 G4cout <<
"G4PhysicsListHelper::RegisterProcess " 498 <<
" : No Process Manager for " 502 G4Exception(
"G4PhysicsListHelper::RegisterProcess ",
504 "No process manager");
510 G4bool duplicated =
false;
512 for (
G4int idx=0; idx<pList->
size(); idx++) {
519 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 521 <<
" with type/subtype =" 522 << pType <<
"/" << pSubType
523 <<
" is has same subType as " 530 G4Exception(
"G4PhysicsListHelper::RegisterPorcess",
532 "Duplication of processes");
535 if (duplicated)
return false;
540 if (code <0)
return false;
543 for(
G4int idx=0; idx<3; idx++){
547 }
else if (ord[idx]==0) {
549 }
else if (ord[idx]<9999) {
557 G4cout <<
"G4PhysicsListHelper::RegisterProcess :" 559 <<
" with type/subtype =" 560 << pType <<
"/" << pSubType
561 <<
" is sucessfully registered with ordering parameters " 562 << ord[0] <<
":" << ord[1] <<
":" << ord[2]
static G4ThreadLocal G4PhysicsListHelper * pPLHelper
G4bool isElectron(G4int ityp)
G4ProcessVector * GetProcessList() const
void ReadOrdingParameterTable()
void SetProcessOrderingToFirst(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
virtual ~G4PhysicsListHelper()
G4bool useCoupledTransportation
const G4String & GetParticleType() const
G4ProcessManager * GetProcessManager() const
static G4RunManagerKernel * GetRunManagerKernel()
G4int GetProcessSubType() const
const G4String & GetProcessName() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfParallelWorld() const
void reset(G4bool ifSkipIon=true)
static G4ScoringManager * GetScoringManagerIfExist()
std::vector< G4PhysicsListOrderingParameter > G4OrdParamTable
void ReadInDefaultOrderingParameter()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4ParticleTable::G4PTblDicIterator * aParticleIterator
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void CheckParticleList() const
G4OrdParamTable * theTable
static G4ParticleTable * GetParticleTable()
void DumpOrdingParameterTable(G4int subType=-1) const
void SetProcessOrderingToLast(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4PhysicsListOrderingParameter GetOrdingParameter(G4int subType) const
G4String ordParamFileName
static G4PhysicsListHelper * GetPhysicsListHelper()
G4ProcessType GetProcessType() const
G4VProcess * theTransportationProcess
G4ParticleTable * theParticleTable
G4double GetPDGCharge() const
G4PTblDicIterator * GetIterator() const