Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PhysListFactory Class Reference

#include <G4PhysListFactory.hh>

Public Member Functions

 G4PhysListFactory ()
 
 ~G4PhysListFactory ()
 
G4VModularPhysicsListGetReferencePhysList (const G4String &)
 
G4VModularPhysicsListReferencePhysList ()
 
G4bool IsReferencePhysList (const G4String &)
 
const std::vector< G4String > & AvailablePhysLists () const
 
const std::vector< G4String > & AvailablePhysListsEM () const
 
void SetVerbose (G4int val)
 

Detailed Description

Definition at line 44 of file G4PhysListFactory.hh.

Constructor & Destructor Documentation

G4PhysListFactory::G4PhysListFactory ( )

Definition at line 74 of file G4PhysListFactory.cc.

75  : defName("FTFP_BERT"),verbose(1)
76 {
77  nlists_hadr = 22;
78  G4String ss[22] = {
79  "FTFP_BERT","FTFP_BERT_TRV","FTFP_BERT_ATL","FTFP_BERT_HP","FTFP_INCLXX",
80  "FTFP_INCLXX_HP","FTF_BIC", "LBE","QBBC",
81  "QGSP_BERT","QGSP_BERT_HP","QGSP_BIC","QGSP_BIC_HP","QGSP_BIC_AllHP",
82  "QGSP_FTFP_BERT","QGSP_INCLXX","QGSP_INCLXX_HP","QGS_BIC",
83  "Shielding","ShieldingLEND","ShieldingM","NuBeam"};
84  for(size_t i=0; i<nlists_hadr; ++i) {
85  listnames_hadr.push_back(ss[i]);
86  }
87 
88  nlists_em = 9;
89  G4String s1[9] = {"","_EMV","_EMX","_EMY","_EMZ","_LIV","_PEN","__GS","__SS"};
90  for(size_t i=0; i<nlists_em; ++i) {
91  listnames_em.push_back(s1[i]);
92  }
93 }
G4PhysListFactory::~G4PhysListFactory ( )

Definition at line 95 of file G4PhysListFactory.cc.

96 {}

Member Function Documentation

const std::vector< G4String > & G4PhysListFactory::AvailablePhysLists ( ) const

Definition at line 228 of file G4PhysListFactory.cc.

229 {
230  return listnames_hadr;
231 }
const std::vector< G4String > & G4PhysListFactory::AvailablePhysListsEM ( ) const

Definition at line 234 of file G4PhysListFactory.cc.

235 {
236  return listnames_em;
237 }
G4VModularPhysicsList * G4PhysListFactory::GetReferencePhysList ( const G4String name)

Definition at line 119 of file G4PhysListFactory.cc.

120 {
121  // analysis on the string
122  size_t n = name.size();
123 
124  // last characters in the string
125  size_t em_opt = 0;
126  G4String em_name = "";
127 
128  // check EM options
129  if(n > 4) {
130  em_name = name.substr(n - 4, 4);
131  for(size_t i=1; i<nlists_em; ++i) {
132  if(listnames_em[i] == em_name) {
133  em_opt = i;
134  n -= 4;
135  break;
136  }
137  }
138  if(0 == em_opt) { em_name = ""; }
139  }
140 
141  // hadronic pHysics List
142  G4String had_name = name.substr(0, n);
143 
144  if(0 < verbose) {
145  G4cout << "G4PhysListFactory::GetReferencePhysList <" << had_name
146  << em_name << "> EMoption= " << em_opt << G4endl;
147  }
149  if(had_name == "FTFP_BERT") {p = new FTFP_BERT(verbose);}
150  else if(had_name == "FTFP_BERT_HP") {p = new FTFP_BERT_HP(verbose);}
151  else if(had_name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV(verbose);}
152  else if(had_name == "FTFP_BERT_ATL") {p = new FTFP_BERT_ATL(verbose);}
153  else if(had_name == "FTFP_INCLXX") {p = new FTFP_INCLXX(verbose);}
154  else if(had_name == "FTFP_INCLXX_HP") {p = new FTFP_INCLXX_HP(verbose);}
155  else if(had_name == "FTF_BIC") {p = new FTF_BIC(verbose);}
156  else if(had_name == "LBE") {p = new LBE();}
157  else if(had_name == "QBBC") {p = new QBBC(verbose);}
158  else if(had_name == "QGSP_BERT") {p = new QGSP_BERT(verbose);}
159  else if(had_name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP(verbose);}
160  else if(had_name == "QGSP_BIC") {p = new QGSP_BIC(verbose);}
161  else if(had_name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP(verbose);}
162  else if(had_name == "QGSP_BIC_AllHP") {p = new QGSP_BIC_AllHP(verbose);}
163  else if(had_name == "QGSP_FTFP_BERT") {p = new QGSP_FTFP_BERT(verbose);}
164  else if(had_name == "QGSP_INCLXX") {p = new QGSP_INCLXX(verbose);}
165  else if(had_name == "QGSP_INCLXX_HP") {p = new QGSP_INCLXX_HP(verbose);}
166  else if(had_name == "QGS_BIC") {p = new QGS_BIC(verbose);}
167  else if(had_name == "Shielding") {p = new Shielding(verbose);}
168  else if(had_name == "ShieldingLEND") {p = new Shielding(verbose,"LEND");}
169  else if(had_name == "ShieldingM") {p = new Shielding(verbose,"HP","M");}
170  else if(had_name == "NuBeam") {p = new NuBeam(verbose);}
171  else {
172  G4cout << "### G4PhysListFactory WARNING: "
173  << "PhysicsList " << had_name << " is not known"
174  << G4endl;
175  }
176  if(p) {
177  G4cout << "<<< Reference Physics List " << had_name
178  << em_name << " is built" << G4endl;
179  G4int ver = p->GetVerboseLevel();
180  p->SetVerboseLevel(0);
181  if(0 < em_opt) {
182  if(1 == em_opt) {
184  } else if(2 == em_opt) {
186  } else if(3 == em_opt) {
188  } else if(4 == em_opt) {
190  } else if(5 == em_opt) {
191  p->ReplacePhysics(new G4EmLivermorePhysics(verbose));
192  } else if(6 == em_opt) {
193  p->ReplacePhysics(new G4EmPenelopePhysics(verbose));
194  } else if(7 == em_opt) {
195  p->ReplacePhysics(new G4EmStandardPhysicsGS(verbose));
196  }
197  }
198  p->SetVerboseLevel(ver);
199  }
200  G4cout << G4endl;
201  return p;
202 }
TQGSP_FTFP_BERT< G4VModularPhysicsList > QGSP_FTFP_BERT
TQGSP_BERT< G4VModularPhysicsList > QGSP_BERT
Definition: QGSP_BERT.hh:63
TQGSP_BIC_HP< G4VModularPhysicsList > QGSP_BIC_HP
Definition: QGSP_BIC_HP.hh:63
TFTFP_BERT_HP< G4VModularPhysicsList > FTFP_BERT_HP
Definition: FTFP_BERT_HP.hh:63
TShielding< G4VModularPhysicsList > Shielding
Definition: Shielding.hh:68
const char * p
Definition: xmltok.h:285
TLBE< G4VModularPhysicsList > LBE
Definition: LBE.hh:123
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
TQGS_BIC< G4VModularPhysicsList > QGS_BIC
Definition: QGS_BIC.hh:63
TFTFP_BERT_TRV< G4VModularPhysicsList > FTFP_BERT_TRV
void SetVerboseLevel(G4int value)
TNuBeam< G4VModularPhysicsList > NuBeam
Definition: NuBeam.hh:64
TQGSP_BIC_AllHP< G4VModularPhysicsList > QGSP_BIC_AllHP
void ReplacePhysics(G4VPhysicsConstructor *)
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
TINCLXXPhysicsListHelper< G4VModularPhysicsList, false, true > FTFP_INCLXX
Definition: FTFP_INCLXX.hh:41
TINCLXXPhysicsListHelper< G4VModularPhysicsList, false, false > QGSP_INCLXX
TINCLXXPhysicsListHelper< G4VModularPhysicsList, true, false > QGSP_INCLXX_HP
#define G4endl
Definition: G4ios.hh:61
TQGSP_BIC< G4VModularPhysicsList > QGSP_BIC
Definition: QGSP_BIC.hh:62
TFTF_BIC< G4VModularPhysicsList > FTF_BIC
Definition: FTF_BIC.hh:62
TFTFP_BERT_ATL< G4VModularPhysicsList > FTFP_BERT_ATL
TQGSP_BERT_HP< G4VModularPhysicsList > QGSP_BERT_HP
Definition: QGSP_BERT_HP.hh:62
Definition: QBBC.hh:44
TINCLXXPhysicsListHelper< G4VModularPhysicsList, true, true > FTFP_INCLXX_HP

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4PhysListFactory::IsReferencePhysList ( const G4String name)

Definition at line 204 of file G4PhysListFactory.cc.

205 {
206  G4bool res = false;
207  size_t n = name.size();
208  if(n > 4) {
209  G4String em_name = name.substr(n - 4, 4);
210  for(size_t i=1; i<nlists_em; ++i) {
211  if(listnames_em[i] == em_name) {
212  n -= 4;
213  break;
214  }
215  }
216  }
217  G4String had_name = name.substr(0, n);
218  for(size_t i=0; i<nlists_hadr; ++i) {
219  if(had_name == listnames_hadr[i]) {
220  res = true;
221  break;
222  }
223  }
224  return res;
225 }
bool G4bool
Definition: G4Types.hh:79
G4VModularPhysicsList * G4PhysListFactory::ReferencePhysList ( )

Definition at line 99 of file G4PhysListFactory.cc.

100 {
101  // instantiate PhysList by environment variable "PHYSLIST"
102  G4String name = "";
103  char* path = getenv("PHYSLIST");
104  if (path) {
105  name = G4String(path);
106  } else {
107  name = defName;
108  G4cout << "### G4PhysListFactory WARNING: "
109  << " environment variable PHYSLIST is not defined"
110  << G4endl
111  << " Default Physics Lists " << name
112  << " is instantiated"
113  << G4endl;
114  }
115  return GetReferencePhysList(name);
116 }
const XML_Char * name
Definition: expat.h:151
G4GLOB_DLL std::ostream G4cout
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4PhysListFactory::SetVerbose ( G4int  val)
inline

Definition at line 67 of file G4PhysListFactory.hh.

67 { verbose = val; }

The documentation for this class was generated from the following files: