Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# $Id: GNUmakefile,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
# $Name: geant4-09-01 $
|
||||
# ===========================================================
|
||||
# Makefile for building G4 MPI aplication
|
||||
# ===========================================================
|
||||
name := exMPI01#
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
G4WORKDIR := .
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
include ../mpi_interface/G4MPI.gmk
|
||||
|
||||
LDLIBS1 += -lG4UImpi
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
$Id: History,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
exMPI01 History
|
||||
---------------
|
||||
|
||||
16 Nov. 2007 K.Murakami
|
||||
- commited to G4 CVS.
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
$Id: README,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Example MPI01
|
||||
-------------
|
||||
|
||||
A simple application.
|
||||
|
||||
* Geometry : chamber / calorimeter
|
||||
* Primary : particle gun (200 MeV electron as default)
|
||||
* Physics List : standard EM
|
||||
|
||||
- Particles are transported in a geometry without any scoring.
|
||||
- Learn how to parallelized your G4 session.
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: exMPI01.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// exMPI01.cc
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
// my application
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "PhysicsList.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
// MPI session
|
||||
#include "G4MPImanager.hh"
|
||||
#include "G4MPIsession.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "G4VisExecutive.hh"
|
||||
#endif
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
// random engine
|
||||
//CLHEP::HepJamesRandom randomEngine;
|
||||
CLHEP::Ranlux64Engine randomEngine;
|
||||
CLHEP::HepRandom::setTheEngine(&randomEngine);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// MPI session
|
||||
// --------------------------------------------------------------------
|
||||
// At first, G4MPImanager/G4MPIsession should be created.
|
||||
G4MPImanager* g4MPI= new G4MPImanager(argc,argv);
|
||||
|
||||
// MPI session (G4MPIsession) instead of G4UIterminal
|
||||
// Terminal availability depends on your MPI implementation.
|
||||
G4MPIsession* session= g4MPI-> GetMPIsession();
|
||||
|
||||
// LAM/MPI users can use G4tcsh.
|
||||
G4String prompt= "[40;01;33m";
|
||||
prompt+= "G4MPI";
|
||||
prompt+= "[40;31m(%s)[40;36m[%/][00;30m:";
|
||||
|
||||
G4UItcsh* tcsh= new G4UItcsh(prompt);
|
||||
tcsh-> SetLsColor(BLUE,RED);
|
||||
session-> SetShell(tcsh);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// user application setting
|
||||
// --------------------------------------------------------------------
|
||||
G4RunManager* runManager= new G4RunManager();
|
||||
|
||||
// setup your application
|
||||
runManager-> SetUserInitialization(new DetectorConstruction);
|
||||
runManager-> SetUserInitialization(new PhysicsList);
|
||||
runManager-> SetUserAction(new PrimaryGeneratorAction);
|
||||
|
||||
runManager-> Initialize();
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
G4VisExecutive* visManager= new G4VisExecutive;
|
||||
visManager-> Initialize();
|
||||
G4cout << G4endl;
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// ready for go
|
||||
// MPIsession treats both interactive and batch modes.
|
||||
// Just start your session as below.
|
||||
// --------------------------------------------------------------------
|
||||
session-> SessionStart();
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// termination
|
||||
// --------------------------------------------------------------------
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
|
||||
delete g4MPI;
|
||||
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorConstruction.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// DetectorConstruction.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef DETECTOR_CONSTRUCTION_H
|
||||
#define DETECTOR_CONSTRUCTION_H
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction {
|
||||
|
||||
public:
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction();
|
||||
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: Materials.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// Materials.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef MATERIALS_H
|
||||
#define MATERIALS_H
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
class Materials {
|
||||
|
||||
public:
|
||||
Materials();
|
||||
~Materials();
|
||||
|
||||
void Construct();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: Particles.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// Particles.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef PARTICLES_H
|
||||
#define PARTICLES_H
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class Particles : public G4VPhysicsConstructor {
|
||||
|
||||
public:
|
||||
Particles();
|
||||
~Particles();
|
||||
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsList.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PhysicsList.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef PHYSICS_LIST_H
|
||||
#define PHYSICS_LIST_H
|
||||
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class PhysicsList: public G4VModularPhysicsList {
|
||||
public:
|
||||
PhysicsList();
|
||||
~PhysicsList();
|
||||
|
||||
virtual void SetCuts();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsListEMstd.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PhysicsListEMstd.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef PHYSICS_LIST_EM_STD_H
|
||||
#define PHYSICS_LIST_EM_STD_H
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class PhysicsListEMstd : public G4VPhysicsConstructor {
|
||||
|
||||
public:
|
||||
PhysicsListEMstd();
|
||||
~PhysicsListEMstd();
|
||||
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.hh,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PrimaryGeneratorAction.hh
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#ifndef PRIMARY_GENERATOR_ACTION_H
|
||||
#define PRIMARY_GENERATOR_ACTION_H
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class definition
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
|
||||
public:
|
||||
PrimaryGeneratorAction();
|
||||
~PrimaryGeneratorAction();
|
||||
|
||||
virtual void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,151 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorConstruction.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// DetectorConstruction.cc
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "Materials.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
// constants (detector parameters)
|
||||
static const G4double DXYZ_AREA= 32.*cm;
|
||||
static const G4double DW= 10.*cm;
|
||||
|
||||
////////////////////////////////////////////
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
DetectorConstruction::~DetectorConstruction()
|
||||
/////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
///////////////////////////////////////////////////
|
||||
{
|
||||
// material definition
|
||||
Materials* materialConstruction= new Materials;
|
||||
materialConstruction-> Construct();
|
||||
|
||||
G4Material* mate;
|
||||
G4VisAttributes* va;
|
||||
|
||||
// ==============================================================
|
||||
// world volume
|
||||
// ==============================================================
|
||||
G4Box* areaSolid= new G4Box("AREA",
|
||||
DXYZ_AREA/2., DXYZ_AREA/2., DXYZ_AREA/2.);
|
||||
|
||||
G4Material* vacuum= G4Material::GetMaterial("Vacuum");
|
||||
G4LogicalVolume* areaLV= new G4LogicalVolume(areaSolid, vacuum, "AREA_LV");
|
||||
G4PVPlacement* area= new G4PVPlacement(0, G4ThreeVector(), "AREA_PV",
|
||||
areaLV, 0, false, 0);
|
||||
// vis. attributes
|
||||
va= new G4VisAttributes(G4Color(1.,1.,1.));
|
||||
va-> SetVisibility(false);
|
||||
areaLV-> SetVisAttributes(va);
|
||||
|
||||
// ==============================================================
|
||||
// detectors
|
||||
// ==============================================================
|
||||
// voxel
|
||||
const G4double dvoxel= 10.*mm;
|
||||
const G4double dl= 10.*cm;
|
||||
|
||||
G4Box* svoxel= new G4Box("voxel", dvoxel, dl, dvoxel);
|
||||
mate= G4Material::GetMaterial("Vacuum");
|
||||
G4LogicalVolume* lvoxel= new G4LogicalVolume(svoxel, mate, "voxel");
|
||||
va= new G4VisAttributes(G4Color(0.,0.8,0.8));
|
||||
va-> SetVisibility(false);
|
||||
lvoxel-> SetVisAttributes(va);
|
||||
|
||||
G4int ix, iz;
|
||||
G4int index=0;
|
||||
for (iz=0; iz<5; iz++) {
|
||||
for (ix=-7; ix<=7; ix++) {
|
||||
G4double x0= (2.*ix)*cm;
|
||||
G4double z0= (-13.+2.*iz)*cm;
|
||||
new G4PVPlacement(0, G4ThreeVector(x0, 0., z0),
|
||||
lvoxel, "voxel", areaLV, false, index);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// tube
|
||||
//G4Tubs* stube= new G4Tubs("tube", 15./2.*mm, 19./2.*mm, dl,
|
||||
G4Tubs* stube= new G4Tubs("tube", 0.*mm, 19./2.*mm, dl,
|
||||
0., 360.*deg);
|
||||
mate= G4Material::GetMaterial("Al");
|
||||
G4LogicalVolume* ltube= new G4LogicalVolume(stube, mate, "tube");
|
||||
va= new G4VisAttributes(G4Color(0.,0.8,0.8));
|
||||
ltube-> SetVisAttributes(va);
|
||||
|
||||
G4RotationMatrix* rmtube= new G4RotationMatrix;
|
||||
rmtube-> rotateX(-90.*deg);
|
||||
new G4PVPlacement(rmtube, G4ThreeVector(),
|
||||
ltube, "tube", lvoxel, false, 0);
|
||||
|
||||
// cal
|
||||
const G4double dxycal= 25.*mm;
|
||||
const G4double dzcal= 3.*cm;
|
||||
|
||||
G4Box* scal= new G4Box("cal", dxycal, dxycal, dzcal);
|
||||
mate= G4Material::GetMaterial("CsI");
|
||||
G4LogicalVolume* lcal= new G4LogicalVolume(scal, mate, "cal");
|
||||
va= new G4VisAttributes(G4Color(0.5,0.5,0.));
|
||||
lcal-> SetVisAttributes(va);
|
||||
|
||||
index= 0;
|
||||
for (ix=-2; ix<=2; ix++) {
|
||||
G4double x0= (5.*ix)*cm;
|
||||
new G4PVPlacement(0, G4ThreeVector(x0, 0., 2.*cm),
|
||||
lcal, "cal", areaLV, false, index);
|
||||
index++;
|
||||
}
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: Materials.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// Materials.cc
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "Materials.hh"
|
||||
#include "G4Material.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
//////////////////////
|
||||
Materials::Materials()
|
||||
//////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////
|
||||
Materials::~Materials()
|
||||
///////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////
|
||||
void Materials::Construct()
|
||||
///////////////////////////
|
||||
{
|
||||
G4double A, Z;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Elements
|
||||
// ------------------------------------------------------------------------
|
||||
G4Element* elH = new G4Element("Hydrogen","H", Z=1., A=1.00794*g/mole);
|
||||
G4Element* elC = new G4Element("Carbon", "C", Z=6., A= 12.011 *g/mole);
|
||||
G4Element* elN = new G4Element("Nitrogen","N", Z=7., A= 14.00674*g/mole);
|
||||
G4Element* elO = new G4Element("Oxygen", "O", Z=8., A= 15.9994*g/mole);
|
||||
G4Element* elNa = new G4Element("Sodium", "Na", Z=11., A= 22.989768*g/mole);
|
||||
G4Element* elSi = new G4Element("Silicon", "Si", Z=14., A= 28.0855*g/mole);
|
||||
G4Element* elAr = new G4Element("Argon", "Ar", Z=18., A= 39.948*g/mole);
|
||||
G4Element* elI = new G4Element("Iodine", "I", Z=53., A= 126.90447*g/mole);
|
||||
G4Element* elCs = new G4Element("Cesium", "Cs", Z=55., A= 132.90543*g/mole);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Materials
|
||||
// ------------------------------------------------------------------------
|
||||
G4double density, massfraction;
|
||||
G4int natoms, nel;
|
||||
|
||||
// temperature of experimental hall is controlled at 20 degree.
|
||||
const G4double expTemp= STP_Temperature+20.*kelvin;
|
||||
|
||||
// vacuum
|
||||
density= universe_mean_density;
|
||||
G4Material* Vacuum= new G4Material("Vacuum", density, nel=2);
|
||||
Vacuum-> AddElement(elN, .7);
|
||||
Vacuum-> AddElement(elO, .3);
|
||||
|
||||
// air
|
||||
density= 1.2929e-03 *g/cm3; // at 20 degree
|
||||
G4Material* Air= new G4Material("Air", density, nel=3,
|
||||
kStateGas, expTemp);
|
||||
G4double ttt= 75.47+23.20+1.28;
|
||||
Air-> AddElement(elN, massfraction= 75.47/ttt);
|
||||
Air-> AddElement(elO, massfraction= 23.20/ttt);
|
||||
Air-> AddElement(elAr, massfraction= 1.28/ttt);
|
||||
|
||||
// Ar gas
|
||||
A= 39.948 *g/mole;
|
||||
const G4double denAr= 1.782e-03 *g/cm3 * STP_Temperature/expTemp;
|
||||
G4Material* Ar= new G4Material("ArgonGas", Z=18., A, denAr,
|
||||
kStateGas, expTemp);
|
||||
|
||||
// ethane (C2H6)
|
||||
const G4double denEthane= 1.356e-3 *g/cm3 * STP_Temperature/expTemp;
|
||||
G4Material* Ethane= new G4Material("Ethane", denEthane, nel=2,
|
||||
kStateGas, expTemp);
|
||||
Ethane-> AddElement(elC, natoms=2);
|
||||
Ethane-> AddElement(elH, natoms=6);
|
||||
|
||||
// Ar(50%) + ethane(50%) mixture
|
||||
density= (denAr+denEthane)/2.;
|
||||
G4Material* ArEthane= new G4Material("ArEthane", density, nel=2,
|
||||
kStateGas, expTemp);
|
||||
ArEthane-> AddMaterial(Ar, massfraction= denAr/density/2.);
|
||||
ArEthane-> AddMaterial(Ethane, massfraction= denEthane/density/2.);
|
||||
|
||||
// silicon
|
||||
A= 28.0855 *g/mole;
|
||||
density= 2.33 *g/cm3;
|
||||
new G4Material("SiliconWafer", Z=14., A, density);
|
||||
|
||||
// alminium
|
||||
A= 26.98 *g/mole;
|
||||
density= 2.70 *g/cm3;
|
||||
new G4Material("Al", Z=13., A, density);
|
||||
|
||||
// iron
|
||||
A= 55.847 *g/mole;
|
||||
density= 7.87 *g/cm3;
|
||||
new G4Material("Iron", Z=26., A, density);
|
||||
|
||||
// lead
|
||||
A= 207.2 *g/mole;
|
||||
density= 11.35 *g/cm3;
|
||||
new G4Material("Lead", Z=82., A, density);
|
||||
|
||||
// scintillator (Polystyene(C6H5CH=CH2))
|
||||
density= 1.032 *g/cm3;
|
||||
G4Material* Scinti= new G4Material("Scinti", density, nel=2);
|
||||
Scinti-> AddElement(elC, natoms=8);
|
||||
Scinti-> AddElement(elH, natoms=8);
|
||||
|
||||
// quartz (SiO2, crystalline)
|
||||
density= 2.64 *g/cm3;
|
||||
G4Material* Quartz= new G4Material("Quartz", density, nel= 2);
|
||||
Quartz-> AddElement(elSi, natoms=1);
|
||||
Quartz-> AddElement(elO, natoms=2);
|
||||
|
||||
// NaI crystal
|
||||
density= 3.67 *g/cm3;
|
||||
G4Material* NaI= new G4Material("NaI", density, nel= 2);
|
||||
NaI-> AddElement(elNa, natoms=1);
|
||||
NaI-> AddElement(elI, natoms=1);
|
||||
|
||||
// CsI crystal
|
||||
density= 4.51 *g/cm3;
|
||||
G4Material* CsI= new G4Material("CsI", density, nel= 2);
|
||||
CsI-> AddElement(elCs, natoms=1);
|
||||
CsI-> AddElement(elI, natoms=1);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: Particles.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// Particles.cc
|
||||
// Physics list for defining particles
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "Particles.hh"
|
||||
|
||||
#include "G4LeptonConstructor.hh"
|
||||
#include "G4BosonConstructor.hh"
|
||||
#include "G4MesonConstructor.hh"
|
||||
#include "G4BaryonConstructor.hh"
|
||||
#include "G4ShortLivedConstructor.hh"
|
||||
#include "G4IonConstructor.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
//////////////////////////////////////
|
||||
Particles::Particles()
|
||||
: G4VPhysicsConstructor("Particles")
|
||||
//////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////
|
||||
Particles::~Particles()
|
||||
///////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////
|
||||
void Particles::ConstructParticle()
|
||||
///////////////////////////////////
|
||||
{
|
||||
G4LeptonConstructor::ConstructParticle();
|
||||
G4BosonConstructor::ConstructParticle();
|
||||
G4MesonConstructor::ConstructParticle();
|
||||
G4BaryonConstructor::ConstructParticle();
|
||||
G4ShortLivedConstructor::ConstructParticle();
|
||||
G4IonConstructor::ConstructParticle();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
void Particles::ConstructProcess()
|
||||
//////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsList.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PhysicsList.cc
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "PhysicsList.hh"
|
||||
#include "Particles.hh"
|
||||
#include "PhysicsListEMstd.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
///////////////////////////
|
||||
PhysicsList::PhysicsList()
|
||||
: G4VModularPhysicsList()
|
||||
////////////////////////////
|
||||
{
|
||||
// default cut value (1.0mm)
|
||||
defaultCutValue = 1.*mm;
|
||||
SetVerboseLevel(1);
|
||||
|
||||
// particles
|
||||
RegisterPhysics(new Particles);
|
||||
|
||||
// EM Physics
|
||||
RegisterPhysics(new PhysicsListEMstd);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////
|
||||
PhysicsList::~PhysicsList()
|
||||
///////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////
|
||||
void PhysicsList::SetCuts()
|
||||
///////////////////////////
|
||||
{
|
||||
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsListEMstd.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PhysicsListEMstd.cc
|
||||
// Physics list for electron/positron/gamma
|
||||
// EM-standard package w/ default parameters
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "PhysicsListEMstd.hh"
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4NeutrinoE.hh"
|
||||
#include "G4AntiNeutrinoE.hh"
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4MultipleScattering.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
////////////////////////////////////
|
||||
PhysicsListEMstd::PhysicsListEMstd()
|
||||
: G4VPhysicsConstructor("EM-std")
|
||||
////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
PhysicsListEMstd::~PhysicsListEMstd()
|
||||
/////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
void PhysicsListEMstd::ConstructParticle()
|
||||
//////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
void PhysicsListEMstd::ConstructProcess()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
G4ProcessManager* pm;
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// gamma physics
|
||||
// ----------------------------------------------------------
|
||||
pm= G4Gamma::Gamma()-> GetProcessManager();
|
||||
pm-> AddDiscreteProcess(new G4PhotoElectricEffect);
|
||||
pm-> AddDiscreteProcess(new G4ComptonScattering);
|
||||
pm-> AddDiscreteProcess(new G4GammaConversion);
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// electron physics
|
||||
// ----------------------------------------------------------
|
||||
G4MultipleScattering* msc= new G4MultipleScattering;
|
||||
G4eIonisation* eion= new G4eIonisation;
|
||||
G4eBremsstrahlung* ebrems= new G4eBremsstrahlung;
|
||||
|
||||
pm= G4Electron::Electron()->GetProcessManager();
|
||||
pm-> AddProcess(msc, ordInActive, 1, 1);
|
||||
pm-> AddProcess(eion, ordInActive, 2, 2);
|
||||
pm-> AddProcess(ebrems, ordInActive, ordInActive, 3);
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// positron physics
|
||||
// ----------------------------------------------------------
|
||||
msc= new G4MultipleScattering;
|
||||
eion= new G4eIonisation;
|
||||
ebrems= new G4eBremsstrahlung;
|
||||
G4eplusAnnihilation* annihilation= new G4eplusAnnihilation;
|
||||
|
||||
pm= G4Positron::Positron()-> GetProcessManager();
|
||||
pm-> AddProcess(msc, ordInActive, 1, 1);
|
||||
pm-> AddProcess(eion, ordInActive, 2, 2);
|
||||
pm-> AddProcess(ebrems, ordInActive, ordInActive, 3);
|
||||
pm-> AddProcess(annihilation, 0, ordInActive, 4);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.cc,v 1.1 2007/11/16 14:16:46 kmura Exp $
|
||||
// $Name: geant4-09-01 $
|
||||
//
|
||||
// ====================================================================
|
||||
// PrimaryGeneratorAction.cc
|
||||
//
|
||||
// 2007 Q
|
||||
// ====================================================================
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// class description
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
////////////////////////////////////////////////
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
particleGun= new G4ParticleGun;
|
||||
|
||||
G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable();
|
||||
G4ParticleDefinition* particle= particleTable-> FindParticle("e-");
|
||||
|
||||
particleGun-> SetParticleDefinition(particle);
|
||||
particleGun-> SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.,0.,-14.9*cm));
|
||||
particleGun-> SetParticleEnergy(200.*MeV);
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
/////////////////////////////////////////////////
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
////////////////////////////////////////////////////////////////
|
||||
{
|
||||
particleGun-> GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/vis/open OGLIX
|
||||
|
||||
/vis/scene/create
|
||||
/vis/scene/add/volume
|
||||
|
||||
/vis/sceneHandler/attach
|
||||
|
||||
/vis/viewer/set/viewpointThetaPhi 90. 270.
|
||||
|
||||
/tracking/storeTrajectory 1
|
||||
/vis/scene/add/trajectories
|
||||
/vis/scene/endOfEventAction accumulate
|
||||
#/vis/scene/endOfEventAction refresh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user