Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
+46 -21
View File
@@ -1,4 +1,4 @@
$Id: History 103591 2017-04-19 07:53:55Z gcosmo $
$Id: History 107319 2017-11-08 16:29:22Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -7,19 +7,44 @@ $Id: History 103591 2017-04-19 07:53:55Z gcosmo $
Hadronic physics-list/lists History
-----------------------------
This file should be used to briefly summarize all major modifications
This file should be used to briefly summarize all major modifications
introduced in the code and keeptrack of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07-November-2017 T. Koi (phys-list-V10-03-08)
- Add ShieldingLEND as a new physics list
co-working with phys-ctor-hinelastic-V10-03-06
07-November-2017 V.Ivanchenko (phys-lists-V10-03-07)
- G4PhysListFactory - added messenger with two commands to enable
radioactive decay or optical physics
02-November-2017 R. Hatcher (phys-list-V10-03-06)
- Add FTFQGSP_BERT to G4RegisterPhysLists.icc to make available to the
new g4alt::G4PhysListFactory
16-October-2017 A.Ribon (phys-lists-V10-03-05)
- FTFQGSP_BERT - created a new, experimental physics list which is similar
to FTFP_BERT, but with QGS fragmentation of strings (instead of the
Lund string fragmentation).
09-October-2017 V.Ivanchenko (phys-lists-V10-03-04)
- LBE.icc - fixed initialisation of G4RadioactiveDecay
14-July-2017 Robert Hatcher (phys-lists-V10-03-03)
- Add __SS option to g4alt::G4PhysListFactory
- allow g4alt factory to use bare phys constructor names as things to
replace/add as well as the shorter predefined extensions (e.g. "EMX")
- whitespace cleanup
19-April-2017 V.Ivanchenko (phys-lists-V10-03-02)
- G4PhysListFactory - fixed EM option "__SS" - problem report #1966
21-March-2017 Koi, Tatsumi (phys-lists-V10-03-01)
- Fix problem of LBE physics list on radioactive decay model
- Fix problem of LBE physics list on radioactive decay model
07-February-2017 V.Ivanchenko (phys-lists-V10-03-00)
- G4PhysListFactory - add single scattering EM option (required by
@@ -40,7 +65,7 @@ introduced in the code and keeptrack of all tags.
26-May-2016, Robert Hatcher (phys-lists-V10-02-07)
- Fix issue where G4PhysListRegistry didn't properly exit if
a requested extension didn't exist in its list.
a requested extension didn't exist in its list.
- Add G4_REFERENCE_PHYSLIST_FACTORY[_NS] for pulling in lists
from static libraries.
@@ -60,9 +85,9 @@ introduced in the code and keeptrack of all tags.
- FTFP_BERT_ATL : created new, experimental physics list for ATLAS,
similar to FTFP_BERT but with the transition between BERT and FTFP
in the energy region [9, 12] GeV.
09-Mar-2016, Alberto Ribon (phys-lists-V10-02-03)
- FTFP_BERT_TRV : Use GS multiple scattering with the most precise
- FTFP_BERT_TRV : Use GS multiple scattering with the most precise
"error-free" stepping. This is done for the purpose of studying
the impact of multiple scattering on hadronic showers.
@@ -103,8 +128,8 @@ introduced in the code and keeptrack of all tags.
the low-mass diffraction dissociation used in G4HadronHElasticPhysics
18-Sep-2015, V.Ivanchenko (phys-lists-V10-01-07)
- G4PhysListFactory - added extra EM option "_GS" where
G4GoudsmithSoundersonMscModel is used for e+-
- G4PhysListFactory - added extra EM option "_GS" where
G4GoudsmithSoundersonMscModel is used for e+-
10-Jun-2015, V.Ivanchenko (phys-lists-V10-01-06)
- FTFP_BERT_TRV - uses G4EmStandardPhysicsGS
@@ -113,7 +138,7 @@ introduced in the code and keeptrack of all tags.
22-May-2015, Robert Hatcher (phys-lists-V10-01-05)
- g4alt::G4PhysListFactory should now work with G4GenericPhysicsList
on clang (3.4 and 3.5) and vc12
- cowork with tags "intercoms-V10-01-02", "emdna-V10-01-19",
- cowork with tags "intercoms-V10-01-02", "emdna-V10-01-19",
"emstand-V10-01-16", "hadr-cohe-V10-01-07", and "hadr-inclxx-V10-01-00"
22-May-2015, Robert Hatcher (phys-lists-V10-01-04)
@@ -173,8 +198,8 @@ introduced in the code and keeptrack of all tags.
- Increased cuts in LBE physics list to 1 micrometer (from 1 nanometer).
15-Oct-2014, Alex Howard (phys-lists-V10-00-07)
- Bugfix 1591 for LBE
- removed Bertini Cascade from alphas, deuterons and tritons and replaced with
- Bugfix 1591 for LBE
- removed Bertini Cascade from alphas, deuterons and tritons and replaced with
BinaryLightIonReaction
- Replaced G4MuonMinusCaptureAtRest with G4MuonMinusCapture
@@ -182,7 +207,7 @@ introduced in the code and keeptrack of all tags.
- Extended Shielding code to also include ShieldingM variant
10-Jun-2014, V.Ivanchenko (phys-lists-V10-00-05)
- INCLXXPhysicsListHelper - for the case of HP set cut on proton to
- INCLXXPhysicsListHelper - for the case of HP set cut on proton to
zero to simulate all recoils from elastic scattering
06-Jun-2014, Alberto Ribon (phys-lists-V10-00-04)
@@ -190,7 +215,7 @@ introduced in the code and keeptrack of all tags.
made yesterday by Krzysztof and Vladimir I.
05-Jun-2014, V.Ivanchenko
- FTFP_BERT_HP, QGSP_BIC_HP, QGSP_BERT_HP - set cut on proton to
- FTFP_BERT_HP, QGSP_BIC_HP, QGSP_BERT_HP - set cut on proton to
zero to simulate all recoils from elastic scattering
05-Jun-2014, Krzysztof Genser
@@ -204,11 +229,11 @@ introduced in the code and keeptrack of all tags.
- Include new (experimental) physics lists ShieldingM and NuBeam
03-Feb-2014, Luciano Pandola (phys-lists-V10-00-01)
- Registered model in LBE.icc to handle neutron capture above 20 MeV
(Bug Report 1562)
- Registered model in LBE.icc to handle neutron capture above 20 MeV
(Bug Report 1562)
29-Jan-2014, Gunter Folger (phys-lists-V10-00-00)
- Removed electromagnetic/dna, cascade/{evaporation,utils}, and
- Removed electromagnetic/dna, cascade/{evaporation,utils}, and
isotope_productionfrom sources.cmake
07-Nov-2013, Tatsumi Koi (phys-lists-V09-06-20)
@@ -232,7 +257,7 @@ introduced in the code and keeptrack of all tags.
06-Sep-2013, Luciano Pandola (phys-lists-V09-06-14)
- LBE.icc, add missing #include of G4HadronCaptureProcess
(gave compilation error to user application using LBE)
(gave compilation error to user application using LBE)
21-Aug-2013, Vladimir Ivantchenko (phys-lists-V09-06-13)
- LBE - removed forgotten header
@@ -245,7 +270,7 @@ introduced in the code and keeptrack of all tags.
27-Mar-2013, Andrea Dotti (phys-lists-V09-06-10)
- Adding mechanism for splitting class of base class G4VUserPhysicsList
for LBE physics list (needed for G4MT).
for LBE physics list (needed for G4MT).
Co-working with tag in run category
28-Mar-2013, Alberto Ribon (phys-lists-V09-06-09)
@@ -278,6 +303,6 @@ introduced in the code and keeptrack of all tags.
- move G4PhysListFactory from constructor/factory to lists.
10-Jan-2013, Gunter Folger (phys-lists-V09-06-00)
- new directory structure introduced.
lists directory only keeps physics lists, hadronic constructors moved to
- new directory structure introduced.
lists directory only keeps physics lists, hadronic constructors moved to
constructors/hadron_inelastic
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: FTFQGSP_BERT.hh 66241 2012-12-13 18:34:42Z gunter $
//
//---------------------------------------------------------------------------
//
// ClassName: FTFQGSP_BERT
//
// Author: Alberto Ribon, October 2017
// created from FTFP_BERT, using QGS string fragmentation instead of the
// Lund string fragmentation
//
// Modified:
//
//----------------------------------------------------------------------------
//
#ifndef TFTFQGSP_BERT_h
#define TFTFQGSP_BERT_h 1
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "G4VModularPhysicsList.hh"
#include "CompileTimeConstraints.hh"
template<class T>
class TFTFQGSP_BERT: public T
{
public:
TFTFQGSP_BERT(G4int ver = 1);
virtual ~TFTFQGSP_BERT();
public:
// SetCuts()
virtual void SetCuts();
private:
enum {ok = CompileTimeConstraints::IsA<T, G4VModularPhysicsList>::ok };
};
#include "FTFQGSP_BERT.icc"
typedef TFTFQGSP_BERT<G4VModularPhysicsList> FTFQGSP_BERT;
#endif
@@ -0,0 +1,119 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: FTFQGSP_BERT.icc 66704 2013-01-10 18:20:17Z gunter $
//
//---------------------------------------------------------------------------
//
// ClassName: FTFQGSP_BERT
//
// Author: 2017 Alberto Ribon
//
// created from FTFP_BERT
//
// Modified:
//
//----------------------------------------------------------------------------
//
#include <iomanip>
#include "globals.hh"
#include "G4ios.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4DecayPhysics.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmExtraPhysics.hh"
#include "G4IonPhysics.hh"
#include "G4StoppingPhysics.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4NeutronTrackingCut.hh"
#include "G4DataQuestionaire.hh"
#include "G4HadronPhysicsFTFQGSP_BERT.hh"
#include "G4WarnPLStatus.hh"
template<class T> TFTFQGSP_BERT<T>::TFTFQGSP_BERT(G4int ver): T()
{
G4DataQuestionaire it(photon);
G4cout << "<<< Geant4 Physics List simulation engine: FTFQGSP_BERT 1.0"<<G4endl;
G4cout <<G4endl;
this->defaultCutValue = 0.7*CLHEP::mm;
this->SetVerboseLevel(ver);
G4WarnPLStatus exp;
exp.Experimental("FTFQGSP_BERT");
// EM Physics
this->RegisterPhysics( new G4EmStandardPhysics(ver) );
// Synchroton Radiation & GN Physics
this->RegisterPhysics( new G4EmExtraPhysics(ver) );
// Decays
this->RegisterPhysics( new G4DecayPhysics(ver) );
// Hadron Elastic scattering
this->RegisterPhysics( new G4HadronElasticPhysics(ver) );
// Hadron Physics
this->RegisterPhysics( new G4HadronPhysicsFTFQGSP_BERT(ver) );
// Stopping Physics
this->RegisterPhysics( new G4StoppingPhysics(ver) );
// Ion Physics
this->RegisterPhysics( new G4IonPhysics(ver) );
// Neutron tracking cut
this->RegisterPhysics( new G4NeutronTrackingCut(ver) );
}
template<class T> TFTFQGSP_BERT<T>::~TFTFQGSP_BERT()
{
}
template<class T> void TFTFQGSP_BERT<T>::SetCuts()
{
if (this->verboseLevel >1){
G4cout << "FTFQGSP_BERT::SetCuts:";
}
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
this->SetCutsWithDefault();
// if (this->verboseLevel > 0)
// G4VUserPhysicsList::DumpCutValuesTable();
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhysListFactory.hh 66892 2013-01-17 10:57:59Z gunter $
// $Id: G4PhysListFactory.hh 107319 2017-11-08 16:29:22Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -41,6 +41,8 @@
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
class G4UImessenger;
class G4PhysListFactory
{
public:
@@ -74,6 +76,7 @@ private:
size_t nlists_hadr;
size_t nlists_em;
G4int verbose;
G4UImessenger* theMessenger;
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhysListFactoryMessenger.hh 66704 2013-01-10 18:20:17Z gunter $
//
//---------------------------------------------------------------------------
//
// ClassName: G4PhysListFactoryMessenger
//
// Author: 2002 J.P. Wellisch
//
// Modified:
// 09.11.2005 V.Ivanchenko edit to provide a standard
// 19.06.2006 V.Ivanchenko add mu-nuclear process
//
//----------------------------------------------------------------------------
//
#ifndef G4PhysListFactoryMessenger_h
#define G4PhysListFactoryMessenger_h 1
#include "G4UImessenger.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcommand.hh"
class G4VModularPhysicsList;
class G4PhysListFactoryMessenger: public G4UImessenger
{
public:
G4PhysListFactoryMessenger(G4VModularPhysicsList* pl);
virtual ~G4PhysListFactoryMessenger();
void SetNewValue(G4UIcommand* aComm, G4String aS);
private:
G4VModularPhysicsList* thePhysList;
G4UIcommand* theRadDecay;
G4UIcommand* theOptical;
G4UIdirectory* theDir;
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id:
// $Id:
//
//
// -------------------------------------------------------------------
@@ -37,14 +37,14 @@
// Author R. Hatcher 2014-10-15
//
// Modifications: based on G4PhysicsConstructorRegistry
//
//
//
// Class Description
// This is a singleton keeping pointers to all physics lists
// Class Description - End
#ifndef G4PhysListRegistry_h
#define G4PhysListRegistry_h 1
#ifndef G4PhysListRegistry_hh
#define G4PhysListRegistry_hh 1
#include <vector>
#include <map>
@@ -59,10 +59,10 @@ class G4PhysListRegistry
public:
static G4PhysListRegistry* Instance();
// access
// access
~G4PhysListRegistry();
void AddFactory(G4String name, G4VBasePhysListStamper*);
void AddPhysicsExtension(G4String name, G4String procname);
// mapping from extension name to actual physics contructor process name
@@ -70,7 +70,6 @@ public:
G4VModularPhysicsList* GetModularPhysicsList(const G4String& name);
G4VModularPhysicsList* GetModularPhysicsListFromEnv();
G4bool IsReferencePhysList(G4String nam) const;
const std::vector<G4String>& AvailablePhysLists() const;
@@ -80,10 +79,16 @@ public:
void PrintAvailablePhysLists() const;
G4bool DeconstructPhysListName(const G4String& name, G4String& plBase,
std::vector<G4String>& physExt,
std::vector<G4String>& physExt,
std::vector<G4int>& replace,
G4int verbose=0) const;
G4bool FindLongestMatch(const G4String& workName,
const G4String& searchName,
const std::vector<G4String>& validNames,
G4String& bestMatch,
G4int verbose=0) const;
inline void SetVerbose(G4int val) { verbose = val; }
inline G4int GetVerbose() const { return verbose; }
@@ -112,7 +117,7 @@ private:
G4String systemDefault; /// use this if user hasn't set userDefault
/// or attempts to set the userDefault=""
// Make these mutable and update them on each request because the map might
// Make these mutable and update them on each request because the map might
// have been updated by the addition of new entries
// The only reason to have them at all is that that original interface
// returned a const reference and so we can't pass back a local object
@@ -93,7 +93,7 @@ G4_DECLARE_PHYSLIST_FACTORY(Shielding);
// some extra hoops because the physlist factory expects to be able
// to construct a list using just a verbosity argument
// but
// but
// "ShieldingLEND" is Shielding(verbose,"LEND");
// "ShieldingM" is Shielding(verbose,"HP","M");
@@ -124,4 +124,18 @@ G4_DECLARE_PHYSLIST_FACTORY(G4GenericPhysicsList);
#include "QGSP_BIC_AllHP.hh"
G4_DECLARE_PHYSLIST_FACTORY(QGSP_BIC_AllHP);
//
#include "FTFQGSP_BERT.hh"
G4_DECLARE_PHYSLIST_FACTORY(FTFQGSP_BERT);
//// should these also be included?
/*
#include "FTF_BIC.hh"
G4_DECLARE_PHYSLIST_FACTORY(FTF_BIC);
#include "QGS_BIC.hh"
G4_DECLARE_PHYSLIST_FACTORY(QGS_BIC);
*/
//
+5 -4
View File
@@ -889,6 +889,7 @@ template<class T> TLBE<T>::~TLBE()
#include "G4LossTableManager.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4NuclearLevelData.hh"
#include "G4NuclideTable.hh"
template<class T> void TLBE<T>::ConstructGeneral() {
@@ -917,14 +918,15 @@ template<class T> TLBE<T>::~TLBE()
G4ParticleTable::GetParticleTable()->GetIonTable();
G4RadioactiveDecay *theRadioactiveDecay = new G4RadioactiveDecay();
{
//Fix for activation of RadioactiveDecay, based on G4RadioactiveDecayPhysics
G4EmParameters* param = G4EmParameters::Instance();
param->SetAugerCascade(true);
param->AddPhysics("world","G4RadioactiveDecay");
G4NuclearLevelData::GetInstance()->GetParameters()->SetUseFilesNEW(true);
G4NuclearLevelData::GetInstance()->GetParameters()->SetStoreAllLevels(true);
G4DeexPrecoParameters* deex = G4NuclearLevelData::GetInstance()->GetParameters();
deex->SetStoreAllLevels(true);
deex->SetMaxLifeTime(G4NuclideTable::GetInstance()->GetThresholdOfHalfLife()
/std::log(2.));
G4LossTableManager* man = G4LossTableManager::Instance();
G4VAtomDeexcitation* ad = man->AtomDeexcitation();
@@ -933,7 +935,6 @@ template<class T> TLBE<T>::~TLBE()
man->SetAtomDeexcitation(ad);
ad->InitialiseAtomicDeexcitation();
}
}
for (G4int i=0; i<theIonTable->Entries(); i++)
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: Shielding.icc 101813 2016-11-30 18:05:43Z gunter $
// $Id: Shielding.icc 107319 2017-11-08 16:29:22Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -70,16 +70,27 @@
#include "G4DataQuestionaire.hh"
#include "G4HadronPhysicsShielding.hh"
#include "G4HadronPhysicsShieldingLEND.hh"
//template<class T> TShielding<T>::TShielding(G4int ver): T()
template<class T> TShielding<T>::TShielding( G4int verbose, G4String LEN_model,
G4String HadrPhysVariant ): T()
{
size_t find = LEN_model.find("LEND__");
G4String evaluation;
if ( find != G4String::npos )
{
evaluation=LEN_model;
evaluation.erase(0,find+6);
LEN_model="LEND";
}
// default cut value (1.0mm)
// defaultCutValue = 1.0*CLHEP::mm;
G4DataQuestionaire it(photon, neutron, radioactive);
G4cout << "<<< Geant4 Physics List simulation engine: Shielding"
<< HadrPhysVariant<< " 2.1"<<G4endl;
if ( LEN_model=="LEND" ) G4cout << "<<< LEND will be used for low energy neutron and gammp projectiles" << G4endl;
G4cout <<G4endl;
this->defaultCutValue = 0.7*CLHEP::mm;
this->SetVerboseLevel(verbose);
@@ -92,22 +103,18 @@ template<class T> TShielding<T>::TShielding( G4int verbose, G4String LEN_model,
//emOptions.SetPIXE(true); // To activate Particle Induced X-Ray Emission (PIXE)
// Synchroton Radiation & GN Physics
this->RegisterPhysics( new G4EmExtraPhysics(verbose) );
G4EmExtraPhysics* emExtraPhysics = new G4EmExtraPhysics(verbose);
if ( LEN_model == "LEND" ) {
// Use LEND model for Gamma Nuclear
emExtraPhysics->LENDGammaNuclear(true);
}
this->RegisterPhysics( emExtraPhysics );
// Decays
this->RegisterPhysics( new G4DecayPhysics(verbose) );
//if ( rad == true ) this->RegisterPhysics( new G4RadioactiveDecayPhysics(verbose) );
this->RegisterPhysics( new G4RadioactiveDecayPhysics(verbose) );
size_t find = LEN_model.find("LEND__");
G4String evaluation;
if ( find != G4String::npos )
{
evaluation=LEN_model;
evaluation.erase(0,find+6);
LEN_model="LEND";
}
// Hadron Elastic scattering
if ( LEN_model == "HP" )
{
@@ -126,29 +133,28 @@ template<class T> TShielding<T>::TShielding( G4int verbose, G4String LEN_model,
this->RegisterPhysics( new G4HadronElasticPhysicsHP(verbose) );
}
G4HadronPhysicsShielding* hps;
// Hadron Physics
G4VPhysicsConstructor* hpc;
// Hadron Physics HP or LEND
if (HadrPhysVariant == "M") {
hps = new G4HadronPhysicsShielding("hInelastic Shielding", verbose, 9.5*CLHEP::GeV, 9.9*CLHEP::GeV);
hpc = new G4HadronPhysicsShielding("hInelastic Shielding", verbose, 9.5*CLHEP::GeV, 9.9*CLHEP::GeV);
} else {
hps = new G4HadronPhysicsShielding("hInelastic Shielding", verbose, 4.0*CLHEP::GeV, 5.0*CLHEP::GeV);
hpc = new G4HadronPhysicsShielding("hInelastic Shielding", verbose, 4.0*CLHEP::GeV, 5.0*CLHEP::GeV);
}
if ( LEN_model == "HP" )
{
;
}
else if ( LEN_model == "LEND" )
{
hps->UseLEND(evaluation);
}
else
{
if ( LEN_model == "LEND" ) {
delete hpc;
if (HadrPhysVariant == "M") {
hpc = new G4HadronPhysicsShieldingLEND("hInelastic ShieldingLEND", verbose, 9.5*CLHEP::GeV, 9.9*CLHEP::GeV);
} else {
hpc = new G4HadronPhysicsShieldingLEND("hInelastic ShieldingLEND", verbose, 4.0*CLHEP::GeV, 5.0*CLHEP::GeV);
}
} else {
//G4cout << "Shielding Physics List: Warning." <<G4endl;
//G4cout << "Name of Low Energy Neutron model " << LEN_model << " is invalid." <<G4endl;
//G4cout << "Will use neutron HP package." <<G4endl;
}
this->RegisterPhysics( hps );
//this->RegisterPhysics( new G4HadronPhysicsShielding(verbose,lend));
this->RegisterPhysics( hpc );
if ( LEN_model == "HP" ) {
//Activate prodcuton of fission fragments in neutronHP
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ShieldingLEND.hh 83151 2014-08-06 16:22:30Z klg $
//
//---------------------------------------------------------------------------
//
// ClassName:
//
// Author: 7 Nov 2017 Tatsumi Koi
// created from Shielding
//
// Modified:
//
//----------------------------------------------------------------------------
//
#ifndef TShieldingLEND_h
#define TShieldingLEND_h 1
#include <CLHEP/Units/SystemOfUnits.h>
#include "globals.hh"
#include "G4VModularPhysicsList.hh"
#include "CompileTimeConstraints.hh"
template<class T>
class TShieldingLEND: public T
{
public:
//TShieldingLEND(G4int ver = 1);
//TShieldingLEND(G4int ver = 1, G4bool rad=true, G4bool lend=false);
explicit TShieldingLEND( G4int verbose = 1 , G4String low_energy_neutron_model = "LEND",
G4String HadrPhysVariant = "");
virtual ~TShieldingLEND();
public:
// SetCuts()
virtual void SetCuts();
private:
enum {ok = CompileTimeConstraints::IsA<T, G4VModularPhysicsList>::ok };
};
#include "ShieldingLEND.icc"
typedef TShieldingLEND<G4VModularPhysicsList> ShieldingLEND;
#endif
@@ -0,0 +1,141 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ShieldingLEND.icc 101814 2016-11-30 18:16:07Z gunter $
//
//---------------------------------------------------------------------------
//
// ClassName:
//
// Author: 7 Nov 2017 Tatsumi Koi
// created from Shielding
//
// Modified:
//----------------------------------------------------------------------------
//
#include <iomanip>
#include "globals.hh"
#include "G4ios.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4DecayPhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4EmProcessOptions.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmExtraPhysics.hh"
#include "G4IonQMDPhysics.hh"
#include "G4IonElasticPhysics.hh"
#include "G4StoppingPhysics.hh"
#include "G4HadronElasticPhysicsLEND.hh"
#include "G4DataQuestionaire.hh"
#include "G4HadronPhysicsShieldingLEND.hh"
template<class T> TShieldingLEND<T>::TShieldingLEND( G4int verbose, G4String /*LEN_model*/,
G4String HadrPhysVariant ): T()
{
// default cut value (1.0mm)
// defaultCutValue = 1.0*CLHEP::mm;
G4DataQuestionaire it(photon, neutron, radioactive);
G4cout << "<<< Geant4 Physics List simulation engine: ShieldingLEND"
<< HadrPhysVariant<< " 2.1"<<G4endl;
G4cout <<G4endl;
this->defaultCutValue = 0.7*CLHEP::mm;
this->SetVerboseLevel(verbose);
// EM Physics
this->RegisterPhysics( new G4EmStandardPhysics(verbose) );
//G4EmProcessOptions emOptions;
//emOptions.SetFluo(true); // To activate deexcitation processes and fluorescence
//emOptions.SetAuger(true); // To activate Auger effect if deexcitation is activated
//emOptions.SetPIXE(true); // To activate Particle Induced X-Ray Emission (PIXE)
// Synchroton Radiation & GN Physics
G4EmExtraPhysics* emExtraPhysics = new G4EmExtraPhysics(verbose);
// Use LEND model for Gamma Nuclear
emExtraPhysics->LENDGammaNuclear(true);
this->RegisterPhysics( emExtraPhysics );
// Decays
this->RegisterPhysics( new G4DecayPhysics(verbose) );
this->RegisterPhysics( new G4RadioactiveDecayPhysics(verbose) );
G4String evaluation("");
//evaluation="ENDF/BVII.1";
//"ENDF/BVII.1" is the only evaluation currently supported.
// Hadron Elastic scattering
this->RegisterPhysics( new G4HadronElasticPhysicsLEND(verbose,evaluation) );
G4DataQuestionaire itt(lend);
G4HadronPhysicsShieldingLEND* hps;
// Hadron Physics
if (HadrPhysVariant == "M") {
hps = new G4HadronPhysicsShieldingLEND("hInelastic ShieldingLEND", verbose, 9.5*CLHEP::GeV, 9.9*CLHEP::GeV);
} else {
hps = new G4HadronPhysicsShieldingLEND("hInelastic ShieldingLEND", verbose, 4.0*CLHEP::GeV, 5.0*CLHEP::GeV);
}
hps->UseLEND(evaluation);
this->RegisterPhysics( hps );
// Stopping Physics
this->RegisterPhysics( new G4StoppingPhysics(verbose) );
// Ion Physics
this->RegisterPhysics( new G4IonQMDPhysics(verbose) );
this->RegisterPhysics( new G4IonElasticPhysics(verbose) );
// Neutron tracking cut --> not by default
// this->RegisterPhysics( new G4NeutronTrackingCut(verbose));
}
template<class T> TShieldingLEND<T>::~TShieldingLEND()
{
}
template<class T> void TShieldingLEND<T>::SetCuts()
{
if (this->verboseLevel >1){
G4cout << "ShieldingLEND::SetCuts:";
}
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
this->SetCutsWithDefault();
//Set proton cut value to 0 for producing low energy recoil nucleus
this->SetCutValue(0, "proton");
}
+8 -2
View File
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 97176 2016-05-27 12:42:50Z gcosmo $
# $Id: sources.cmake 107319 2017-11-08 16:29:22Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -116,10 +116,13 @@ GEANT4_DEFINE_MODULE(NAME G4phys_lists
FTFP_BERT_TRV.icc
FTFP_BERT_ATL.hh
FTFP_BERT_ATL.icc
FTFQGSP_BERT.hh
FTFQGSP_BERT.icc
G4GenericPhysicsList.hh
G4GenericPhysicsList.icc
G4PhysListFactory.hh
LBE.hh
G4PhysListFactoryMessenger.hh
LBE.hh
LBE.icc
NuBeam.hh
NuBeam.icc
@@ -144,6 +147,8 @@ GEANT4_DEFINE_MODULE(NAME G4phys_lists
FTFP_INCLXX_HP.hh
Shielding.hh
Shielding.icc
ShieldingLEND.hh
ShieldingLEND.icc
G4PhysListRegistry.hh
G4PhysListStamper.hh
G4PhysListFactoryAlt.hh
@@ -152,6 +157,7 @@ GEANT4_DEFINE_MODULE(NAME G4phys_lists
G4RegisterPhysLists.icc
SOURCES
G4PhysListFactory.cc
G4PhysListFactoryMessenger.cc
QBBC.cc
G4PhysListRegistry.cc
G4PhysListFactoryAlt.cc
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhysListFactory.cc 103591 2017-04-19 07:53:55Z gcosmo $
// $Id: G4PhysListFactory.cc 107319 2017-11-08 16:29:22Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -44,6 +44,7 @@
#include "FTFP_BERT_HP.hh"
#include "FTFP_BERT_TRV.hh"
#include "FTFP_BERT_ATL.hh"
#include "FTFQGSP_BERT.hh"
#include "FTFP_INCLXX.hh"
#include "FTFP_INCLXX_HP.hh"
#include "FTF_BIC.hh"
@@ -59,6 +60,7 @@
#include "QGSP_INCLXX.hh"
#include "QGSP_INCLXX_HP.hh"
#include "Shielding.hh"
#include "ShieldingLEND.hh"
#include "NuBeam.hh"
#include "G4EmStandardPhysics.hh"
@@ -70,14 +72,16 @@
#include "G4EmStandardPhysicsSS.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "G4PhysListFactoryMessenger.hh"
#include "G4UImessenger.hh"
G4PhysListFactory::G4PhysListFactory()
: defName("FTFP_BERT"),verbose(1)
: defName("FTFP_BERT"),verbose(1),theMessenger(nullptr)
{
nlists_hadr = 22;
G4String ss[22] = {
"FTFP_BERT","FTFP_BERT_TRV","FTFP_BERT_ATL","FTFP_BERT_HP","FTFP_INCLXX",
"FTFP_INCLXX_HP","FTF_BIC", "LBE","QBBC",
nlists_hadr = 23;
G4String ss[23] = {
"FTFP_BERT","FTFP_BERT_TRV","FTFP_BERT_ATL","FTFP_BERT_HP","FTFQGSP_BERT",
"FTFP_INCLXX","FTFP_INCLXX_HP","FTF_BIC", "LBE","QBBC",
"QGSP_BERT","QGSP_BERT_HP","QGSP_BIC","QGSP_BIC_HP","QGSP_BIC_AllHP",
"QGSP_FTFP_BERT","QGSP_INCLXX","QGSP_INCLXX_HP","QGS_BIC",
"Shielding","ShieldingLEND","ShieldingM","NuBeam"};
@@ -93,7 +97,9 @@ G4PhysListFactory::G4PhysListFactory()
}
G4PhysListFactory::~G4PhysListFactory()
{}
{
delete theMessenger;
}
G4VModularPhysicsList*
G4PhysListFactory::ReferencePhysList()
@@ -145,11 +151,12 @@ G4PhysListFactory::GetReferencePhysList(const G4String& name)
G4cout << "G4PhysListFactory::GetReferencePhysList <" << had_name
<< em_name << "> EMoption= " << em_opt << G4endl;
}
G4VModularPhysicsList* p = 0;
G4VModularPhysicsList* p = nullptr;
if(had_name == "FTFP_BERT") {p = new FTFP_BERT(verbose);}
else if(had_name == "FTFP_BERT_HP") {p = new FTFP_BERT_HP(verbose);}
else if(had_name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV(verbose);}
else if(had_name == "FTFP_BERT_ATL") {p = new FTFP_BERT_ATL(verbose);}
else if(had_name == "FTFQGSP_BERT") {p = new FTFQGSP_BERT(verbose);}
else if(had_name == "FTFP_INCLXX") {p = new FTFP_INCLXX(verbose);}
else if(had_name == "FTFP_INCLXX_HP") {p = new FTFP_INCLXX_HP(verbose);}
else if(had_name == "FTF_BIC") {p = new FTF_BIC(verbose);}
@@ -165,7 +172,7 @@ G4PhysListFactory::GetReferencePhysList(const G4String& name)
else if(had_name == "QGSP_INCLXX_HP") {p = new QGSP_INCLXX_HP(verbose);}
else if(had_name == "QGS_BIC") {p = new QGS_BIC(verbose);}
else if(had_name == "Shielding") {p = new Shielding(verbose);}
else if(had_name == "ShieldingLEND") {p = new Shielding(verbose,"LEND");}
else if(had_name == "ShieldingLEND") {p = new ShieldingLEND(verbose);}
else if(had_name == "ShieldingM") {p = new Shielding(verbose,"HP","M");}
else if(had_name == "NuBeam") {p = new NuBeam(verbose);}
else {
@@ -178,7 +185,7 @@ G4PhysListFactory::GetReferencePhysList(const G4String& name)
<< em_name << " is built" << G4endl;
G4int ver = p->GetVerboseLevel();
p->SetVerboseLevel(0);
if(0 < em_opt) {
if(0 < em_opt && had_name != "LBE") {
if(1 == em_opt) {
p->ReplacePhysics(new G4EmStandardPhysics_option1(verbose));
} else if(2 == em_opt) {
@@ -198,6 +205,7 @@ G4PhysListFactory::GetReferencePhysList(const G4String& name)
}
}
p->SetVerboseLevel(ver);
theMessenger = new G4PhysListFactoryMessenger(p);
}
G4cout << G4endl;
return p;
@@ -41,7 +41,7 @@
namespace g4alt {
G4PhysListFactory::G4PhysListFactory()
G4PhysListFactory::G4PhysListFactory()
{
}
@@ -53,30 +53,30 @@ void G4PhysListFactory::SetDefaultReferencePhysList(const G4String& name)
return G4PhysListRegistry::Instance()->SetUserDefaultPhysList(name);
}
G4VModularPhysicsList*
G4VModularPhysicsList*
G4PhysListFactory::ReferencePhysList()
{
return G4PhysListRegistry::Instance()->GetModularPhysicsListFromEnv();
}
G4VModularPhysicsList*
G4VModularPhysicsList*
G4PhysListFactory::GetReferencePhysList(const G4String& name)
{
return G4PhysListRegistry::Instance()->GetModularPhysicsList(name);
}
G4bool G4PhysListFactory::IsReferencePhysList(const G4String& name)
{
return G4PhysListRegistry::Instance()->IsReferencePhysList(name);
}
const std::vector<G4String>&
const std::vector<G4String>&
G4PhysListFactory::AvailablePhysLists() const
{
return G4PhysListRegistry::Instance()->AvailablePhysLists();
}
const std::vector<G4String>&
const std::vector<G4String>&
G4PhysListFactory::AvailablePhysListsEM() const
{
return G4PhysListRegistry::Instance()->AvailablePhysListsEM();
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PhysListFactoryMessenger.cc 66704 2013-01-10 18:20:17Z gunter $
//
//---------------------------------------------------------------------------
//
// ClassName: G4PhysListFactoryMessenger
//
// Author: 2017 V.Ivanchenko
//
//----------------------------------------------------------------------------
//
#include "G4PhysListFactoryMessenger.hh"
#include "G4VModularPhysicsList.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4OpticalPhysics.hh"
G4PhysListFactoryMessenger::G4PhysListFactoryMessenger(G4VModularPhysicsList* pl)
{
//G4cout << "### G4PhysListFactoryMessenger constructed" << G4endl;
thePhysList = pl;
theDir = new G4UIdirectory("/physics_lists/factory/");
theDir->SetGuidance("commands for configuration of physics lists.");
theRadDecay = new G4UIcommand("/physics_lists/factory/addRadioactiveDecay",this);
theRadDecay->SetGuidance("Enable radioactive decay.");
theRadDecay->AvailableForStates(G4State_PreInit,G4State_Init,G4State_Idle);
theOptical = new G4UIcommand("/physics_lists/factory/addOptical",this);
theOptical->SetGuidance("Enable optical physics.");
theOptical->AvailableForStates(G4State_PreInit,G4State_Init,G4State_Idle);
}
G4PhysListFactoryMessenger::~G4PhysListFactoryMessenger()
{
delete theOptical;
delete theRadDecay;
delete theDir;
}
void G4PhysListFactoryMessenger::SetNewValue(G4UIcommand* aComm, G4String)
{
if(aComm == theRadDecay) {
thePhysList->RegisterPhysics(new G4RadioactiveDecayPhysics(1));
} else if(aComm == theOptical) {
thePhysList->RegisterPhysics(new G4OpticalPhysics(1));
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id:
// $Id:
//
// -------------------------------------------------------------------
//
@@ -52,10 +52,13 @@
G4ThreadLocal G4PhysListRegistry* G4PhysListRegistry::theInstance = 0;
const int doReplace = 0x01; // _ (ReplacePhysics) vs. + (RegisterPhysics)
const int isCtorName = 0x02; // true if actual physCtor name vs. ext name
G4PhysListRegistry* G4PhysListRegistry::Instance()
{
if ( 0 == theInstance) {
static G4ThreadLocal G4PhysListRegistry *manager_G4MT_TLS_ = 0;
static G4ThreadLocal G4PhysListRegistry *manager_G4MT_TLS_ = 0;
if (!manager_G4MT_TLS_) manager_G4MT_TLS_ = new G4PhysListRegistry;
G4PhysListRegistry &manager = *manager_G4MT_TLS_;
theInstance = &manager;
@@ -70,8 +73,11 @@ G4PhysListRegistry* G4PhysListRegistry::Instance()
theInstance->AddPhysicsExtension("PEN","G4EmPenelopePhysics");
// the GS EM extension originally required double underscores
// support either one or two as __GS is confusing to users
// same for __SS
theInstance->AddPhysicsExtension("GS","G4EmStandardPhysicsGS");
theInstance->AddPhysicsExtension("_GS","G4EmStandardPhysicsGS");
theInstance->AddPhysicsExtension("SS","G4EmStandardPhysicsSS");
theInstance->AddPhysicsExtension("_SS","G4EmStandardPhysicsSS");
return theInstance;
}
@@ -105,15 +111,15 @@ void G4PhysListRegistry::AddPhysicsExtension(G4String name, G4String procname)
physicsExtensions[name] = procname;
}
G4VModularPhysicsList*
G4VModularPhysicsList*
G4PhysListRegistry::GetModularPhysicsList(const G4String& name)
{
//
//
//
G4String plBase = "";
std::vector<G4String> physExt;
std::vector<G4int> physReplace;
G4bool allKnown =
G4bool allKnown =
DeconstructPhysListName(name,plBase,physExt,physReplace,verbose);
size_t npc = physExt.size();
@@ -121,13 +127,13 @@ G4PhysListRegistry::GetModularPhysicsList(const G4String& name)
G4cout << "G4PhysListRegistry::GetModularPhysicsList <"
<< name << ">"
<< ", as \"" << plBase << "\" with extensions \"";
for ( size_t ipc = 0; ipc < npc; ++ipc )
G4cout << ((physReplace[ipc]>0)?"_":"+") << physExt[ipc];
for ( size_t ipc = 0; ipc < npc; ++ipc )
G4cout << ((physReplace[ipc]&doReplace)?"_":"+") << physExt[ipc];
G4cout << "\"" << G4endl;
}
if ( ! allKnown ) {
// couldn't match what the user wanted ...
// couldn't match what the user wanted ...
G4cout << "### G4PhysListRegistry WARNING: " << name
<< " is not known" << G4endl << G4endl;
if ( ! unknownFatal ) return 0;
@@ -144,36 +150,37 @@ G4PhysListRegistry::GetModularPhysicsList(const G4String& name)
}
ED << "]" << G4endl;
}
G4Exception("G4PhysListRegistry::GetModularPhysicsList",
G4Exception("G4PhysListRegistry::GetModularPhysicsList",
"PhysicsList002", FatalException, ED);
return 0;
}
// if we want this method "const" then the next line becomes more complex
// because there is no const version of [] (which adds an entry if the
// because there is no const version of [] (which adds an entry if the
// key doesn't exist)
G4VModularPhysicsList* pl = factories[plBase]->Instantiate(verbose);
G4PhysicsConstructorRegistry* pcRegistry =
G4PhysicsConstructorRegistry* pcRegistry =
G4PhysicsConstructorRegistry::Instance();
G4int ver = pl->GetVerboseLevel();
pl->SetVerboseLevel(0);
for ( size_t ipc = 0; ipc < npc; ++ipc ) {
// got back a list of short names, need to use the map to get the
// got back a list of short names, need to use the map to get the
// full physics constructor name
G4String extName = physExt[ipc];
G4String pcname = physicsExtensions[extName];
G4String pcname =
((physReplace[ipc]&isCtorName)) ? extName : physicsExtensions[extName];
// this doesn't have a verbose option ... it should
// but G4PhysicsConstructorFactory doesn't support it
G4VPhysicsConstructor* pctor = pcRegistry->GetPhysicsConstructor(pcname);
G4String reporreg = "";
if ( physReplace[ipc] > 0 ) {
if (( physReplace[ipc] & doReplace)) {
pl->ReplacePhysics(pctor);
reporreg = "ReplacePhysics ";
} else {
pl->RegisterPhysics(pctor);
reporreg = "RegisterPhysics";
}
if ( verbose > 0 ) G4cout << "<<< " << reporreg << " with " << pcname
if ( verbose > 0 ) G4cout << "<<< " << reporreg << " with " << pcname
<< " \"" << extName << "\"" << G4endl;
}
pl->SetVerboseLevel(ver);
@@ -183,10 +190,10 @@ G4PhysListRegistry::GetModularPhysicsList(const G4String& name)
return pl;
}
G4VModularPhysicsList*
G4VModularPhysicsList*
G4PhysListRegistry::GetModularPhysicsListFromEnv()
{
//
//
// instantiate PhysList by environment variable "PHYSLIST"
// if not set use default
G4String name = "";
@@ -196,11 +203,11 @@ G4PhysListRegistry::GetModularPhysicsListFromEnv()
} else {
name = userDefault;
G4cout << "### G4PhysListRegistry WARNING: "
<< " environment variable PHYSLIST is not defined"
<< G4endl
<< " Default Physics Lists " << name
<< " is instantiated"
<< G4endl;
<< " environment variable PHYSLIST is not defined"
<< G4endl
<< " Default Physics Lists " << name
<< " is instantiated"
<< G4endl;
}
return GetModularPhysicsList(name);
}
@@ -215,53 +222,42 @@ G4bool G4PhysListRegistry::IsReferencePhysList(G4String name) const
}
G4bool G4PhysListRegistry::DeconstructPhysListName(const G4String& name,
G4String& plBase,
G4String& plBase,
std::vector<G4String>& physExt,
std::vector<G4int>& replace,
G4int verb) const
{
// Take apart a name given to us by the user
// this name might be a base PhysList + unknown number of extensions
// Extensions preceeded with a "_" should use
// Extensions preceeded with a "_" should use
// ReplacePhysics()
// those proceeded with a "+" should use
// RegisterPhysics()
// the former is in line with previous behaviour, while the second allows
// the former is in line with previous behaviour, while the second allows
// additional flexibility
plBase = "";
physExt.clear();
replace.clear();
bool allKnown = false;
G4String workingName = name;
const std::vector<G4String>& availBases = AvailablePhysLists();
const std::vector<G4String>& availBases = AvailablePhysLists();
const std::vector<G4String>& availExtras = AvailablePhysicsExtensions();
G4PhysicsConstructorRegistry* physConstRegistry =
G4PhysicsConstructorRegistry* physConstRegistry =
G4PhysicsConstructorRegistry::Instance();
const std::vector<G4String>& availPhysCtors =
physConstRegistry->AvailablePhysicsConstructors();
// find the longest base list that is contained in the user supplied name
// and starts at the beginning
size_t nb = availBases.size();
for (size_t ib=0; ib<nb; ++ib) {
const G4String& testBase = availBases[ib];
size_t ipos = workingName.find(testBase);
if ( ipos == 0 ) {
if ( testBase.size() > plBase.size() ) {
plBase = testBase;
allKnown = true;
if ( verb > 3 ) { G4cout << " physlist current best guess: " << testBase << G4endl; }
} else {
if ( verb > 3 ) { G4cout << " physlist match but shorter: " << testBase << G4endl; }
}
} else {
if ( verb > 3 ) { G4cout << " physlist reject: " << testBase << G4endl; }
}
}
if ( verb > 2 ) {
G4cout << " physlist " << name << ", base known " << allKnown
<< " chosen plBase \"" << plBase << "\"" << G4endl;
G4String bestBase = "";
allKnown = FindLongestMatch(workingName,"base",availBases,plBase);
if ( verb > 2 ) {
G4cout << " " << name << ", base known=" << ((allKnown)?"true":"false")
<< " chosen plBase \"" << plBase << "\"" << G4endl;
}
if ( ! allKnown ) {
// didn't find any matching base physics list
@@ -271,75 +267,57 @@ G4bool G4PhysListRegistry::DeconstructPhysListName(const G4String& name,
// remove base name for working name
workingName.erase(0,plBase.size());
// now start trying to match up extensions
// now start trying to match up extensions and/or physCtors
// each should be preceeded by at "_" (replace) or "+" (register)
// but don't freak if it isn't, just assume "_"
size_t ne = availExtras.size();
while ( ! workingName.empty() ) {
char c = workingName.data()[0]; // leading character
if ( '_' == c || '+' == c ) workingName.erase(0,1); // and remove it
G4int replaceExtra = ( c != '+' );
G4int replaceExtra = (( c != '+' ) ? doReplace : 0 );
G4String extraName = "";
G4bool extraKnown = false;
for (size_t ie=0; ie<ne; ++ie) {
const G4String& testExtra = availExtras[ie];
size_t ipos = workingName.find(testExtra);
if ( ipos == 0 ) {
if ( testExtra.size() > extraName.size() ) {
extraName = testExtra;
extraKnown = true;
#ifdef G4VERBOSE
if ( verb > 3 ) {
G4cout << " physextra current best guess: "
<< testExtra << G4endl;
}
} else {
if ( verb > 3 ) {
G4cout << " physextra match but shorter: "
<< testExtra << G4endl;
}
#endif
}
} else {
#ifdef G4VERBOSE
if ( verb > 3 ) {
G4cout << " physextra reject: " << testExtra << G4endl;
}
#endif
}
}
#ifdef G4VERBOSE
if ( verb > 2 ) {
G4cout << " physextra " << name << " [" << workingName << "]"
<<", extra known " << extraKnown
<< " chosen extra \"" << extraName << "\""
<< " replace " << replaceExtra << G4endl;
}
#endif
extraKnown = FindLongestMatch(workingName,"extNames",availExtras,extraName);
if ( extraKnown ) {
// physics mapping name is known, but is it actually linked to physics?
//const issue// G4String pcname = physicsExtensions[extraName];
std::map<G4String,G4String>::const_iterator itr =
//const issue// G4String pcname = physicsExtensions[extraName];
std::map<G4String,G4String>::const_iterator itr =
physicsExtensions.find(extraName);
G4String pcname = "";
if ( itr != physicsExtensions.end() ) pcname = itr->second;
bool realknown = physConstRegistry->IsKnownPhysicsConstructor(pcname);
if ( ! realknown ) allKnown = false;
#ifdef G4VERBOSE
if ( verb > 2 ) {
if ( verb > 2 ) {
G4cout << " extraName \"" << extraName << "\" maps to physics ctor \""
<< pcname << "\" which is itself realknown " << realknown
<< G4endl;
}
#endif
if ( ! realknown ) allKnown = false;
} else {
// perhaps it's an explicit physCtor name
extraKnown =
FindLongestMatch(workingName,"physCtors",availPhysCtors,extraName);
if ( extraKnown ) replaceExtra |= isCtorName; // flag it
}
#ifdef G4VERBOSE
if ( verb > 2 ) {
G4cout << " physextra " << name << " [" << workingName << "]"
<<", extra known " << extraKnown
<< " chosen extra \"" << extraName << "\""
<< " replace " << replaceExtra << G4endl;
}
#endif
if ( extraKnown ) {
physExt.push_back(extraName);
replace.push_back(replaceExtra);
// and remove it so we can look for the next bit
workingName.erase(0,extraName.size());
} else {
#ifdef G4VERBOSE
if ( verb > 2 ) {
G4cout << " workingName \"" << workingName << "\""
if ( verb > 2 ) {
G4cout << " workingName \"" << workingName << "\""
<< " couldn't be found in the extensions list"
<< G4endl;
}
@@ -353,6 +331,43 @@ G4bool G4PhysListRegistry::DeconstructPhysListName(const G4String& name,
return allKnown;
}
G4bool G4PhysListRegistry::FindLongestMatch(const G4String& workingName,
const G4String& searchName,
const std::vector<G4String>& validNames,
G4String& bestMatch,
G4int verb) const
{
bestMatch = "";
bool found = false;
size_t n = validNames.size();
for (size_t i=0; i<n; ++i) {
const G4String& testName = validNames[i];
size_t ipos = workingName.find(testName);
if ( ipos == 0 ) {
if ( testName.size() > bestMatch.size() ) {
bestMatch = testName;
found = true;
if ( verb > 3 ) {
G4cout << " " << searchName << " current best guess: "
<< testName << G4endl;
}
} else {
if ( verb > 3 ) {
G4cout << " " << searchName << " match but shorter: "
<< testName << G4endl;
}
}
} else {
if ( verb > 3 ) {
G4cout << " " << searchName << " reject: " << testName << G4endl;
}
}
}
return found;
}
const std::vector<G4String>& G4PhysListRegistry::AvailablePhysLists() const
{
availBasePhysLists.clear();
@@ -378,7 +393,7 @@ const std::vector<G4String>& G4PhysListRegistry::AvailablePhysicsExtensions() co
const std::vector<G4String>& G4PhysListRegistry::AvailablePhysListsEM() const
{
// in principle this method could weed out all the extensions that aren't
// EM replacements ... but for now just use it as a synonym for
// EM replacements ... but for now just use it as a synonym for
// AvailablePhysicsExtensions()
return AvailablePhysicsExtensions();
}
@@ -414,4 +429,3 @@ void G4PhysListRegistry::PrintAvailablePhysLists() const
<< " to use ReplacePhysics() (\"_\") or RegisterPhysics() (\"+\")."
<< G4endl;
}