Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -0,0 +1,15 @@
# $Id: GNUmakefile,v 1.1 2000/07/24 11:23:40 gcosmo Exp $
# ----------------------------------------------------------------
name := clGeometry
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
@@ -0,0 +1,163 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: clGeometry.cc,v 1.1 2000/07/24 11:23:40 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// controls whether drawing is to be Done or not
#include "g4std/fstream"
#include <math.h>
#include "G4ios.hh"
// package includes
#include "G3toG4DetectorConstruction.hh"
#include "G3toG4RunAction.hh"
#include "G3toG4PrimaryGeneratorAction.hh"
#include "G3toG4PhysicsList.hh"
#include "G3toG4EventAction.hh"
#include "G4LogicalVolume.hh"
#include "G3VolTable.hh"
// geant4 includes
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
// visualization
#ifdef G4VIS_USE
#include "G3toG4VisManager.hh"
#endif
G4int main(int argc, char** argv)
{
G4String inFile;
G4String macroFile = "";
if (argc < 2) {
G4cerr << "clGeometry: Correct syntax: clGeometry <call_list_file> [ <macro_file> ]"
<< G4endl;
G4cerr << "If only one argument is specified, interactive mode will be "
<< "entered." << G4endl << "The second argument, if specified, is "
<< "the name of the macro file (batch mode)." << G4endl;
return EXIT_FAILURE;
}
if (argc >= 2) {
// Process the command line
inFile = argv[1];
G4std::ifstream in(inFile);
if (!in) {
G4cerr << "Cannot open input file \"" << inFile << "\"" << G4endl;
return EXIT_FAILURE;
}
}
if (argc >= 3) {
macroFile = argv[2];
G4std::ifstream mac(macroFile);
if (!mac) {
G4cout << "Cannot open macro file """ << macroFile << """" << G4endl;
return 2;
}
}
if (argc >= 4) {
G4cerr << "Too many command line arguments (" << argc <<")" << G4endl;
return EXIT_FAILURE;
}
// Construct the default run manager
G4RunManager* RunManager = new G4RunManager;
// set mandatory initialization classes
RunManager->SetUserInitialization(new G3toG4DetectorConstruction(inFile));
G3toG4PhysicsList* thePhysicsList = new G3toG4PhysicsList;
// set verbosity of PhysicsList
thePhysicsList->SetVerboseLevel(2);
RunManager->SetUserInitialization(thePhysicsList);
//----------------
// Visualization:
//----------------
#ifdef G4VIS_USE
G4VisManager* VisManager = new G3toG4VisManager;
VisManager -> Initialize();
#endif
// set user action classes
RunManager->SetUserAction(new G3toG4RunAction);
G3toG4EventAction* theEventAction = new G3toG4EventAction;
theEventAction->SetDrawFlag("all");
RunManager->SetUserAction(theEventAction);
RunManager->SetUserAction(new G3toG4PrimaryGeneratorAction);
// the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
// set some additional defaults and initial actions
UI->ApplyCommand("/control/verbose 1");
UI->ApplyCommand("/run/verbose 1");
UI->ApplyCommand("/tracking/verbose 1");
UI->ApplyCommand("/tracking/storeTrajectory 1");
UI->ApplyCommand("/run/initialize");
G4bool batch_mode = macroFile != "";
if(!batch_mode) {
G4UIsession * session = new G4UIterminal;
if (session != 0) {
session->SessionStart();
delete session;
// G4cout << "deleted G4UITerminal..." << G4endl;
}
}
else {
// Batch mode
G4String command = "/control/execute ";
UI->ApplyCommand(command+macroFile);
}
#ifdef G4VIS_USE
if (VisManager !=0) delete VisManager;
#endif
delete RunManager;
return EXIT_SUCCESS;
}
@@ -0,0 +1,29 @@
#
# Initialize GEANT4
#
/gun/position 0. -1.5 0. mm
/gun/direction 0. 1. 0.
/gun/energy 1 GeV
/gun/particle mu-
/run/beamOn 1
/gun/particle mu+
/run/beamOn 1
/gun/particle e-
/run/beamOn 1
/gun/particle e+
/run/beamOn 1
#
/gun/position 0. 1.5 0. mm
/gun/direction 1. 0. 0.
/gun/energy 1 GeV
/gun/particle mu-
/run/beamOn 1
/gun/particle mu+
/run/beamOn 1
/gun/particle e-
/run/beamOn 1
/gun/particle e+
/run/beamOn 1
#
# Termination
#
@@ -0,0 +1,387 @@
**********************************************
Geant4 version $Name: geant4-03-00 $
(30-Jun-2000)
Copyright : Geant4 Collaboration
**********************************************
Instantiated G3toG4DetectorConstruction using call list file "/afs/cern.ch/sw/geant4/stt/dev1/src/geant4/examples/extended/g3tog4/data/testmodel.dat"
G4VUserPhysicsList::SetVerboseLevel : Verbose level is set to 2
/run/verbose 1
/tracking/verbose 1
/tracking/storeTrajectory 1
/run/initialize
Instantiated unit rotation matrix irot=0
Reading the call List file /afs/cern.ch/sw/geant4/stt/dev1/src/geant4/examples/extended/g3tog4/data/testmodel.dat...
G4ggclos: setting top-level VolTableEntry
Dump of VTD - 26 entries:
Instantiated 26 volume table entries
15 positions.
G3VolTable element 0 name BOX1 has 1 daughters
G3VolTable element 1 name BOX1_1 has 1 daughters
G3VolTable element 2 name BOX1_2 has 1 daughters
G3VolTable element 3 name BOX1_3 has 1 daughters
G3VolTable element 4 name BOX1_4 has 1 daughters
G3VolTable element 5 name BOX2 has 1 daughters
G3VolTable element 6 name BOX2_1 has 1 daughters
G3VolTable element 7 name BOX2_2 has 1 daughters
G3VolTable element 8 name BOX2_3 has 1 daughters
G3VolTable element 9 name BOX2_4 has 1 daughters
G3VolTable element 10 name BOX2_5 has 1 daughters
G3VolTable element 11 name BXD1 has 0 daughters
G3VolTable element 12 name BXD1_1 has 0 daughters
G3VolTable element 13 name BXD1_2 has 0 daughters
G3VolTable element 14 name BXD1_2_ENV has 1 daughters
G3VolTable element 15 name BXD1_3 has 0 daughters
G3VolTable element 16 name BXD1_3_ENV has 1 daughters
G3VolTable element 17 name BXD1_4 has 0 daughters
G3VolTable element 18 name BXD1_4_ENV has 1 daughters
G3VolTable element 19 name BXD1_5 has 0 daughters
G3VolTable element 20 name BXD1_5_ENV has 1 daughters
G3VolTable element 21 name HALL has 6 daughters
G3VolTable element 22 name TBD1 has 0 daughters
G3VolTable element 23 name TBD2 has 0 daughters
G3VolTable element 24 name TUB1 has 1 daughters
G3VolTable element 25 name TUB2 has 1 daughters
Call List file read completed. Build geometry
G3toG4 top level volume is HALL
Top-level G3toG4 logical volume HALL G4VisAttributes: invisible, daughters visible, colour: (1,1,1,1)
linestyle: solid, line width: 1
drawing style unforced
Top-level G3toG4 logical volume HALL G4VisAttributes: invisible, daughters visible, colour: (1,1,1,1)
linestyle: solid, line width: 1
drawing style unforced
G4VUserPhysicsList::Construct()
Construct particles
Construct processes
G3toG4PhysicsList::SetCuts:CutLength : 2 mm
phot: Total cross sections from a parametrisation. Good description from 10 KeV to 50 MeV for all Z
Sandia crossSection below 50 KeV
PhysicsTables from 50 keV to 50 MeV in 100 bins.
compt: Total cross sections from a parametrisation. Good description from 10 KeV to (100/Z) GeV.
Scattered gamma energy according Klein-Nishina.
PhysicsTables from 10 keV to 100 GeV in 100 bins.
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
e+e- energies according Bethe-Heitler
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
Set cuts for gamma
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to 100 GeV.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
eIoni Minimum Delta cut in range=0.2 mm.
material min.delta energy(keV)
HYDROGEN 42.186
DEUTERIUM 67.149
HELIUM 37.6
LITHIUM 76.527
BERILLIUM 158.47
CARBON 187.35
NITROGEN 99.22
NEON 121.65
ALUMINIUM 191.92
IRON 356.49
COPPER 380.82
TUNGSTEN 561.11
LEAD 370.83
URANIUM 529.64
AIR 0.99
VACUUM 0.99
eBrem: Total cross sections from a NEW parametrisation based on the EEDL data library.
Good description from 1 KeV to 100 GeV.
log scale extrapolation above 100 GeV
Gamma energy sampled from a parametrised formula.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
Set cuts for e-
annihil: Total cross section from Heilter formula (annihilation into 2 photons).
gamma energies sampled according Heitler
PhysicsTables from 10 keV to 10 TeV in 100 bins.
Set cuts for e+
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
hIoni Minimum Delta cut in range=0.2 mm.
material min.delta energy(keV)
HYDROGEN 42.186
DEUTERIUM 67.149
HELIUM 37.6
LITHIUM 76.527
BERILLIUM 158.47
CARBON 187.35
NITROGEN 99.22
NEON 121.65
ALUMINIUM 191.92
IRON 356.49
COPPER 380.82
TUNGSTEN 561.11
LEAD 370.83
URANIUM 529.64
AIR 0.99
VACUUM 0.99
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
Set cuts for proton
Set cuts for anti_proton
G4VUserPhysicsList::SetCutValueForOthers :2[mm]
Set cuts for anti_kaon0
Set cuts for anti_neutron
Set cuts for anti_nu_e
Set cuts for anti_nu_mu
Set cuts for chargedgeantino
Set cuts for eta
Set cuts for eta_prime
Set cuts for geantino
Set cuts for kaon+
Set cuts for kaon-
Set cuts for kaon0
Set cuts for kaon0L
Set cuts for kaon0S
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
MuIoni: knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
MuBrems: theoretical cross section
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
Set cuts for mu+
Set cuts for mu-
Set cuts for neutron
Set cuts for nu_e
Set cuts for nu_mu
Set cuts for opticalphoton
Set cuts for pi+
Set cuts for pi-
Set cuts for pi0
============= The cut Energy ==============================
gamma e-
Cut in range 2 mm 2 mm
Cut in energy
HYDROGEN 990 eV 162 keV
DEUTERIUM 990 eV 271 keV
HELIUM 990 eV 145 keV
LITHIUM 1.33 keV 322 keV
BERILLIUM 2.4 keV 782 keV
CARBON 4.3 keV 976 keV
NITROGEN 3.34 keV 444 keV
NEON 5.38 keV 568 keV
ALUMINIUM 9.56 keV 1.03 MeV
IRON 29.5 keV 2.43 MeV
COPPER 35.7 keV 2.68 MeV
TUNGSTEN 133 keV 4.66 MeV
LEAD 121 keV 2.61 MeV
URANIUM 169 keV 4.28 MeV
AIR 990 eV 990 eV
VACUUM 990 eV 990 eV
===================================================
Idle> #
Idle> # Initialize GEANT4
Idle> #
Idle> /gun/position 0. -1.5 0. mm
Idle> /gun/direction 0. 1. 0.
Idle> /gun/energy 1 GeV
Idle> /gun/particle mu-
Idle> /run/beamOn 1
### Run 0 start.
Start Run processing.
>>>>>>>> Primary direction: (0,1,0)
*********************************************************************************************************
* G4Track Information: Particle = mu-, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 -1.5 0 1e+03 0 0 0 TBD1 initStep
1 0 200 0 1e+03 0 202 202 TBD2 Transportation
2 0 360 0 1e+03 0 160 362 HALL Transportation
3 0 4e+03 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0.02s Real=0.06s Sys=0s
Idle> /gun/particle mu+
Idle> /run/beamOn 1
### Run 1 start.
Start Run processing.
>>>>>>>> Primary direction: (0,1,0)
*********************************************************************************************************
* G4Track Information: Particle = mu+, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 -1.5 0 1e+03 0 0 0 TBD1 initStep
1 0 200 0 1e+03 0 202 202 TBD2 Transportation
2 0 360 0 1e+03 0 160 362 HALL Transportation
3 0 4e+03 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0.01s Real=0.01s Sys=0s
Idle> /gun/particle e-
Idle> /run/beamOn 1
### Run 2 start.
Start Run processing.
>>>>>>>> Primary direction: (0,1,0)
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 -1.5 0 1e+03 0 0 0 TBD1 initStep
1 0 200 0 1e+03 0 202 202 TBD2 Transportation
2 0 360 0 1e+03 0 160 362 HALL Transportation
3 0 4e+03 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0.01s Real=0.01s Sys=0s
Idle> /gun/particle e+
Idle> /run/beamOn 1
### Run 3 start.
Start Run processing.
>>>>>>>> Primary direction: (0,1,0)
*********************************************************************************************************
* G4Track Information: Particle = e+, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 -1.5 0 1e+03 0 0 0 TBD1 initStep
1 0 200 0 1e+03 0 202 202 TBD2 Transportation
2 0 360 0 1e+03 0 160 362 HALL Transportation
3 0 4e+03 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0.01s Real=0.01s Sys=0s
Idle> #
Idle> /gun/position 0. 1.5 0. mm
Idle> /gun/direction 1. 0. 0.
Idle> /gun/energy 1 GeV
Idle> /gun/particle mu-
Idle> /run/beamOn 1
### Run 4 start.
Start Run processing.
>>>>>>>> Primary direction: (1,0,0)
*********************************************************************************************************
* G4Track Information: Particle = mu-, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 1.5 0 1e+03 0 0 0 TBD1 initStep
1 200 1.5 0 1e+03 0 200 200 TBD2 Transportation
2 360 1.5 0 1e+03 0 160 360 HALL Transportation
3 4e+03 1.5 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
Idle> /gun/particle mu+
Idle> /run/beamOn 1
### Run 5 start.
Start Run processing.
>>>>>>>> Primary direction: (1,0,0)
*********************************************************************************************************
* G4Track Information: Particle = mu+, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 1.5 0 1e+03 0 0 0 TBD1 initStep
1 200 1.5 0 1e+03 0 200 200 TBD2 Transportation
2 360 1.5 0 1e+03 0 160 360 HALL Transportation
3 4e+03 1.5 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
Idle> /gun/particle e-
Idle> /run/beamOn 1
### Run 6 start.
Start Run processing.
>>>>>>>> Primary direction: (1,0,0)
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 1.5 0 1e+03 0 0 0 TBD1 initStep
1 200 1.5 0 1e+03 0 200 200 TBD2 Transportation
2 360 1.5 0 1e+03 0 160 360 HALL Transportation
3 4e+03 1.5 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
Idle> /gun/particle e+
Idle> /run/beamOn 1
### Run 7 start.
Start Run processing.
>>>>>>>> Primary direction: (1,0,0)
*********************************************************************************************************
* G4Track Information: Particle = e+, Track ID = 1, Parent ID = 0
*********************************************************************************************************
Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 1.5 0 1e+03 0 0 0 TBD1 initStep
1 200 1.5 0 1e+03 0 200 200 TBD2 Transportation
2 360 1.5 0 1e+03 0 160 360 HALL Transportation
3 4e+03 1.5 0 1e+03 0 3.64e+03 4e+03 OutOfWorld Transportation
>>> Event 0
1 trajectories stored in this event.
Run terminated.
Run Summary
Number of events processed : 1
User=0s Real=0s Sys=0s
Idle> #
Idle> # Termination
Idle> #
Idle> G4 kernel has come to Quit state.
@@ -0,0 +1,45 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4DetectorConstruction.hh,v 1.1 2000/07/24 11:23:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G3toG4DetectorConstruction_h
#define G3toG4DetectorConstruction_h 1
//--------------------------------------------------------------------------
// G3toG4DetectorConstruction. Most the work is Done in
// G4BuildGeom, which returns a G4LogicalVolume*, a pointer to the
// top-level logiical volume in the detector defined by the call List file
// inFile
//--------------------------------------------------------------------------
#include "G4VUserDetectorConstruction.hh"
#include "G4PVPlacement.hh"
#include "G4LogicalVolume.hh"
#include "G3G4Interface.hh"
#include "globals.hh"
class G3toG4DetectorConstruction : public G4VUserDetectorConstruction
{
public:
G3toG4DetectorConstruction(G4String inFile="svt.dat");
~G3toG4DetectorConstruction();
G4VPhysicalVolume* Construct();
G4LogicalVolume* SimpleConstruct();
private:
G4String _inFile;
G4VPhysicalVolume* _pv;
G4LogicalVolume* _lv;
};
#endif
@@ -0,0 +1,45 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4EventAction.hh,v 1.1 2000/07/24 11:23:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G3toG4EventAction_h
#define G3toG4EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class G3toG4EventActionMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G3toG4EventAction : public G4UserEventAction
{
public:
G3toG4EventAction();
~G3toG4EventAction();
public:
void BeginOfEventAction(const G4Event* anEvent);
void EndOfEventAction(const G4Event* anEvent);
void SetDrawFlag(G4String val) {drawFlag = val;};
private:
G4String drawFlag; // control the drawing of event
G3toG4EventActionMessenger* eventMessenger;
};
#endif
@@ -0,0 +1,40 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4EventActionMessenger.hh,v 1.1 2000/07/24 11:23:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G3toG4EventActionMessenger_h
#define G3toG4EventActionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class G3toG4EventAction;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G3toG4EventActionMessenger: public G4UImessenger
{
public:
G3toG4EventActionMessenger(G3toG4EventAction*);
~G3toG4EventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
G3toG4EventAction* eventAction;
G4UIcmdWithAString* DrawCmd;
};
#endif
@@ -0,0 +1,68 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4PhysicsList.hh,v 1.1 2000/07/24 11:23:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G3toG4PhysicsList_h
#define G3toG4PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G3toG4PhysicsList: public G4VUserPhysicsList
{
public:
G3toG4PhysicsList();
~G3toG4PhysicsList();
protected:
// Construct particle and physics
virtual void ConstructParticle();
virtual void ConstructProcess();
virtual void SetCuts();
public:
// Set/Get cut values
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForProton(G4double);
G4double GetCutForGamma() const;
G4double GetCutForElectron() const;
G4double GetCutForProton() const;
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructMesons();
void ConstructBaryons();
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForProton;
G4double currentDefaultCut;
};
#endif
@@ -0,0 +1,36 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4PrimaryGeneratorAction.hh,v 1.1 2000/07/24 11:23:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G3toG4PrimaryGeneratorAction_h
#define G3toG4PrimaryGeneratorAction_h 1
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ThreeVector.hh"
class G3toG4PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
G3toG4PrimaryGeneratorAction();
~G3toG4PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* particleGun;
G4ThreeVector GetRandomDirection();
};
#endif
@@ -0,0 +1,35 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4RunAction.hh,v 1.1 2000/07/24 11:23:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G3toG4RunAction_h
#define G3toG4RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
class G3toG4RunAction : public G4UserRunAction
{
public:
G3toG4RunAction();
~G3toG4RunAction();
public:
void BeginOfRunAction(const G4Run* aRun);
void EndOfRunAction(const G4Run* aRun);
private:
G4int runIDcounter;
};
#endif
@@ -0,0 +1,50 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4VisManager.hh,v 1.1 2000/07/24 11:23:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// Example Visualization Manager implementing virtual function
// RegisterGraphicsSystems. Exploits C-pre-processor variables
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
// environment variables of the same name are set.
// So all you have to do is set environment variables and compile and
// instantiate this in your main().
// Alternatively, you can implement an empty function here and just
// register the systems you want in your main(), e.g.:
// G4VisManager* myVisManager = new MyVisManager;
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G3toG4VisManager_h
#define G3toG4VisManager_h 1
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G3toG4VisManager: public G4VisManager {
public:
G3toG4VisManager ();
private:
void RegisterGraphicsSystems ();
};
#endif
@@ -0,0 +1,110 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4DetectorConstruction.cc,v 1.1 2000/07/24 11:23:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//--------------------------------------------------------------------------
// G3toG4DetectorConstruction. Most the work is Done in
// G4BuildGeom, which returns a G4LogicalVolume*, a pointer to the
// top-level logiical volume in the detector defined by the call List file
// inFile
//--------------------------------------------------------------------------
#include "G4ios.hh"
#include "G3toG4DetectorConstruction.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4Material.hh"
#include "G4Box.hh"
G3toG4DetectorConstruction::G3toG4DetectorConstruction(G4String inFile){
_inFile = inFile;
G4cout << "Instantiated G3toG4DetectorConstruction using call list file \""
<< _inFile << "\"" << G4endl;
}
G3toG4DetectorConstruction::~G3toG4DetectorConstruction(){
// G4cout << "Deleted G3toG4DetectorConstruction..." << G4endl;
}
G4VPhysicalVolume*
G3toG4DetectorConstruction::Construct(){
_lv = G4BuildGeom(_inFile);
//_lv = SimpleConstruct();
if (_lv != 0) {
_pv = new G4PVPlacement(0, G4ThreeVector(), _lv, _lv->GetName(), 0,
false, 0);
G4cout << "Top-level G3toG4 logical volume " << _lv->GetName() << " "
<< *(_lv -> GetVisAttributes()) << G4endl;
} else
G4cerr << "creation of logical mother failed !!!" << G4endl;
return _pv;
}
G4LogicalVolume*
G3toG4DetectorConstruction::SimpleConstruct(){
G4String name, symbol; //a=mass of a mole;
G4double a, z, density, fractionmass; //z=mean number of protons;
G4int ncomponents, iz, n; //iz=number of protons in an isotope;
// n=number of nucleons in an isotope;
a = 14.01*g/mole;
G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
a = 16.00*g/mole;
G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
//
// define a material from elements. case 2: mixture by fractional mass
//
density = 1.290*mg/cm3;
G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
Air->AddElement(N, fractionmass=0.7);
Air->AddElement(O, fractionmass=0.3);
G4VSolid* Mother = new G4Box("TestMother", //its name
100*cm, 100*cm, 100*cm); //its size
G4VSolid* Daughter = new G4Box("TestDaughter", 50*cm, 20*cm, 10*cm);
G4LogicalVolume* logicMother = new G4LogicalVolume(Mother, //its solid
Air, //its material
"LTestMother");//its name
G4LogicalVolume* logicDaughter = new G4LogicalVolume(Daughter, //its solid
Air, //its material
"LTestDaughter");
G4VPhysicalVolume* physiDaughter = new G4PVPlacement(0,
G4ThreeVector(),
logicDaughter,
"PTestDaughter",
logicMother,
false,0);
//
// Visualization attributes
//
logicMother->SetVisAttributes (G4VisAttributes::Invisible);
G4VisAttributes* DaughterVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
DaughterVisAtt->SetVisibility(true);
logicDaughter->SetVisAttributes(DaughterVisAtt);
return logicMother;
}
@@ -0,0 +1,77 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4EventAction.cc,v 1.1 2000/07/24 11:23:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "g4rw/tvordvec.h"
#include "G4ios.hh"
#include "G3toG4EventAction.hh"
#include "G3toG4EventActionMessenger.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4UImanager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4EventAction::G3toG4EventAction()
: drawFlag("all"),eventMessenger(NULL)
{
eventMessenger = new G3toG4EventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4EventAction::~G3toG4EventAction()
{
delete eventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4EventAction::BeginOfEventAction(const G4Event* Ev)
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4EventAction::EndOfEventAction(const G4Event* Ev)
{
const G4Event* evt = fpEventManager->GetConstCurrentEvent();
G4cout << ">>> Event " << evt->GetEventID() << G4endl;
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if(trajectoryContainer){
n_trajectories = trajectoryContainer->entries();
}
G4cout << " " << n_trajectories
<< " trajectories stored in this event." << G4endl;
if(G4VVisManager::GetConcreteInstance()){
for(G4int i=0; i<n_trajectories; i++) {
G4Trajectory* trj = (G4Trajectory*)(*(evt->GetTrajectoryContainer()))[i];
if (drawFlag == "all") trj->DrawTrajectory(50);
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(50);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,52 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4EventActionMessenger.cc,v 1.1 2000/07/24 11:23:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G3toG4EventActionMessenger.hh"
#include "G3toG4EventAction.hh"
#include "G4UIcmdWithAString.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4EventActionMessenger::G3toG4EventActionMessenger(G3toG4EventAction* EvAct)
:eventAction(EvAct)
{
DrawCmd = new G4UIcmdWithAString("/event/draw",this);
DrawCmd->SetGuidance("Draw the tracks in the event");
DrawCmd->SetGuidance(" Choice : none, charged, all (default)");
DrawCmd->SetParameterName("choice",true);
DrawCmd->SetDefaultValue("all");
DrawCmd->SetCandidates("none charged all");
DrawCmd->AvailableForStates(Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4EventActionMessenger::~G3toG4EventActionMessenger()
{
delete DrawCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if(command == DrawCmd)
{eventAction->SetDrawFlag(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,293 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4PhysicsList.cc,v 1.1 2000/07/24 11:23:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G3toG4PhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4PhysicsList::G3toG4PhysicsList(): G4VUserPhysicsList()
{
currentDefaultCut = defaultCutValue = 2.0*mm;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForProton = defaultCutValue;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4PhysicsList::~G3toG4PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
//gamma
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
pmanager->AddDiscreteProcess(new G4ComptonScattering());
pmanager->AddDiscreteProcess(new G4GammaConversion());
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4MultipleScattering(),-1, 1,1);
pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1,3);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MultipleScattering(),-1, 1,1);
pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1,3);
pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1,4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
pmanager->AddProcess(new G4MultipleScattering(),-1, 1,1);
pmanager->AddProcess(new G4MuIonisation(), -1, 2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(), -1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(), -1,-1,4);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(), -1,2,2);
}
}
}
#include "G4Decay.hh"
void G3toG4PhysicsList::ConstructGeneral()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(theDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::SetCuts()
{
// reactualise cutValues
if (currentDefaultCut != defaultCutValue)
{
if(cutForGamma == currentDefaultCut) cutForGamma = defaultCutValue;
if(cutForElectron == currentDefaultCut) cutForElectron = defaultCutValue;
if(cutForProton == currentDefaultCut) cutForProton = defaultCutValue;
currentDefaultCut = defaultCutValue;
}
if (verboseLevel >0){
G4cout << "G3toG4PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForElectron, "e+");
// set cut values for proton and anti_proton before all other hadrons
// because some processes for hadrons need cut values for proton/anti_proton
SetCutValue(cutForProton, "proton");
SetCutValue(cutForProton, "anti_proton");
SetCutValueForOthers(defaultCutValue);
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4PhysicsList::SetCutForGamma(G4double cut)
{
ResetCuts();
cutForGamma = cut;
}
void G3toG4PhysicsList::SetCutForElectron(G4double cut)
{
ResetCuts();
cutForElectron = cut;
}
void G3toG4PhysicsList::SetCutForProton(G4double cut)
{
ResetCuts();
cutForProton = cut;
}
G4double G3toG4PhysicsList::GetCutForGamma() const
{
return cutForGamma;
}
G4double G3toG4PhysicsList::GetCutForElectron() const
{
return cutForElectron;
}
G4double G3toG4PhysicsList::GetCutForProton() const
{
return cutForGamma;
}
@@ -0,0 +1,76 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4PrimaryGeneratorAction.cc,v 1.2 2000/08/01 09:44:01 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "globals.hh"
#include "Randomize.hh"
#include "G3toG4PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
G3toG4PrimaryGeneratorAction::G3toG4PrimaryGeneratorAction(){
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="chargedgeantino");
particleGun->SetParticleDefinition(particle);
G4ThreeVector direction(0, 0, 1);
particleGun->SetParticleMomentumDirection(direction.unit());
particleGun->SetParticleEnergy(1.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.*cm, 0.*cm,0.*cm));
}
G3toG4PrimaryGeneratorAction::~G3toG4PrimaryGeneratorAction(){
delete particleGun;
}
void
G3toG4PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent){
//G4ThreeVector direction = GetRandomDirection();
//particleGun->SetParticleMomentumDirection( direction.unit() ) ;
G4cout << ">>>>>>>> Primary direction: "
<< particleGun->GetParticleMomentumDirection() << G4endl;
particleGun->GeneratePrimaryVertex(anEvent);
}
G4ThreeVector
G3toG4PrimaryGeneratorAction::GetRandomDirection() {
G4ThreeVector retval;
G4double CosTheta;
G4double SinTheta;
G4double Phi;
G4double SinPhi;
G4double CosPhi;
G4double rand;
rand = G4UniformRand();
CosTheta = 2.0*rand -1.0;
SinTheta = sqrt (1.-CosTheta*CosTheta);
rand = G4UniformRand();
Phi = twopi*rand;
SinPhi = sin (Phi);
CosPhi = cos (Phi);
retval.setX(SinTheta*CosPhi);
retval.setY(SinTheta*SinPhi);
retval.setZ(CosTheta);
return retval;
}
@@ -0,0 +1,38 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4RunAction.cc,v 1.1 2000/07/24 11:23:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4ios.hh"
#include "G3toG4RunAction.hh"
#include "G4Run.hh"
#include "G4VVisManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
G3toG4RunAction::G3toG4RunAction(){
runIDcounter = 0;
}
G3toG4RunAction::~G3toG4RunAction(){;}
void G3toG4RunAction::BeginOfRunAction(const G4Run* aRun){
((G4Run *)(aRun))->SetRunID(runIDcounter++);
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
G4UImanager* UI = G4UImanager::GetUIpointer();
if (G4VVisManager::GetConcreteInstance()) {
UI->ApplyCommand("/vis~/clear/view");
UI->ApplyCommand("/vis~/draw/current");
}
}
void G3toG4RunAction::EndOfRunAction(const G4Run* aRun){;}
@@ -0,0 +1,142 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G3toG4VisManager.cc,v 1.1 2000/07/24 11:23:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// John Allison 24th January 1998.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ios.hh"
#ifdef G4VIS_USE
#include "G3toG4VisManager.hh"
// Supported drivers...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_DAWNFILE
#include "G4DAWNFILE.hh"
#endif
#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
#ifdef G4VIS_USE_OIX
#include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_RAYX
#include "G4RayX.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
#ifdef G4VIS_USE_VRMLFILE
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G3toG4VisManager::G3toG4VisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G3toG4VisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_DAWNFILE
RegisterGraphicsSystem (new G4DAWNFILE);
#endif
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
#ifdef G4VIS_USE_OIX
RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_RAYX
RegisterGraphicsSystem (new G4RayX);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
#ifdef G4VIS_USE_VRMLFILE
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....