Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/// \brief Main program of the hadronic/Hadr01 example
|
||||
//
|
||||
//
|
||||
// $Id: Hadr01.cc 107541 2017-11-22 08:24:57Z gcosmo $
|
||||
// $Id: Hadr01.cc 109185 2018-04-03 07:20:46Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT4 Hadr01
|
||||
@@ -61,20 +61,16 @@
|
||||
#include "EventAction.hh"
|
||||
#include "StackingAction.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
|
||||
CLHEP::HepRandom::setTheEngine(new CLHEP::MixMaxRng());
|
||||
//detect interactive mode (if no arguments) and define UI session
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if (argc == 1) { ui = new G4UIExecutive(argc,argv); }
|
||||
|
||||
//Construct the default run manager
|
||||
G4RunManager * runManager = new G4RunManager();
|
||||
@@ -87,7 +83,7 @@ int main(int argc,char** argv) {
|
||||
PhysicsListMessenger* mess = 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 name defined via environment variable
|
||||
@@ -96,15 +92,15 @@ int main(int argc,char** argv) {
|
||||
if (path) { physName = G4String(path); }
|
||||
}
|
||||
|
||||
// reference PhysicsList via its name
|
||||
if("" != physName && factory.IsReferencePhysList(physName)) {
|
||||
//reference PhysicsList via its name
|
||||
if ("" != physName && factory.IsReferencePhysList(physName)) {
|
||||
phys = factory.GetReferencePhysList(physName);
|
||||
|
||||
// instantiated messenger
|
||||
mess = new PhysicsListMessenger();
|
||||
}
|
||||
|
||||
// local Physics List
|
||||
//local Physics List
|
||||
if(!phys) { phys = new PhysicsList(); }
|
||||
|
||||
// define physics
|
||||
@@ -116,40 +112,29 @@ int main(int argc,char** argv) {
|
||||
runManager->SetUserAction(new EventAction());
|
||||
runManager->SetUserAction(new StackingAction());
|
||||
|
||||
//initialize visualization
|
||||
G4VisManager* visManager = nullptr;
|
||||
|
||||
//get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
#ifdef G4VIS_USE
|
||||
G4VisManager* visManager = nullptr;
|
||||
#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
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
//job termination
|
||||
delete mess;
|
||||
|
||||
return 0;
|
||||
delete visManager;
|
||||
delete runManager;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History 107541 2017-11-22 08:24:57Z gcosmo $
|
||||
$Id: History 109654 2018-05-04 08:57:00Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -15,6 +15,23 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
03-05-18 J.Allison (exhadr01-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.
|
||||
- DetectorConstruction.cc: Pass vis attributes as objects, not pointers.
|
||||
|
||||
29-03-18 V.Ivanchenko (exhadr01-V10-04-02)
|
||||
- DetectorConstruction, DetectorMessenger, HistoManager,
|
||||
PrimaryGeneratorAction - cleanup geometry definition
|
||||
|
||||
26-03-18 V.Ivanchenko (exhadr01-V10-04-01)
|
||||
- Fixed compilation
|
||||
|
||||
22-03-18 M.Maire (exhadr01-V10-04-00)
|
||||
- Hadr01.cc : remove G4UI_USE and G4VIS_USE
|
||||
|
||||
21-11-17 V.Ivanchenko (exhadr01-V10-03-00)
|
||||
- Fixed histograms and 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
|
||||
@@ -17,7 +17,6 @@
|
||||
#
|
||||
/testhadr/TargetMat G4_Al
|
||||
/testhadr/TargetRadius 1 cm
|
||||
/run/reinitializeGeometry
|
||||
/testhadr/TargetLength 10 cm
|
||||
/testhadr/NumberDivZ 100
|
||||
/testhadr/PrintModulo 10
|
||||
@@ -75,8 +74,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
|
||||
@@ -443,8 +442,7 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Model: FTFP: 3 GeV ---> 100 TeV
|
||||
Model: BertiniCascade: 1 GeV ---> 5 GeV
|
||||
Model: Binary Cascade: 0 eV ---> 1.5 GeV
|
||||
Cr_sctns: G4NeutronInelasticXS: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
Cr_sctns: G4ParticleInelasticXS: 0 eV ---> 100 TeV
|
||||
|
||||
Process: nCapture
|
||||
Model: nRadCapture: 0 eV ---> 100 TeV
|
||||
@@ -685,13 +683,11 @@ 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
|
||||
Model: BertiniCascade: 0 eV ---> 5 GeV
|
||||
Cr_sctns: Barashenkov-Glauber-Gribov: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
|
||||
---------------------------------------------------
|
||||
Hadronic Processes for pi-
|
||||
@@ -700,13 +696,11 @@ 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
|
||||
Model: BertiniCascade: 0 eV ---> 5 GeV
|
||||
Cr_sctns: Barashenkov-Glauber-Gribov: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
|
||||
Process: hBertiniCaptureAtRest
|
||||
|
||||
@@ -716,15 +710,12 @@ CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
|
||||
Process: hadElastic
|
||||
Model: hElasticCHIPS: 0 eV ---> 100 TeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: ChipsProtonElasticXS: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaElastic: 0 eV ---> 100 TeV
|
||||
|
||||
Process: protonInelastic
|
||||
Model: FTFP: 3 GeV ---> 100 TeV
|
||||
Model: BertiniCascade: 1 GeV ---> 5 GeV
|
||||
Model: Binary Cascade: 0 eV ---> 1.5 GeV
|
||||
Cr_sctns: Barashenkov-Glauber: 0 eV ---> 100 TeV
|
||||
Cr_sctns: GheishaInelastic: 0 eV ---> 100 TeV
|
||||
Cr_sctns: G4ParticleInelasticXS: 0 eV ---> 100 TeV
|
||||
|
||||
---------------------------------------------------
|
||||
Hadronic Processes for triton
|
||||
@@ -808,8 +799,8 @@ G4GeometryManager::ReportVoxelStats -- Voxel Statistics
|
||||
100.00 10k 1 197 200 0.00 Check
|
||||
### Run 0 starts.
|
||||
### Run 0 start
|
||||
RunAction::BeginOfRunAction: User=1.01s Real=1.3s Sys=0.01s
|
||||
NuclearData: User=0s Real=0s Sys=0s
|
||||
RunAction::BeginOfRunAction: User=0.880000s Real=0.946507s Sys=0.010000s
|
||||
NuclearData: User=0.000000s Real=0.000008s Sys=0.000000s
|
||||
EventAction: Event # 0 started
|
||||
EventAction: Event # 10 started
|
||||
EventAction: Event # 20 started
|
||||
@@ -823,33 +814,33 @@ EventAction: Event # 90 started
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 100
|
||||
User=0.16s Real=0.21s Sys=0s
|
||||
User=0.150000s Real=0.164718s Sys=0.000000s
|
||||
RunAction: End of run actions are started
|
||||
HistoManager: End of run actions are started
|
||||
========================================================
|
||||
Beam particle proton
|
||||
Beam Energy(MeV) 3000
|
||||
Number of events 100
|
||||
Average energy deposit (MeV) 71.54 RMS(MeV) 66.03
|
||||
Average number of steps 216
|
||||
Average number of gamma 1.77
|
||||
Average energy deposit (MeV) 65.7 RMS(MeV) 64.9
|
||||
Average number of steps 207.7
|
||||
Average number of gamma 1.79
|
||||
Average number of e- 3.79
|
||||
Average number of e+ 0.07
|
||||
Average number of neutrons 1.29
|
||||
Average number of protons 1.29
|
||||
Average number of e+ 0.03
|
||||
Average number of neutrons 1.02
|
||||
Average number of protons 0.98
|
||||
Average number of antiprotons 0
|
||||
Average number of pi+ & pi- 0.28
|
||||
Average number of pi0 0.21
|
||||
Average number of pi+ & pi- 0.25
|
||||
Average number of pi0 0.13
|
||||
Average number of kaons 0
|
||||
Average number of muons 0
|
||||
Average number of deuterons+tritons 0.33
|
||||
Average number of He3+alpha 0.24
|
||||
Average number of ions 0.53
|
||||
Average number of forward neutrons 0.18
|
||||
Average number of reflected neutrons 0.97
|
||||
Average number of leaked neutrons 0.04
|
||||
Average number of proton leak 0.59
|
||||
Average number of pion leak 0.25
|
||||
Average number of deuterons+tritons 0.28
|
||||
Average number of He3+alpha 0.23
|
||||
Average number of ions 0.45
|
||||
Average number of forward neutrons 0.14
|
||||
Average number of reflected neutrons 0.84
|
||||
Average number of leaked neutrons 0.01
|
||||
Average number of proton leak 0.43
|
||||
Average number of pion leak 0.23
|
||||
========================================================
|
||||
|
||||
#
|
||||
@@ -863,22 +854,22 @@ G4SDManager deleted.
|
||||
EventManager deleted.
|
||||
Units table cleared.
|
||||
TransportationManager deleted.
|
||||
Total navigation history collections cleaned: 14
|
||||
Total navigation history collections cleaned: 15
|
||||
================== Deleting memory pools ===================
|
||||
Pool ID '20G4NavigationLevelRep', size : 0.0192 MB
|
||||
Pool ID '20G4NavigationLevelRep', size : 0.0211 MB
|
||||
Pool ID '24G4ReferenceCountedHandleIvE', size : 0.000961 MB
|
||||
Pool ID '17G4DynamicParticle', size : 0.00577 MB
|
||||
Pool ID '17G4DynamicParticle', size : 0.00385 MB
|
||||
Pool ID '7G4Event', size : 0.000961 MB
|
||||
Pool ID '15G4PrimaryVertex', size : 0.000961 MB
|
||||
Pool ID '17G4PrimaryParticle', size : 0.000961 MB
|
||||
Pool ID '15G4HCofThisEvent', size : 0.000961 MB
|
||||
Pool ID '7G4Track', size : 0.0115 MB
|
||||
Pool ID '7G4Track', size : 0.00769 MB
|
||||
Pool ID '18G4TouchableHistory', size : 0.00192 MB
|
||||
Pool ID '15G4CountedObjectIvE', size : 0.000961 MB
|
||||
Pool ID '10G4Fragment', size : 0.00192 MB
|
||||
Pool ID '17G4ReactionProduct', size : 0.00192 MB
|
||||
Number of memory pools allocated: 12 of which, static: 0
|
||||
Dynamic pools deleted: 12 / Total memory freed: 0.048 MB
|
||||
Dynamic pools deleted: 12 / Total memory freed: 0.044 MB
|
||||
============================================================
|
||||
G4Allocator objects are deleted.
|
||||
UImanager deleted.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr01/include/DetectorConstruction.hh
|
||||
/// \brief Definition of the DetectorConstruction class
|
||||
//
|
||||
// $Id: DetectorConstruction.hh 77255 2013-11-22 10:09:14Z gcosmo $
|
||||
// $Id: DetectorConstruction.hh 109185 2018-04-03 07:20:46Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -49,7 +49,9 @@
|
||||
|
||||
class CheckVolumeSD;
|
||||
class TargetSD;
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class DetectorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -71,20 +73,36 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void ComputeGeomParameters();
|
||||
|
||||
DetectorConstruction & operator=(const DetectorConstruction &right);
|
||||
DetectorConstruction(const DetectorConstruction&);
|
||||
|
||||
G4double fRadius;
|
||||
|
||||
G4Material* fTargetMaterial;
|
||||
G4Material* fWorldMaterial;
|
||||
|
||||
G4Tubs* fSolidW;
|
||||
G4Tubs* fSolidA;
|
||||
G4Tubs* fSolidC;
|
||||
|
||||
G4LogicalVolume* fLogicTarget;
|
||||
G4LogicalVolume* fLogicCheck;
|
||||
G4LogicalVolume* fLogicWorld;
|
||||
|
||||
G4VPhysicalVolume* fPhysWorld;
|
||||
|
||||
DetectorMessenger* fDetectorMessenger;
|
||||
|
||||
G4double fRadius;
|
||||
G4double fCheckR;
|
||||
G4double fWorldR;
|
||||
G4double fTargetZ;
|
||||
G4double fCheckZ;
|
||||
G4double fWorldZ;
|
||||
G4double fSliceZ;
|
||||
|
||||
G4int fSlices;
|
||||
G4bool fInitialized;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr01/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
// $Id: DetectorConstruction.cc 101905 2016-12-07 11:34:39Z gunter $
|
||||
// $Id: DetectorConstruction.cc 109654 2018-05-04 08:57:00Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -74,12 +74,16 @@
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
: G4VUserDetectorConstruction(),
|
||||
fTargetMaterial(0),
|
||||
fWorldMaterial(0),
|
||||
fLogicTarget(0),
|
||||
fLogicCheck(0),
|
||||
fLogicWorld(0),
|
||||
fDetectorMessenger(0)
|
||||
fTargetMaterial(nullptr),
|
||||
fWorldMaterial(nullptr),
|
||||
fSolidW(nullptr),
|
||||
fSolidA(nullptr),
|
||||
fSolidC(nullptr),
|
||||
fLogicTarget(nullptr),
|
||||
fLogicCheck(nullptr),
|
||||
fLogicWorld(nullptr),
|
||||
fPhysWorld(nullptr),
|
||||
fInitialized(false)
|
||||
{
|
||||
fDetectorMessenger = new DetectorMessenger(this);
|
||||
|
||||
@@ -88,7 +92,7 @@ DetectorConstruction::DetectorConstruction()
|
||||
fTargetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al");
|
||||
fWorldMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
|
||||
|
||||
ComputeGeomParameters();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -98,90 +102,96 @@ DetectorConstruction::~DetectorConstruction()
|
||||
delete fDetectorMessenger;
|
||||
}
|
||||
|
||||
void DetectorConstruction::ComputeGeomParameters()
|
||||
{
|
||||
// Sizes
|
||||
fCheckR = fRadius + CLHEP::mm;
|
||||
fWorldR = fRadius + CLHEP::cm;
|
||||
fTargetZ = HistoManager::GetPointer()->Length()*0.5;
|
||||
fCheckZ = fTargetZ + CLHEP::mm;
|
||||
fWorldZ = fTargetZ + CLHEP::cm;
|
||||
|
||||
fSlices = HistoManager::GetPointer()->NumberOfSlices();
|
||||
fSliceZ = fTargetZ/G4double(fSlices);
|
||||
if(fPhysWorld) {
|
||||
fSolidW->SetOuterRadius(fWorldR);
|
||||
fSolidW->SetZHalfLength(fWorldZ);
|
||||
fSolidA->SetOuterRadius(fRadius);
|
||||
fSolidA->SetZHalfLength(fSliceZ);
|
||||
fSolidC->SetOuterRadius(fCheckR);
|
||||
fSolidC->SetZHalfLength(fCheckZ);
|
||||
}
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
{
|
||||
// Cleanup old geometry
|
||||
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
|
||||
// Sizes
|
||||
G4double checkR = fRadius + mm;
|
||||
G4double worldR = fRadius + cm;
|
||||
G4double targetZ = HistoManager::GetPointer()->Length()*0.5;
|
||||
G4double checkZ = targetZ + mm;
|
||||
G4double worldZ = targetZ + cm;
|
||||
|
||||
G4int nSlices = HistoManager::GetPointer()->NumberOfSlices();
|
||||
G4double sliceZ = targetZ/G4double(nSlices);
|
||||
if(fPhysWorld) { return fPhysWorld; }
|
||||
ComputeGeomParameters();
|
||||
|
||||
//
|
||||
// World
|
||||
//
|
||||
G4Tubs* solidW = new G4Tubs("World",0.,worldR,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,fWorldZ,0.,twopi);
|
||||
fLogicWorld = new G4LogicalVolume(fSolidW, fWorldMaterial, "World");
|
||||
fPhysWorld = new G4PVPlacement(nullptr,G4ThreeVector(0.,0.,0.),
|
||||
fLogicWorld,"World",nullptr,false,0);
|
||||
//
|
||||
// Check volume
|
||||
//
|
||||
G4Tubs* solidC = new G4Tubs("Check",0.,checkR,checkZ,0.,twopi);
|
||||
fLogicCheck = new G4LogicalVolume( solidC,fWorldMaterial,"Check");
|
||||
new G4PVPlacement(0,G4ThreeVector(),fLogicCheck,"Check",
|
||||
fSolidC = new G4Tubs("Check",0.,fCheckR,fCheckZ,0.,twopi);
|
||||
fLogicCheck = new G4LogicalVolume(fSolidC, fWorldMaterial, "Check");
|
||||
new G4PVPlacement(nullptr,G4ThreeVector(),fLogicCheck,"Check",
|
||||
fLogicWorld,false,0);
|
||||
|
||||
//
|
||||
// Target volume
|
||||
//
|
||||
G4Tubs* solidA = new G4Tubs("Target",0.,fRadius,sliceZ,0.,twopi);
|
||||
fLogicTarget = new G4LogicalVolume( solidA,fTargetMaterial,"Target");
|
||||
fSolidA = new G4Tubs("Target",0.,fRadius,fSliceZ,0.,twopi);
|
||||
fLogicTarget = new G4LogicalVolume(fSolidA,fTargetMaterial,"Target");
|
||||
|
||||
G4double z = sliceZ - targetZ;
|
||||
G4double z = fSliceZ - fTargetZ;
|
||||
|
||||
for(G4int i=0; i<nSlices; i++) {
|
||||
for(G4int i=0; i<fSlices; ++i) {
|
||||
// physC =
|
||||
new G4PVPlacement(0,G4ThreeVector(0.0,0.0,z),fLogicTarget,"Target",
|
||||
new G4PVPlacement(nullptr,G4ThreeVector(0.0,0.0,z),fLogicTarget,"Target",
|
||||
fLogicCheck,false,i);
|
||||
z += 2.0*sliceZ;
|
||||
z += 2.0*fSliceZ;
|
||||
}
|
||||
G4cout << "### Target consist of " << nSlices
|
||||
G4cout << "### Target consist of " << fSlices
|
||||
<< " of " << fTargetMaterial->GetName()
|
||||
<< " disks with R(mm)= " << fRadius/mm
|
||||
<< " Width(mm)= " << 2.0*sliceZ/mm
|
||||
<< " Total Length(mm)= " << 2.0*targetZ/mm
|
||||
<< " Width(mm)= " << 2.0*fSliceZ/mm
|
||||
<< " Total Length(mm)= " << 2.0*fTargetZ/mm
|
||||
<< " ###" << G4endl;
|
||||
|
||||
// colors
|
||||
G4VisAttributes zero = G4VisAttributes::GetInvisible();
|
||||
fLogicWorld->SetVisAttributes(&zero);
|
||||
fLogicWorld->SetVisAttributes(zero);
|
||||
|
||||
G4VisAttributes regWcolor(G4Colour(0.3, 0.3, 0.3));
|
||||
fLogicCheck->SetVisAttributes(®Wcolor);
|
||||
fLogicCheck->SetVisAttributes(regWcolor);
|
||||
|
||||
G4VisAttributes regCcolor(G4Colour(0., 0.3, 0.7));
|
||||
fLogicTarget->SetVisAttributes(®Ccolor);
|
||||
fLogicTarget->SetVisAttributes(regCcolor);
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
return world;
|
||||
return fPhysWorld;
|
||||
}
|
||||
|
||||
void DetectorConstruction::ConstructSDandField()
|
||||
{
|
||||
static G4ThreadLocal G4bool initialized = false;
|
||||
if ( ! initialized ) {
|
||||
// Prepare sensitive detectors
|
||||
CheckVolumeSD* fCheckSD = new CheckVolumeSD("checkSD");
|
||||
(G4SDManager::GetSDMpointer())->AddNewDetector( fCheckSD );
|
||||
fLogicCheck->SetSensitiveDetector(fCheckSD);
|
||||
if (!fInitialized) {
|
||||
// Prepare sensitive detectors
|
||||
CheckVolumeSD* fCheckSD = new CheckVolumeSD("checkSD");
|
||||
(G4SDManager::GetSDMpointer())->AddNewDetector( fCheckSD );
|
||||
fLogicCheck->SetSensitiveDetector(fCheckSD);
|
||||
|
||||
TargetSD* fTargetSD = new TargetSD("targetSD");
|
||||
(G4SDManager::GetSDMpointer())->AddNewDetector( fTargetSD );
|
||||
fLogicTarget->SetSensitiveDetector(fTargetSD);
|
||||
initialized=true;
|
||||
}
|
||||
TargetSD* fTargetSD = new TargetSD("targetSD");
|
||||
(G4SDManager::GetSDMpointer())->AddNewDetector( fTargetSD );
|
||||
fLogicTarget->SetSensitiveDetector(fTargetSD);
|
||||
fInitialized = true;
|
||||
}
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -217,7 +227,7 @@ void DetectorConstruction::SetTargetRadius(G4double val)
|
||||
{
|
||||
if(val > 0.0) {
|
||||
fRadius = val;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
ComputeGeomParameters();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr01/src/DetectorMessenger.cc
|
||||
/// \brief Implementation of the DetectorMessenger class
|
||||
//
|
||||
// $Id: DetectorMessenger.cc 77255 2013-11-22 10:09:14Z gcosmo $
|
||||
// $Id: DetectorMessenger.cc 109185 2018-04-03 07:20:46Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -93,17 +93,17 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fLCmd->SetParameterName("length",false);
|
||||
fLCmd->SetUnitCategory("Length");
|
||||
fLCmd->SetRange("length>0");
|
||||
fLCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fLCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
fBinCmd = new G4UIcmdWithAnInteger("/testhadr/NumberOfBinsE",this);
|
||||
fBinCmd->SetGuidance("Set number of bins for Energy");
|
||||
fBinCmd->SetParameterName("NEbins",false);
|
||||
fBinCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fBinCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
fNOfAbsCmd = new G4UIcmdWithAnInteger("/testhadr/NumberDivZ",this);
|
||||
fNOfAbsCmd->SetGuidance("Set number of slices");
|
||||
fNOfAbsCmd->SetParameterName("NZ",false);
|
||||
fNOfAbsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fNOfAbsCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
fEdepCmd = new G4UIcmdWithADoubleAndUnit("/testhadr/MaxEdep",this);
|
||||
fEdepCmd->SetGuidance("Set max energy in histogram");
|
||||
@@ -113,7 +113,8 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fEdepCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fBeamCmd = new G4UIcmdWithABool("/testhadr/DefaultBeamPosition",this);
|
||||
fBeamCmd->SetGuidance("show inelastic and elastic cross sections");
|
||||
fBeamCmd->SetGuidance("Use default beam position");
|
||||
fBeamCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fVerbCmd = new G4UIcmdWithAnInteger("/testhadr/Verbose",this);
|
||||
fVerbCmd->SetGuidance("Set verbose for ");
|
||||
@@ -143,9 +144,9 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
HistoManager* h = HistoManager::GetPointer();
|
||||
if( command == fMatCmd ) {
|
||||
fDetector->SetTargetMaterial(newValue);
|
||||
fDetector->SetTargetMaterial(newValue);
|
||||
} else if( command == fMat1Cmd ) {
|
||||
fDetector->SetWorldMaterial(newValue);
|
||||
fDetector->SetWorldMaterial(newValue);
|
||||
} else if( command == fRCmd ) {
|
||||
fDetector->SetTargetRadius(fRCmd->GetNewDoubleValue(newValue));
|
||||
} else if( command == fLCmd ) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr01/src/HistoManager.cc
|
||||
/// \brief Implementation of the HistoManager class
|
||||
//
|
||||
// $Id: HistoManager.cc 107541 2017-11-22 08:24:57Z gcosmo $
|
||||
// $Id: HistoManager.cc 109185 2018-04-03 07:20:46Z gcosmo $
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -91,7 +91,7 @@ HistoManager* HistoManager::GetPointer()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
HistoManager::HistoManager()
|
||||
: fPrimaryDef(0),
|
||||
: fPrimaryDef(nullptr),
|
||||
fEdepMax(1.0*GeV),
|
||||
fLength (300.*mm),
|
||||
fPrimaryKineticEnergy(0.0),
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr01/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorAction class
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.cc 70761 2013-06-05 12:30:51Z gcosmo $
|
||||
// $Id: PrimaryGeneratorAction.cc 109185 2018-04-03 07:20:46Z gcosmo $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -69,7 +69,8 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
if(fHisto->DefaultBeamPosition()) {
|
||||
G4double zVertex = -(5.0*mm + fHisto->Length());
|
||||
static const G4double offset = 2*CLHEP::mm;
|
||||
G4double zVertex = -(offset + 0.5*fHisto->Length());
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,zVertex));
|
||||
}
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
|
||||
@@ -76,18 +76,6 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
G4cout << "NuclearData: " << *fTimer << G4endl;
|
||||
|
||||
(HistoManager::GetPointer())->BeginOfRun();
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -97,12 +85,6 @@ void RunAction::EndOfRunAction(const G4Run*)
|
||||
|
||||
G4cout << "RunAction: End of run actions are started" << G4endl;
|
||||
(HistoManager::GetPointer())->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