source: trunk/source/physics_lists/lists/src/G4PhysListFactory.cc@ 1318

Last change on this file since 1318 was 1273, checked in by garnier, 16 years ago

cvs update phys-lists-V09-03-03

File size: 5.9 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id: G4PhysListFactory.cc,v 1.13 2010/05/26 15:06:49 gunter Exp $
27// GEANT4 tag $Name: phys-lists-V09-03-03 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName: G4PhysListFactory
32//
33// Author: 21 April 2008 V. Ivanchenko
34//
35// Modified:
36//
37//----------------------------------------------------------------------------
38//
39
40#include "G4PhysListFactory.hh"
41#include "CHIPS.hh"
42#include "FTFP_BERT.hh"
43#include "FTFP_BERT_EMV.hh"
44#include "FTFP_BERT_EMX.hh"
45#include "FTFP_BERT_TRV.hh"
46#include "FTF_BIC.hh"
47#include "LBE.hh"
48#include "LHEP.hh"
49#include "LHEP_EMV.hh"
50#include "QBBC.hh"
51#include "QGSC_BERT.hh"
52#include "QGSC_CHIPS.hh"
53#include "QGSP_BERT.hh"
54#include "QGSP_BERT_EMV.hh"
55#include "QGSP_BERT_EMX.hh"
56#include "QGSP_BERT_HP.hh"
57#include "QGSP_BERT_NOLEP.hh"
58#include "QGSP_BERT_TRV.hh"
59#include "QGSP_BERT_CHIPS.hh"
60#include "QGSP_BIC.hh"
61#include "QGSP_BIC_EMY.hh"
62#include "QGSP_BIC_HP.hh"
63#include "QGSP_FTFP_BERT.hh"
64#include "QGS_BIC.hh"
65#include "QGSP_INCL_ABLA.hh"
66
67G4PhysListFactory::G4PhysListFactory()
68{
69 defName = "QGSP_BERT";
70 nlists = 27;
71 G4String s[27] = {
72 "CHIPS",
73 "FTFP_BERT","FTFP_BERT_EMV","FTFP_BERT_EMX","FTFP_BERT_TRV","FTF_BIC",
74 "LBE","LHEP","LHEP_EMV",
75 "QBBC","QBBC_XGG","QBBC_XGGSN",
76 "QGSC_BERT","QGSC_CHIPS",
77 "QGSP_BERT","QGSP_BERT_EMV","QGSP_BERT_EMX","QGSP_BERT_HP",
78 "QGSP_BERT_NOLEP","QGSP_BERT_TRV","QGSP_BERT_CHIPS",
79 "QGSP_BIC","QGSP_BIC_EMY","QGSP_BIC_HP",
80 "QGSP_FTFP_BERT","QGS_BIC", "QGSP_INCL_ABLA"};
81
82 for(size_t i=0; i<nlists; i++) {
83 listnames.push_back(s[i]);
84 }
85}
86
87G4PhysListFactory::~G4PhysListFactory()
88{}
89
90G4VModularPhysicsList* G4PhysListFactory::ReferencePhysList()
91{
92 // instantiate PhysList by environment variable "PHYSLIST"
93 G4String name = "";
94 char* path = getenv("PHYSLIST");
95 if (path) {
96 name = G4String(path);
97 } else {
98 name = defName;
99 G4cout << "### G4PhysListFactory WARNING: "
100 << " environment variable PHYSLIST is not defined"
101 << G4endl
102 << " Default Physics Lists " << name
103 << " is instantiated"
104 << G4endl;
105 }
106 return GetReferencePhysList(name);
107}
108
109G4VModularPhysicsList* G4PhysListFactory::GetReferencePhysList(
110 const G4String& name)
111{
112 G4VModularPhysicsList* p = 0;
113 if(name == "CHIPS") {p = new CHIPS();}
114 else if(name == "FTFP_BERT") {p = new FTFP_BERT();}
115 else if(name == "FTFP_BERT_EMV") {p = new FTFP_BERT_EMV();}
116 else if(name == "FTFP_BERT_EMX") {p = new FTFP_BERT_EMX();}
117 else if(name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV();}
118 else if(name == "FTF_BIC") {p = new FTF_BIC();}
119 else if(name == "LBE") {p = new LBE();}
120 else if(name == "LHEP") {p = new LHEP();}
121 else if(name == "LHEP_EMV") {p = new LHEP_EMV();}
122 else if(name == "QBBC") {p = new QBBC();}
123 else if(name == "QBBC_XGG") {p = new QBBC(1,"QBBC_XGG");}
124 else if(name == "QBBC_XGGSN") {p = new QBBC(1,"QBBC_XGGSN");}
125 else if(name == "QGSC_BERT") {p = new QGSC_BERT();}
126 else if(name == "QGSC_CHIPS") {p = new QGSC_CHIPS();}
127 else if(name == "QGSP_BERT") {p = new QGSP_BERT();}
128 else if(name == "QGSP_BERT_EMV") {p = new QGSP_BERT_EMV();}
129 else if(name == "QGSP_BERT_EMX") {p = new QGSP_BERT_EMX();}
130 else if(name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP();}
131 else if(name == "QGSP_BERT_NOLEP") {p = new QGSP_BERT_NOLEP();}
132 else if(name == "QGSP_BERT_TRV") {p = new QGSP_BERT_TRV();}
133 else if(name == "QGSP_BERT_CHIPS") {p = new QGSP_BERT_CHIPS();}
134 else if(name == "QGSP_BIC") {p = new QGSP_BIC();}
135 else if(name == "QGSP_BIC_EMY") {p = new QGSP_BIC_EMY();}
136 else if(name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP();}
137 else if(name == "QGSP_FTFP_BERT") {p = new QGSP_FTFP_BERT();}
138 else if(name == "QGS_BIC") {p = new QGS_BIC();}
139 else if(name == "QGSP_INCL_ABLA") {p = new QGSP_INCL_ABLA();}
140 else {
141 G4cout << "### G4PhysListFactory WARNING: "
142 << "PhysicsList " << name << " is not known"
143 << G4endl
144 << " Default Physics Lists " << defName
145 << " is instantiated"
146 << G4endl;
147 p = new QGSP_BERT();
148 }
149 return p;
150}
151
152G4bool G4PhysListFactory::IsReferencePhysList(const G4String& name)
153{
154 G4bool res = false;
155 for(size_t i=0; i<nlists; i++) {
156 if(name == listnames[i]) {
157 res = true;
158 break;
159 }
160 }
161 return res;
162}
163
164const std::vector<G4String>&
165G4PhysListFactory::AvailablePhysLists() const
166{
167 return listnames;
168}
169
Note: See TracBrowser for help on using the repository browser.