Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-12 17:16:06 +01:00
parent 80e2389dd8
commit 84f33a068c
593 changed files with 68589 additions and 1 deletions
@@ -0,0 +1,16 @@
# - build test library
# library
set(_TARGET gtest01)
g4py_add_module(${_TARGET}
Particles.cc
PhysicsListEMstd.cc
QDetectorConstruction.cc
QEventAction.cc
QMaterials.cc
QPhysicsList.cc
QPrimaryGeneratorAction.cc
gtest01.cc
)
target_link_libraries(${_TARGET} PRIVATE G4particles G4processes G4run)
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// Particles.cc
//
// Physics list for defining particles
//
// ====================================================================
#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,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// Particles.hh
//
// 2004 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,121 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// PhysicsListEMstd.cc
//
// Physics list for electron/positron/gamma
// EM-standard package w/ default parameters
//
// ====================================================================
#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 "G4eMultipleScattering.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
// ----------------------------------------------------------
G4eMultipleScattering* msc= new G4eMultipleScattering;
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 G4eMultipleScattering;
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,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// PhysicsListEMstd.hh
//
// 2004 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,144 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QDetectorConstruction.cc
//
// 2005 Q
// ====================================================================
#include "QDetectorConstruction.hh"
#include "G4Material.hh"
#include "G4Tubs.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4SystemOfUnits.hh"
// ====================================================================
//
// class description
//
// ====================================================================
// constants (detector parameters)
static const G4double DXYZ_AREA= 30.*cm;
//////////////////////////////////////////////
QDetectorConstruction::QDetectorConstruction()
//////////////////////////////////////////////
{
}
///////////////////////////////////////////////
QDetectorConstruction::~QDetectorConstruction()
///////////////////////////////////////////////
{
}
/////////////////////////////////////////////////////
G4VPhysicalVolume* QDetectorConstruction::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-> SetForceWireframe(true);
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;
/*G4PVPlacement* pvoxel=*/ 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);
/*G4PVPlacement* ptube=*/ 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;
/*G4PVPlacement* pcal=*/ new G4PVPlacement(0, G4ThreeVector(x0, 0., 2.*cm),
lcal, "cal", areaLV, false, index);
index++;
}
return area;
}
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QDetectorConstruction.hh
//
// 2005 Q
// ====================================================================
#ifndef Q_DETECTOR_CONSTRUCTION_H
#define Q_DETECTOR_CONSTRUCTION_H
#include "G4VUserDetectorConstruction.hh"
// ====================================================================
//
// class definition
//
// ====================================================================
class QDetectorConstruction : public G4VUserDetectorConstruction {
public:
QDetectorConstruction();
~QDetectorConstruction();
virtual G4VPhysicalVolume* Construct();
};
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QEventAction.cc
//
// 2005 Q
// ====================================================================
#include "QEventAction.hh"
#include "globals.hh"
// ====================================================================
//
// class description
//
// ====================================================================
////////////////////////////
QEventAction::QEventAction()
////////////////////////////
{
}
/////////////////////////////
QEventAction::~QEventAction()
/////////////////////////////
{
}
////////////////////////////////////////////////////////////
void QEventAction::BeginOfEventAction(const G4Event* /*aevent*/)
////////////////////////////////////////////////////////////
{
G4cout << "QEventAction::BofEA is called." << G4endl;
}
//////////////////////////////////////////////////////////
void QEventAction::EndOfEventAction(const G4Event* /*aevent*/)
//////////////////////////////////////////////////////////
{
G4cout << "QEventAction::EofEA is called." << G4endl;
}
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QEventAction.hh
//
// 2005 Q
// ====================================================================
#ifndef Q_EVENT_ACTION_H
#define Q_EVENT_ACTION_H
#include "G4UserEventAction.hh"
// ====================================================================
//
// class definition
//
// ====================================================================
class QEventAction : public G4UserEventAction {
public:
QEventAction();
~QEventAction();
virtual void BeginOfEventAction(const G4Event* aevent);
virtual void EndOfEventAction(const G4Event* aevent);
};
#endif
@@ -0,0 +1,163 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QMaterials.cc
//
// 2005 Q
// ====================================================================
#include "QMaterials.hh"
#include "G4Material.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
// ====================================================================
//
// class description
//
// ====================================================================
////////////////////////
QMaterials::QMaterials()
////////////////////////
{
}
/////////////////////////
QMaterials::~QMaterials()
/////////////////////////
{
}
////////////////////////////
void QMaterials::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;
/*G4Material* Si=*/ new G4Material("SiliconWafer", Z=14., A, density);
// alminium
A= 26.98 *g/mole;
density= 2.70 *g/cm3;
/*G4Material* Al=*/ new G4Material("Al", Z=13., A, density);
// iron
A= 55.847 *g/mole;
density= 7.87 *g/cm3;
/*G4Material* Fe=*/ new G4Material("Iron", Z=26., A, density);
// lead
A= 207.2 *g/mole;
density= 11.35 *g/cm3;
/*G4Material* Pb=*/ 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,50 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QMaterials.hh
//
// 2005 Q
// ====================================================================
#ifndef Q_MATERIALS_H
#define Q_MATERIALS_H
#include "globals.hh"
// ====================================================================
//
// class definition
//
// ====================================================================
class QMaterials {
public:
QMaterials();
~QMaterials();
void Construct();
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QPhysicsList.cc
//
// 2005 Q
// ====================================================================
#include "QPhysicsList.hh"
#include "Particles.hh"
#include "PhysicsListEMstd.hh"
#include "G4SystemOfUnits.hh"
// ====================================================================
//
// class description
//
// ====================================================================
////////////////////////////
QPhysicsList::QPhysicsList()
: G4VModularPhysicsList()
////////////////////////////
{
// default cut value (1.0mm)
defaultCutValue = 1.*mm;
SetVerboseLevel(1);
// particles
RegisterPhysics(new Particles);
// EM Physics
RegisterPhysics(new PhysicsListEMstd);
}
/////////////////////////////
QPhysicsList::~QPhysicsList()
/////////////////////////////
{
}
////////////////////////////
void QPhysicsList::SetCuts()
////////////////////////////
{
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
}
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QPhysicsList.hh
//
// 2005 Q
// ====================================================================
#ifndef Q_PHYSICS_LIST_H
#define Q_PHYSICS_LIST_H
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
// ====================================================================
//
// class definition
//
// ====================================================================
class QPhysicsList: public G4VModularPhysicsList {
public:
QPhysicsList();
~QPhysicsList();
virtual void SetCuts();
};
#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. *
// ********************************************************************
//
// ====================================================================
// QPrimaryGeneratorAction.cc
//
// 2005 Q
// ====================================================================
#include "QPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
// ====================================================================
//
// class description
//
// ====================================================================
//////////////////////////////////////////////////
QPrimaryGeneratorAction::QPrimaryGeneratorAction()
//////////////////////////////////////////////////
{
particleGun= new G4ParticleGun;
}
///////////////////////////////////////////////////
QPrimaryGeneratorAction::~QPrimaryGeneratorAction()
///////////////////////////////////////////////////
{
delete particleGun;
}
/////////////////////////////////////////////////////////////////
void QPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
/////////////////////////////////////////////////////////////////
{
particleGun-> GeneratePrimaryVertex(anEvent);
}
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// QPrimaryGeneratorAction.hh
//
// 2005 Q
// ====================================================================
#ifndef Q_PRIMARY_GENERATOR_ACTION_H
#define Q_PRIMARY_GENERATOR_ACTION_H
#include "G4VUserPrimaryGeneratorAction.hh"
class G4ParticleGun;
// ====================================================================
//
// class definition
//
// ====================================================================
class QPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
private:
// use G4 particle gun
G4ParticleGun* particleGun;
public:
QPrimaryGeneratorAction();
~QPrimaryGeneratorAction();
G4ParticleGun* GetParticleGun() const;
virtual void GeneratePrimaries(G4Event* anEvent);
};
// ====================================================================
// inline functions
// ====================================================================
inline G4ParticleGun* QPrimaryGeneratorAction::GetParticleGun() const
{ return particleGun; }
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ====================================================================
// gtest01.cc
//
// python wrapper for user application
// 2005 Q
// ====================================================================
#include <boost/python.hpp>
#include "QMaterials.hh"
#include "QDetectorConstruction.hh"
#include "QPhysicsList.hh"
#include "QPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "QEventAction.hh"
using namespace boost::python;
// ====================================================================
// Expose to Python
// ====================================================================
BOOST_PYTHON_MODULE(gtest01) {
class_<QMaterials>("QMaterials", "my material")
.def("Construct", &QMaterials::Construct)
;
class_<QDetectorConstruction, QDetectorConstruction*,
bases<G4VUserDetectorConstruction> >
("QDetectorConstruction", "my detector")
;
class_<QPhysicsList, QPhysicsList*,
bases<G4VUserPhysicsList> >
("QPhysicsList", "my physics list")
;
class_<QPrimaryGeneratorAction, QPrimaryGeneratorAction*,
bases<G4VUserPrimaryGeneratorAction> >
("QPrimaryGeneratorAction", "my primary generator action")
.def("GetParticleGun", &QPrimaryGeneratorAction::GetParticleGun,
return_internal_reference<>())
;
class_<QEventAction, QEventAction*,
bases<G4UserEventAction> >
("QEventAction", "my event action")
;
}