Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::G4PhysListFactory ( )

Definition at line 69 of file G4PhysListFactory.cc.

70 : defName("FTFP_BERT"),verbose(1)
71{
72 nlists_hadr = 19;
73 G4String ss[19] = {
74 "CHIPS",
75 "FTFP_BERT","FTFP_BERT_TRV","FTFP_BERT_HP","FTF_BIC",
76 "LBE","LHEP","QBBC",
77 "QGSC_BERT","QGSP","QGSP_BERT","QGSP_BERT_CHIPS","QGSP_BERT_HP",
78 "QGSP_BIC","QGSP_BIC_HP",
79 "QGSP_FTFP_BERT","QGS_BIC","QGSP_INCLXX",
80 "Shielding"};
81 for(size_t i=0; i<nlists_hadr; ++i) {
82 listnames_hadr.push_back(ss[i]);
83 }
84
85 nlists_em = 7;
86 G4String s1[7] = {"","_EMV","_EMX","_EMY","_EMZ","_LIV","_PEN"};
87 for(size_t i=0; i<nlists_em; ++i) {
88 listnames_em.push_back(s1[i]);
89 }
90}

◆ ~G4PhysListFactory()

G4PhysListFactory::~G4PhysListFactory ( )

Definition at line 92 of file G4PhysListFactory.cc.

93{}

Member Function Documentation

◆ AvailablePhysLists()

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

Definition at line 221 of file G4PhysListFactory.cc.

222{
223 return listnames_hadr;
224}

◆ AvailablePhysListsEM()

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

Definition at line 227 of file G4PhysListFactory.cc.

228{
229 return listnames_em;
230}

◆ GetReferencePhysList()

G4VModularPhysicsList * G4PhysListFactory::GetReferencePhysList ( const G4String name)

Definition at line 116 of file G4PhysListFactory.cc.

