Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/// \brief Main program of the hadronic/Hadr00 example
|
||||
//
|
||||
//
|
||||
// $Id: Hadr00.cc 106244 2017-09-26 01:58:00Z gcosmo $
|
||||
// $Id: Hadr00.cc 109182 2018-04-03 07:18:45Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT4 Hadr00
|
||||
@@ -55,20 +55,16 @@
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4VisExecutive.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4UI_USE
|
||||
#include "G4UIExecutive.hh"
|
||||
#endif
|
||||
#include "G4VisExecutive.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
//choose the Random engine
|
||||
G4Random::setTheEngine(new CLHEP::RanecuEngine());
|
||||
//detect interactive mode (if no arguments) and define UI session
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if (argc == 1) { ui = new G4UIExecutive(argc,argv); }
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager * runManager = new G4MTRunManager();
|
||||
@@ -78,11 +74,11 @@ int main(int argc,char** argv) {
|
||||
G4int nThreads = G4UIcommand::ConvertToInt(argv[3]);
|
||||
runManager->SetNumberOfThreads(nThreads);
|
||||
}
|
||||
G4cout << "##### Hadr00 started for " << runManager->GetNumberOfThreads()
|
||||
G4cout << "##### Hadr00 started for " << runManager->GetNumberOfThreads()
|
||||
<< " threads" << " #####" << G4endl;
|
||||
#else
|
||||
G4RunManager * runManager = new G4RunManager();
|
||||
G4cout << "##### Hadr00 started in sequential mode"
|
||||
G4RunManager * runManager = new G4RunManager();
|
||||
G4cout << "##### Hadr00 started in sequential mode"
|
||||
<< " #####" << G4endl;
|
||||
#endif
|
||||
|
||||
@@ -94,21 +90,21 @@ int main(int argc,char** argv) {
|
||||
G4VModularPhysicsList* phys = nullptr;
|
||||
G4String physName = "";
|
||||
|
||||
// Physics List name defined via 3nd argument
|
||||
//Physics List name defined via 3nd argument
|
||||
if (argc>=3) { physName = argv[2]; }
|
||||
|
||||
// Physics List is defined via environment variable PHYSLIST
|
||||
if("" == physName) {
|
||||
//Physics List is defined via environment variable PHYSLIST
|
||||
if ("" == physName) {
|
||||
char* path = getenv("PHYSLIST");
|
||||
if (path) { physName = G4String(path); }
|
||||
}
|
||||
|
||||
// if name is not known to the factory use FTFP_BERT
|
||||
//if name is not known to the factory use FTFP_BERT
|
||||
if("" == physName || !factory.IsReferencePhysList(physName)) {
|
||||
physName = "FTFP_BERT";
|
||||
physName = "FTFP_BERT";
|
||||
}
|
||||
|
||||
// reference PhysicsList via its name
|
||||
//reference PhysicsList via its name
|
||||
phys = factory.GetReferencePhysList(physName);
|
||||
|
||||
runManager->SetUserInitialization(phys);
|
||||
@@ -117,39 +113,28 @@ int main(int argc,char** argv) {
|
||||
//set user action classes
|
||||
runManager->SetUserInitialization(new ActionInitialization(det));
|
||||
|
||||
//initialize visualization
|
||||
G4VisManager* visManager = nullptr;
|
||||
|
||||
//get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
#ifdef G4VIS_USE
|
||||
G4VisManager* visManager = 0;
|
||||
#endif
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc==1) // Define UI terminal for interactive mode
|
||||
{
|
||||
#ifdef G4VIS_USE
|
||||
//visualization manager
|
||||
visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
#ifdef G4UI_USE
|
||||
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
#endif
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
if (ui) {
|
||||
//interactive mode
|
||||
visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
} else {
|
||||
//batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
//job termination
|
||||
#ifdef G4VIS_USE
|
||||
//job termination
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History 106244 2017-09-26 01:58:00Z gcosmo $
|
||||
$Id: History 109655 2018-05-04 08:57:37Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -15,6 +15,22 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
03-05-18 J.Allison (exhadr00-V10-04-03)
|
||||
- RunAction.cc:
|
||||
o Remove G4VIS_USE.
|
||||
o Remove /vis/ commands - not necessary now and causes
|
||||
problem in Qt with in multithreaded mode.
|
||||
|
||||
29-03-18 V.Ivanchenko (exhadr00-V10-04-02)
|
||||
- DetectorConstruction - cleanup geometry
|
||||
- Hadr00.cc - more cleanup visualisation
|
||||
|
||||
24-03-18 M.Maire (exhadr00-V10-04-01)
|
||||
- Hadr00.cc : come back to FTFP_BERT
|
||||
|
||||
22-03-18 M.Maire (exhadr00-V10-04-00)
|
||||
- Hadr00.cc : remove G4UI_USE and G4VIS_USE
|
||||
|
||||
25-09-17 V.Ivanchenko (exhadr00-V10-03-00)
|
||||
- Added possibility to enable radioactive decay
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
############################################
|
||||
|
||||
**************************************************************
|
||||
Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
|
||||
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
|
||||
Copyright : Geant4 Collaboration
|
||||
References : NIM A 506 (2003), 250-303
|
||||
: IEEE-TNS 53 (2006), 270-278
|
||||
@@ -22,9 +22,7 @@ G4PhysListFactory::GetReferencePhysList <FTFP_BERT> EMoption= 0
|
||||
/tracking/verbose 0
|
||||
/testhadr/TargetMat G4_Al
|
||||
/testhadr/TargetRadius 2 cm
|
||||
/run/reinitializeGeometry
|
||||
/testhadr/TargetLength 50 cm
|
||||
/run/reinitializeGeometry
|
||||
/run/printProgress 10
|
||||
/run/setCut 1 km
|
||||
/testhadr/RadDecay true
|
||||
@@ -85,8 +83,8 @@ compt: for gamma SubType= 13 BuildTable= 1
|
||||
conv: for gamma SubType= 14 BuildTable= 1
|
||||
Lambda table from 1.022 MeV to 100 TeV, 18 bins per decade, spline: 1
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
BetheHeitler : Emin= 0 eV Emax= 80 GeV
|
||||
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV
|
||||
BetheHeitler : Emin= 0 eV Emax= 80 GeV AngularGenUrban
|
||||
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV AngularGenUrban
|
||||
|
||||
Rayl: for gamma SubType= 11 BuildTable= 1
|
||||
Lambda table from 100 eV to 100 keV, 7 bins per decade, spline: 0
|
||||
@@ -467,7 +465,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Model: BertiniCascade: 0 eV ---> 12 GeV
|
||||
Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
|
||||
Process: nCapture
|
||||
Model: nRadCapture: 0 eV ---> 100 TeV
|
||||
@@ -710,7 +707,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
|
||||
Model: hElasticGlauber: 1 GeV ---> 100 TeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
|
||||
|
||||
Process: pi+Inelastic
|
||||
Model: FTFP: 3 GeV ---> 100 TeV
|
||||
@@ -727,7 +723,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Model: hElasticLHEP: 0 eV ---> 1.0001 GeV
|
||||
Model: hElasticGlauber: 1 GeV ---> 100 TeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
|
||||
|
||||
Process: pi-Inelastic
|
||||
Model: FTFP: 3 GeV ---> 100 TeV
|
||||
@@ -751,7 +746,6 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Model: FTFP: 3 GeV ---> 100 TeV
|
||||
Model: BertiniCascade: 0 eV ---> 12 GeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
|
||||
---------------------------------------------------
|
||||
Hadronic Processes for triton
|
||||
@@ -812,7 +806,7 @@ EventAction: Event # 0 started
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 10
|
||||
User=0.06s Real=0.1s Sys=0.01s
|
||||
User=0.020000s Real=0.044197s Sys=0.000000s
|
||||
RunAction: End of run actions are started
|
||||
HistoManager: End of run actions are started
|
||||
### Fill Cross Sections for proton off Al
|
||||
@@ -1624,6 +1618,6 @@ HistoManager: End of run actions are started
|
||||
G4 kernel has come to Quit state.
|
||||
================== Deleting memory pools ===================
|
||||
Number of memory pools allocated: 11 of which, static: 0
|
||||
Dynamic pools deleted: 11 / Total memory freed: 0.037 MB
|
||||
Dynamic pools deleted: 11 / Total memory freed: 0.039 MB
|
||||
============================================================
|
||||
RunManagerKernel is deleted. Good bye :)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr00/include/DetectorConstruction.hh
|
||||
/// \brief Definition of the DetectorConstruction class
|
||||
//
|
||||
// $Id: DetectorConstruction.hh 106244 2017-09-26 01:58:00Z gcosmo $
|
||||
// $Id: DetectorConstruction.hh 109182 2018-04-03 07:18:45Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -46,7 +46,9 @@
|
||||
#include "globals.hh"
|
||||
#include "G4Material.hh"
|
||||
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class DetectorMessenger;
|
||||
class G4VModularPhysicsList;
|
||||
|
||||
@@ -73,18 +75,27 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void ComputeGeomParameters();
|
||||
|
||||
DetectorConstruction & operator=(const DetectorConstruction &right);
|
||||
DetectorConstruction(const DetectorConstruction&);
|
||||
|
||||
G4double fRadius;
|
||||
G4double fLength;
|
||||
G4double fWorldR;
|
||||
G4double fWorldZ;
|
||||
|
||||
G4Material* fTargetMaterial;
|
||||
G4Material* fWorldMaterial;
|
||||
|
||||
G4Tubs* fSolidW;
|
||||
G4Tubs* fSolidA;
|
||||
|
||||
G4LogicalVolume* fLogicTarget;
|
||||
G4LogicalVolume* fLogicWorld;
|
||||
|
||||
G4VPhysicalVolume* fPhysWorld;
|
||||
|
||||
DetectorMessenger* fDetectorMessenger;
|
||||
G4VModularPhysicsList* fPhysList;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr00/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
// $Id: DetectorConstruction.cc 106244 2017-09-26 01:58:00Z gcosmo $
|
||||
// $Id: DetectorConstruction.cc 109182 2018-04-03 07:18:45Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -69,8 +69,9 @@
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
: G4VUserDetectorConstruction(),
|
||||
fTargetMaterial(nullptr), fWorldMaterial(nullptr),
|
||||
fSolidW(nullptr), fSolidA(nullptr),
|
||||
fLogicTarget(nullptr), fLogicWorld(nullptr),
|
||||
fDetectorMessenger(nullptr), fPhysList(nullptr)
|
||||
fPhysWorld(nullptr), fPhysList(nullptr)
|
||||
{
|
||||
fDetectorMessenger = new DetectorMessenger(this);
|
||||
|
||||
@@ -80,6 +81,8 @@ DetectorConstruction::DetectorConstruction()
|
||||
fTargetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al");
|
||||
fWorldMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
|
||||
|
||||
ComputeGeomParameters();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -89,34 +92,39 @@ DetectorConstruction::~DetectorConstruction()
|
||||
delete fDetectorMessenger;
|
||||
}
|
||||
|
||||
void DetectorConstruction::ComputeGeomParameters()
|
||||
{
|
||||
// Sizes
|
||||
fWorldR = fRadius + CLHEP::cm;
|
||||
fWorldZ = fLength + CLHEP::cm;
|
||||
if(fPhysWorld) {
|
||||
fSolidW->SetOuterRadius(fWorldR);
|
||||
fSolidW->SetZHalfLength(fWorldZ*0.5);
|
||||
fSolidA->SetOuterRadius(fRadius);
|
||||
fSolidA->SetZHalfLength(fLength*0.5);
|
||||
}
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
{
|
||||
// Cleanup old geometry
|
||||
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
// Sizes
|
||||
G4double worldR = fRadius + cm;
|
||||
G4double worldZ = fLength + cm;
|
||||
if(fPhysWorld) { return fPhysWorld; }
|
||||
ComputeGeomParameters();
|
||||
|
||||
//
|
||||
// World
|
||||
//
|
||||
G4Tubs* solidW = new G4Tubs("World", 0., worldR, 0.5*worldZ, 0., twopi);
|
||||
fLogicWorld = new G4LogicalVolume(solidW, fWorldMaterial,"World");
|
||||
G4VPhysicalVolume* world = new G4PVPlacement(0, G4ThreeVector(),
|
||||
fLogicWorld, "World",
|
||||
0, false, 0);
|
||||
fSolidW = new G4Tubs("World", 0., fWorldR, 0.5*fWorldZ, 0., twopi);
|
||||
fLogicWorld = new G4LogicalVolume(fSolidW, fWorldMaterial,"World");
|
||||
fPhysWorld = new G4PVPlacement(nullptr, G4ThreeVector(0.,0.,0.),
|
||||
fLogicWorld, "World",
|
||||
nullptr, false, 0);
|
||||
|
||||
//
|
||||
// Target volume
|
||||
//
|
||||
G4Tubs* solidA = new G4Tubs("Target", 0., fRadius, 0.5*fLength, 0.,twopi);
|
||||
fLogicTarget = new G4LogicalVolume( solidA, fTargetMaterial, "Target");
|
||||
new G4PVPlacement(0, G4ThreeVector(), fLogicTarget, "Target",
|
||||
fSolidA = new G4Tubs("Target", 0., fRadius, 0.5*fLength, 0.,twopi);
|
||||
fLogicTarget = new G4LogicalVolume(fSolidA, fTargetMaterial, "Target");
|
||||
new G4PVPlacement(nullptr, G4ThreeVector(), fLogicTarget, "Target",
|
||||
fLogicWorld, false, 0);
|
||||
|
||||
G4cout << "### Target consist of "
|
||||
@@ -133,7 +141,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
return world;
|
||||
return fPhysWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -145,7 +153,7 @@ void DetectorConstruction::SetTargetMaterial(const G4String& mat)
|
||||
|
||||
if (material && material != fTargetMaterial) {
|
||||
fTargetMaterial = material;
|
||||
if(fLogicTarget) fLogicTarget->SetMaterial(fTargetMaterial);
|
||||
if(fLogicTarget) { fLogicTarget->SetMaterial(fTargetMaterial); }
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
}
|
||||
@@ -159,7 +167,7 @@ void DetectorConstruction::SetWorldMaterial(const G4String& mat)
|
||||
|
||||
if (material && material != fWorldMaterial) {
|
||||
fWorldMaterial = material;
|
||||
if(fLogicWorld) fLogicWorld->SetMaterial(fWorldMaterial);
|
||||
if(fLogicWorld) { fLogicWorld->SetMaterial(fWorldMaterial); }
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
}
|
||||
@@ -168,7 +176,7 @@ void DetectorConstruction::SetTargetRadius(G4double val)
|
||||
{
|
||||
if(val > 0.0 && val != fRadius) {
|
||||
fRadius = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
ComputeGeomParameters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +186,7 @@ void DetectorConstruction::SetTargetLength(G4double val)
|
||||
{
|
||||
if(val > 0.0 && val != fLength) {
|
||||
fLength = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
ComputeGeomParameters();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,18 +76,6 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
G4cout << "### Run " << id << " start" << G4endl;
|
||||
fHisto->BeginOfRun();
|
||||
}
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -106,12 +94,6 @@ void RunAction::EndOfRunAction(const G4Run*)
|
||||
}
|
||||
fHisto->EndOfRun();
|
||||
}
|
||||
#ifdef G4VIS_USE
|
||||
if (G4VVisManager::GetConcreteInstance()) {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user