Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# $Id: GNUmakefile,v 2.1 1998/07/02 15:27:17 gunter Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := exampleN06
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,26 @@
|
||||
$Id: History,v 2.2 1998/08/21 10:18:24 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example N06 History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
21st August 1998 John Allison
|
||||
- Changed file names from N06* to ExN06*.
|
||||
|
||||
9th August 1998 John Allison
|
||||
- Changed G4UIterminal to G4UIGAG.
|
||||
|
||||
April 09, 98 G. Cosmo
|
||||
|
||||
- Created.
|
||||
@@ -0,0 +1,48 @@
|
||||
$Id: README,v 2.1 1998/08/26 00:42:44 gum Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleN06
|
||||
----------
|
||||
|
||||
This example presently illustrates the following basic concepts, and in
|
||||
particular (indicated with ***), how to use G4 for optical photon
|
||||
generation and transport:
|
||||
|
||||
main()
|
||||
------
|
||||
|
||||
==> define Random Number Engine and initial seed
|
||||
|
||||
G4VUserPhysicsList
|
||||
------------------
|
||||
|
||||
==> define particles; including *** G4OpticalPhoton ***
|
||||
define processes; including *** G4Cerenkov ***
|
||||
*** G4OpAbsorption ***
|
||||
*** G4OpRayleigh ***
|
||||
*** G4OpBoundaryProcess ***
|
||||
|
||||
G4VUserDetectorConstruction
|
||||
---------------------------
|
||||
|
||||
==> define material: Air and Water
|
||||
define simple G4box geometry (with translation and rotation)
|
||||
*** add G4MaterialPropertiesTable to G4Material ***
|
||||
*** define G4LogicalSurface(s) ***
|
||||
*** define G4OpticalSurface ***
|
||||
*** add G4MaterialPropertiesTable to G4OpticalSurface ***
|
||||
|
||||
G4VUserPrimaryGeneratorAction
|
||||
-----------------------------
|
||||
|
||||
==> Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator
|
||||
|
||||
G4UserRunAction
|
||||
---------------
|
||||
|
||||
==> define G4Timer (start/stop)
|
||||
set verbose levels
|
||||
@@ -0,0 +1,86 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - exampleExN06
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD Group
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// File: exampleExN06.cc
|
||||
// Description: Test of Continuous Process G4Cerenkov
|
||||
// -- Generation Cerenkov Photons --
|
||||
// -- Transport of optical Photons --
|
||||
// Version: 5.0
|
||||
// Created: 1996-04-30
|
||||
// Author: Juliet Armstrong
|
||||
// Updated: 1998-06-03 by Peter Gumplinger for example ExN06
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
|
||||
#include "ExN06DetectorConstruction.hh"
|
||||
#include "ExN06PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "ExN06PhysicsList.hh"
|
||||
#include "ExN06RunAction.hh"
|
||||
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
// Seed the random number generator manually
|
||||
// -----------------------------------------
|
||||
|
||||
G4long myseed = 345354;
|
||||
|
||||
HepRandom::setTheSeed(myseed);
|
||||
|
||||
// Run manager
|
||||
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// UserInitialization classes - mandatory
|
||||
|
||||
runManager-> SetUserInitialization(new ExN06DetectorConstruction);
|
||||
runManager-> SetUserInitialization(new ExN06PhysicsList);
|
||||
|
||||
// UserAction classes - optional
|
||||
|
||||
runManager->SetUserAction(new ExN06RunAction);
|
||||
runManager->SetUserAction(new ExN06PrimaryGeneratorAction);
|
||||
|
||||
// User interactions
|
||||
// Define (G)UI for interactive mode
|
||||
if(argc==1)
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else
|
||||
// Batch mode
|
||||
{
|
||||
G4UImanager * UI = G4UImanager::GetUIpointer();
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
delete runManager;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/control/verbose 2
|
||||
/run/initialize
|
||||
/run/beamOn 1
|
||||
exit
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#ifndef ExN06DetectorConstruction_h
|
||||
#define ExN06DetectorConstruction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
class ExN06DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
ExN06DetectorConstruction();
|
||||
~ExN06DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
private:
|
||||
|
||||
G4double expHall_x;
|
||||
G4double expHall_y;
|
||||
G4double expHall_z;
|
||||
|
||||
G4double tank_x;
|
||||
G4double tank_y;
|
||||
G4double tank_z;
|
||||
|
||||
G4double bubble_x;
|
||||
G4double bubble_y;
|
||||
G4double bubble_z;
|
||||
|
||||
};
|
||||
|
||||
#endif /*ExN06DetectorConstruction_h*/
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#ifndef ExN06PhysicsList_h
|
||||
#define ExN06PhysicsList_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
|
||||
class ExN06PhysicsList : public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN06PhysicsList();
|
||||
virtual ~ExN06PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particles and processes
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
|
||||
//
|
||||
virtual void SetCuts(G4double aCut);
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
virtual void ConstructBosons();
|
||||
virtual void ConstructLeptons();
|
||||
virtual void ConstructMesons();
|
||||
virtual void ConstructBarions();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
virtual void ConstructGeneral();
|
||||
virtual void ConstructEM();
|
||||
virtual void ConstructOp();
|
||||
|
||||
};
|
||||
|
||||
#endif /* ExN06PhysicsList_h */
|
||||
@@ -0,0 +1,33 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#ifndef ExN06PrimaryGeneratorAction_h
|
||||
#define ExN06PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
|
||||
class ExN06PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
|
||||
ExN06PrimaryGeneratorAction();
|
||||
~ExN06PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
private:
|
||||
|
||||
G4ParticleGun* particleGun;
|
||||
};
|
||||
|
||||
#endif /*ExN06PrimaryGeneratorAction_h*/
|
||||
@@ -0,0 +1,36 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#ifndef ExN06RunAction_h
|
||||
#define ExN06RunAction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4UserRunAction.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
class ExN06RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
|
||||
ExN06RunAction();
|
||||
~ExN06RunAction();
|
||||
|
||||
public:
|
||||
|
||||
void BeginOfRunAction(G4Run* aRun);
|
||||
void EndOfRunAction(G4Run* aRun);
|
||||
|
||||
private:
|
||||
|
||||
G4Timer* timer;
|
||||
G4int runIDcounter;
|
||||
};
|
||||
|
||||
#endif /*ExN06RunAction_h*/
|
||||
@@ -0,0 +1,264 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#include "ExN06DetectorConstruction.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4LogicalBorderSurface.hh"
|
||||
#include "G4LogicalSkinSurface.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
|
||||
#include "G4OpBoundaryProcess.hh"
|
||||
|
||||
ExN06DetectorConstruction::ExN06DetectorConstruction()
|
||||
{
|
||||
expHall_x = 10.*m;
|
||||
expHall_y = 10.*m;
|
||||
expHall_z = 10.*m;
|
||||
|
||||
tank_x = 5.*m;
|
||||
tank_y = 5.*m;
|
||||
tank_z = 5.*m;
|
||||
|
||||
bubble_x = 0.5*m;
|
||||
bubble_y = 0.5*m;
|
||||
bubble_z = 0.5*m;
|
||||
}
|
||||
|
||||
ExN06DetectorConstruction::~ExN06DetectorConstruction(){;}
|
||||
|
||||
G4VPhysicalVolume* ExN06DetectorConstruction::Construct()
|
||||
{
|
||||
|
||||
// ------------- Materials -------------
|
||||
|
||||
G4double a, z, density;
|
||||
G4String name, symbol;
|
||||
G4int nel;
|
||||
|
||||
// Air
|
||||
// ---
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", z=7., a);
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen", symbol="O", z=8., a);
|
||||
|
||||
density = 1.29e-03*g/cm3;
|
||||
G4Material* Air = new G4Material(name="Air", density, nel=2);
|
||||
Air->AddElement(elN, .7);
|
||||
Air->AddElement(elO, .3);
|
||||
|
||||
// Water
|
||||
// -----
|
||||
|
||||
a = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen", symbol="H", z=1., a);
|
||||
|
||||
density = 1.0*g/cm3;
|
||||
G4Material* Water = new G4Material(name="Water", density, nel=2);
|
||||
|
||||
Water->AddElement(elH, 2);
|
||||
Water->AddElement(elO, 1);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// Generate & Add Material Properties Table
|
||||
/////////////////////////////////////////////
|
||||
|
||||
const G4int NUMENTRIES = 32;
|
||||
|
||||
G4double PPCKOV[NUMENTRIES] =
|
||||
{ 2.038E-9*GeV, 2.072E-9*GeV, 2.107E-9*GeV, 2.143E-9*GeV,
|
||||
2.181E-9*GeV, 2.220E-9*GeV, 2.260E-9*GeV, 2.302E-9*GeV,
|
||||
2.346E-9*GeV, 2.391E-9*GeV, 2.438E-9*GeV, 2.486E-9*GeV,
|
||||
2.537E-9*GeV, 2.590E-9*GeV, 2.645E-9*GeV, 2.702E-9*GeV,
|
||||
2.763E-9*GeV, 2.825E-9*GeV, 2.891E-9*GeV, 2.960E-9*GeV,
|
||||
3.032E-9*GeV, 3.108E-9*GeV, 3.188E-9*GeV, 3.271E-9*GeV,
|
||||
3.360E-9*GeV, 3.453E-9*GeV, 3.552E-9*GeV, 3.656E-9*GeV,
|
||||
3.767E-9*GeV, 3.884E-9*GeV, 4.010E-9*GeV, 4.144E-9*GeV };
|
||||
|
||||
G4double RINDEX1[NUMENTRIES] =
|
||||
{ 1.33, 1.33, 1.33, 1.33, 1.33, 1.33, 1.33,
|
||||
1.33, 1.33, 1.34, 1.34, 1.34, 1.34, 1.34,
|
||||
1.34, 1.34, 1.34, 1.34, 1.34, 1.34, 1.34,
|
||||
1.34, 1.34, 1.35, 1.35, 1.35, 1.35, 1.35,
|
||||
1.35, 1.35, 1.35, 1.35 };
|
||||
|
||||
G4double RINDEX2[NUMENTRIES] =
|
||||
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00 };
|
||||
|
||||
G4double ABSORPTION1[NUMENTRIES] =
|
||||
{344.8*cm, 408.2*cm, 632.9*cm, 917.4*cm, 1234.6*cm, 1388.9*cm,
|
||||
1515.2*cm, 1724.1*cm, 1886.8*cm, 2000.0*cm, 2631.6*cm, 3571.4*cm,
|
||||
4545.5*cm, 4761.9*cm, 5263.2*cm, 5263.2*cm, 5555.6*cm, 5263.2*cm,
|
||||
5263.2*cm, 4761.9*cm, 4545.5*cm, 4166.7*cm, 3703.7*cm, 3333.3*cm,
|
||||
3000.0*cm, 2850.0*cm, 2700.0*cm, 2450.0*cm, 2200.0*cm, 1950.0*cm,
|
||||
1750.0*cm, 1450.0*cm };
|
||||
|
||||
G4MaterialPropertiesTable *myMPT1 = new G4MaterialPropertiesTable();
|
||||
myMPT1->AddProperty("RINDEX", PPCKOV, RINDEX1, NUMENTRIES);
|
||||
myMPT1->AddProperty("ABSLENGTH",PPCKOV, ABSORPTION1, NUMENTRIES);
|
||||
Water->SetMaterialPropertiesTable(myMPT1);
|
||||
|
||||
G4MaterialPropertiesTable *myMPT2 = new G4MaterialPropertiesTable();
|
||||
myMPT2->AddProperty("RINDEX", PPCKOV, RINDEX2, NUMENTRIES);
|
||||
Air->SetMaterialPropertiesTable(myMPT2);
|
||||
|
||||
// ------------- Volumes --------------
|
||||
|
||||
// The experimental Hall
|
||||
// ---------------------
|
||||
|
||||
G4Box * expHall_box
|
||||
= new G4Box("World",expHall_x,expHall_y,expHall_z);
|
||||
|
||||
G4LogicalVolume * expHall_log
|
||||
= new G4LogicalVolume(expHall_box,Air,"World",0,0,0);
|
||||
|
||||
G4VPhysicalVolume * expHall_phys
|
||||
= new G4PVPlacement(0,G4ThreeVector(),"World",expHall_log,0,false,0);
|
||||
|
||||
// The Water Tank
|
||||
// --------------
|
||||
|
||||
G4Box * waterTank_box
|
||||
= new G4Box("Tank",tank_x,tank_y,tank_z);
|
||||
|
||||
G4LogicalVolume * waterTank_log
|
||||
= new G4LogicalVolume(waterTank_box,Water,"Tank",0,0,0);
|
||||
|
||||
G4RotationMatrix *rot1=new G4RotationMatrix();
|
||||
rot1->rotateZ(M_PI*0.125);
|
||||
|
||||
// G4VPhysicalVolume * waterTank_phys
|
||||
// = new G4PVPlacement(rot1,G4ThreeVector(),"Tank",
|
||||
// waterTank_log,expHall_phys,false,0);
|
||||
|
||||
G4VPhysicalVolume * waterTank_phys
|
||||
= new G4PVPlacement(0,G4ThreeVector(),"Tank",
|
||||
waterTank_log,expHall_phys,false,0);
|
||||
|
||||
// The Air Bubble
|
||||
// --------------
|
||||
|
||||
G4Box * bubbleAir_box
|
||||
= new G4Box("Bubble",bubble_x,bubble_y,bubble_z);
|
||||
|
||||
G4LogicalVolume * bubbleAir_log
|
||||
= new G4LogicalVolume(bubbleAir_box,Air,"Bubble",0,0,0);
|
||||
|
||||
G4RotationMatrix *rot2=new G4RotationMatrix();
|
||||
rot2->rotateZ(M_PI*0.25);
|
||||
|
||||
// G4VPhysicalVolume * bubbleAir_phys
|
||||
// = new G4PVPlacement(rot2,G4ThreeVector(0,2.5*m,0),"Bubble",
|
||||
// bubbleAir_log,waterTank_phys,false,0);
|
||||
|
||||
G4VPhysicalVolume * bubbleAir_phys
|
||||
= new G4PVPlacement(0,G4ThreeVector(0,2.5*m,0),"Bubble",
|
||||
bubbleAir_log,waterTank_phys,false,0);
|
||||
|
||||
// ------------- Surfaces --------------
|
||||
|
||||
G4OpticalSurface * OpWaterSurface =
|
||||
new G4OpticalSurface("WaterSurface");
|
||||
|
||||
G4LogicalBorderSurface * WaterSurface =
|
||||
new G4LogicalBorderSurface("WaterSurface",
|
||||
waterTank_phys,expHall_phys,
|
||||
OpWaterSurface);
|
||||
|
||||
OpWaterSurface->SetType(dielectric_metal);
|
||||
OpWaterSurface->SetFinish(polished);
|
||||
OpWaterSurface->SetModel(glisur);
|
||||
|
||||
if( WaterSurface->GetVolume1() == waterTank_phys ) G4cout << " Equal " << endl;
|
||||
if( WaterSurface->GetVolume2() == expHall_phys ) G4cout << " Equal " << endl;
|
||||
|
||||
G4OpticalSurface * OpAirSurface =
|
||||
new G4OpticalSurface("AirSurface");
|
||||
|
||||
G4LogicalSkinSurface * AirSurface =
|
||||
new G4LogicalSkinSurface("AirSurface",
|
||||
bubbleAir_log,
|
||||
OpAirSurface);
|
||||
|
||||
OpAirSurface->SetType(dielectric_dielectric);
|
||||
OpAirSurface->SetFinish(ground);
|
||||
OpAirSurface->SetModel(unified);
|
||||
|
||||
if( AirSurface->GetLogicalVolume() == bubbleAir_log ) G4cout << " Equal " << endl;
|
||||
|
||||
G4LogicalBorderSurface * Tmp1Surface = WaterSurface->
|
||||
GetSurface(waterTank_phys,expHall_phys);
|
||||
|
||||
// if (Tmp1Surface == *WaterSurface) G4cout << " Equal " << endl;
|
||||
|
||||
G4LogicalSkinSurface * Tmp2Surface = AirSurface->GetSurface(bubbleAir_log);
|
||||
|
||||
// if (Tmp2Surface == *AirSurface ) G4cout << " Equal " << endl;
|
||||
|
||||
G4OpticalSurface * TmpOpSurface = Tmp2Surface->GetOpticalSurface();
|
||||
TmpOpSurface->DumpInfo();
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// Generate & Add Material Properties Table
|
||||
/////////////////////////////////////////////
|
||||
|
||||
const G4int NUM = 2;
|
||||
|
||||
G4double PP[NUM] =
|
||||
{ 2.038E-9*GeV, 4.144E-9*GeV };
|
||||
|
||||
G4double RINDEX[NUM] =
|
||||
{ 1.35, 1.40 };
|
||||
G4double SPECULARLOBECONSTANT[NUM] =
|
||||
{ 0.3, 0.3 };
|
||||
G4double SPECULARSPIKECONSTANT[NUM] =
|
||||
{ 0.2, 0.2 };
|
||||
G4double BACKSCATTERCONSTANT[NUM] =
|
||||
{ 0.2, 0.2 };
|
||||
|
||||
G4MaterialPropertiesTable *myST1 = new G4MaterialPropertiesTable();
|
||||
|
||||
myST1->AddProperty("RINDEX", PP, RINDEX, NUM);
|
||||
myST1->
|
||||
AddProperty("SPECULARLOBECONSTANT", PP, SPECULARLOBECONSTANT, NUM);
|
||||
myST1->
|
||||
AddProperty("SPECULARSPIKECONSTANT", PP, SPECULARSPIKECONSTANT, NUM);
|
||||
myST1->
|
||||
AddProperty("BACKSCATTERCONSTANT", PP, BACKSCATTERCONSTANT, NUM);
|
||||
|
||||
OpWaterSurface->SetMaterialPropertiesTable(myST1);
|
||||
|
||||
G4double REFLECTIVITY[NUM] =
|
||||
{ 0.3, 0.5 };
|
||||
G4double EFFICIENCY[NUM] =
|
||||
{ 0.8, 1.0 };
|
||||
|
||||
G4MaterialPropertiesTable *myST2 = new G4MaterialPropertiesTable();
|
||||
|
||||
myST2->AddProperty("REFLECTIVITY", PP, REFLECTIVITY, NUM);
|
||||
myST2->AddProperty("EFFICIENCY", PP, EFFICIENCY, NUM);
|
||||
|
||||
OpAirSurface->SetMaterialPropertiesTable(myST2);
|
||||
|
||||
return expHall_phys;
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "ExN06PhysicsList.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
|
||||
ExN06PhysicsList::ExN06PhysicsList() : G4VUserPhysicsList() {}
|
||||
|
||||
ExN06PhysicsList::~ExN06PhysicsList() {}
|
||||
|
||||
void ExN06PhysicsList::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();
|
||||
ConstructBarions();
|
||||
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// optical photon
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
G4Neutron::NeutronDefinition();
|
||||
G4AntiNeutron::AntiNeutronDefinition();
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructGeneral();
|
||||
ConstructEM();
|
||||
ConstructOp();
|
||||
}
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void ExN06PhysicsList::ConstructGeneral()
|
||||
{
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (theDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager->AddDiscreteProcess(theDecayProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#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"
|
||||
|
||||
void ExN06PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
// Construct processes for gamma
|
||||
// pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
// pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
// pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for 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
|
||||
// Construct processes for 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
|
||||
// Construct processes for 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->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 "G4Cerenkov.hh"
|
||||
#include "G4OpAbsorption.hh"
|
||||
#include "G4OpRayleigh.hh"
|
||||
#include "G4OpBoundaryProcess.hh"
|
||||
|
||||
void ExN06PhysicsList::ConstructOp()
|
||||
{
|
||||
G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
|
||||
G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
|
||||
G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
|
||||
G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
|
||||
|
||||
// theCerenkovProcess->DumpPhysicsTable();
|
||||
// theAbsorptionProcess->DumpPhysicsTable();
|
||||
// theRayleighScatteringProcess->DumpPhysicsTable();
|
||||
|
||||
theCerenkovProcess->SetVerboseLevel(1);
|
||||
theAbsorptionProcess->SetVerboseLevel(1);
|
||||
theRayleighScatteringProcess->SetVerboseLevel(1);
|
||||
theBoundaryProcess->SetVerboseLevel(1);
|
||||
|
||||
G4int MaxNumPhotons = 300;
|
||||
|
||||
theCerenkovProcess->SetTrackSecondariesFirst(true);
|
||||
theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
|
||||
|
||||
G4OpticalSurfaceModel themodel = unified;
|
||||
theBoundaryProcess->SetModel(themodel);
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
if (theCerenkovProcess->IsApplicable(*particle)) {
|
||||
pmanager->AddContinuousProcess(theCerenkovProcess);
|
||||
}
|
||||
if (particleName == "opticalphoton") {
|
||||
G4cout << " AddDiscreteProcess to OpticalPhoton " << endl;
|
||||
pmanager->AddDiscreteProcess(theAbsorptionProcess);
|
||||
pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
|
||||
pmanager->AddDiscreteProcess(theBoundaryProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ExN06PhysicsList::SetCuts(G4double cut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "ExN06PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << cut/mm << " (mm)" << endl;
|
||||
}
|
||||
|
||||
// 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(cut, "gamma");
|
||||
SetCutValue(cut, "e-");
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton
|
||||
|
||||
SetCutValue(cut, "proton");
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(GetDefaultCutValue());
|
||||
|
||||
if (verboseLevel>1) {
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#include "ExN06PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
ExN06PrimaryGeneratorAction::ExN06PrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
}
|
||||
|
||||
ExN06PrimaryGeneratorAction::~ExN06PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
void ExN06PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="e+");
|
||||
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleTime(0.0*ns);
|
||||
|
||||
G4ThreeVector position(0.0*cm,0.0*cm,0.0*cm);
|
||||
particleGun->SetParticlePosition(position);
|
||||
|
||||
G4ThreeVector direction(1.0,0.0,0.0);
|
||||
particleGun->SetParticleMomentumDirection(direction.unit());
|
||||
|
||||
G4double energy = 10.0*MeV;
|
||||
particleGun->SetParticleEnergy(energy);
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
|
||||
#include "ExN06RunAction.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
ExN06RunAction::ExN06RunAction()
|
||||
{
|
||||
timer = new G4Timer;
|
||||
runIDcounter = 0;
|
||||
}
|
||||
|
||||
ExN06RunAction::~ExN06RunAction()
|
||||
{
|
||||
delete timer;
|
||||
}
|
||||
|
||||
void ExN06RunAction::BeginOfRunAction(G4Run* aRun)
|
||||
{
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/event/verbose 1");
|
||||
UI->ApplyCommand("/tracking/verbose 1");
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << endl;
|
||||
timer->Start();
|
||||
}
|
||||
|
||||
void ExN06RunAction::EndOfRunAction(G4Run* aRun)
|
||||
{
|
||||
timer->Stop();
|
||||
G4cout << "number of event = " << aRun->GetNumberOfEvent()
|
||||
<< " " << *timer << endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user