117{
118 // analysis on the string
119 size_t n = name.size();
120
121 // last characters in the string
122 size_t em_opt = 0;
123 G4String em_name = "";
124
125 // check EM options
126 if(n > 4) {
127 em_name = name.substr(n - 4, 4);
128 for(size_t i=1; i<nlists_em; ++i) {
129 if(listnames_em[i] == em_name) {
130 em_opt = i;
131 n -= 4;
132 break;
133 }
134 }
135 if(0 == em_opt) { em_name = ""; }
136 }
137
138 // hadronic pHysics List
139 G4String had_name = name.substr(0, n);
140
141 if(0 < verbose) {
142 G4cout << "G4PhysListFactory::GetReferencePhysList <" << had_name
143 << em_name << "> EMoption= " << em_opt << G4endl;
144 }
146 if(had_name == "CHIPS") {p = new CHIPS(verbose);}
147 else if(had_name == "FTFP_BERT") {p = new FTFP_BERT(verbose);}
148 else if(had_name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV(verbose);}
149 else if(had_name == "FTFP_BERT_HP") {p = new FTFP_BERT_HP(verbose);}
150 // else if(had_name == "FTFP_BERT_DE") {p = new FTFP_BERT_DE(verbose);}
151 else if(had_name == "FTF_BIC") {p = new FTF_BIC(verbose);}
152 else if(had_name == "LBE") {p = new LBE();}
153 else if(had_name == "LHEP") {p = new LHEP(verbose);}
154 else if(had_name == "QBBC") {p = new QBBC(verbose);}
155 else if(had_name == "QGSC_BERT") {p = new QGSC_BERT(verbose);}
156 else if(had_name == "QGSP_BERT") {p = new QGSP_BERT(verbose);}
157 else if(had_name == "QGSP_BERT_CHIPS"){p = new QGSP_BERT_CHIPS(verbose);}
158 else if(had_name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP(verbose);}
159 else if(had_name == "QGSP_BIC") {p = new QGSP_BIC(verbose);}
160 else if(had_name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP(verbose);}
161 else if(had_name == "QGSP_FTFP_BERT") {p = new QGSP_FTFP_BERT(verbose);}
162 else if(had_name == "QGS_BIC") {p = new QGS_BIC(verbose);}
163 else if(had_name == "QGSP_INCLXX") {p = new QGSP_INCLXX(verbose);}
164 else if(had_name == "Shielding") {p = new Shielding(verbose);}
165 else if(had_name == "ShieldingLEND") {p = new Shielding(verbose,"LEND");}
166 else {
167 G4cout << "### G4PhysListFactory WARNING: "
168 << "PhysicsList " << had_name << " is not known"
169 << G4endl;
170 }
171 if(p) {
172 G4cout << "<<< Reference Physics List " << had_name
173 << em_name << " is built" << G4endl;
174 G4int ver = p->GetVerboseLevel();
175 p->SetVerboseLevel(0);
176 if(0 < em_opt) {
177 if(1 == em_opt) {
179 } else if(2 == em_opt) {
181 } else if(3 == em_opt) {
183 } else if(4 == em_opt) {
185 } else if(5 == em_opt) {
186 p->ReplacePhysics(new G4EmLivermorePhysics(verbose));
187 } else if(6 == em_opt) {
188 p->ReplacePhysics(new G4EmPenelopePhysics(verbose));
189 }
190 }
191 p->SetVerboseLevel(ver);
192 }
193 G4cout << G4endl;
194 return p;
195}
TCHIPS< G4VModularPhysicsList > CHIPS
Definition: CHIPS.hh:50
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
TFTFP_BERT_HP< G4VModularPhysicsList > FTFP_BERT_HP
Definition: FTFP_BERT_HP.hh:63
TFTFP_BERT_TRV< G4VModularPhysicsList > FTFP_BERT_TRV
TFTF_BIC< G4VModularPhysicsList > FTF_BIC
Definition: FTF_BIC.hh:62
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
TLBE< G4VModularPhysicsList > LBE
Definition: LBE.hh:119
TLHEP< G4VModularPhysicsList > LHEP
Definition: LHEP.hh:50
TQGSC_BERT< G4VModularPhysicsList > QGSC_BERT
Definition: QGSC_BERT.hh:50
TQGSP_BERT< G4VModularPhysicsList > QGSP_BERT
Definition: QGSP_BERT.hh:63
TQGSP_BERT_CHIPS< G4VModularPhysicsList > QGSP_BERT_CHIPS
TQGSP_BERT_HP< G4VModularPhysicsList > QGSP_BERT_HP
Definition: QGSP_BERT_HP.hh:62
TQGSP_BIC< G4VModularPhysicsList > QGSP_BIC
Definition: QGSP_BIC.hh:62
TQGSP_BIC_HP< G4VModularPhysicsList > QGSP_BIC_HP
Definition: QGSP_BIC_HP.hh:63
TQGSP_FTFP_BERT< G4VModularPhysicsList > QGSP_FTFP_BERT
TQGSP_INCLXX< G4VModularPhysicsList > QGSP_INCLXX
Definition: QGSP_INCLXX.hh:92
TQGS_BIC< G4VModularPhysicsList > QGS_BIC
Definition: QGS_BIC.hh:63
TShielding< G4VModularPhysicsList > Shielding
Definition: Shielding.hh:65
void SetVerboseLevel(G4int value)
void ReplacePhysics(G4VPhysicsConstructor *)
Definition: QBBC.hh:45

Referenced by ReferencePhysList().

◆ IsReferencePhysList()

G4bool G4PhysListFactory::IsReferencePhysList ( const G4String name)

Definition at line 197 of file G4PhysListFactory.cc.

198{
199 G4bool res = false;
200 size_t n = name.size();
201 if(n > 4) {
202 G4String em_name = name.substr(n - 4, 4);
203 for(size_t i=1; i<nlists_em; ++i) {
204 if(listnames_em[i] == em_name) {
205 n -= 4;
206 break;
207 }
208 }
209 }
210 G4String had_name = name.substr(0, n);
211 for(size_t i=0; i<nlists_hadr; ++i) {
212 if(had_name == listnames_hadr[i]) {
213 res = true;
214 break;
215 }
216 }
217 return res;
218}
bool G4bool
Definition: G4Types.hh:67

◆ ReferencePhysList()

G4VModularPhysicsList * G4PhysListFactory::ReferencePhysList ( )

Definition at line 96 of file G4PhysListFactory.cc.

97{
98 // instantiate PhysList by environment variable "PHYSLIST"
99 G4String name = "";
100 char* path = getenv("PHYSLIST");
101 if (path) {
102 name = G4String(path);
103 } else {
104 name = defName;
105 G4cout << "### G4PhysListFactory WARNING: "
106 << " environment variable PHYSLIST is not defined"
107 << G4endl
108 << " Default Physics Lists " << name
109 << " is instantiated"
110 << G4endl;
111 }
112 return GetReferencePhysList(name);
113}
G4VModularPhysicsList * GetReferencePhysList(const G4String &)

◆ SetVerbose()

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: