[988] | 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 | // |
---|
[1205] | 26 | // $Id: G4PhysListFactory.cc,v 1.12 2009/11/25 18:55:56 vnivanch Exp $ |
---|
[1228] | 27 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[988] | 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" |
---|
[1205] | 41 | #include "CHIPS.hh" |
---|
[988] | 42 | #include "FTFP_BERT.hh" |
---|
[1205] | 43 | #include "FTFP_BERT_EMV.hh" |
---|
| 44 | #include "FTFP_BERT_EMX.hh" |
---|
| 45 | #include "FTFP_BERT_TRV.hh" |
---|
[988] | 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" |
---|
[1205] | 52 | #include "QGSC_CHIPS.hh" |
---|
[988] | 53 | #include "QGSP_BERT.hh" |
---|
| 54 | #include "QGSP_BERT_EMV.hh" |
---|
[1205] | 55 | #include "QGSP_BERT_EMX.hh" |
---|
[988] | 56 | #include "QGSP_BERT_HP.hh" |
---|
[1205] | 57 | #include "QGSP_BERT_NOLEP.hh" |
---|
[988] | 58 | #include "QGSP_BERT_TRV.hh" |
---|
| 59 | #include "QGSP_BIC.hh" |
---|
[1205] | 60 | #include "QGSP_BIC_EMY.hh" |
---|
[988] | 61 | #include "QGSP_BIC_HP.hh" |
---|
[1205] | 62 | #include "QGSP_FTFP_BERT.hh" |
---|
[988] | 63 | #include "QGS_BIC.hh" |
---|
[1205] | 64 | #include "QGSP_INCL_ABLA.hh" |
---|
[988] | 65 | |
---|
| 66 | G4PhysListFactory::G4PhysListFactory() |
---|
| 67 | { |
---|
| 68 | defName = "QGSP_BERT"; |
---|
[1205] | 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"}; |
---|
[988] | 79 | |
---|
| 80 | for(size_t i=0; i<nlists; i++) { |
---|
| 81 | listnames.push_back(s[i]); |
---|
| 82 | } |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | G4PhysListFactory::~G4PhysListFactory() |
---|
| 86 | {} |
---|
| 87 | |
---|
| 88 | G4VModularPhysicsList* 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 | |
---|
| 107 | G4VModularPhysicsList* G4PhysListFactory::GetReferencePhysList( |
---|
| 108 | const G4String& name) |
---|
| 109 | { |
---|
| 110 | G4VModularPhysicsList* p = 0; |
---|
[1205] | 111 | if(name == "CHIPS") {p = new CHIPS();} |
---|
[988] | 112 | else if(name == "FTFP_BERT") {p = new FTFP_BERT();} |
---|
[1205] | 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();} |
---|
[988] | 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();} |
---|
[1205] | 121 | else if(name == "QBBC_XGG") {p = new QBBC(1,"QBBC_XGG");} |
---|
| 122 | else if(name == "QBBC_XGGSN") {p = new QBBC(1,"QBBC_XGGSN");} |
---|
[988] | 123 | else if(name == "QGSC_BERT") {p = new QGSC_BERT();} |
---|
[1205] | 124 | else if(name == "QGSC_CHIPS") {p = new QGSC_CHIPS();} |
---|
[988] | 125 | else if(name == "QGSP_BERT") {p = new QGSP_BERT();} |
---|
| 126 | else if(name == "QGSP_BERT_EMV") {p = new QGSP_BERT_EMV();} |
---|
[1205] | 127 | else if(name == "QGSP_BERT_EMX") {p = new QGSP_BERT_EMX();} |
---|
[988] | 128 | else if(name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP();} |
---|
[1205] | 129 | else if(name == "QGSP_BERT_NOLEP") {p = new QGSP_BERT_NOLEP();} |
---|
[988] | 130 | else if(name == "QGSP_BERT_TRV") {p = new QGSP_BERT_TRV();} |
---|
| 131 | else if(name == "QGSP_BIC") {p = new QGSP_BIC();} |
---|
[1205] | 132 | else if(name == "QGSP_BIC_EMY") {p = new QGSP_BIC_EMY();} |
---|
[988] | 133 | else if(name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP();} |
---|
[1205] | 134 | else if(name == "QGSP_FTFP_BERT") {p = new QGSP_FTFP_BERT();} |
---|
[988] | 135 | else if(name == "QGS_BIC") {p = new QGS_BIC();} |
---|
[1205] | 136 | else if(name == "QGSP_INCL_ABLA") {p = new QGSP_INCL_ABLA();} |
---|
[988] | 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 | |
---|
| 149 | G4bool 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 | |
---|
| 161 | const std::vector<G4String>& |
---|
| 162 | G4PhysListFactory::AvailablePhysLists() const |
---|
| 163 | { |
---|
| 164 | return listnames; |
---|
| 165 | } |
---|
| 166 | |
---|