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

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

update geant4.9.3 tag

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