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

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 6.0 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.14 2010/06/08 16:06:18 gunter Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
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#include "Shielding.hh"
67
68G4PhysListFactory::G4PhysListFactory() 
69{
70  defName = "QGSP_BERT";
71  nlists = 28;
72  G4String s[28] = {
73    "CHIPS",
74    "FTFP_BERT","FTFP_BERT_EMV","FTFP_BERT_EMX","FTFP_BERT_TRV","FTF_BIC",
75    "LBE","LHEP","LHEP_EMV",
76    "QBBC","QBBC_XGG","QBBC_XGGSN",
77    "QGSC_BERT","QGSC_CHIPS",
78    "QGSP_BERT","QGSP_BERT_EMV","QGSP_BERT_EMX","QGSP_BERT_HP",
79    "QGSP_BERT_NOLEP","QGSP_BERT_TRV","QGSP_BERT_CHIPS",
80    "QGSP_BIC","QGSP_BIC_EMY","QGSP_BIC_HP",
81    "QGSP_FTFP_BERT","QGS_BIC", "QGSP_INCL_ABLA",
82    "Shielding"};
83
84  for(size_t i=0; i<nlists; i++) {
85    listnames.push_back(s[i]);
86  }
87}
88
89G4PhysListFactory::~G4PhysListFactory()
90{}
91
92G4VModularPhysicsList* G4PhysListFactory::ReferencePhysList()
93{
94  // instantiate PhysList by environment variable "PHYSLIST"
95  G4String name = "";
96  char* path = getenv("PHYSLIST");
97  if (path) {
98    name = G4String(path);
99  } else {
100    name = defName;
101    G4cout << "### G4PhysListFactory WARNING: "
102           << " environment variable PHYSLIST is not defined"
103           << G4endl
104           << "    Default Physics Lists " << name
105           << " is instantiated" 
106           << G4endl;
107  }
108  return GetReferencePhysList(name);
109}
110
111G4VModularPhysicsList* G4PhysListFactory::GetReferencePhysList(
112        const G4String& name)
113{
114  G4VModularPhysicsList* p = 0;
115  if(name == "CHIPS") {p = new CHIPS();}
116  else if(name == "FTFP_BERT") {p = new FTFP_BERT();}
117  else if(name == "FTFP_BERT_EMV") {p = new FTFP_BERT_EMV();}
118  else if(name == "FTFP_BERT_EMX") {p = new FTFP_BERT_EMX();}
119  else if(name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV();}
120  else if(name == "FTF_BIC") {p = new FTF_BIC();}
121  else if(name == "LBE") {p = new LBE();}
122  else if(name == "LHEP") {p = new LHEP();}
123  else if(name == "LHEP_EMV") {p = new LHEP_EMV();}
124  else if(name == "QBBC") {p = new QBBC();}
125  else if(name == "QBBC_XGG") {p = new QBBC(1,"QBBC_XGG");}
126  else if(name == "QBBC_XGGSN") {p = new QBBC(1,"QBBC_XGGSN");}
127  else if(name == "QGSC_BERT") {p = new QGSC_BERT();}
128  else if(name == "QGSC_CHIPS") {p = new QGSC_CHIPS();}
129  else if(name == "QGSP_BERT") {p = new QGSP_BERT();}
130  else if(name == "QGSP_BERT_EMV") {p = new QGSP_BERT_EMV();}
131  else if(name == "QGSP_BERT_EMX") {p = new QGSP_BERT_EMX();}
132  else if(name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP();}
133  else if(name == "QGSP_BERT_NOLEP") {p = new QGSP_BERT_NOLEP();}
134  else if(name == "QGSP_BERT_TRV") {p = new QGSP_BERT_TRV();}
135  else if(name == "QGSP_BERT_CHIPS") {p = new QGSP_BERT_CHIPS();}
136  else if(name == "QGSP_BIC") {p = new QGSP_BIC();}
137  else if(name == "QGSP_BIC_EMY") {p = new QGSP_BIC_EMY();}
138  else if(name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP();}
139  else if(name == "QGSP_FTFP_BERT") {p = new QGSP_FTFP_BERT();}
140  else if(name == "QGS_BIC") {p = new QGS_BIC();}
141  else if(name == "QGSP_INCL_ABLA") {p = new QGSP_INCL_ABLA();}
142  else if(name == "Shielding") {p = new Shielding();}
143  else {
144    G4cout << "### G4PhysListFactory WARNING: "
145           << "PhysicsList " << name << " is not known"
146           << G4endl
147           << "    Default Physics Lists " << defName
148           << " is instantiated" 
149           << G4endl;
150    p = new QGSP_BERT();
151  }
152  return p;
153}
154 
155G4bool G4PhysListFactory::IsReferencePhysList(const G4String& name)
156{
157  G4bool res = false;
158  for(size_t i=0; i<nlists; i++) {
159    if(name == listnames[i]) {
160      res = true;
161      break;
162    }
163  }
164  return res;
165}
166
167const std::vector<G4String>& 
168G4PhysListFactory::AvailablePhysLists() const
169{
170  return listnames;
171}
172
Note: See TracBrowser for help on using the repository browser.