Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
+2 -26
View File
@@ -1,11 +1,9 @@
# $Id: GNUmakefile,v 1.6 2006/07/24 15:32:13 witoldp Exp $
# $Id: GNUmakefile,v 1.10 2007/12/05 08:25:56 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module.
# Author: Radovan Chytracek
# Date: 04/12/2004.
# --------------------------------------------------------------
name := g4_gdml_read_write
name := load_gdml
G4TARGET := $(name)
G4EXLIB := true
@@ -13,33 +11,11 @@ ifndef G4INSTALL
G4INSTALL = ../../..
endif
CPPFLAGS += \
-I$(GDML_INC) \
-I$(XERCESCROOT)/include
EXTRALIBS += \
-L$(GDML_LIB) \
-lG4Evaluator \
-lG4Processor \
-lG4Subscribers \
-lG4Writer \
-lSaxana \
-lProcesses \
-lWriter \
-L$(XERCESCROOT)/lib -lxerces-c
.PHONY: all
all: lib bin
ifndef XERCESCROOT
@echo XERCESCROOT not defined!
endif
ifndef GDML_INC
@echo GDML_INC not defined!
endif
ifndef GDML_LIB
@echo GDML_LIB not defined!
endif
include $(G4INSTALL)/config/binmake.gmk
+13 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.9 2006/12/01 16:57:09 gcosmo Exp $
$Id: History,v 1.12 2007/12/11 13:09:39 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,18 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
December 11th, 2007 G.Cosmo - exgdml-V09-00-02
- Protected usage of G4UItcsh in main().
December 5th, 2007 Z.Torzsok - exgdml-V09-00-01
- Corrected call to parser in main.
- Use OGLX instead of OGLXm.
- Fixed gun position.
November 19th, 2007 Z.Torzsok - exgdml-V09-00-00
- Updated to co-work with built-in GDML plugin module GDML-3.
- Showing loading of modular GDML files.
December 1st, 2006 W.Pokorski - exgdml-V08-01-00
- Set schema location to LCG release area in test.gdml.
- Updated README and GNUmakefile.
+19 -36
View File
@@ -1,4 +1,4 @@
$Id: README,v 1.9 2006/07/24 15:32:13 witoldp Exp $
$Id: README,v 1.10 2007/11/20 08:34:16 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,46 +14,29 @@ Geometry Description Markup Language).
The GDML files can be then used to interchange geometries between different
applications and users.
The detector construction consists of a call to GDMLProcessor which parses the
GDML file (test.gdml) and returns the pointer to the world volume. The user
can also write his/her own GDML file and use it as the primary input format for
his/her Geant4 application.
The detector construction consists of a call to GDMLProcessor which parses a
GDML file and returns the pointer to the world volume. The user can also write
her/his own GDML file and use it as the primary input format for her/his Geant4
application.
Once the Geant4 geometry is loaded in the memory, the G4GDMLWriter class is
instantiated (in the 'main') to demonstrate the exporting of the GDML file.
The call to DumpGeometryInfo method causes the GDML writer to scan the Geant4
geometry tree and write it out in the form of a GDML file.
More than one simple GDML files are provided:
- axes.gdml, showing loading and orientation of Cartesian axes;
- diamond.gdml, a simple diamond structure made of tessellated solids;
- modular.gdml, the combination of the two GDML files above loaded as
separate modules in the same setup.
HOW TO BUILD THE EXAMPLE ?
- Install the GDML package with the Geant4 binding as well as Xerces.
See: http://cern.ch/gdml.
- You need to have built the persistency/gdml plugin module by having
set G4LIB_BUILD_GDML variable in your environment.
It is also required you specify the path where the XercesC XML parser
package is installed in your system, through the variable XERCESCROOT.
- Set the environment variable GDML_INC to point to the directory where
GDML includes are installed and GDML_LIB to point to the directory
where GDML libraries are installed.
Set XERCESCROOT to point to place where Xerces is installed.
You can also edit the GNUmakefile provided with the example and
customise it for your specific setup.
- Compile and link to generate an executable:
- Compile and link to generate the executable:
% gmake
Note 1: GDML requires that all the Geant4 header files are copied to
one directory. You can use the Geant4 Configure script for coping
the Geant4 header files.
Note 2: new version of GDML (after GDML_2_5_0) have one additional
library called G4Evaluator. If you are compiling with older version
of GDML, you should remove that library from the makefile.
- You may need to customise the location of the GDML schema file which is
specified at the top of test.gdml file (the geometry file). By default
the schema will be loaded from the web server of LCG release area, however,
you can load your own copy of the schema by specifying the path, like:
xsi:noNamespaceSchemaLocation="/home/me/MYGDML/src/GDMLSchema/gdml.xsd"
- Execute the application:
% g4_gdml_read_write
Note: if you are using dynamic libraries, you should add $GDML_LIB
and $XERCESCROOT/lib paths to the LD_LIBRARY_PATH directory (or
equivalent on your system).
% load_gdml [GDML-file].gdml
Note: if you are using dynamic libraries, you should add and
$XERCESCROOT/lib paths to the LD_LIBRARY_PATH directory (or
equivalent on your system).
+114
View File
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
xsi:noNamespaceSchemaLocation="/afs/cern.ch/user/z/ztorzsok/scratch0/GDML2/GDMLSchema/gdml.xsd">
<define>
<constant name="XLength" value="100"/>
<constant name="YLength" value="200"/>
<constant name="ZLength" value="300"/>
<position name="XBoxPos" x="XLength/2"/>
<position name="YBoxPos" y="YLength/2"/>
<position name="ZBoxPos" z="ZLength/2"/>
<position name="XArrowPos" x="XLength"/>
<position name="YArrowPos" y="YLength"/>
<position name="ZArrowPos" z="ZLength"/>
<rotation name="XArrowRot" y="-90" unit="deg"/>
<rotation name="YArrowRot" x="90" unit="deg"/>
<rotation name="ZArrowRot" unit="deg"/>
<position name="v1" x="+10" y="+10" z="0"/>
<position name="v2" x="-10" y="+10" z="0"/>
<position name="v3" x="-10" y="-10" z="0"/>
<position name="v4" x="+10" y="-10" z="0"/>
<position name="v5" x="0" y="0" z="30"/>
</define>
<materials>
<material Z="1.0" name="AIR">
<D value="1e-25"/>
<atom value="1.00794"/>
</material>
<material name="ALU" Z="13.0">
<D value="2.70"/>
<atom value="26.98"/>
</material>
</materials>
<solids>
<box name="WorldBox" x="2000" y="2000" z="2000"/>
<box name="XBox" x="100" y="005" z="005"/>
<box name="YBox" x="005" y="200" z="005"/>
<box name="ZBox" x="005" y="005" z="300"/>
<box name="Origin" x="10" y="10" z="10"/>
<tessellated name="Arrow">
<quadrangular v1="v1" v2="v2" v3="v3" v4="v4"/>
<triangular v1="v1" v2="v2" v3="v5"/>
<triangular v1="v2" v2="v3" v3="v5"/>
<triangular v1="v3" v2="v4" v3="v5"/>
<triangular v1="v4" v2="v1" v3="v5"/>
</tessellated>
</solids>
<structure>
<volume name="vXBox">
<materialref ref="ALU"/>
<solidref ref="XBox"/>
</volume>
<volume name="vYBox">
<materialref ref="ALU"/>
<solidref ref="YBox"/>
</volume>
<volume name="vZBox">
<materialref ref="ALU"/>
<solidref ref="ZBox"/>
</volume>
<volume name="vOrigin">
<materialref ref="ALU"/>
<solidref ref="Origin"/>
</volume>
<volume name="vArrow">
<materialref ref="ALU"/>
<solidref ref="Arrow"/>
</volume>
<volume name="TOP">
<materialref ref="AIR"/>
<solidref ref="WorldBox"/>
<physvol>
<volumeref ref="vXBox"/>
<positionref ref="XBoxPos"/>
</physvol>
<physvol>
<volumeref ref="vYBox"/>
<positionref ref="YBoxPos"/>
</physvol>
<physvol>
<volumeref ref="vZBox"/>
<positionref ref="ZBoxPos"/>
</physvol>
<physvol>
<volumeref ref="vOrigin"/>
</physvol>
<physvol>
<volumeref ref="vArrow"/>
<rotationref ref="XArrowRot"/>
<positionref ref="XArrowPos"/>
</physvol>
<physvol>
<volumeref ref="vArrow"/>
<rotationref ref="YArrowRot"/>
<positionref ref="YArrowPos"/>
</physvol>
<physvol>
<volumeref ref="vArrow"/>
<rotationref ref="ZArrowRot"/>
<positionref ref="ZArrowPos"/>
</physvol>
</volume>
</structure>
<setup version="1.0" name="Default">
<world ref="TOP"/>
</setup>
</gdml>
+108
View File
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
xsi:noNamespaceSchemaLocation="/afs/cern.ch/user/z/ztorzsok/scratch0/GDML2/GDMLSchema/gdml.xsd">
<define>
<constant name="XSize" value="100"/>
<constant name="YSize" value="200"/>
<constant name="ZSize" value="300"/>
</define>
<materials>
<material Z="1.0" name="AIR">
<D value="1e-25"/>
<atom value="1.00794"/>
</material>
<material name="ALU" Z="13.0">
<D value="2.70"/>
<atom value="26.98"/>
</material>
</materials>
<solids>
<box name="WorldBox" y="1000" x="1000" z="1000"/>
<xtru name="Extruded">
<twoDimVertex x="0" y="0"/>
<twoDimVertex x="XSize" y="0"/>
<twoDimVertex x="0" y="YSize"/>
<section zOrder="0" zPosition="0" xOffset="0" yOffset="0" scalingFactor="1.0"/>
<section zOrder="1" zPosition="ZSize" xOffset="0" yOffset="0" scalingFactor="0.5"/>
</xtru>
<reflectedSolid name="Reflected0" solid="Extruded" sx="+1" sy="+1" sz="+1"/>
<reflectedSolid name="Reflected1" solid="Extruded" sx="-1" sy="+1" sz="+1"/>
<reflectedSolid name="Reflected2" solid="Extruded" sx="+1" sy="-1" sz="+1"/>
<reflectedSolid name="Reflected3" solid="Extruded" sx="+1" sy="+1" sz="-1"/>
<reflectedSolid name="Reflected4" solid="Extruded" sx="-1" sy="-1" sz="+1"/>
<reflectedSolid name="Reflected5" solid="Extruded" sx="+1" sy="-1" sz="-1"/>
<reflectedSolid name="Reflected6" solid="Extruded" sx="-1" sy="+1" sz="-1"/>
<reflectedSolid name="Reflected7" solid="Extruded" sx="-1" sy="-1" sz="-1"/>
</solids>
<structure>
<volume name="vReflected0">
<materialref ref="ALU"/>
<solidref ref="Reflected0"/>
</volume>
<volume name="vReflected1">
<materialref ref="ALU"/>
<solidref ref="Reflected1"/>
</volume>
<volume name="vReflected2">
<materialref ref="ALU"/>
<solidref ref="Reflected2"/>
</volume>
<volume name="vReflected3">
<materialref ref="ALU"/>
<solidref ref="Reflected3"/>
</volume>
<volume name="vReflected4">
<materialref ref="ALU"/>
<solidref ref="Reflected4"/>
</volume>
<volume name="vReflected5">
<materialref ref="ALU"/>
<solidref ref="Reflected5"/>
</volume>
<volume name="vReflected6">
<materialref ref="ALU"/>
<solidref ref="Reflected6"/>
</volume>
<volume name="vReflected7">
<materialref ref="ALU"/>
<solidref ref="Reflected7"/>
</volume>
<volume name="TOP">
<materialref ref="AIR"/>
<solidref ref="WorldBox"/>
<physvol>
<volumeref ref="vReflected0"/>
</physvol>
<physvol>
<volumeref ref="vReflected1"/>
</physvol>
<physvol>
<volumeref ref="vReflected2"/>
</physvol>
<physvol>
<volumeref ref="vReflected3"/>
</physvol>
<physvol>
<volumeref ref="vReflected4"/>
</physvol>
<physvol>
<volumeref ref="vReflected5"/>
</physvol>
<physvol>
<volumeref ref="vReflected6"/>
</physvol>
<physvol>
<volumeref ref="vReflected7"/>
</physvol>
</volume>
</structure>
<setup version="1.0" name="Default">
<world ref="TOP"/>
</setup>
</gdml>
@@ -1,121 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -*- C++ -*-
// $Id: g4_gdml_read_write.cc,v 1.6 2006/06/29 17:21:23 gunter Exp $
//
// Author: Radovan Chytracek 2000 - 2004
// Witek Pokorski
//
#include <stdexcept>
#include "globals.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIsession.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "G4TransportationManager.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#include "g4rwDetectorConstruction.hh"
#include "g4rwPhysicsList.hh"
#include "g4rwPrimaryGeneratorAction.hh"
//g4 writer
#include "G4Writer/G4GDMLWriter.h"
int main()
{
// Construct the default run manager
G4RunManager* runManager = new G4RunManager;
//
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
// set mandatory initialization classes
runManager->SetUserInitialization(new gogdmlDetectorConstruction);
runManager->SetUserInitialization(new gogdmlPhysicsList);
// set mandatory user action class
runManager->SetUserAction(new gogdmlPrimaryGeneratorAction);
// initialize G4 kernel
runManager->Initialize();
// scanning geometry tree
G4VPhysicalVolume* g4wv =
G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume();
G4GDMLWriter g4writer("GDMLschema/gdml.xsd", "g4writertest.gdml");
try
{
g4writer.DumpGeometryInfo(g4wv);
}
catch(std::logic_error &lerr)
{
std::cout << "Caught an exception: "
<< lerr.what () << std::endl;
}
// get the pointer to the UI manager and set verbosities
G4UImanager* UI = G4UImanager::GetUIpointer();
// G4UIterminal is a (dumb) terminal.
G4UIsession * session = new G4UIterminal(new G4UItcsh);
UI->ApplyCommand("/control/execute vis.mac");
UI->ApplyCommand("/run/verbose 0");
UI->ApplyCommand("/event/verbose 0");
UI->ApplyCommand("/tracking/verbose 1");
// start a run
int numberOfEvent = 10;
runManager->BeamOn(numberOfEvent);
session->SessionStart();
// job termination
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
}
@@ -23,32 +23,31 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// -*- C++ -*-
// $Id: g4rwDetectorConstruction.hh,v 1.3 2006/06/29 17:21:41 gunter Exp $
#ifndef g4rwDetectorConstruction_H
#define g4rwDetectorConstruction_H 1
//
// $Id: DetectorConstruction.hh,v 1.2 2007/11/20 09:42:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
class G4VPhysicalVolume;
#ifndef _DETECTORCONSTRUCTION_H_
#define _DETECTORCONSTRUCTION_H_
#include "G4VUserDetectorConstruction.hh"
#include "Saxana/SAXProcessor.h"
#include "Saxana/ProcessingConfigurator.h"
class DetectorConstruction : public G4VUserDetectorConstruction {
private:
G4VPhysicalVolume *World;
public:
DetectorConstruction(G4VPhysicalVolume *setWorld = 0) {
World = setWorld;
}
class gogdmlDetectorConstruction : public G4VUserDetectorConstruction
{
public:
gogdmlDetectorConstruction();
~gogdmlDetectorConstruction();
public:
G4VPhysicalVolume* Construct();
private:
SAXProcessor sxp;
ProcessingConfigurator config;
G4VPhysicalVolume* fWorld;
G4VPhysicalVolume *Construct() {
return World;
}
};
#endif
@@ -23,27 +23,27 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// -*- C++ -*-
// $Id: g4rwPhysicsList.hh,v 1.3 2006/06/29 17:21:43 gunter Exp $
//
// $Id: PhysicsList.hh,v 1.2 2007/11/20 09:42:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
#ifndef gogdmlPhysicsList_h
#define gogdmlPhysicsList_h 1
#ifndef _PHYSICSLIST_H_
#define _PHYSICSLIST_H_
#include "G4VUserPhysicsList.hh"
#include "G4ParticleTypes.hh"
#include "globals.hh"
class gogdmlPhysicsList: public G4VUserPhysicsList
{
public:
gogdmlPhysicsList();
~gogdmlPhysicsList();
protected:
// Construct particle and physics process
void ConstructParticle();
void ConstructProcess();
void SetCuts();
class PhysicsList: public G4VUserPhysicsList {
public:
PhysicsList();
~PhysicsList();
protected:
void ConstructParticle();
void ConstructProcess();
void SetCuts();
};
#endif
@@ -24,33 +24,32 @@
// ********************************************************************
//
//
// $Id: g4rwPrimaryGeneratorAction.hh,v 1.2 2006/06/29 17:21:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: PrimaryGeneratorAction.hh,v 1.2 2007/11/20 09:42:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
#ifndef gogdmlPrimaryGeneratorAction_h
#define gogdmlPrimaryGeneratorAction_h 1
#ifndef _PRIMARYGENERATORACTION_H_
#define _PRIMARYGENERATORACTION_H_
#include "G4VUserPrimaryGeneratorAction.hh"
class G4ParticleGun;
class G4Event;
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "globals.hh"
class gogdmlPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
gogdmlPrimaryGeneratorAction();
~gogdmlPrimaryGeneratorAction();
//class G4ParticleGun;
//class G4Event;
public:
void GeneratePrimaries(G4Event* anEvent);
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
public:
PrimaryGeneratorAction();
~PrimaryGeneratorAction();
private:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* particleGun;
};
@@ -24,54 +24,66 @@
// ********************************************************************
//
//
// $Id: g4rwDetectorConstruction.cc,v 1.3 2006/06/29 17:21:47 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: load_gdml.cc,v 1.6 2007/12/11 13:13:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
//
// --------------------------------------------------------------
// Comments
// GEANT 4 - load_gdml
//
// --------------------------------------------------------------
#include "globals.hh"
#include "G4VisAttributes.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIsession.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "G4TransportationManager.hh"
#include "G4VisExecutive.hh"
#include "g4rwDetectorConstruction.hh"
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "G4Processor/GDMLProcessor.h"
#include "G4GDMLParser.hh"
// Added here just to help resolve properly dependencies
#include "G4BooleanSolid.hh"
#include "G4CSGSolid.hh"
int main(int argc, char **argv) {
gogdmlDetectorConstruction::gogdmlDetectorConstruction()
{
sxp.Initialize();
config.SetURI( "test.gdml" );
config.SetSetupName( "Default" );
sxp.Configure( &config );
if (argc<2) {
G4cout << "Usage: load_gdml <filename>" << G4endl;
return 0;
}
G4GDMLParser parser;
parser.Read(argv[1]);
G4RunManager* runManager = new G4RunManager;
G4VisManager* visManager = new G4VisExecutive;
runManager->SetUserInitialization(new DetectorConstruction(parser.GetWorldVolume()));
runManager->SetUserInitialization(new PhysicsList);
runManager->SetUserAction(new PrimaryGeneratorAction);
runManager->Initialize();
visManager->Initialize();
G4UImanager* UI = G4UImanager::GetUIpointer();
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
UI->ApplyCommand("/control/execute vis.mac");
session->SessionStart();
delete visManager;
delete runManager;
return 0;
}
gogdmlDetectorConstruction::~gogdmlDetectorConstruction()
{
sxp.Finalize();
}
G4VPhysicalVolume* gogdmlDetectorConstruction::Construct()
{
sxp.Run();
fWorld = (G4VPhysicalVolume *)GDMLProcessor::GetInstance()->GetWorldVolume();
fWorld->GetLogicalVolume()->SetVisAttributes (G4VisAttributes::Invisible);
if( fWorld == 0 ) {
G4Exception(
"World volume not set properly check your setup selection criteria or GDML input!"
);
}
return fWorld;
}
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
xsi:noNamespaceSchemaLocation="/afs/cern.ch/user/z/ztorzsok/scratch0/GDML2/GDMLSchema/gdml.xsd">
<define>
<variable name="i" value="0"/>
<variable name="j" value="0"/>
<variable name="k" value="0"/>
<constant name="num" value="4"/>
<constant name="scale" value="200"/>
</define>
<materials>
<material Z="1.0" name="AIR">
<D value="1e-25"/>
<atom value="1.00794"/>
</material>
<material name="ALU" Z="13.0">
<D value="2.70"/>
<atom value="26.98"/>
</material>
</materials>
<solids>
<box name="WorldBox" x="2000" y="2000" z="2000"/>
<loop var="i" from="0" to="num" step="1">
<loop var="j" from="0" to="num" step="1">
<loop var="k" from="0" to="num" step="1">
<box name="Box[i][j][k]" x="64-i*10" y="64-j*10" z="64-k*10"/>
</loop>
</loop>
</loop>
</solids>
<structure>
<loop var="i" from="0" to="num" step="1">
<loop var="j" from="0" to="num" step="1">
<loop var="k" from="0" to="num" step="1">
<volume name="vBox[i][j][k]">
<materialref ref="ALU"/>
<solidref ref="Box[i][j][k]"/>
</volume>
</loop>
</loop>
</loop>
<volume name="TOP">
<materialref ref="AIR"/>
<solidref ref="WorldBox"/>
<loop var="i" from="0" to="num" step="1">
<loop var="j" from="0" to="num" step="1">
<loop var="k" from="0" to="num" step="1">
<physvol>
<volumeref ref="vBox[i][j][k]"/>
<position x="scale*(i-num/2)" y="scale*(j-num/2)" z="scale*(k-num/2)"/>
</physvol>
</loop>
</loop>
</loop>
<physvol>
<file name="axes.gdml" volname="TOP"/>
</physvol>
</volume>
</structure>
<setup version="1.0" name="Default">
<world ref="TOP"/>
</setup>
</gdml>
+43
View File
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
xsi:noNamespaceSchemaLocation="/afs/cern.ch/user/z/ztorzsok/scratch0/GDML2/GDMLSchema/gdml.xsd">
<define>
<position name="pos" x="200" y="200" z="200"/>
</define>
<materials>
<material Z="1.0" name="AIR">
<D value="1e-25"/>
<atom value="1.00794"/>
</material>
<material name="ALU" Z="13.0">
<D value="2.70"/>
<atom value="26.98"/>
</material>
</materials>
<solids>
<box name="WorldBox" x="1000" y="1000" z="1000"/>
</solids>
<structure>
<volume name="MAIN">
<materialref ref="AIR"/>
<solidref ref="WorldBox"/>
<physvol>
<file name="diamond.gdml" volname="TOP"/>
<positionref ref="pos"/>
</physvol>
<physvol>
<file name="axes.gdml" volname="TOP"/>
</physvol>
</volume>
</structure>
<setup version="1.0" name="Default">
<world ref="MAIN"/>
</setup>
</gdml>
+106
View File
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
xsi:noNamespaceSchemaLocation="/afs/cern.ch/user/z/ztorzsok/scratch0/GDML2/GDMLSchema/gdml.xsd">
<define>
<position name="DiamondPos" x="100" y="0"/>
<rotation name="DiamondRot" z="30" unit="deg"/>
<scale name="DiamondScl" x="-1" y="+1" z="+1"/>
</define>
<materials>
<material Z="1.0" name="AIR">
<D value="1e-25"/>
<atom value="1.00794"/>
</material>
<material name="ALU" Z="13.0">
<D value="2.70"/>
<atom value="26.98"/>
</material>
</materials>
<solids>
<box y="200" x="200" lunit="cm" z="200" name="WorldBox"/>
<xtru name="Extruded">
<twoDimVertex x="0" y="0"/>
<twoDimVertex x="100" y="0"/>
<twoDimVertex x="0" y="200"/>
<section zOrder="0" zPosition="000" xOffset="0" yOffset="0" scalingFactor="1.0"/>
<section zOrder="1" zPosition="200" xOffset="0" yOffset="0" scalingFactor="0.5"/>
</xtru>
</solids>
<structure>
<volume name="VExtruded">
<materialref ref="ALU"/>
<solidref ref="Extruded"/>
</volume>
<volume name="VDiamond">
<materialref ref="ALU"/>
<solidref ref="Extruded"/>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScalePPP" x="+1" y="+1" z="+1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScaleNPP" x="-1" y="+1" z="+1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScalePNP" x="+1" y="-1" z="+1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScalePPN" x="+1" y="+1" z="-1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScaleNNP" x="-1" y="-1" z="+1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScalePNN" x="+1" y="-1" z="-1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScaleNPN" x="-1" y="+1" z="-1"/>
</physvol>
<physvol>
<volumeref ref="VExtruded"/>
<scale name="ScaleNNN" x="-1" y="-1" z="-1"/>
</physvol>
</volume>
<volume name="VMother">
<materialref ref="ALU"/>
<solidref ref="WorldBox"/>
<physvol>
<volumeref ref="VDiamond"/>
<positionref ref="DiamondPos"/>
<rotationref ref="DiamondRot"/>
<scaleref ref="DiamondScl"/>
</physvol>
</volume>
<volume name="TOP">
<materialref ref="AIR"/>
<solidref ref="WorldBox"/>
<physvol>
<file name="axes.gdml" volname="TOP"/>
</physvol>
<physvol>
<volumeref ref="VMother"/>
<scaleref ref="DiamondScl"/>
</physvol>
</volume>
</structure>
<setup version="1.0" name="Default">
<world ref="TOP"/>
</setup>
</gdml>
+57
View File
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * 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.2 2007/11/20 09:42:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
#include "PhysicsList.hh"
PhysicsList::PhysicsList() {
}
PhysicsList::~PhysicsList() {
}
void PhysicsList::ConstructParticle() {
G4Geantino::GeantinoDefinition();
}
void PhysicsList::ConstructProcess() {
AddTransportation();
}
void PhysicsList::SetCuts() {
G4int temp = GetVerboseLevel();
SetVerboseLevel(0);
SetCutsWithDefault();
SetVerboseLevel(temp);
}
@@ -24,49 +24,46 @@
// ********************************************************************
//
//
// $Id: g4rwPrimaryGeneratorAction.cc,v 1.4 2006/06/29 17:21:52 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: PrimaryGeneratorAction.cc,v 1.4 2007/12/05 08:41:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
#include "g4rwPrimaryGeneratorAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4UImanager.hh"
#include "globals.hh"
PrimaryGeneratorAction::PrimaryGeneratorAction() {
gogdmlPrimaryGeneratorAction::gogdmlPrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/gun/particle geantino");
UI->ApplyCommand("/gun/position 0.0 0.0 0.0 cm");
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="geantino"));
particleGun->SetParticleEnergy(1.0*GeV);
particleGun->SetParticlePosition(G4ThreeVector(-2.0*m, 0.1, 0.1));
}
gogdmlPrimaryGeneratorAction::~gogdmlPrimaryGeneratorAction()
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete particleGun;
}
void gogdmlPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4UImanager* UI = G4UImanager::GetUIpointer();
G4int i = anEvent->GetEventID() % 3;
G4ThreeVector v(1.0,0.0,0.0);
switch(i)
{
case 0:
UI->ApplyCommand("/gun/direction 0.2 0.0 1.0");
break;
case 1:
UI->ApplyCommand("/gun/direction 0.0 0.3 1.0");
v.setY(0.1);
break;
case 2:
UI->ApplyCommand("/gun/direction 0.1 0.0 1.0");
v.setZ(0.1);
break;
}
particleGun->SetParticleMomentumDirection(v);
particleGun->GeneratePrimaryVertex(anEvent);
}
@@ -1,74 +0,0 @@
//
// ********************************************************************
// * 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: g4rwPhysicsList.cc,v 1.2 2006/06/29 17:21:49 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
//
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
#include "g4rwPhysicsList.hh"
#include "G4ParticleTypes.hh"
gogdmlPhysicsList::gogdmlPhysicsList()
{;}
gogdmlPhysicsList::~gogdmlPhysicsList()
{;}
void gogdmlPhysicsList::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.
G4Geantino::GeantinoDefinition();
}
void gogdmlPhysicsList::ConstructProcess()
{
// Define transportation process
AddTransportation();
}
void gogdmlPhysicsList::SetCuts()
{
// uppress error messages even in case e/gamma/proton do not exist
G4int temp = GetVerboseLevel(); SetVerboseLevel(0);
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
// Retrieve verbose level
SetVerboseLevel(temp);
}
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -12,5 +12,5 @@
/vis/viewer/zoom 1.4
/vis/viewer/flush
# (if you prefer refreshing each event, comment out next line)
/vis/scene/endOfEventAction accumulate
# (if you prefer not refreshing each event, uncomment next line)
# /vis/scene/endOfEventAction accumulate