Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# $Id: GNUmakefile,v 1.1.1.1 2002/05/31 00:34:42 radoone Exp $
|
||||
# --------------------------------------------------------------
|
||||
# Makes libraries and applications:
|
||||
# libgdml sample N03gdml
|
||||
# GNUmakefile for gdml libraries and examples. Radovan Chytracek 30/05/2002.
|
||||
|
||||
SUBDIRS = libgdml sample N03gdml
|
||||
|
||||
all:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE)); done
|
||||
|
||||
clean:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) clean); done
|
||||
|
||||
clean_libs:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) clean_libs); done
|
||||
@@ -0,0 +1,24 @@
|
||||
$Id: History,v 1.1 2002/06/03 10:32:56 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Category History file
|
||||
---------------------
|
||||
This file should be used by G4 developers and category coordinators
|
||||
to briefly summarize all major modifications introduced in the code
|
||||
and keep track of all category-tags.
|
||||
It DOES NOT substitute the CVS log-message one should put at every
|
||||
committal in the CVS repository !
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
June 3rd, 2002 R.Chytracek - exgdml-V04-00-00
|
||||
- First implementation of GDML example for detector description persistency.
|
||||
|
||||
June 3rd, 2002 G.Cosmo
|
||||
- Created.
|
||||
@@ -0,0 +1,41 @@
|
||||
# $Id: INSTALL,v 1.3 2002/06/10 11:57:38 radoone Exp $
|
||||
GDML Processor for Geant4 setup and build instructions
|
||||
======================================================
|
||||
|
||||
Xerces-C XML Parser
|
||||
-------------------
|
||||
|
||||
Set the environment variable XERCESCROOT:
|
||||
|
||||
For example AFS users can do:
|
||||
|
||||
export XERCESCROOT=/afs/cern.ch/sw/geant4/dev/XercesC/$G4SYSTEM
|
||||
|
||||
Build GDML Processor
|
||||
--------------------
|
||||
|
||||
cd $G4INSTALL/examples/extended/gdml
|
||||
gmake
|
||||
|
||||
Run sample applications
|
||||
-----------------------
|
||||
|
||||
Set LD_LIBRARY_PATH to the location of the G4 shared libraries + Xerces-C libraries:
|
||||
|
||||
export LD_LIBRARY_PATH=\
|
||||
$G4WORKDIR/lib/$G4SYSTEM:\
|
||||
$G4WORKDIR/tmp/$G4SYSTEM:\
|
||||
/afs/cern.ch/sw/geant4/dev/Mesa/$G4SYSTEM/lib:\
|
||||
$XERCESCROOT/lib:.
|
||||
|
||||
1. sample
|
||||
|
||||
cd $G4INSTALL/examples/extended/gdml/sample
|
||||
$G4WORKDIR/bin/$G4SYSTEM/gogdml
|
||||
|
||||
2. N03gdml
|
||||
|
||||
cd $G4INSTALL/examples/extended/gdml/N03gdml
|
||||
$G4WORKDIR/bin/$G4SYSTEM/N03gdml
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# $Id: GNUmakefile,v 1.3 2002/06/11 15:48:31 radoone Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := NO3gogdml
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
GDMLINSTALL := $(G4INSTALL)/examples/extended/gdml
|
||||
GDMLLIBROOT := $(GDMLINSTALL)/libgdml
|
||||
|
||||
CPPFLAGS += \
|
||||
-I$(GDMLINSTALL)/libgdml/saxana/include \
|
||||
-I$(GDMLINSTALL)/libgdml/schema/include \
|
||||
-I$(GDMLINSTALL)/libgdml/management/include \
|
||||
-I$(GDMLINSTALL)/libgdml/processes/include \
|
||||
-I$(GDMLINSTALL)/libgdml/subscribers/include \
|
||||
-I$(XERCESCROOT)/include
|
||||
|
||||
EXTRALIBS += \
|
||||
-lGDMLsaxana \
|
||||
-lGDMLmanagement \
|
||||
-lGDMLschema \
|
||||
-lGDMLprocesses \
|
||||
-lGDMLsubscribers \
|
||||
-L $(XERCESCROOT)/lib -lxerces-c
|
||||
|
||||
EXTRALIBSSOURCEDIRS += \
|
||||
$(GDMLLIBROOT)/saxana \
|
||||
$(GDMLLIBROOT)/schema \
|
||||
$(GDMLLIBROOT)/processes \
|
||||
$(GDMLLIBROOT)/management \
|
||||
$(GDMLLIBROOT)/subscribers
|
||||
|
||||
# EXTRA_LINK_DEPENDENCIES := \
|
||||
# $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libNO3gogdml.a \
|
||||
# $(G4WORKDIR)/lib/$(G4SYSTEM)/libGDMLmanagement.a \
|
||||
# $(G4WORKDIR)/lib/$(G4SYSTEM)/libGDMLprocesses.a \
|
||||
# $(G4WORKDIR)/lib/$(G4SYSTEM)/libGDMLsaxana.a \
|
||||
# $(G4WORKDIR)/lib/$(G4SYSTEM)/libGDMLschema.a \
|
||||
# $(G4WORKDIR)/lib/$(G4SYSTEM)/libGDMLsubscribers.a
|
||||
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
visclean:
|
||||
rm -f g4*.prim g4*.eps g4*.wrl
|
||||
rm -f .DAWN_*
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gdml xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../schema/gdml_1.0.xsd">
|
||||
<define>
|
||||
<constant name="NbOfLayers" value="10"/>
|
||||
<quantity name="AbsorberThickness" type="length" value="2.0" unit="cm"/>
|
||||
<quantity name="GapThickness" type="length" value="5.0" unit="cm"/>
|
||||
<quantity name="CalorSizeYZ" type="length" value="1.5" unit="m"/>
|
||||
<expression name="LayerThickness">AbsorberThickness+GapThickness</expression>
|
||||
<expression name="CalorThickness">NbOfLayers*LayerThickness</expression>
|
||||
<expression name="WorldSizeX">1.2*CalorThickness</expression>
|
||||
<expression name="WorldSizeYZ">1.2*CalorSizeYZ</expression>
|
||||
<!-- Positions & Rotations -->
|
||||
<position name="GapPosition" x="AbsorberThickness/2."/>
|
||||
<position name="AbsorberPosition" x="-1*GapThickness/2."/>
|
||||
<position name="center" />
|
||||
<position name="shiftx" x="1.*LayerThickness" />
|
||||
<position name="shift2x" x="2.*LayerThickness" />
|
||||
<position name="shift-1x" x="-1.*LayerThickness" />
|
||||
<position name="shift-2x" x="-2.*LayerThickness" />
|
||||
<rotation name="identity" />
|
||||
</define>
|
||||
<materials>
|
||||
<define>
|
||||
<quantity type="density" name="universe_mean_density" value="1.e-25" unit="g/cm3"/>
|
||||
</define>
|
||||
<!-- Element from isotopes -->
|
||||
<isotope name="U235" Z="92" N="235"> <atom type="A" value="235.01"/> </isotope>
|
||||
<isotope name="U238" Z="92" N="238"> <atom type="A" value="238.03"/> </isotope>
|
||||
<element name="enriched_Uranium" formula="U">
|
||||
<fraction ref="U235" n="0.9"/>
|
||||
<fraction ref="U238" n="0.1"/>
|
||||
</element>
|
||||
<!-- Elements -->
|
||||
<element name="Hydrogen" formula="H" Z="1."> <atom value="1.01"/> </element>
|
||||
<element name="Carbon" formula="C" Z="6."> <atom value="12.01"/> </element>
|
||||
<element name="Nitrogen" formula="N" Z="7."> <atom value="14.01"/> </element>
|
||||
<element name="Oxygen" formula="O" Z="8."> <atom value="16.0"/> </element>
|
||||
<element name="Silicon" formula="Si" Z="14."> <atom value="28.09"/> </element>
|
||||
<!-- Simple materials -->
|
||||
<material name="Aluminium" formula="Al" Z="13.0">
|
||||
<D value="2.70"/> <atom value="26.98"/>
|
||||
</material>
|
||||
<material name="liquidArgon" formula="Ar" Z="18.0">
|
||||
<D value="1.390"/> <atom value="39.95"/>
|
||||
</material>
|
||||
<material name="Lead" formula="Pb" Z="82.">
|
||||
<D value="11.35"/> <atom value="207.19"/>
|
||||
</material>
|
||||
<!-- Material from elements or chemical formula -->
|
||||
<material name="Water" formula="H20">
|
||||
<D value="1.0"/> <composite n="2" ref="Hydrogen"/> <composite n="1" ref="Oxygen"/>
|
||||
</material>
|
||||
<material name="Scintillator">
|
||||
<D value="1.032"/> <composite n="9" ref="Carbon"/> <composite n="10" ref="Hydrogen"/>
|
||||
</material>
|
||||
<material name="SiO2">
|
||||
<D value="2.200"/> <composite n="1" ref="Silicon"/> <composite n="2" ref="Oxygen"/>
|
||||
</material>
|
||||
<!-- Material from elements by fractional mass -->
|
||||
<material name="Air">
|
||||
<D value="1.290" unit="mg/cm3"/>
|
||||
<fraction n="0.7" ref="Nitrogen"/>
|
||||
<fraction n="0.3" ref="Oxygen"/>
|
||||
</material>
|
||||
<!-- Material from elements and/or mixtures by fractional mass -->
|
||||
<material name="Aerogel">
|
||||
<D value="0.200"/>
|
||||
<fraction n="0.625" ref="SiO2"/>
|
||||
<fraction n="0.374" ref="Water"/>
|
||||
<fraction n="0.001" ref="Carbon"/>
|
||||
</material>
|
||||
<!-- Example of gas in nonSTP conditions -->
|
||||
<material name="CarbonicGas" state="gas">
|
||||
<T value="325.0"/> <P value="50." unit="atmosphere"/> <D value="27.0" unit="mg/cm3"/>
|
||||
<composite n="1" ref="Carbon"/> <composite n="2" ref="Oxygen"/>
|
||||
</material>
|
||||
<material name="WaterSteam" state="gas">
|
||||
<T value="500.0"/> <P value="2." unit="atmosphere"/> <D value="0.3" unit="mg/cm3"/>
|
||||
<fraction n="1." ref="Water"/>
|
||||
</material>
|
||||
<!-- Vacuum -->
|
||||
<material name="Galactic" Z="1.">
|
||||
<T value="2.73"/> <P value="3.0e-18" unit="pascal"/> <Dref ref="universe_mean_density"/>
|
||||
<atom value="1.01"/>
|
||||
</material>
|
||||
<material name="Beam" state="gas">
|
||||
<!-- <temperature value="STP_Temperature"/> -->
|
||||
<P value="2.e-2" unit="bar"/> <D value="1.0e-5"/>
|
||||
<fraction n="1." ref="Air"/>
|
||||
</material>
|
||||
</materials>
|
||||
<solids>
|
||||
<box name="solidWorld" x="WorldSizeX" y="WorldSizeYZ" z="WorldSizeYZ"/>
|
||||
<box name="solidCalor" x="CalorThickness" y="CalorSizeYZ" z="CalorSizeYZ"/>
|
||||
<box name="solidLayer" x="LayerThickness" y="CalorSizeYZ" z="CalorSizeYZ"/>
|
||||
<box name="solidAbsorber" x="AbsorberThickness" y="CalorSizeYZ" z="CalorSizeYZ"/>
|
||||
<box name="solidGap" x="GapThickness" y="CalorSizeYZ" z="CalorSizeYZ"/>
|
||||
</solids>
|
||||
<structure>
|
||||
<volume name="Gap">
|
||||
<materialref ref="liquidArgon"/> <solidref ref="solidGap"/>
|
||||
</volume>
|
||||
<volume name="Absorber">
|
||||
<materialref ref="Lead"/> <solidref ref="solidAbsorber"/>
|
||||
</volume>
|
||||
<volume name="Layer">
|
||||
<materialref ref="Galactic"/> <solidref ref="solidLayer"/>
|
||||
<child>
|
||||
<volumeref ref="Absorber"/> <positionref ref="AbsorberPosition"/> <rotationref ref="identity"/>
|
||||
</child>
|
||||
<child>
|
||||
<volumeref ref="Gap"/> <positionref ref="GapPosition"/> <rotationref ref="identity"/>
|
||||
</child>
|
||||
</volume>
|
||||
<volume name="Calorimeter">
|
||||
<materialref ref="Galactic"/> <solidref ref="solidCalor"/>
|
||||
<child> <volumeref ref="Layer"/> <positionref ref="shift-1x"/> <rotationref ref="identity"/> </child>
|
||||
<child> <volumeref ref="Layer"/> <positionref ref="shift-2x"/> <rotationref ref="identity"/> </child>
|
||||
<child> <volumeref ref="Layer"/> <positionref ref="center"/> <rotationref ref="identity"/> </child>
|
||||
<child> <volumeref ref="Layer"/> <positionref ref="shiftx"/> <rotationref ref="identity"/> </child>
|
||||
<child> <volumeref ref="Layer"/> <positionref ref="shift2x"/> <rotationref ref="identity"/> </child>
|
||||
</volume>
|
||||
<volume name="World">
|
||||
<materialref ref="Galactic"/> <solidref ref="solidWorld"/>
|
||||
<child> <volumeref ref="Calorimeter"/> <positionref ref="center"/> <rotationref ref="identity"/> </child>
|
||||
</volume>
|
||||
</structure>
|
||||
<setup name="N03" version="1.0"> <world ref="World"/> </setup>
|
||||
<setup name="Test1" version="1.0"> <world ref="World"/> </setup>
|
||||
</gdml>
|
||||
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: NO3gogdml.cc,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - exampleN03
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#ifdef G4UI_USE_XM
|
||||
#include "G4UIXm.hh"
|
||||
#endif
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "ExN03VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03PhysicsList.hh"
|
||||
#include "ExN03PrimaryGeneratorAction.hh"
|
||||
#include "ExN03RunAction.hh"
|
||||
#include "ExN03EventAction.hh"
|
||||
#include "ExN03SteppingAction.hh"
|
||||
#include "ExN03SteppingVerbose.hh"
|
||||
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
// choose the Random engine
|
||||
HepRandom::setTheEngine(new RanecuEngine);
|
||||
|
||||
//my Verbose output class
|
||||
G4VSteppingVerbose::SetInstance(new ExN03SteppingVerbose);
|
||||
|
||||
// Construct the default run manager
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// set mandatory initialization classes
|
||||
ExN03DetectorConstruction* detector = new ExN03DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new ExN03PhysicsList);
|
||||
|
||||
G4UIsession* session=0;
|
||||
|
||||
if (argc==1) // Define UI session for interactive mode.
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
#ifdef G4UI_USE_XM
|
||||
session = new G4UIXm(argc,argv);
|
||||
#else
|
||||
#ifdef G4UI_USE_TCSH
|
||||
session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
session = new G4UIterminal();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// visualization manager
|
||||
G4VisManager* visManager = new ExN03VisManager;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
// set user action classes
|
||||
runManager->SetUserAction(new ExN03PrimaryGeneratorAction(detector));
|
||||
runManager->SetUserAction(new ExN03RunAction);
|
||||
runManager->SetUserAction(new ExN03EventAction);
|
||||
runManager->SetUserAction(new ExN03SteppingAction);
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
|
||||
// get the pointer to the User Interface manager
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (session) // Define UI session for interactive mode.
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
UI->ApplyCommand("/control/execute vis.mac");
|
||||
#ifdef G4UI_USE_XM
|
||||
// Customize the G4UIXm menubar with a macro file :
|
||||
UI->ApplyCommand("/control/execute visTutor/gui.mac");
|
||||
#endif
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
$Id: README,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleN03
|
||||
----------
|
||||
|
||||
This example simulates a simple Sampling Calorimeter setup.
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
The calorimeter is a box made of a given number of layers. A layer
|
||||
consists of an absorber plate and of a detection gap. The layer is
|
||||
replicated.
|
||||
|
||||
Six parameters define the calorimeter :
|
||||
- the material of the absorber,
|
||||
- the thickness of an absorber plate,
|
||||
- the material of the detection gap,
|
||||
- the thickness of a gap,
|
||||
- the number of layers,
|
||||
- the transverse size of the calorimeter (the input face is a square).
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class,
|
||||
but all of the above parameters can be modified interactively via
|
||||
the commands defined in the DetectorMessenger class.
|
||||
|
||||
NB. The thickness of the absorber or of the gap can be set to zero
|
||||
(but not together), and the number of layers to 1. In this case we
|
||||
have a unique homogeneous block of matter, which looks like
|
||||
a bubble chamber rather than a calorimeter ...
|
||||
(see the macro of commands: newgeom.mac)
|
||||
|
||||
2- AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
The primary kinematic consists of a single particle which hits the
|
||||
calorimeter perpendicular to the input face. The type of the particle
|
||||
and its energy are set in the PrimaryGeneratorAction class, and can
|
||||
be changed via the G4 build-in commands of ParticleGun class (see
|
||||
the macros provided with this example).
|
||||
|
||||
In addition one can choose randomly the impact point of the incident
|
||||
particle. The corresponding interactive command is built in
|
||||
PrimaryGeneratorMessenger class.
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
3- DETECTOR RESPONSE
|
||||
|
||||
A HIT is a record, event per event and volume per volume, of all the
|
||||
informations needed to simulate and analyse the detector response.
|
||||
|
||||
In this example a CalorHit is defined as a set of 4 informations per
|
||||
layer :
|
||||
- the total energy deposit in the absorber plate,
|
||||
- the total tracklength of all charged particles in the absorber plate,
|
||||
- the total energy deposit in the detection gap,
|
||||
- the total tracklength of all charged particles in the detection gap.
|
||||
|
||||
Therefore both the absorber and the detection gap are declared
|
||||
'sensitive detector' (SD), which means they can contribute to the hit.
|
||||
|
||||
At the end of a run, from the CalorHitsCollection, one can study the
|
||||
calorimeter performances such as :
|
||||
- shower profile,
|
||||
- calorimeter resolution,
|
||||
- pi/e ratio ...
|
||||
|
||||
4- VISUALIZATION
|
||||
|
||||
The Visualization Manager is set in the main().
|
||||
The initialisation of the drawing is done via a set of /vis/ commands
|
||||
in the macro vis.mac. This macro is automatically read from
|
||||
the main in case of interactive running mode.
|
||||
|
||||
The detector has a default view which is a longitudinal view of the
|
||||
calorimeter.
|
||||
|
||||
The tracks are drawn at the end of event, and erased at the end of run.
|
||||
Optionaly one can choose to draw all particles, only the charged,
|
||||
or neutral or none. This command is build in EventActionMessenger class.
|
||||
|
||||
NB 1: the visualization (with OpenGL driver) assumes two things:
|
||||
1- the visualisation & interfaces categories have been compiled
|
||||
with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
|
||||
2- exampleN03.cc has been compiled with G4VIS_USE_OPENGLX.
|
||||
|
||||
NB 2: the visualization (with DAWNFILE driver) assumes two things:
|
||||
1- the visualisation & interfaces categories have been compiled
|
||||
with the environment variable G4VIS_BUILD_DAWNFILE_DRIVER.
|
||||
2- exampleN03.cc has been compiled with G4VIS_USE_DAWNFILE.
|
||||
|
||||
NN 3: The macros "visTutor/exN03VisX.mac" are tutorial macros for
|
||||
visualization. They can be tried as:
|
||||
% $G4BINDIR/exampleN03
|
||||
idle > /control/execute visTutor/exN03VisX.mac
|
||||
For details, see comment lines described in the macro files.
|
||||
These macros are designed to help your understanding the
|
||||
User's Guide.
|
||||
|
||||
5- PHYSICS DEMO
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
In addition the build-in interactive command:
|
||||
/process/(in)activate processName
|
||||
allows to activate/inactivate the processes one by one.
|
||||
Then one can well visualize the processes one by one, especially
|
||||
in the bubble chamber setup with a transverse magnetic field.
|
||||
|
||||
As a homework try to visualize a gamma conversion alone,
|
||||
or the effect of the multiple scattering.
|
||||
|
||||
6- USER INTERFACES
|
||||
|
||||
The default command interface, called G4UIterminal, is done via
|
||||
standart cin/G4cout.
|
||||
On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
|
||||
It is enough to set the environment variable G4UI_USE_TCSH
|
||||
|
||||
On can use a Motif driven command interface (called G4UIXm) if:
|
||||
1- interfaces category has been compiled with G4UI_BUILD_XM_SESSION
|
||||
2- exampleN03.cc has been compiled with G4UI_USE_XM.
|
||||
|
||||
|
||||
7- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd N03
|
||||
% gmake
|
||||
|
||||
- execute N03 in 'batch' mode from macro files
|
||||
% exampleN03 run1.mac
|
||||
|
||||
- execute N03 in 'interactive mode' with visualization
|
||||
% exampleN03
|
||||
....
|
||||
Idle> type your commands. For instance:
|
||||
Idle> /control/execute newgeom.mac
|
||||
....
|
||||
Idle> exit
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
# e+ 300MeV
|
||||
/gun/particle e+
|
||||
/gun/energy 300 MeV
|
||||
/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
/process/inactivate msc
|
||||
/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
/calor/setAbsMat Aluminium
|
||||
/calor/setGapMat Aerogel
|
||||
/calor/setAbsThick 2. cm
|
||||
/calor/setGapThick 5. cm
|
||||
/calor/setNbOfLayers 30
|
||||
/calor/setSizeYZ 1.5 m
|
||||
/calor/update
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/run/beamOn 1
|
||||
exit
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
# e+ 300MeV
|
||||
/gun/particle e+
|
||||
/gun/energy 300 MeV
|
||||
/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
/process/inactivate msc
|
||||
/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
/calor/setAbsMat Aluminium
|
||||
/calor/setGapMat Aerogel
|
||||
/calor/setAbsThick 2. cm
|
||||
/calor/setGapThick 5. cm
|
||||
/calor/setNbOfLayers 30
|
||||
/calor/setSizeYZ 1.5 m
|
||||
/calor/update
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/event/printModulo 500
|
||||
/run/beamOn 5000
|
||||
exit
|
||||
@@ -0,0 +1,218 @@
|
||||
**********************************************
|
||||
Geant4 version $Name: geant4-04-01 $
|
||||
(28-Feb-2002)
|
||||
Copyright : Geant4 Collaboration
|
||||
**********************************************
|
||||
Visualization Manager instantiating...
|
||||
Visualization Manager initialising...
|
||||
Registering graphics systems...
|
||||
|
||||
You have successfully chosen to use the following graphics systems.
|
||||
Current available graphics systems are:
|
||||
ASCIITree (ATree)
|
||||
DAWNFILE (DAWNFILE)
|
||||
GAGTree (GAGTree)
|
||||
G4HepRepFile (HepRepFile)
|
||||
RayTracer (RayTracer)
|
||||
VRML1FILE (VRML1FILE)
|
||||
VRML2FILE (VRML2FILE)
|
||||
|
||||
***** Table : Nb of materials = 12 *****
|
||||
|
||||
Material: Aluminium density: 2.700 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 8.893 cm
|
||||
---> Element: Aluminium Z = 13.0 N = 27.0 A = 26.98 g/mole fractionMass: 100.00 % Abundance 100.00 %
|
||||
|
||||
Material: liquidArgon density: 1.390 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 14.065 cm
|
||||
---> Element: liquidArgon Z = 18.0 N = 40.0 A = 39.95 g/mole fractionMass: 100.00 % Abundance 100.00 %
|
||||
|
||||
Material: Lead density: 11.350 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 5.612 mm
|
||||
---> Element: Lead Z = 82.0 N = 207.2 A = 207.19 g/mole fractionMass: 100.00 % Abundance 100.00 %
|
||||
|
||||
Material: Water density: 1.000 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 36.092 cm
|
||||
---> Element: Hydrogen H Z = 1.0 N = 1.0 A = 1.01 g/mole fractionMass: 11.21 % Abundance 66.67 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 88.79 % Abundance 33.33 %
|
||||
|
||||
Material: Scintillator density: 1.032 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 42.549 cm
|
||||
---> Element: Carbon C Z = 6.0 N = 12.0 A = 12.01 g/mole fractionMass: 91.45 % Abundance 47.37 %
|
||||
---> Element: Hydrogen H Z = 1.0 N = 1.0 A = 1.01 g/mole fractionMass: 8.55 % Abundance 52.63 %
|
||||
|
||||
Material: quartz density: 2.200 g/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 12.295 cm
|
||||
---> Element: Silicon Si Z = 14.0 N = 28.1 A = 28.09 g/mole fractionMass: 46.75 % Abundance 33.33 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 53.25 % Abundance 66.67 %
|
||||
|
||||
Material: Air density: 1.290 mg/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 285.161 m
|
||||
---> Element: Nitrogen N Z = 7.0 N = 14.0 A = 14.01 g/mole fractionMass: 70.00 % Abundance 72.71 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 30.00 % Abundance 27.29 %
|
||||
|
||||
Material: Aerogel density: 200.000 mg/cm3 temperature: 273.15 K pressure: 1.00 atm RadLength: 1.493 m
|
||||
---> Element: Silicon Si Z = 14.0 N = 28.1 A = 28.09 g/mole fractionMass: 29.22 % Abundance 11.12 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 66.49 % Abundance 44.42 %
|
||||
---> Element: Hydrogen H Z = 1.0 N = 1.0 A = 1.01 g/mole fractionMass: 4.19 % Abundance 44.37 %
|
||||
---> Element: Carbon C Z = 6.0 N = 12.0 A = 12.01 g/mole fractionMass: 0.10 % Abundance 0.09 %
|
||||
|
||||
Material: CarbonicGas density: 27.000 mg/cm3 temperature: 325.00 K pressure: 50.00 atm RadLength: 13.406 m
|
||||
---> Element: Carbon C Z = 6.0 N = 12.0 A = 12.01 g/mole fractionMass: 27.29 % Abundance 33.33 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 72.71 % Abundance 66.67 %
|
||||
|
||||
Material: WaterSteam density: 0.300 mg/cm3 temperature: 500.00 K pressure: 2.00 atm RadLength: 1.203 km
|
||||
---> Element: Hydrogen H Z = 1.0 N = 1.0 A = 1.01 g/mole fractionMass: 11.21 % Abundance 66.67 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 88.79 % Abundance 33.33 %
|
||||
|
||||
Material: Galactic density: 0.000 mg/cm3 temperature: 2.73 K pressure: 0.00 atm RadLength: 204727576.737 pc
|
||||
---> Element: Galactic Z = 1.0 N = 1.0 A = 1.01 g/mole fractionMass: 100.00 % Abundance 100.00 %
|
||||
|
||||
Material: Beam density: 0.010 mg/cm3 temperature: 273.15 K pressure: 0.02 atm RadLength: 36.786 km
|
||||
---> Element: Nitrogen N Z = 7.0 N = 14.0 A = 14.01 g/mole fractionMass: 70.00 % Abundance 72.71 %
|
||||
---> Element: Oxygen O Z = 8.0 N = 16.0 A = 16.00 g/mole fractionMass: 30.00 % Abundance 27.29 %
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 10 layers of: [ 10mm of Lead + 5mm of liquidArgon ]
|
||||
------------------------------------------------------------
|
||||
ExN03PhysicsList::SetCuts:CutLength : 1 mm
|
||||
|
||||
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
|
||||
e+e- energies according Bethe-Heitler
|
||||
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
|
||||
|
||||
compt: Total cross sections from a parametrisation. Good description from 10 KeV to (100/Z) GeV.
|
||||
Scattered gamma energy according Klein-Nishina.
|
||||
PhysicsTables from 10 keV to 100 GeV in 100 bins.
|
||||
|
||||
phot: Total cross sections from a parametrisation. Good description from 10 KeV to 50 MeV for all Z
|
||||
Sandia crossSection below 50 KeV
|
||||
PhysicsTables from 50 keV to 50 MeV in 100 bins.
|
||||
|
||||
msc: Tables of transport mean free paths.
|
||||
New model of MSC , computes the lateral
|
||||
displacement of the particle , too.
|
||||
PhysicsTables from 100 eV to 100 TeV in 100 bins.
|
||||
|
||||
eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to 100 GeV.
|
||||
delta ray energy sampled from differential Xsection.
|
||||
PhysicsTables from 1 keV to 100 TeV in 100 bins.
|
||||
|
||||
eBrem: Total cross sections from a NEW parametrisation based on the EEDL data library.
|
||||
Good description from 1 KeV to 100 GeV.
|
||||
log scale extrapolation above 100 GeV
|
||||
Gamma energy sampled from a parametrised formula.
|
||||
PhysicsTables from 1 keV to 100 TeV in 100 bins.
|
||||
|
||||
annihil: Total cross section from Heilter formula(annihilation into 2 photons).
|
||||
gamma energies sampled according Heitler
|
||||
PhysicsTables from 10 keV to 10 TeV in 100 bins.
|
||||
|
||||
hIoni: Knock-on electron cross sections .
|
||||
Good description above the mean excitation energy.
|
||||
delta ray energy sampled from differential Xsection.
|
||||
PhysicsTables from 1 keV to 100 TeV in 100 bins.
|
||||
|
||||
msc: Tables of transport mean free paths.
|
||||
New model of MSC , computes the lateral
|
||||
displacement of the particle , too.
|
||||
PhysicsTables from 100 eV to 100 TeV in 100 bins.
|
||||
|
||||
MuIoni: Knock-on electron cross sections .
|
||||
Good description above the mean excitation energy.
|
||||
delta ray energy sampled from differential Xsection.
|
||||
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
|
||||
|
||||
msc: Tables of transport mean free paths.
|
||||
New model of MSC , computes the lateral
|
||||
displacement of the particle , too.
|
||||
PhysicsTables from 100 eV to 100 TeV in 100 bins.
|
||||
|
||||
MuBrems: theoretical cross section
|
||||
Good description up to 1000 PeV.
|
||||
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
|
||||
|
||||
MuPairProd: theoretical cross sections
|
||||
Good description up to 1000 PeV.
|
||||
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
|
||||
============= The cut Energy ==============================
|
||||
gamma e-
|
||||
Cut in range
|
||||
Aluminium 1 mm 1 mm
|
||||
liquidArgon 1 mm 1 mm
|
||||
Lead 1 mm 1 mm
|
||||
Water 1 mm 1 mm
|
||||
Scintillator 1 mm 1 mm
|
||||
quartz 1 mm 1 mm
|
||||
Air 1 mm 1 mm
|
||||
Aerogel 1 mm 1 mm
|
||||
CarbonicGas 1 mm 1 mm
|
||||
WaterSteam 1 mm 1 mm
|
||||
Galactic 1 mm 1 mm
|
||||
Beam 1 mm 1 mm
|
||||
Cut in energy
|
||||
Aluminium 6.89 keV 597 keV
|
||||
liquidArgon 6.18 keV 343 keV
|
||||
Lead 101 keV 1.38 MeV
|
||||
Water 2.9 keV 347 keV
|
||||
Scintillator 2.37 keV 356 keV
|
||||
quartz 5.52 keV 534 keV
|
||||
Air 990 eV 990 eV
|
||||
Aerogel 1.71 keV 119 keV
|
||||
CarbonicGas 990 eV 36.5 keV
|
||||
WaterSteam 990 eV 990 eV
|
||||
Galactic 990 eV 990 eV
|
||||
Beam 990 eV 990 eV
|
||||
===================================================
|
||||
### Run 0 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 9876, 54321
|
||||
----------------------------------------
|
||||
---> End of event: 0
|
||||
Absorber: total energy: 283.131 MeV total track length: 19.9534 cm
|
||||
Gap: total energy: 12.4027 MeV total track length: 6.03802 cm
|
||||
|
||||
10 hits are stored in ExN03CalorHitsCollection.
|
||||
Transportation, hIoni, msc, eIoni
|
||||
eBrem, annihil, conv, compt
|
||||
phot, MuIoni, MuBrems, MuPairProd
|
||||
Decay
|
||||
### Run 1 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 1291960900, 759167195
|
||||
----------------------------------------
|
||||
---> End of event: 0
|
||||
Absorber: total energy: 281.881 MeV total track length: 19.6742 cm
|
||||
Gap: total energy: 15.4463 MeV total track length: 8.07961 cm
|
||||
|
||||
10 hits are stored in ExN03CalorHitsCollection.
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 10 layers of: [ 10mm of Aluminium + 5mm of liquidArgon ]
|
||||
------------------------------------------------------------
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 10 layers of: [ 10mm of Aluminium + 5mm of Aerogel ]
|
||||
------------------------------------------------------------
|
||||
|
||||
------------------------------------------------------------
|
||||
---> The calorimeter is 30 layers of: [ 20mm of Aluminium + 50mm of Aerogel ]
|
||||
------------------------------------------------------------
|
||||
### Run 2 start.
|
||||
|
||||
---> Begin of event: 0
|
||||
|
||||
--------- Ranecu engine status ---------
|
||||
Initial seed (index) = 0
|
||||
Current couple of seeds = 796806890, 2027378855
|
||||
----------------------------------------
|
||||
---> End of event: 0
|
||||
Absorber: total energy: 374.373 MeV total track length: 90.1156 cm
|
||||
Gap: total energy: 92.9847 MeV total track length: 2.59813 m
|
||||
|
||||
18 hits are stored in ExN03CalorHitsCollection.
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
@@ -0,0 +1,27 @@
|
||||
# e+ 300MeV
|
||||
/gun/particle e+
|
||||
/gun/energy 300 MeV
|
||||
/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
/process/inactivate msc
|
||||
/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
# /calor/setAbsMat Aluminium
|
||||
# /calor/setGapMat Aerogel
|
||||
# /calor/setAbsThick 2. cm
|
||||
# /calor/setGapThick 5. cm
|
||||
# /calor/setNbOfLayers 30
|
||||
# /calor/setSizeYZ 1.5 m
|
||||
# /calor/update
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/run/beamOn 1
|
||||
#exit
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
# e+ 300MeV
|
||||
/gun/particle e+
|
||||
/gun/energy 300 MeV
|
||||
/run/beamOn 1
|
||||
#
|
||||
# list the existing physics processes
|
||||
/process/list
|
||||
#
|
||||
# switch off MultipleScattering
|
||||
/process/inactivate msc
|
||||
/run/beamOn 1
|
||||
#
|
||||
# switch on MultipleScattering
|
||||
/process/activate msc
|
||||
#
|
||||
# change detector parameter
|
||||
# /calor/setAbsMat Aluminium
|
||||
# /calor/setGapMat Aerogel
|
||||
# /calor/setAbsThick 2. cm
|
||||
# /calor/setGapThick 5. cm
|
||||
# /calor/setNbOfLayers 30
|
||||
# /calor/setSizeYZ 1.5 m
|
||||
# /calor/update
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 500 MeV
|
||||
/event/printModulo 500
|
||||
/run/beamOn 5000
|
||||
#exit
|
||||
@@ -0,0 +1,35 @@
|
||||
# $Id: exo1.mac,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
#
|
||||
# Macro file for "exampleN03.cc"
|
||||
#
|
||||
# this macro can be executed
|
||||
# during an interactive session:
|
||||
#
|
||||
# Idle> /control/execute exo1.mac
|
||||
#
|
||||
#
|
||||
/calor/setNbOfLayers 1
|
||||
#
|
||||
/calor/setAbsMat Aluminium
|
||||
/calor/setAbsThick 10 cm
|
||||
#
|
||||
/calor/setGapMat Air
|
||||
/calor/setGapThick 0 cm
|
||||
#
|
||||
/calor/setSizeYZ 10 cm
|
||||
#
|
||||
/calor/update
|
||||
#
|
||||
/vis/viewer/zoom 1.3
|
||||
#
|
||||
/process/list
|
||||
/process/inactivate msc
|
||||
/process/inactivate eBrem
|
||||
/process/inactivate compt
|
||||
/process/inactivate conv
|
||||
#
|
||||
/run/particle/setCut 10 cm
|
||||
/run/initialize
|
||||
#
|
||||
/gun/particle e+
|
||||
/gun/energy 30 MeV
|
||||
@@ -0,0 +1,35 @@
|
||||
# $Id: exo2.mac,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
#
|
||||
# Macro file for "exampleN03.cc"
|
||||
#
|
||||
# this macro can be executed
|
||||
# during an interactive session:
|
||||
#
|
||||
# Idle> /control/execute exo2.mac
|
||||
#
|
||||
#
|
||||
/calor/setNbOfLayers 1
|
||||
#
|
||||
/calor/setAbsMat Aluminium
|
||||
/calor/setAbsThick 10 cm
|
||||
#
|
||||
/calor/setGapMat Air
|
||||
/calor/setGapThick 0 cm
|
||||
#
|
||||
/calor/setSizeYZ 10 cm
|
||||
#
|
||||
/calor/update
|
||||
#
|
||||
/vis/viewer/zoom 1.3
|
||||
#
|
||||
/process/list
|
||||
/process/inactivate msc
|
||||
/process/inactivate eBrem
|
||||
/process/inactivate phot
|
||||
/process/inactivate conv
|
||||
#
|
||||
/run/particle/setCut 10 cm
|
||||
/run/initialize
|
||||
#
|
||||
/gun/particle gamma
|
||||
/gun/energy 10 MeV
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03CalorHit.hh,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03CalorHit_h
|
||||
#define ExN03CalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03CalorHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN03CalorHit();
|
||||
~ExN03CalorHit();
|
||||
ExN03CalorHit(const ExN03CalorHit&);
|
||||
const ExN03CalorHit& operator=(const ExN03CalorHit&);
|
||||
int operator==(const ExN03CalorHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
public:
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
|
||||
|
||||
G4double GetEdepAbs() { return EdepAbs; };
|
||||
G4double GetTrakAbs() { return TrackLengthAbs; };
|
||||
G4double GetEdepGap() { return EdepGap; };
|
||||
G4double GetTrakGap() { return TrackLengthGap; };
|
||||
|
||||
private:
|
||||
|
||||
G4double EdepAbs, TrackLengthAbs;
|
||||
G4double EdepGap, TrackLengthGap;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
typedef G4THitsCollection<ExN03CalorHit> ExN03CalorHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN03CalorHit> ExN03CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void* ExN03CalorHit::operator new(size_t)
|
||||
{
|
||||
void* aHit;
|
||||
aHit = (void*) ExN03CalorHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void ExN03CalorHit::operator delete(void* aHit)
|
||||
{
|
||||
ExN03CalorHitAllocator.FreeSingle((ExN03CalorHit*) aHit);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03CalorimeterSD.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef ExN03CalorimeterSD_h
|
||||
#define ExN03CalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN03DetectorConstruction;
|
||||
class G4HCofThisEvent;
|
||||
class G4Step;
|
||||
#include "ExN03CalorHit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class ExN03CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
ExN03CalorimeterSD(G4String, ExN03DetectorConstruction* );
|
||||
~ExN03CalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
|
||||
ExN03CalorHitsCollection* CalCollection;
|
||||
ExN03DetectorConstruction* Detector;
|
||||
G4int* HitID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorConstruction.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef ExN03DetectorConstruction_H
|
||||
#define ExN03DetectorConstruction_H 1
|
||||
|
||||
#include "G4String.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
#include "SAXProcessor.hh"
|
||||
#include "ProcessingConfigurator.hh"
|
||||
|
||||
class ExN03CalorimeterSD;
|
||||
class ExN03DetectorMessenger;
|
||||
|
||||
class ExN03DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
ExN03DetectorConstruction();
|
||||
~ExN03DetectorConstruction();
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
G4LogicalVolume* FindLogicalVolume( const G4String& );
|
||||
G4double GetWorldSizeX();
|
||||
G4double GetWorldSizeYZ();
|
||||
G4double GetCalorThickness();
|
||||
G4double GetCalorSizeYZ();
|
||||
G4int GetNbOfLayers();
|
||||
const G4VPhysicalVolume* GetphysiWorld();
|
||||
const G4VPhysicalVolume* GetAbsorber();
|
||||
const G4VPhysicalVolume* GetGap();
|
||||
|
||||
|
||||
private:
|
||||
SAXProcessor sxp;
|
||||
ProcessingConfigurator config;
|
||||
G4VPhysicalVolume* fWorld;
|
||||
ExN03CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
|
||||
ExN03DetectorMessenger* detectorMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorMessenger.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03DetectorMessenger_h
|
||||
#define ExN03DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN03DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03DetectorMessenger(ExN03DetectorConstruction* );
|
||||
~ExN03DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03DetectorConstruction* ExN03Detector;
|
||||
|
||||
G4UIdirectory* ExN03detDir;
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
G4UIcmdWithAString* GapMaterCmd;
|
||||
G4UIdirectory* GDMLDir;
|
||||
G4UIcmdWithAString* GDMLFile;
|
||||
G4UIcmdWithAString* GDMLSetup;
|
||||
G4UIcmdWithAString* GDMLVersion;
|
||||
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* GapThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* SizeYZCmd;
|
||||
G4UIcmdWithAnInteger* NbLayersCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventAction.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03EventAction_h
|
||||
#define ExN03EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN03EventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
ExN03EventAction();
|
||||
virtual ~ExN03EventAction();
|
||||
|
||||
public:
|
||||
virtual void BeginOfEventAction(const G4Event*);
|
||||
virtual void EndOfEventAction(const G4Event*);
|
||||
|
||||
void SetDrawFlag (G4String val) {drawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {printModulo = val;};
|
||||
|
||||
private:
|
||||
G4int calorimeterCollID;
|
||||
G4String drawFlag;
|
||||
G4int printModulo;
|
||||
ExN03EventActionMessenger* eventMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventActionMessenger.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03EventActionMessenger_h
|
||||
#define ExN03EventActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN03EventAction;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03EventActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03EventActionMessenger(ExN03EventAction*);
|
||||
~ExN03EventActionMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03EventAction* eventAction;
|
||||
G4UIcmdWithAString* DrawCmd;
|
||||
G4UIcmdWithAnInteger* PrintCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PhysicsList.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PhysicsList_h
|
||||
#define ExN03PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN03PhysicsList();
|
||||
~ExN03PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBaryons();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorAction.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PrimaryGeneratorAction_h
|
||||
#define ExN03PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class ExN03DetectorConstruction;
|
||||
class ExN03PrimaryGeneratorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExN03PrimaryGeneratorAction(ExN03DetectorConstruction*);
|
||||
~ExN03PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event*);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun; //pointer a to G4 class
|
||||
ExN03DetectorConstruction* ExN03Detector; //pointer to the geometry
|
||||
|
||||
ExN03PrimaryGeneratorMessenger* gunMessenger; //messenger of this class
|
||||
G4String rndmFlag; //flag for a rndm impact point
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorMessenger.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03PrimaryGeneratorMessenger_h
|
||||
#define ExN03PrimaryGeneratorMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN03PrimaryGeneratorAction;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN03PrimaryGeneratorMessenger(ExN03PrimaryGeneratorAction*);
|
||||
~ExN03PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN03PrimaryGeneratorAction* ExN03Action;
|
||||
G4UIcmdWithAString* RndmCmd;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03RunAction.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03RunAction_h
|
||||
#define ExN03RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4Run;
|
||||
|
||||
class ExN03RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
ExN03RunAction();
|
||||
~ExN03RunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingAction.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03SteppingAction_h
|
||||
#define ExN03SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
ExN03SteppingAction();
|
||||
~ExN03SteppingAction();
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingVerbose.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingVerbose;
|
||||
|
||||
#ifndef ExN03SteppingVerbose_h
|
||||
#define ExN03SteppingVerbose_h 1
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03SteppingVerbose : public G4SteppingVerbose
|
||||
{
|
||||
public:
|
||||
|
||||
ExN03SteppingVerbose();
|
||||
~ExN03SteppingVerbose();
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03VisManager.hh,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Example Visualization Manager implementing virtual function
|
||||
// RegisterGraphicsSystems. Exploits C-pre-processor variables
|
||||
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
|
||||
// environment variables of the same name are set.
|
||||
|
||||
// So all you have to do is set environment variables and compile and
|
||||
// instantiate this in your main().
|
||||
|
||||
// Alternatively, you can implement an empty function here and just
|
||||
// register the systems you want in your main(), e.g.:
|
||||
// G4VisManager* myVisManager = new MyVisManager;
|
||||
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef ExN03VisManager_h
|
||||
#define ExN03VisManager_h 1
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class ExN03VisManager: public G4VisManager {
|
||||
|
||||
public:
|
||||
|
||||
ExN03VisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
# Example of interactive redefinition
|
||||
# of the geometry
|
||||
#
|
||||
# this macro can be executed at any time
|
||||
# during an interactive session:
|
||||
#
|
||||
# Idle> /control/execute newgeom.mac
|
||||
#
|
||||
#
|
||||
/calor/setNbOfLayers 1
|
||||
#
|
||||
/calor/setAbsMat Water
|
||||
/calor/setAbsThick 40 cm
|
||||
#
|
||||
/calor/setGapMat Air
|
||||
/calor/setGapThick 0 cm
|
||||
#
|
||||
/calor/setSizeYZ 40 cm
|
||||
#
|
||||
/calor/update
|
||||
#
|
||||
/calor/setField 3 tesla
|
||||
#
|
||||
/vis/viewer/zoom 1.3
|
||||
@@ -0,0 +1,20 @@
|
||||
# $Id: run1.mac,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
#
|
||||
# Macro file for "exampleN03.cc"
|
||||
#
|
||||
# can be run in batch, without graphic
|
||||
# or interactively: Idle> /control/execute run1.mac
|
||||
#
|
||||
/control/verbose 2
|
||||
/control/saveHistory
|
||||
#
|
||||
/run/verbose 2
|
||||
/event/verbose 0
|
||||
/tracking/verbose 1
|
||||
#
|
||||
# muon 300 MeV to the direction (1.,0.,0.)
|
||||
# 3 events
|
||||
#
|
||||
/gun/particle mu+
|
||||
/gun/energy 300 MeV
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,28 @@
|
||||
# $Id: run2.mac,v 1.1.1.1 2002/05/31 00:34:43 radoone Exp $
|
||||
#
|
||||
# Macro file of "exampleN03.cc"
|
||||
#
|
||||
# can be run in batch, without graphic
|
||||
# or interactively: Idle> /control/execute run2.mac
|
||||
#
|
||||
/control/verbose 2
|
||||
#
|
||||
# electron 30 MeV to the direction (1.,0.,0.)
|
||||
# 1 event
|
||||
#
|
||||
/run/beamOn 1
|
||||
#
|
||||
# shoot randomly 20 events
|
||||
#
|
||||
/event/printModulo 5
|
||||
/gun/random on
|
||||
/run/beamOn 20
|
||||
#
|
||||
# activate/inactivate physic processes
|
||||
#
|
||||
/process/list
|
||||
/process/inactivate eBrem
|
||||
#
|
||||
/run/beamOn 20
|
||||
#
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03CalorHit.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03CalorHit.hh"
|
||||
|
||||
G4Allocator<ExN03CalorHit> ExN03CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03CalorHit::ExN03CalorHit()
|
||||
{
|
||||
EdepAbs = 0.; TrackLengthAbs = 0.;
|
||||
EdepGap = 0.; TrackLengthGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03CalorHit::~ExN03CalorHit()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03CalorHit::ExN03CalorHit(const ExN03CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const ExN03CalorHit& ExN03CalorHit::operator=(const ExN03CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int ExN03CalorHit::operator==(const ExN03CalorHit& right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorHit::Draw()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorHit::Print()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03CalorimeterSD.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03CalorimeterSD.hh"
|
||||
|
||||
#include "ExN03CalorHit.hh"
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03CalorimeterSD::ExN03CalorimeterSD(G4String name,
|
||||
ExN03DetectorConstruction* det)
|
||||
:G4VSensitiveDetector(name),Detector(det)
|
||||
{
|
||||
collectionName.insert("CalCollection");
|
||||
HitID = new G4int[500];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03CalorimeterSD::~ExN03CalorimeterSD()
|
||||
{
|
||||
delete [] HitID;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
|
||||
{
|
||||
CalCollection = new ExN03CalorHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
for (G4int j=0;j<Detector->GetNbOfLayers();j++) {HitID[j] = -1;};
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool ExN03CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
|
||||
G4double stepl = 0.;
|
||||
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
|
||||
stepl = aStep->GetStepLength();
|
||||
|
||||
if ((edep==0.)&&(stepl==0.)) return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
//theTouchable->MoveUpHistory();
|
||||
G4int LayerNumber = 0;
|
||||
if(Detector->GetNbOfLayers()>1) LayerNumber=theTouchable->GetReplicaNumber(1);
|
||||
|
||||
if (HitID[LayerNumber]==-1)
|
||||
{
|
||||
ExN03CalorHit* calHit = new ExN03CalorHit();
|
||||
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
|
||||
if (physVol == Detector->GetGap ()) calHit->AddGap(edep,stepl);
|
||||
HitID[LayerNumber] = CalCollection->insert(calHit) - 1;
|
||||
if (verboseLevel>0)
|
||||
G4cout << " New Calorimeter Hit on layer: " << LayerNumber << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (physVol == Detector->GetAbsorber())
|
||||
(*CalCollection)[HitID[LayerNumber]]->AddAbs(edep,stepl);
|
||||
if (physVol == Detector->GetGap())
|
||||
(*CalCollection)[HitID[LayerNumber]]->AddGap(edep,stepl);
|
||||
if (verboseLevel>0)
|
||||
G4cout << " Energy added to Layer: " << LayerNumber << G4endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
|
||||
{
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0)
|
||||
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
|
||||
HCE->AddHitsCollection(HCID,CalCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorimeterSD::clear()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorimeterSD::DrawAll()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03CalorimeterSD::PrintAll()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorConstruction.cc,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03DetectorMessenger.hh"
|
||||
#include "ExN03CalorimeterSD.hh"
|
||||
|
||||
//#include "G4UniformMagField.hh"
|
||||
//#include "G4FieldManager.hh"
|
||||
//#include "G4TransportationManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
//#include "G4RunManager.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
#include "GDMLProcessor.hh"
|
||||
#include "GDMLExpressionEvaluator.hh"
|
||||
|
||||
// Added here just to help resolve properly dependencies
|
||||
#include "G4BooleanSolid.hh"
|
||||
|
||||
ExN03DetectorConstruction::ExN03DetectorConstruction()
|
||||
: calorimeterSD( 0 ) {
|
||||
// create commands for interactive definition of the calorimeter
|
||||
detectorMessenger = new ExN03DetectorMessenger(this);
|
||||
|
||||
sxp.Initialize();
|
||||
config.SetURI( "NO3.gdml" );
|
||||
config.SetSetupName( "N03" );
|
||||
sxp.Configure( &config );
|
||||
}
|
||||
|
||||
ExN03DetectorConstruction::~ExN03DetectorConstruction() {
|
||||
sxp.Finalize();
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* ExN03DetectorConstruction::Construct() {
|
||||
sxp.Run();
|
||||
|
||||
fWorld = (G4VPhysicalVolume *)GDMLProcessor::GetInstance()->GetWorldVolume();
|
||||
|
||||
if( fWorld == 0 ) {
|
||||
G4Exception(
|
||||
"World volume not set properly check your setup selection criteria or GDML input!"
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Sensitive Detectors: Absorber and Gap
|
||||
//
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
if(!calorimeterSD)
|
||||
{
|
||||
calorimeterSD = new ExN03CalorimeterSD("CalorSD",this);
|
||||
SDman->AddNewDetector( calorimeterSD );
|
||||
}
|
||||
G4LogicalVolume* lv = 0;
|
||||
lv = FindLogicalVolume( "Absorber" );
|
||||
if ( lv )
|
||||
lv->SetSensitiveDetector(calorimeterSD);
|
||||
lv = FindLogicalVolume( "Gap" );
|
||||
if ( lv )
|
||||
lv->SetSensitiveDetector(calorimeterSD);
|
||||
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
lv = FindLogicalVolume( "World" );
|
||||
lv->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
lv = FindLogicalVolume( "Calorimeter" );
|
||||
lv->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
lv = FindLogicalVolume( "Layer" );
|
||||
lv->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
return fWorld;
|
||||
}
|
||||
|
||||
G4LogicalVolume* ExN03DetectorConstruction::FindLogicalVolume( const G4String& vn ) {
|
||||
return const_cast<G4LogicalVolume*>( GDMLProcessor::GetInstance()->GetLogicalVolume( vn ) );
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume* ExN03DetectorConstruction::GetAbsorber() {
|
||||
return GDMLProcessor::GetInstance()->GetPhysicalVolume( "pv_Absorber_0" );
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume* ExN03DetectorConstruction::GetGap() {
|
||||
return GDMLProcessor::GetInstance()->GetPhysicalVolume( "pv_Gap_0" );
|
||||
}
|
||||
|
||||
G4double ExN03DetectorConstruction::GetWorldSizeX() {
|
||||
GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
|
||||
return( calc->Eval( "WorldSizeX" ) );
|
||||
}
|
||||
|
||||
G4double ExN03DetectorConstruction::GetWorldSizeYZ() {
|
||||
GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
|
||||
return( calc->Eval( "WorldSizeYZ" ) );
|
||||
}
|
||||
|
||||
G4double ExN03DetectorConstruction::GetCalorThickness() {
|
||||
GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
|
||||
return( calc->Eval( "CalorThickness" ) );
|
||||
}
|
||||
|
||||
G4double ExN03DetectorConstruction::GetCalorSizeYZ() {
|
||||
GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
|
||||
return( calc->Eval( "CalorSizeYZ" ) );
|
||||
}
|
||||
|
||||
G4int ExN03DetectorConstruction::GetNbOfLayers() {
|
||||
GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator();
|
||||
return( (G4int)calc->Eval( "NbOfLayers" ) );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorMessenger.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03DetectorMessenger.hh"
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorMessenger::ExN03DetectorMessenger(
|
||||
ExN03DetectorConstruction* ExN03Det)
|
||||
:ExN03Detector(ExN03Det)
|
||||
{
|
||||
GDMLDir = new G4UIdirectory("/gdml/");
|
||||
GDMLDir->SetGuidance("GDML control.");
|
||||
|
||||
GDMLFile = new G4UIcmdWithAString("/gdml/input",this);
|
||||
GDMLFile->SetGuidance("Select GDML input");
|
||||
GDMLFile->SetParameterName("file",false);
|
||||
GDMLFile->AvailableForStates(Idle);
|
||||
|
||||
GDMLSetup = new G4UIcmdWithAString("/gdml/setup",this);
|
||||
GDMLSetup->SetGuidance("Select geometry setup in GDML input");
|
||||
GDMLSetup->SetGuidance("If none is specified the GDML processor will choose the first found");
|
||||
GDMLSetup->SetParameterName("id",true);
|
||||
GDMLSetup->SetDefaultValue( "default" );
|
||||
GDMLSetup->AvailableForStates(Idle);
|
||||
|
||||
GDMLVersion = new G4UIcmdWithAString("/gdml/version",this);
|
||||
GDMLVersion->SetGuidance("Select a particular version of a given geometry setup in GDML input");
|
||||
GDMLVersion->SetGuidance("If none is specified the GDML processor will choose the first found");
|
||||
GDMLVersion->SetParameterName("id",false);
|
||||
GDMLVersion->SetDefaultValue( "default" );
|
||||
GDMLVersion->AvailableForStates(Idle);
|
||||
|
||||
ExN03detDir = new G4UIdirectory("/calor/");
|
||||
ExN03detDir->SetGuidance("ExN03 detector control.");
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",false);
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
GapMaterCmd = new G4UIcmdWithAString("/calor/setGapMat",this);
|
||||
GapMaterCmd->SetGuidance("Select Material of the Gap.");
|
||||
GapMaterCmd->SetParameterName("choice",false);
|
||||
GapMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
AbsThickCmd->SetParameterName("Size",false);
|
||||
AbsThickCmd->SetRange("Size>=0.");
|
||||
AbsThickCmd->SetUnitCategory("Length");
|
||||
AbsThickCmd->AvailableForStates(Idle);
|
||||
|
||||
GapThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setGapThick",this);
|
||||
GapThickCmd->SetGuidance("Set Thickness of the Gap");
|
||||
GapThickCmd->SetParameterName("Size",false);
|
||||
GapThickCmd->SetRange("Size>=0.");
|
||||
GapThickCmd->SetUnitCategory("Length");
|
||||
GapThickCmd->AvailableForStates(Idle);
|
||||
|
||||
SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setSizeYZ",this);
|
||||
SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
|
||||
SizeYZCmd->SetParameterName("Size",false);
|
||||
SizeYZCmd->SetRange("Size>0.");
|
||||
SizeYZCmd->SetUnitCategory("Length");
|
||||
SizeYZCmd->AvailableForStates(Idle);
|
||||
|
||||
NbLayersCmd = new G4UIcmdWithAnInteger("/calor/setNbOfLayers",this);
|
||||
NbLayersCmd->SetGuidance("Set number of layers.");
|
||||
NbLayersCmd->SetParameterName("NbLayers",false);
|
||||
NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
|
||||
NbLayersCmd->AvailableForStates(Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/calor/setField",this);
|
||||
MagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MagFieldCmd->SetParameterName("Bz",false);
|
||||
MagFieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
MagFieldCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03DetectorMessenger::~ExN03DetectorMessenger()
|
||||
{
|
||||
delete NbLayersCmd;
|
||||
delete AbsMaterCmd; delete GapMaterCmd;
|
||||
delete AbsThickCmd; delete GapThickCmd;
|
||||
delete SizeYZCmd; delete UpdateCmd;
|
||||
delete MagFieldCmd;
|
||||
delete ExN03detDir;
|
||||
delete GDMLFile;
|
||||
delete GDMLSetup;
|
||||
delete GDMLVersion;
|
||||
delete GDMLDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
/*
|
||||
if( command == AbsMaterCmd )
|
||||
{ ExN03Detector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == GapMaterCmd )
|
||||
{ ExN03Detector->SetGapMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ ExN03Detector->SetAbsorberThickness(AbsThickCmd
|
||||
->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == GapThickCmd )
|
||||
{ ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == SizeYZCmd )
|
||||
{ ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == NbLayersCmd )
|
||||
{ ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ ExN03Detector->UpdateGeometry(); }
|
||||
|
||||
if( command == MagFieldCmd )
|
||||
{ ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
*/
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventAction.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03EventAction.hh"
|
||||
|
||||
#include "ExN03CalorHit.hh"
|
||||
#include "ExN03EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventAction::ExN03EventAction()
|
||||
:calorimeterCollID(-1),drawFlag("all"),printModulo(1),
|
||||
eventMessenger(0)
|
||||
{
|
||||
eventMessenger = new ExN03EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventAction::~ExN03EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
{
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
if (calorimeterCollID==-1)
|
||||
{
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
calorimeterCollID = SDman->GetCollectionID("CalCollection");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
|
||||
// extracted from hits, compute the total energy deposit (and total charged
|
||||
// track length) in all absorbers and in all gaps
|
||||
|
||||
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
|
||||
ExN03CalorHitsCollection* CHC = 0;
|
||||
G4int n_hit = 0;
|
||||
G4double totEAbs=0, totLAbs=0, totEGap=0, totLGap=0;
|
||||
|
||||
if (HCE) CHC = (ExN03CalorHitsCollection*)(HCE->GetHC(calorimeterCollID));
|
||||
|
||||
if (CHC)
|
||||
{
|
||||
n_hit = CHC->entries();
|
||||
for (G4int i=0;i<n_hit;i++)
|
||||
{
|
||||
totEAbs += (*CHC)[i]->GetEdepAbs();
|
||||
totLAbs += (*CHC)[i]->GetTrakAbs();
|
||||
totEGap += (*CHC)[i]->GetEdepGap();
|
||||
totLGap += (*CHC)[i]->GetTrakGap();
|
||||
}
|
||||
}
|
||||
|
||||
// print this information event by event (modulo n)
|
||||
|
||||
if (evtNb%printModulo == 0) {
|
||||
G4cout << "---> End of event: " << evtNb << G4endl;
|
||||
|
||||
G4cout
|
||||
<< " Absorber: total energy: " << G4std::setw(7)
|
||||
<< G4BestUnit(totEAbs,"Energy")
|
||||
<< " total track length: " << G4std::setw(7)
|
||||
<< G4BestUnit(totLAbs,"Length")
|
||||
<< G4endl
|
||||
<< " Gap: total energy: " << G4std::setw(7)
|
||||
<< G4BestUnit(totEGap,"Energy")
|
||||
<< " total track length: " << G4std::setw(7)
|
||||
<< G4BestUnit(totLGap,"Length")
|
||||
<< G4endl;
|
||||
|
||||
G4cout << "\n " << n_hit
|
||||
<< " hits are stored in ExN03CalorHitsCollection." << G4endl;
|
||||
}
|
||||
|
||||
// extract the trajectories and draw them
|
||||
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
|
||||
for (G4int i=0; i<n_trajectories; i++)
|
||||
{ G4Trajectory* trj = (G4Trajectory*)
|
||||
((*(evt->GetTrajectoryContainer()))[i]);
|
||||
if (drawFlag == "all") trj->DrawTrajectory(50);
|
||||
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
|
||||
trj->DrawTrajectory(50);
|
||||
else if ((drawFlag == "neutral")&&(trj->GetCharge() == 0.))
|
||||
trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventActionMessenger.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03EventActionMessenger.hh"
|
||||
|
||||
#include "ExN03EventAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventActionMessenger::ExN03EventActionMessenger(ExN03EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none, charged(default),neutral, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged neutral all");
|
||||
DrawCmd->AvailableForStates(Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventActionMessenger::~ExN03EventActionMessenger()
|
||||
{
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03EventActionMessenger::SetNewValue(
|
||||
G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,316 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PhysicsList.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PhysicsList.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PhysicsList::ExN03PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
defaultCutValue = 1.0*mm;
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PhysicsList::~ExN03PhysicsList()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructMesons();
|
||||
ConstructBaryons();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// optical photon
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4Eta::EtaDefinition();
|
||||
G4EtaPrime::EtaPrimeDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
G4KaonZero::KaonZeroDefinition();
|
||||
G4AntiKaonZero::AntiKaonZeroDefinition();
|
||||
G4KaonZeroLong::KaonZeroLongDefinition();
|
||||
G4KaonZeroShort::KaonZeroShortDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructBaryons()
|
||||
{
|
||||
// barions
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
G4Neutron::NeutronDefinition();
|
||||
G4AntiNeutron::AntiNeutronDefinition();
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeminusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeminusMultipleScattering);
|
||||
pmanager->AddProcess(theeminusIonisation);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeplusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeplusMultipleScattering);
|
||||
pmanager->AddProcess(theeplusIonisation);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung);
|
||||
pmanager->AddProcess(theeplusAnnihilation);
|
||||
//
|
||||
// set ordering for AtRestDoIt
|
||||
pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
|
||||
pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
|
||||
|
||||
} else if( particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
//muon
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
|
||||
G4VProcess* aPairProduction = new G4MuPairProduction();
|
||||
G4VProcess* anIonisation = new G4MuIonisation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
pmanager->AddProcess(aBremsstrahlung);
|
||||
pmanager->AddProcess(aPairProduction);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
|
||||
pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
|
||||
|
||||
} else if ((!particle->IsShortLived()) &&
|
||||
(particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")) {
|
||||
// all others charged particles except geantino
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* anIonisation = new G4hIonisation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void ExN03PhysicsList::ConstructGeneral()
|
||||
{
|
||||
// Add Decay Process
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (theDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "ExN03PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
|
||||
}
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
//
|
||||
SetCutValue(defaultCutValue, "gamma");
|
||||
SetCutValue(defaultCutValue, "e-");
|
||||
SetCutValue(defaultCutValue, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
//
|
||||
SetCutValue(defaultCutValue, "proton");
|
||||
SetCutValue(defaultCutValue, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(defaultCutValue);
|
||||
|
||||
if (verboseLevel>0) DumpCutValuesTable();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorAction.cc,v 1.2 2002/06/03 09:59:37 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "ExN03DetectorConstruction.hh"
|
||||
#include "ExN03PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorAction::ExN03PrimaryGeneratorAction(
|
||||
ExN03DetectorConstruction* ExN03DC)
|
||||
:ExN03Detector(ExN03DC),rndmFlag("off")
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
//create a messenger for this class
|
||||
gunMessenger = new ExN03PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="e-");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleEnergy(50.*MeV);
|
||||
// We can't call it here as the WorldSizeX is not yet read from GDML input
|
||||
//G4double position = -0.5*(ExN03Detector->GetWorldSizeX());
|
||||
//particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorAction::~ExN03PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
//
|
||||
G4double x0 = -0.5*(ExN03Detector->GetWorldSizeX());
|
||||
G4double y0 = 0.*cm, z0 = 0.*cm;
|
||||
if (rndmFlag == "on")
|
||||
{y0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
|
||||
z0 = (ExN03Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
|
||||
}
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorMessenger.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "ExN03PrimaryGeneratorAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorMessenger::ExN03PrimaryGeneratorMessenger(
|
||||
ExN03PrimaryGeneratorAction* ExN03Gun)
|
||||
:ExN03Action(ExN03Gun)
|
||||
{
|
||||
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
|
||||
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
|
||||
RndmCmd->SetGuidance(" Choice : on(default), off");
|
||||
RndmCmd->SetParameterName("choice",true);
|
||||
RndmCmd->SetDefaultValue("on");
|
||||
RndmCmd->SetCandidates("on off");
|
||||
RndmCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03PrimaryGeneratorMessenger::~ExN03PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03PrimaryGeneratorMessenger::SetNewValue(
|
||||
G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ ExN03Action->SetRndmFlag(newValue);}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03RunAction.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03RunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03RunAction::ExN03RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03RunAction::~ExN03RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03RunAction::EndOfRunAction(const G4Run* )
|
||||
{
|
||||
if (G4VVisManager::GetConcreteInstance()) {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingAction.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingAction::ExN03SteppingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingAction::~ExN03SteppingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingAction::UserSteppingAction(const G4Step*)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingVerbose.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03SteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingVerbose::ExN03SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03SteppingVerbose::~ExN03SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << G4std::setw( 5) << "#Step#" << " "
|
||||
<< G4std::setw( 6) << "X" << " "
|
||||
<< G4std::setw( 6) << "Y" << " "
|
||||
<< G4std::setw( 6) << "Z" << " "
|
||||
<< G4std::setw( 9) << "KineE" << " "
|
||||
<< G4std::setw( 9) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "Volume" << " "
|
||||
<< G4std::setw(10) << "Process" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << G4std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
// if( fStepStatus != fWorldBoundary){
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << G4std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << G4std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
G4cout << " "
|
||||
<< G4std::setw(10)
|
||||
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << " UserLimit";
|
||||
}
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << " :----- List of 2ndaries - "
|
||||
<< "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot
|
||||
<< "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt
|
||||
<< ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt
|
||||
<< ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt
|
||||
<< "), "
|
||||
<< "#SpawnTotal=" << G4std::setw(3) << (*fSecondary).size()
|
||||
<< " ---------------"
|
||||
<< G4endl;
|
||||
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++){
|
||||
G4cout << " : "
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw(10)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :-----------------------------"
|
||||
<< "----------------------------------"
|
||||
<< "-- EndOf2ndaries Info ---------------"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << G4std::setw( 5) << "Step#" << " "
|
||||
<< G4std::setw( 6) << "X" << " "
|
||||
<< G4std::setw( 6) << "Y" << " "
|
||||
<< G4std::setw( 6) << "Z" << " "
|
||||
<< G4std::setw( 9) << "KineE" << " "
|
||||
<< G4std::setw( 9) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "Volume" << " "
|
||||
<< G4std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << G4std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << "OutOfWorld";
|
||||
}
|
||||
G4cout << " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03VisManager.cc,v 1.1.1.1 2002/05/31 00:34:44 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "ExN03VisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
#include "G4Wo.hh"
|
||||
#include "G4Xo.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03VisManager::ExN03VisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03VisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
RegisterGraphicsSystem (new G4Wo);
|
||||
RegisterGraphicsSystem (new G4Xo);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# Macro file for the initialization phase of "exampleN03.cc"
|
||||
# when running in interactive mode
|
||||
#
|
||||
# Sets some default verbose
|
||||
#
|
||||
/control/verbose 2
|
||||
/control/saveHistory
|
||||
/run/verbose 2
|
||||
#
|
||||
# create empty scene
|
||||
#
|
||||
/vis/scene/create
|
||||
#
|
||||
# Create a scene handler for a specific graphics system
|
||||
# (Edit the next line(s) to choose another graphic system)
|
||||
#
|
||||
/vis/open DAWNFILE
|
||||
/vis/open OGLIX
|
||||
#
|
||||
/vis/viewer/flush
|
||||
#
|
||||
# for drawing the tracks
|
||||
# (if too many tracks cause core dump => storeTrajectory 0)
|
||||
#
|
||||
/tracking/storeTrajectory 1
|
||||
/vis/scene/endOfEventAction accumulate
|
||||
@@ -0,0 +1,22 @@
|
||||
====================================
|
||||
examples/novice/N03/visTutor/History
|
||||
====================================
|
||||
|
||||
14-11-01 Satoshi Tanaka (exN03VisTutor-V03-02-02)
|
||||
- exN03Vis8.mac : Batch visualization with the DAWNFILE driver
|
||||
- exN03Vis9.mac : Multi-page PostScript file generation (old exN03Vis8.mac)
|
||||
|
||||
08-11-01 Satoshi Tanaka (exN03VisTutor-V03-02-01a)
|
||||
- /vis/viewer/viewpointThetaPhi ==> /vis/viewer/set/viewpointThetaPhi
|
||||
|
||||
07-11-01 Satoshi Tanaka (exN03VisTutor-V03-02-01)
|
||||
- Macros are rewritten with /vis/viewer/flush
|
||||
- Comments are updated.
|
||||
|
||||
18-09-01 Satoshi Tanaka (exN03VisTutor-V03-02-00)
|
||||
- Updation for automatic visualization at Hebden Bridge mini-workshop.
|
||||
- /vis/viewer/flush and /vis/flushAll are not included yet.
|
||||
(To be included in the next tag.)
|
||||
- /vis/drawTree may still require /vis/scene/notifyHandlers.
|
||||
(John Allison will revise the /vis/drawTree command soon.)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Tree0.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# #
|
||||
# CONTENTS: A macro to demonstrate ASCII DTREE #
|
||||
# #
|
||||
# USAGE: #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Tree0.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix / Windows #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# VERBOSE LEVEL: #
|
||||
# #
|
||||
# < 10: - does not print daughters of repeated logical volumes. #
|
||||
# - does not repeat replicas. #
|
||||
# >= 10: prints all physical volumes. #
|
||||
# For level of detail add: #
|
||||
# >= 0: prints physical volume name. #
|
||||
# >= 1: prints logical volume name. #
|
||||
# >= 2: prints solid name and type. #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# * The geometry tree is displayed in the stdout. #
|
||||
# * The compound command to visualize geometry tree: #
|
||||
# /vis/drawTree [<physical-volume-name>] [<system>] #
|
||||
#######################################################################
|
||||
|
||||
# Draw the whole geometry tree
|
||||
/vis/drawTree
|
||||
|
||||
# Draw a part of tree
|
||||
/vis/drawTree Gap
|
||||
|
||||
# Change the level to display details
|
||||
/vis/ASCIITree/verbose 1
|
||||
/vis/drawTree
|
||||
|
||||
# Change the level to display details
|
||||
/vis/ASCIITree/verbose 2
|
||||
/vis/drawTree
|
||||
|
||||
# Change the level to display details
|
||||
/vis/ASCIITree/verbose 10
|
||||
/vis/drawTree
|
||||
@@ -0,0 +1,63 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Tree0.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# #
|
||||
# CONTENTS: A macro to demonstrate GAG DTREE #
|
||||
# #
|
||||
# USAGE: #
|
||||
# * Edit exampleN03.cc to use the GAG interface #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Tree1.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix/Windows, GAG (Java version) #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# VERBOSE LEVEL: #
|
||||
# #
|
||||
# < 10: - does not print daughters of repeated logical volumes. #
|
||||
# - does not repeat replicas. #
|
||||
# >= 10: prints all physical volumes. #
|
||||
# For level of detail add: #
|
||||
# >= 0: prints physical volume name. #
|
||||
# >= 1: prints logical volume name. #
|
||||
# >= 2: prints solid name and type. #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# * The geometry tree is displayed in GAG windows stdout. #
|
||||
# (If you are using the G4 character terminals, the tree is #
|
||||
# displayed in stdout.) #
|
||||
# * The compound command to visualize geometry tree: #
|
||||
# /vis/drawTree [<physical-volume-name>] [<system>] #
|
||||
#######################################################################
|
||||
|
||||
# Draw the whole geometry tree
|
||||
# Note: "!" means the default argument, i.e., "world"
|
||||
/vis/drawTree ! GAGTree
|
||||
|
||||
# Draw a part of tree
|
||||
/vis/drawTree Gap GAGTree
|
||||
|
||||
# Change the level to display details
|
||||
/vis/GAGTree/verbose 1
|
||||
/vis/drawTree ! GAGTree
|
||||
|
||||
# Change the level to display details
|
||||
/vis/GAGTree/verbose 2
|
||||
/vis/drawTree ! GAGTree
|
||||
|
||||
# Change the level to display details
|
||||
/vis/GAGTree/verbose 10
|
||||
/vis/drawTree ! GAGTree
|
||||
@@ -0,0 +1,108 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis0.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# June 06, 2000 #
|
||||
# May 20, 2000 #
|
||||
# November 10, 1999 #
|
||||
# #
|
||||
# CONTENTS: A simplest macro to demonstrate visualization of #
|
||||
# detector geometry and events #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis0.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv OGLHOME ... (e.g. /usr/X11R6) #
|
||||
# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPENGLX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The compound command "/vis/open <vis-driver-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/sceneHandler/create $1 #
|
||||
# /vis/viewer/create #
|
||||
# #
|
||||
# The compound command "/vis/drawVolume <physical-volume-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/scene/create #
|
||||
# /vis/scene/add/volume $1 #
|
||||
# /vis/sceneHandler/attach #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
##############################################
|
||||
# Visualization of detector geometry
|
||||
# with the OGLIX (OpenGL Immediate X) driver
|
||||
##############################################
|
||||
|
||||
# Invoke the OGLIX driver
|
||||
/vis/open OGLIX
|
||||
#/vis/open DAWNFILE
|
||||
|
||||
# Set camera
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/viewpointThetaPhi 70 20
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# The following command "flush"
|
||||
# the action of the current viewer.
|
||||
# They are required for the post-processing drivers
|
||||
# such as DAWNFILE, VRMLFILE, HepRep drivers, etc.
|
||||
# For OpenGL drivers, these commands are not required
|
||||
# but harmless even if they are described.
|
||||
/vis/viewer/flush
|
||||
|
||||
#########################################################
|
||||
# Visualization of events with the DAWNFILE driver
|
||||
#
|
||||
# * Each visualized view is saved to a file "g4_XX.eps"
|
||||
# with the "vectorized" PostScript format.
|
||||
#
|
||||
# * Set an environmental variable if you wish to
|
||||
# skip DAWN GUI:
|
||||
# % setenv G4DAWNFILE_VIEWER "dawn -d"
|
||||
##########################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Add the world volume to the current scene
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Set camera
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.5
|
||||
/vis/viewer/set/viewpointThetaPhi 70 20
|
||||
|
||||
# Visualize events added to the current scene
|
||||
/tracking/storeTrajectory 1
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,164 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis1.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# June 06, 2000 #
|
||||
# May 20, 2000 #
|
||||
# November 10, 1999 #
|
||||
# #
|
||||
# CONTENTS: A basic macro for visualization of detector geometry #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis1.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv OGLHOME ... (e.g. /usr/X11R6) #
|
||||
# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPENGLX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The compound command "/vis/open <vis-driver-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/sceneHandler/create $1 #
|
||||
# /vis/viewer/create #
|
||||
# #
|
||||
# The compound command "/vis/drawVolume <physical-volume-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/scene/create #
|
||||
# /vis/scene/add/volume $1 #
|
||||
# /vis/sceneHandler/attach #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
###########################################
|
||||
# Visualization of detector geometry
|
||||
# with the OGLSX (OpenGL Stored X) driver
|
||||
###########################################
|
||||
|
||||
# Invoke the OGLSX driver
|
||||
/vis/open OGLSX
|
||||
|
||||
# Bird's-eye view of the detector geometry
|
||||
#
|
||||
# viewpoint : (theta,phi) = (20*deg, 70*deg),
|
||||
# zoom factor: 0.8 of the full screen size
|
||||
#
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/viewpointThetaPhi 20 70
|
||||
/vis/viewer/zoom 0.8
|
||||
/vis/drawVolume
|
||||
|
||||
# The following two commands "flush"
|
||||
# the action of the current viewer.
|
||||
# They are required for the post-processing drivers
|
||||
# such as DAWNFILE, VRMLFILE, HepRep drivers, etc.
|
||||
# For OpenGL drivers, these commands are not required
|
||||
# but harmless even if they are described.
|
||||
/vis/viewer/flush
|
||||
|
||||
##########################################################
|
||||
# Visualization with the DAWNFILE driver
|
||||
#
|
||||
# * Each visualized view is saved to a file "g4_XX.eps"
|
||||
# with the "vectorized" PostScript format.
|
||||
#
|
||||
# * Set an environmental variable if you wish to
|
||||
# skip DAWN GUI:
|
||||
# % setenv G4DAWNFILE_VIEWER "dawn -d"
|
||||
##########################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Bird's-eye view of a detector component (Absorber)
|
||||
# viewpoint : (theta,phi) = (35*deg, 35*deg),
|
||||
# zoom factor: 1.1 of the full screen size
|
||||
# coordinate axes:
|
||||
# x-axis:red, y-axis:green, z-axis:blue
|
||||
# origin: (0,0,0), length: 500
|
||||
# Scale: length = 10 cm, Orientation = z, color = red,
|
||||
# placing_algorithm = manual,
|
||||
# center = (-2.5 cm , -5 cm, 0 cm)
|
||||
#
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.1
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
/vis/drawVolume Absorber
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 40 -100 -140 Absorber
|
||||
/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm
|
||||
|
||||
# "Flush the action of all the existing viewers.
|
||||
# Note: You should execute these commands, e.g.,
|
||||
# when the current scene is modified.
|
||||
/vis/scene/notifyHandlers
|
||||
/vis/viewer/update
|
||||
|
||||
# FOR FUTURE UPDATION
|
||||
#/vis/viewer/flushAll
|
||||
|
||||
# Bird's-eye view of a detector component (Gap)
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.1
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
/vis/drawVolume Gap
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 50 -100 -140 Gap
|
||||
/vis/scene/add/scale 10 cm z 1 0 0 manual -2.5 -5 0 cm
|
||||
|
||||
# "Flush the action of all the existing viewers.
|
||||
/vis/scene/notifyHandlers
|
||||
/vis/viewer/update
|
||||
|
||||
# FOR FUTURE UPDATION
|
||||
#/vis/viewer/flushAll
|
||||
|
||||
|
||||
# Bird's-eye view of the whole detector components (world)
|
||||
# * The argument "world" of the command
|
||||
# "/vis/scene/add/volume" is omittable.
|
||||
# * "/vis/viewer/set/culling false" makes the invisible
|
||||
# world volume visible.
|
||||
# (The invisibility of the world volume is set
|
||||
# in ExN03DetectorConstruction.cc.)
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.1
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
/vis/viewer/set/culling global false
|
||||
/vis/drawVolume
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 50 -100 -240 World
|
||||
/vis/scene/add/scale 10 cm x 1 0 0
|
||||
|
||||
# "Flush the action of all the existing viewers.
|
||||
/vis/scene/notifyHandlers
|
||||
/vis/viewer/update
|
||||
|
||||
# FOR FUTURE UPDATION
|
||||
#/vis/viewer/flushAll
|
||||
|
||||
|
||||
# Make the culling on for next visualization
|
||||
# Note: You may also use "/vis/viewer/reset"
|
||||
# for this initialization.
|
||||
/vis/viewer/set/culling global true
|
||||
@@ -0,0 +1,127 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis2.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# June 06, 2000 #
|
||||
# May 20, 2000 #
|
||||
# November 10, 1999 #
|
||||
# #
|
||||
# CONTENTS: A basic macro for visualization of events #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis2.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv OGLHOME ... (e.g. /usr/X11R6) #
|
||||
# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPENGLX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The compound command "/vis/open <vis-driver-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/sceneHandler/create $1 #
|
||||
# /vis/viewer/create #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
#################################################
|
||||
# Store particle trajactories for visualization
|
||||
#################################################
|
||||
/tracking/storeTrajectory 1
|
||||
|
||||
#######################################################
|
||||
# Visualization with the OGLSX (OpenGL Stored X) driver
|
||||
#######################################################
|
||||
|
||||
# Invoke the OGLSX driver
|
||||
/vis/open OGLSX
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Set viewing parameters
|
||||
# viewpoint : (theta,phi) = (10*deg, 10*deg).
|
||||
# drawing style: surface
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/style surface
|
||||
/vis/viewer/set/viewpointThetaPhi 10 10
|
||||
|
||||
# Generate one event and visualize it.
|
||||
/run/beamOn 1
|
||||
|
||||
|
||||
##########################################################
|
||||
# Visualization with the DAWNFILE driver
|
||||
#
|
||||
# * Each visualized view is saved to a file "g4_XX.eps"
|
||||
# with the "vectorized" PostScript format.
|
||||
#
|
||||
# * Set an environmental variable if you wish to
|
||||
# skip DAWN GUI:
|
||||
# % setenv G4DAWNFILE_VIEWER "dawn -d"
|
||||
##########################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Set the trajectory-accumulation mode to "accumulate".
|
||||
# Trajectories of each event are accumulated
|
||||
# and visualized at the end of one run.
|
||||
/vis/scene/endOfEventAction accumulate
|
||||
|
||||
# Visualize many events (bird's eye view)
|
||||
# viewpoint : (theta,phi) = (45*deg, 45*deg)
|
||||
# zoom factor: 1.5 x (full screen size)
|
||||
# drawing style: wireframe
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/style wireframe
|
||||
/vis/viewer/set/viewpointThetaPhi 45 45
|
||||
/vis/viewer/zoom 1.5
|
||||
/run/beamOn 50
|
||||
|
||||
# Visualize many events (zoomed-up view)
|
||||
# viewpoint : (theta,phi) = (90*deg, 0)
|
||||
# zoom factor: 5 x (full screen size)
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/style wireframe
|
||||
/vis/viewer/set/viewpointThetaPhi 90 0
|
||||
/vis/viewer/zoom 5
|
||||
/run/beamOn 50
|
||||
|
||||
# Reset trajectory-accumulation mode to "refresh" (default)
|
||||
# Trajectories are visualized at the end of each event.
|
||||
/vis/scene/endOfEventAction refresh
|
||||
@@ -0,0 +1,136 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis3.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# June 06, 2000 #
|
||||
# May 20, 2000 #
|
||||
# November 10, 1999 #
|
||||
# #
|
||||
# CONTENTS: A basic macro for demonstrating various drawing styles #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis3.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, OpenGL, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv OGLHOME ... (e.g. /usr/local) #
|
||||
# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPENGLX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The compound command "/vis/open <vis-driver-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/sceneHandler/create $1 #
|
||||
# /vis/viewer/create #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
##############################################
|
||||
# Store particle trajactories for visualization
|
||||
##############################################
|
||||
/tracking/storeTrajectory 1
|
||||
|
||||
###########################################################
|
||||
# Visualization with the OGLIX (OpenGL Immediate X) driver
|
||||
###########################################################
|
||||
|
||||
# Invoke the OGLSX driver
|
||||
/vis/open OGLSX
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Bird-eye view of events with
|
||||
# the hidden-surface drawing style
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/viewpointThetaPhi 45 45
|
||||
/vis/viewer/set/style surface
|
||||
/run/beamOn 10
|
||||
|
||||
##########################################################
|
||||
# Visualization with the DAWNFILE driver
|
||||
#
|
||||
# * Each visualized view is saved to a file "g4_XX.eps"
|
||||
# with the "vectorized" PostScript format.
|
||||
#
|
||||
# * Set an environmental variable if you wish to
|
||||
# skip DAWN GUI:
|
||||
# % setenv G4DAWNFILE_VIEWER "dawn -d"
|
||||
#
|
||||
##########################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Bird-eye view of events with the
|
||||
# wireframe drawing style
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.5
|
||||
/vis/viewer/set/viewpointThetaPhi 45 45
|
||||
/vis/viewer/set/style wireframe
|
||||
/run/beamOn 3
|
||||
|
||||
# Set the trajectory-accumulation mode to "accumulate".
|
||||
# Trajectories of each event are accumulated
|
||||
# and visualized at the end of one run.
|
||||
/vis/scene/endOfEventAction accumulate
|
||||
|
||||
# Bird-eye view of events with the
|
||||
# hidden-surface drawing style
|
||||
/vis/viewer/set/style surface
|
||||
/run/beamOn 50
|
||||
|
||||
# Cull detector geometry and show only trajectories.
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/culling global true
|
||||
/vis/viewer/set/culling density true 999
|
||||
/vis/viewer/set/style wireframe
|
||||
/run/beamOn 10
|
||||
|
||||
# Reset the culling policy for next visualization
|
||||
# The default culling policy is:
|
||||
# global : on
|
||||
# invisible : on
|
||||
# low density : off
|
||||
# covered daughter: off
|
||||
#
|
||||
# Note: You may also use "/vis/viewer/reset"
|
||||
# for this initialization.
|
||||
/vis/viewer/set/culling density false
|
||||
|
||||
# Reset trajectory-accumulation mode to "refresh" (default)
|
||||
# Trajectories are visualized at the end of each event.
|
||||
/vis/scene/endOfEventAction refresh
|
||||
@@ -0,0 +1,105 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis4.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# June 06, 2000 #
|
||||
# #
|
||||
# CONTENTS: An example for the compound command, #
|
||||
# "/vis/specify <logical_volume_name>" #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis4.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv OGLHOME ... (e.g. /usr/X11R6) #
|
||||
# % setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPENGLX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The compound command "/vis/open <vis-driver-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/sceneHandler/create $1 #
|
||||
# /vis/viewer/create #
|
||||
# #
|
||||
# The compound command "/vis/specify <logical-volume-name>" #
|
||||
# is equivalent to the following set of commands: #
|
||||
# #
|
||||
# /vis/scene/create #
|
||||
# /vis/scene/add/logicalVolume $1 #
|
||||
# /vis/sceneHandler/attach #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
##########################################################
|
||||
# Visualization with the OGLIX driver
|
||||
##########################################################
|
||||
|
||||
# Invoke the OGLIX driver
|
||||
/vis/open OGLIX
|
||||
|
||||
# Set camera
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 0.9
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
|
||||
# Visualize a selected logical volume
|
||||
/vis/specify Absorber
|
||||
/vis/viewer/flush
|
||||
|
||||
##########################################################
|
||||
# Visualization with the DAWNFILE driver
|
||||
#
|
||||
# * Each visualized view is saved to a file "g4_XX.eps"
|
||||
# with the "vectorized" PostScript format.
|
||||
#
|
||||
# * Set an environmental variable if you wish to
|
||||
# skip DAWN GUI:
|
||||
# % setenv G4DAWNFILE_VIEWER "dawn -d"
|
||||
##########################################################
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Set camera
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 0.9
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
|
||||
# Visualize a selected logical volume (1)
|
||||
/vis/specify Absorber
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 40 -100 -200 LogVol:Absorber
|
||||
/vis/scene/notifyHandlers
|
||||
/vis/viewer/update
|
||||
|
||||
# FOR FUTURE UPDATION
|
||||
#/vis/viewer/flushAll
|
||||
|
||||
# Visualize a selected logical volume (2)
|
||||
/vis/specify Gap
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 40 -100 -200 LogVol:Gap
|
||||
/vis/scene/notifyHandlers
|
||||
/vis/viewer/update
|
||||
|
||||
# FOR FUTURE UPDATION
|
||||
#/vis/viewer/flushAll
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis5.mac #
|
||||
# #
|
||||
# AUTHOR(S): Guy Barrand #
|
||||
# #
|
||||
# DATE: June 09, 2000 #
|
||||
# #
|
||||
# CONTENTS: A basic macro for demonstrating OPACS/Xo driver #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 visTutor/exN03Vis5.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, Motif, X-window, OpenGL, #
|
||||
# OPACS (version 3.0) #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_BUILD_OPACS_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OPACS 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# Controls on a Xo window are : #
|
||||
# - Ctrl + left-button1 + move pointer : #
|
||||
# move things (default is scale). #
|
||||
# - right-button : popup menu to change, for example, the #
|
||||
# upper behaviour. #
|
||||
# - left-button : pick an object. After your can center on it #
|
||||
# through the popup-menu. #
|
||||
# - left-button + move pointer : collect objects. #
|
||||
# - Ctrl + Shift + left-button + move pointer : #
|
||||
# rubber band zoom. #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
# Create "scene-0"
|
||||
/vis/scene/create
|
||||
|
||||
# Invoke the Xo driver
|
||||
/vis/sceneHandler/create Xo
|
||||
/vis/viewer/create
|
||||
|
||||
# Add the world volume to the current scene
|
||||
/vis/scene/add/volume
|
||||
/tracking/storeTrajectory 1
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Bird-eye view of events
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/viewpointThetaPhi 45 45
|
||||
|
||||
/run/beamOn 1
|
||||
|
||||
#######################################################################
|
||||
# Controls on a Xo window are : #
|
||||
# - Ctrl + left-button1 + move pointer : #
|
||||
# move things (default is scale). #
|
||||
# - right-button : popup menu to change, for example, the #
|
||||
# upper behaviour. #
|
||||
# - left-button : pick an object. After your can center on it #
|
||||
# through the popup-menu. #
|
||||
# - left-button + move pointer : collect objects. #
|
||||
# - Ctrl + Shift + left-button + move pointer : #
|
||||
# rubber band zoom. #
|
||||
#######################################################################
|
||||
@@ -0,0 +1,65 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis6.mac #
|
||||
# #
|
||||
# AUTHOR(S): Guy Barrand #
|
||||
# #
|
||||
# DATE: June 09, 2000 #
|
||||
# #
|
||||
# CONTENTS: A basic macro for demonstrating Inventor driver #
|
||||
# #
|
||||
# USAGE: % $G4BINDIR/exampleN03 visTutor/exN03Vis6.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, Motif, X-window, OpenGL, #
|
||||
# HEPVis #
|
||||
# Inventor (TGS or SoFree) #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_BUILD_OIX_DRIVER 1 #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# % setenv G4VIS_USE_OIX 1 #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
# Create "scene-0"
|
||||
/vis/scene/create
|
||||
|
||||
# Invoke the Xo driver
|
||||
/vis/sceneHandler/create OIX
|
||||
/vis/viewer/create
|
||||
|
||||
# Add the world volume to the current scene
|
||||
/vis/scene/add/volume
|
||||
#/vis/scene/add/trajectories
|
||||
/tracking/storeTrajectory 1
|
||||
|
||||
# Bird-eye view of events
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/set/viewpointThetaPhi 45 45
|
||||
|
||||
# Attach the just created Go scene graph to the viewer.
|
||||
/vis/viewer/update
|
||||
# Attach the just created Go scene graph to the viewer.
|
||||
/vis/viewer/update
|
||||
/vis/scene/notifyHandlers
|
||||
|
||||
/run/beamOn 1
|
||||
|
||||
#######################################################################
|
||||
# Controls on an Inventor examiner viewer are : #
|
||||
# - in picking mode (cursor is the upper left arrow) #
|
||||
# Ctrl + pick an volume : see daughters. #
|
||||
# Shift + pick an volume : see mother. #
|
||||
# - in viewing mode (cursor is the hand) #
|
||||
# Left-button + pointer move : rotate. #
|
||||
# Ctrl+Left-button + pointer move : pane. #
|
||||
# Ctrl+Shift+Left-button + pointer move : scale. #
|
||||
# Middle-button + pointer move : pane. #
|
||||
# #
|
||||
#######################################################################
|
||||
@@ -0,0 +1,68 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis7.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# #
|
||||
# CONTENTS: A macro to demonstrate the VRMLFILE driver #
|
||||
# #
|
||||
# USAGE: % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis7.mac #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, #
|
||||
# VRML viewer (e.g. VRMLview) #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# RECOMMENDED ENVIRONMENTAL VARIABLES FOR VISUALIZATION: #
|
||||
# #
|
||||
# % setenv G4VRMLFILE_VIEWER vrmlview #
|
||||
# ( The default value is "NONE".) #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# The VRML-file viewer "vrmlview" is obtainable from the following #
|
||||
# Web site: #
|
||||
# http://www.sim.no/downloads.html #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
###################################################
|
||||
# Visualization of detector geometry and events
|
||||
# with the VRML2FILE driver.
|
||||
###################################################
|
||||
|
||||
# Store particle trajactories for visualization
|
||||
/tracking/storeTrajectory 1
|
||||
|
||||
# Invoke the VRML2FILE driver
|
||||
# Note: The VRML1FILE driver generates VRML 1.0 format files.
|
||||
# The VRML2FILE driver generates VRML 2.0 format files.
|
||||
/vis/open VRML2FILE
|
||||
|
||||
# Create an empty scene and add the detector geometry to it
|
||||
/vis/drawVolume
|
||||
|
||||
# Visualize 3 events in the wireframe mode
|
||||
# Note: The command /vis/scene/add/trajectories
|
||||
# is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
# Note: "/vis/viewer/set/style wireframe" means
|
||||
# "half-transparent" in the VRML2FILE driver.
|
||||
# It is a convention only for this driver.
|
||||
#/vis/scene/add/trajectories
|
||||
/vis/viewer/set/style wireframe
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,61 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis8.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 14, 2001 #
|
||||
# #
|
||||
# CONTENTS: A macro to demonstrate batch visualization to generate #
|
||||
# PostScript file with the DAWNFILE driver #
|
||||
# #
|
||||
# % setenv DAWN_BATCH 1 #
|
||||
# % make visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis8.mac #
|
||||
# Idle> exit #
|
||||
# % gv g4_00.eps & #
|
||||
# % gv g4_01.eps & #
|
||||
# % gv g4_02.eps & #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
####################################################################
|
||||
# Creation of a multi-page PostScript file with the DAWNFILE driver
|
||||
####################################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Add the world volume to the current scene
|
||||
/vis/drawVolume
|
||||
|
||||
# Add trajectories to the current scene
|
||||
# Note: This command is not necessary in exampleN03,
|
||||
# since the C++ method DrawTrajectory() is
|
||||
# described in the event action.
|
||||
#/vis/scene/add/trajectories
|
||||
|
||||
# Set camera
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 1.5
|
||||
/vis/viewer/set/viewpointThetaPhi 70 20
|
||||
|
||||
# Visualize events added to the current scene
|
||||
/tracking/storeTrajectory 1
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,87 @@
|
||||
#######################################################################
|
||||
# MACRO FILE NAME: exN03Vis9.mac #
|
||||
# #
|
||||
# AUTHOR(S): Satoshi Tanaka #
|
||||
# #
|
||||
# DATE: #
|
||||
# Nov 14, 2001 (renamed from exN03Vis8.mac) #
|
||||
# Nov 07, 2001 #
|
||||
# Sept 08-09, 2001 (at Hebden Bridge, UK) #
|
||||
# June 20, 2001 #
|
||||
# November 26, 2000 #
|
||||
# October 17, 2000 #
|
||||
# #
|
||||
# CONTENTS: A macro to demonstrate creation of a "multi-page" #
|
||||
# PostScript file #
|
||||
# #
|
||||
# USAGE: % setenv G4DAWNFILE_MAX_FILE_NUM 1 #
|
||||
# % setenv DAWN_BATCH a #
|
||||
# % gmake visclean #
|
||||
# % $G4BINDIR/exampleN03 #
|
||||
# Idle> /control/execute visTutor/exN03Vis9.mac #
|
||||
# Idle> exit #
|
||||
# % gv g4_00.eps #
|
||||
# #
|
||||
# Then click, "<<", ">>" etc to traverse pages #
|
||||
# #
|
||||
# REQUIRED PLATFORMS & SOFTWARES: Unix, X-window, #
|
||||
# DAWN (version 3.85 or after) #
|
||||
# gv (Ghostview), Tcl/Tk #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR INSTALLATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ENVIRONMENTAL VARIABLES (C-MACROS) FOR COMPILATION: #
|
||||
# (See geant4/source/visualization/README for details.) #
|
||||
# #
|
||||
# * Unnecessary #
|
||||
# #
|
||||
# ADDITIONAL NOTES: #
|
||||
# * If you execute this macro plural times, all the views are #
|
||||
# sequentially appended to the file "g4_00.eps". #
|
||||
# For example if you execute it two times, a 6-page (3+3 page) #
|
||||
# PostScript file is made. #
|
||||
# Unset environmental variables to initialize your environment: #
|
||||
# #
|
||||
# % unsetenv G4DAWNFILE_MAX_FILE_NUM #
|
||||
# % unsetenv DAWN_BATCH #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
####################################################################
|
||||
# Creation of a multi-page PostScript file with the DAWNFILE driver
|
||||
####################################################################
|
||||
|
||||
# Invoke the DAWNFILE driver
|
||||
/vis/open DAWNFILE
|
||||
|
||||
# Set viewing parameters
|
||||
/vis/viewer/reset
|
||||
/vis/viewer/zoom 0.9
|
||||
/vis/viewer/set/viewpointThetaPhi 35 35
|
||||
|
||||
# Generate page 1: Absorber
|
||||
/vis/drawVolume Absorber
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 30 -150 -200 Page1/3:Absorber
|
||||
/vis/viewer/flush
|
||||
|
||||
# Generate page 2: Gap
|
||||
/vis/drawVolume Gap
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 30 -100 -200 Page2/3:Gap
|
||||
/vis/viewer/flush
|
||||
|
||||
# Generate page 3: World
|
||||
/vis/viewer/set/culling global false
|
||||
/vis/drawVolume
|
||||
/vis/scene/add/axes 0 0 0 500 mm
|
||||
/vis/scene/add/text 0 0 0 mm 50 -100 -200 Page3/3:world
|
||||
/vis/viewer/flush
|
||||
|
||||
# Make the culling on for next visualization
|
||||
# Note: You may also use "/vis/viewer/reset"
|
||||
# for this initialization.
|
||||
/vis/viewer/set/culling global true
|
||||
@@ -0,0 +1,364 @@
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!
|
||||
!!!! A X11 resource file to customize G4UI sessions and
|
||||
!!!! visualization viewers based over Xt. You use it by
|
||||
!!!! setting the XENVIRONMENT environment variable to point
|
||||
!!!! to this file, for example :
|
||||
!!!! csh> setenv XENVIRONMENT g4Xt.xrm
|
||||
!!!! sh> XENVIRONMENT=g4Xt.xrm;export XENVIRONMENT
|
||||
!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*topShadowColor :white
|
||||
*bottomShadowColor :black
|
||||
*foreground :black
|
||||
*background :lightgrey
|
||||
*borderColor :lightgrey
|
||||
*fontList :-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!! G4UIXm
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*text.background :white
|
||||
*text.fontList :*courier*-r-*--14-*
|
||||
*text.maxLength :8000
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!!! OPACS/Xo/XoCamera widget
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*XoCamera.width:400
|
||||
*XoCamera.height:400
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! OpenInventor resources, copied from file :
|
||||
! OpenInventor2.4.1/app-defaults/Inventor
|
||||
!
|
||||
!#################################################
|
||||
! RESSOURCE FILE FOR OPEN INVENTOR !
|
||||
!#################################################
|
||||
!
|
||||
! You must put this file in
|
||||
! /usr/lib/X11/app-defaults
|
||||
! or set up XAPPLRESDIR (see X window documentation)
|
||||
!
|
||||
!#################################################
|
||||
!!################################################
|
||||
!! POPUP MENU
|
||||
!!------------------------------------------------
|
||||
!! FUNCTIONS MENU
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvFunctions1.labelString: Functions
|
||||
*IvFunctions2.IvHelp.labelString: Help
|
||||
*IvFunctions2.IvHome.labelString: Home
|
||||
*IvFunctions2.IvSetHome.labelString: Set Home
|
||||
*IvFunctions2.IvViewAll.labelString: View All
|
||||
*IvFunctions2.IvSeek.labelString: Seek
|
||||
*IvFunctions2.IvCopyView.labelString: Copy View
|
||||
*IvFunctions2.IvPasteView.labelString: Paste View
|
||||
!!------------------------------------------------
|
||||
!! DRAW STYLE MENU
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvDrawStyle1.labelString: Draw Style
|
||||
*IvDrawStyle2.IvAsIs.labelString: as is
|
||||
*IvDrawStyle2.IvHiddenLine.labelString: hidden line
|
||||
*IvDrawStyle2.IvNoTexture.labelString: no texture
|
||||
*IvDrawStyle2.IvLowResolution.labelString: low resolution
|
||||
*IvDrawStyle2.IvWireFrame.labelString: wireframe
|
||||
*IvDrawStyle2.IvPoints.labelString: points
|
||||
*IvDrawStyle2.IvBoundingBoxNoDepth.labelString: bounding box ( no depth )
|
||||
*IvDrawStyle2.IvMoveSameAsStill.labelString: move same as still
|
||||
*IvDrawStyle2.IvMoveNoTexture.labelString: move no texture.
|
||||
*IvDrawStyle2.IvMoveLowRes.labelString: move low res
|
||||
*IvDrawStyle2.IvMoveWireFrame.labelString: move wireframe
|
||||
*IvDrawStyle2.IvMoveLowResWireFrameNoDepth.labelString: move low res wire frame ( no depth )
|
||||
*IvDrawStyle2.IvMovePoints.labelString: move points
|
||||
*IvDrawStyle2.IvMoveLowResPointsNoDepth.labelString: move low res points ( no depth )
|
||||
*IvDrawStyle2.IvMoveBoundingBoxNoDepth.labelString: move bounding box ( no depth )
|
||||
*IvDrawStyle2.IvSingleBuffer.labelString: single buffer
|
||||
*IvDrawStyle2.IvDoubleBuffer.labelString: Double buffer
|
||||
*IvDrawStyle2.IvInteractiveBuffer.labelString: interactive buffer
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvViewing.labelString: Viewing
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvDecoration.labelString: Decoration
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvHeadlight.labelString: Headlight
|
||||
!!------------------------------------------------
|
||||
*IvMenu.IvPreferences.labelString: Preferences ...
|
||||
|
||||
!!------------------------------------------------
|
||||
!! PREFERENCES
|
||||
!!------------------------------------------------
|
||||
*IvFormPreference1.IvSeekAnimationTime.labelString: Seek animation time
|
||||
*IvFormPreference1.IvSeconds.labelString: seconds
|
||||
*IvFormPreference1.IvSeekTo.labelString: Seek to:
|
||||
*IvFormPreference1.IvPoint.labelString: point
|
||||
*IvFormPreference1.IvObject.labelString: object
|
||||
*IvFormPreference2.IvSeekDistance.labelString: Seek distance:
|
||||
*IvFormPreference2.IvPercentage.labelString: percentage
|
||||
*IvFormPreference2.IvAbsolute.labelString: absolute
|
||||
*IvZoomForm.IvCameraZoom.labelString: Camera zoom
|
||||
*IvZoomForm.IvZoomSliderRangesFrom.labelString: Zoom slider ranges from:
|
||||
*IvZoomForm.IvTo.labelString: to:
|
||||
*IvZoomForm.IvZoomSlider.labelString: Zoom slider
|
||||
*IvZoomForm.IvZoomField.labelString: Zoom field
|
||||
*IvZoomForm.IvZoomFrom.labelString: Zoom from
|
||||
*IvZoomForm.IvZoomTo.labelString: Zoom to
|
||||
*IvFormPreference3.IvAutoClippingPlanes.labelString: Auto clipping planes
|
||||
*IvFormPreference4.IvStereoViewing.labelString: Stereo Viewing
|
||||
*IvFormPreference6.IvNearPlane.labelString: near plane
|
||||
*IvFormPreference6.IvFarPlane.labelString: far plane
|
||||
*IvStereoThumbForm.IvCameraRotation.labelString: Camera rotation
|
||||
|
||||
!!------------------------------------------------
|
||||
!! Preferences for Examiner Viewer
|
||||
!!------------------------------------------------
|
||||
*IvFormExaminer1.IvEnableSpinAnimation.labelString: Enable spin animation
|
||||
*IvFormExaminer1.IvShowPointOfRotationAxes.labelString: Show point of rotation axes
|
||||
*IvFormExaminer1.IvAxesSize.labelString: axes size
|
||||
*IvFormExaminer1.IvPixels.labelString: pixels
|
||||
!!------------------------------------------------
|
||||
!! Decorations for Examiner Viewer !!
|
||||
!!------------------------------------------------
|
||||
*IvExamTitle.labelString: Examiner Viewer
|
||||
*IvExamPrefTitle.labelString: Examiner Viewer Preference Sheet
|
||||
*IvExamPopupTitle.labelString: Examiner Viewer
|
||||
*IvExamIconTitle.labelString: Examiner Viewer
|
||||
*IvExamRotx.labelString: Rotx
|
||||
*IvExamRoty.labelString: Roty
|
||||
*IvExamZoom.labelString: Zoom
|
||||
*IvExamDolly.labelString: Dolly
|
||||
!!------------------------------------------------
|
||||
!! Decorations for Plane Viewer !!
|
||||
!!------------------------------------------------
|
||||
*IvPlaneTitle.labelString: Plane Viewer
|
||||
*IvPlanePrefTitle.labelString: Plane Viewer Preference Sheet
|
||||
*IvPlanePopupTitle.labelString: Plane Viewer
|
||||
*IvPlaneIconTitle.labelString: Plane Viewer
|
||||
*IvPlaneTransx.labelString: transX
|
||||
*IvPlaneTransy.labelString: transY
|
||||
*IvPlaneZoom.labelString: Zoom
|
||||
*IvPlaneDolly.labelString: Dolly
|
||||
!!------------------------------------------------
|
||||
!! Decorations for Fly Viewer !!
|
||||
!!------------------------------------------------
|
||||
*IvFlyTitle.labelString: Fly Viewer
|
||||
*IvFlyPrefTitle.labelString: Fly Viewer Preference Sheet
|
||||
*IvFlyPopupTitle.labelString: Fly Viewer
|
||||
*IvFlyIconTitle.labelString: Fly Viewer
|
||||
!! Same for Walk Viewer !!
|
||||
*IvFlyWalkRotate.labelString: Rotate
|
||||
!! Same for Walk Viewer !!
|
||||
*IvFlyWalkTilt.labelString: Tilt
|
||||
!! Same for Walk Viewer !!
|
||||
*IvFlyWalkDolly.labelString: Dolly
|
||||
!!------------------------------------------------
|
||||
!! Preferences for Fly Viewer !!
|
||||
!!------------------------------------------------
|
||||
*FlyPreference.FlyingSpeed.labelString: Flying speed:
|
||||
*FlyPreference.Increase.labelString: increase
|
||||
*FlyPreference.Decrease.labelString: decrease
|
||||
!!------------------------------------------------
|
||||
!! Decorations for Walk Viewer !!
|
||||
!!------------------------------------------------
|
||||
*IvWalkTitle.labelString: Walk Viewer
|
||||
*IvWalkPrefTitle.labelString: Walk Viewer Preference Sheet
|
||||
*IvWalkPopupTitle.labelString: Walk Viewer
|
||||
*IvWalkIconTitle.labelString: Walk Viewer
|
||||
*IvLeftTrimForm.IvH.labelString: H
|
||||
!!------------------------------------------------
|
||||
!! Preferences for Walk Viewer !!
|
||||
!!------------------------------------------------
|
||||
*IvFormPreference5.IvViewerSpeed.labelString: Viewer speed
|
||||
*IvFormPreference5.IvIncrease.labelString: increase
|
||||
*IvFormPreference5.IvDecrease.labelString: decrease
|
||||
!!------------------------------------------------
|
||||
!! EDITORS
|
||||
!!------------------------------------------------
|
||||
!! Drectional Light Editor !!
|
||||
!!------------------------------------------------
|
||||
*IvDirectLightTitle.labelString: Dir Light Editor
|
||||
*IvDirectLightIconTitle.labelString: Dir Light Ed
|
||||
*IvDirectLightInten.labelString: Inten
|
||||
*IvDirectLightColorEditor.labelString: Directional Light Color
|
||||
*IvDLMenuBar.IvEdit.labelString: Edit
|
||||
*IvDLMenuBar*IvControlPullDown*IvColorEditor.labelString: Color Editor
|
||||
*IvDLMenuBar*IvControlPullDown*IvCopy.labelString: Copy
|
||||
*IvDLMenuBar*IvControlPullDown*IvPaste.labelString: Paste
|
||||
*IvDLMenuBar*IvControlPullDown*IvHelp.labelString: Help
|
||||
!!------------------------------------------------
|
||||
!! Color Editor !!
|
||||
!!------------------------------------------------
|
||||
*IvColorEditorTitle.labelString: Color Editor
|
||||
*IvColorEditorIconTitle.labelString: Color Editor
|
||||
*IvColorEditorR.labelString: R
|
||||
*IvColorEditorG.labelString: G
|
||||
*IvColorEditorB.labelString: B
|
||||
*IvColorEditorH.labelString: H
|
||||
*IvColorEditorS.labelString: S
|
||||
*IvColorEditorV.labelString: V
|
||||
*IvColorEditorRight.labelString: Right
|
||||
*IvColorEditorSwitch.labelString: Switch
|
||||
*IvColorEditorCont.labelString: Continuous
|
||||
*IvColorEditorManu.labelString: Manual
|
||||
*IvColorEditorWysi.labelString: WYSIWYG
|
||||
*IvColorEditorCopy.labelString: Copy
|
||||
*IvColorEditorPaste.labelString: Paste
|
||||
*IvColorEditorHelp.labelString: Help
|
||||
*IvColorEditorNone.labelString: None
|
||||
*IvColorEditorValue.labelString: Value
|
||||
*IvColorEditorRGB.labelString: RGB
|
||||
*IvColorEditorHSV.labelString: HSV
|
||||
*IvColorEditorRGBV.labelString: RGB V
|
||||
*IvColorEditorRGBHSV.labelString: RGB HSV
|
||||
|
||||
*IvCEMenuBar.IvEdit.labelString: Edit
|
||||
*IvCEMenuBar.IvSliders.labelString: Sliders
|
||||
*IvButtonsForm.IvAccept.labelString: Accept
|
||||
!!------------------------------------------------
|
||||
!! Material Editor !!
|
||||
!!------------------------------------------------
|
||||
*IvMaterialEditorTitle.labelString: Material Editor
|
||||
*IvMaterialEditorIconTitle.labelString: Mat Editor
|
||||
*IvMaterialAmbientTitle.labelString: Material Ambient Color
|
||||
*IvMaterialDiffuseTitle.labelString: Material Diffuse Color
|
||||
*IvMaterialSpecularTitle.labelString: Material Specular Color
|
||||
*IvMaterialEmissiveTitle.labelString: -Material Emissive Color
|
||||
*IvMaterialEditorMaterial.labelString: Material /
|
||||
*IvMaterialEditorAmb.labelString: Amb /
|
||||
*IvMaterialEditorDiff.labelString: Diff /
|
||||
*IvMaterialEditorSpec.labelString: Spec /
|
||||
*IvMaterialEditorEmis.labelString: Emis /
|
||||
*IvMaterialEditorColor.labelString: Color
|
||||
*IvMEMenuBar.IvEdit.labelString: Edit
|
||||
*IvMEMenuBar*IvEditPullDown.IvMaterialList.labelString: Material List
|
||||
*IvMEMenuBar*IvEditPullDown.IvContinuous.labelString: Continuous
|
||||
*IvMEMenuBar*IvEditPullDown.IvManual.labelString: Manual
|
||||
*IvMEMenuBar*IvEditPullDown.IvCopy.labelString: Copy
|
||||
*IvMEMenuBar*IvEditPullDown.IvPaste.labelString: Paste
|
||||
*IvMEMenuBar*IvEditPullDown.IvHelp.labelString: Help
|
||||
*IvControls.IvEditColor.labelString: Edit Color
|
||||
*IvsliderForm.IvtextForm.IvAmb.labelString: Amb:
|
||||
*IvsliderForm.IvtextForm.IvDiff.labelString: Diff
|
||||
*IvsliderForm.IvtextForm.IvSpec.labelString: Spec
|
||||
*IvsliderForm.IvtextForm.IvEmis.labelString: Emis
|
||||
*IvsliderForm.IvtextForm.IvShininess.labelString: Shininess
|
||||
*IvsliderForm.IvtextForm.IvTransp.labelString: Transp:
|
||||
*IvMETop.IvAccept.labelString: Accept
|
||||
!!------------------------------------------------
|
||||
!! Material List !!
|
||||
!!------------------------------------------------
|
||||
*IvMaterialListTitle.labelString: Material List
|
||||
*IvMaterialListeIconTitle.labelString: Mat List
|
||||
*IvMLMenuBar*IvPalettes.labelString: Palettes
|
||||
!!------------------------------------------------
|
||||
!! Print Dialog
|
||||
!!------------------------------------------------
|
||||
*IvPrintDialTitle.labelString: Print Dialog
|
||||
*IvPrintDialIconTitle.labelString: -rint Dialog
|
||||
*IvPrintDialPrinter.labelString: Printer:
|
||||
*IvPrintDialPageOut.labelString: Page Output:
|
||||
*IvPrintDialToPrinter.labelString: To Printer
|
||||
*IvPrintDialToFile.labelString: To File
|
||||
*IvPrintDialQuit.labelString: Quit
|
||||
*IvPrintDialPrint.labelString: Print
|
||||
*IvPrintDialMessage.labelString: Message:
|
||||
*IvPrintDialFileFormat.labelString: File Format:
|
||||
*IvPrintDialPostScript.labelString: PostScript
|
||||
*IvPrintDialRGB.labelString: RGB
|
||||
*IvPrintDialPrintQuality.labelString: Print Quality:
|
||||
*IvPrintDialHigh.labelString: High
|
||||
*IvPrintDialDraft.labelString: Draft
|
||||
*IvPrintDialPageFormat.labelString: Page Format
|
||||
*IvPrintDialPortrait.labelString: Portrait
|
||||
*IvPrintDialLandscape.labelString: Landscape
|
||||
*IvPrintDialPrintSize.labelString: Print Size (inches):
|
||||
*IvPrintDialFileName.labelString: File Name:
|
||||
*IvPrintDialResolution.labelString: Resolution
|
||||
*IvPrintDialBy.labelString: by
|
||||
*IvPrintDialDpi.labelString: DPI:
|
||||
*IvPrintDialMess1.labelString: Printing in progress...
|
||||
*IvPrintDialMess2.labelString: ERROR: Empty database.
|
||||
*IvPrintDialMess3.labelString: ERROR: Exceeds
|
||||
*IvPrintDialMess4.labelString: ERROR: Could not execute print.
|
||||
*IvPrintDialMess5.labelString: ERROR: Could not execute print.
|
||||
*IvPrintDialMess6.labelString: ERROR: No printer.
|
||||
*IvPrintDialMess7.labelString: ERROR: Couldn't open
|
||||
*IvPrintDialMess8.labelString: ERROR: No file name.
|
||||
*IvPrintDialMess9.labelString: ERROR: Could not open file.
|
||||
*IvPrintDialMess10.labelString: ERROR: Could not get data.
|
||||
*IvPrintDialMess11.labelString: ERROR: Could not get data.
|
||||
*IvPrintDialMess12.labelString: Printing completed.
|
||||
|
||||
!!------------------------------------------------
|
||||
!! Xt Component ( For Light and Material Sliders Set )
|
||||
!!------------------------------------------------
|
||||
*IvXtComponentTitle.labelString: Xt Component
|
||||
*IvTGSXtComponentTitle.labelString: TGS: Xt Component
|
||||
!!------------------------------------------------
|
||||
!! For All Sliders
|
||||
!!------------------------------------------------
|
||||
*IvSlidersMin.labelString: min
|
||||
*IvSlidersMax.labelString: max
|
||||
*IvSlidersStyle.labelString: style
|
||||
!!------------------------------------------------
|
||||
!! Light Slider Set
|
||||
!!------------------------------------------------
|
||||
*IvLightSliderColor.labelString: COLOR
|
||||
*IvLightSliderRed.labelString: Red
|
||||
*IvLightSliderGreen.labelString: Green
|
||||
*IvLightSliderBlue.labelString: Blue
|
||||
*IvLightSliderIntensity1.labelString: INTENSITY
|
||||
*IvLightSliderIntensity2.labelString: Intensity
|
||||
!!------------------------------------------------
|
||||
!! Material Slider Set
|
||||
!!------------------------------------------------
|
||||
*IvMaterialSliderAmbient.labelString: AMBIENT
|
||||
*IvMaterialSliderAmbientRed.labelString: Ambient Red
|
||||
*IvMaterialSliderAmbientGreen.labelString: Ambient Green
|
||||
*IvMaterialSliderAmbientBleu.labelString: Ambient Blue
|
||||
*IvMaterialSliderDiffuse.labelString: DIFFUSE
|
||||
*IvMaterialSliderDiffuseRed.labelString: Diffuse Red
|
||||
*IvMaterialSliderDiffuseGreen.labelString: Diffuse Green
|
||||
*IvMaterialSliderDiffuseBleu.labelString: Diffuse Blue
|
||||
*IvMaterialSliderSpecular.labelString: SPECULAR
|
||||
*IvMaterialSliderSpecularRed.labelString: Specular Red
|
||||
*IvMaterialSliderSpecularGreen.labelString: Specular Green
|
||||
*IvMaterialSliderSpecularBleu.labelString: Specular Blue
|
||||
*IvMaterialSliderEmissive.labelString: EMISSIVE
|
||||
*IvMaterialSliderEmissiveRed.labelString: Emissive Red
|
||||
*IvMaterialSliderEmissiveGreen.labelString: Emissive Green
|
||||
*IvMaterialSliderEmissiveBlue.labelString: Emissive Blue
|
||||
*IvMaterialSliderShininess.labelString: SHININESS
|
||||
*IvMaterialSliderShininessShininess.labelString: shininess
|
||||
*IvMaterialSliderTransparency.labelString: TRANSPARENCY
|
||||
*IvMaterialSliderTransparencyTransparency.labelString: transparency
|
||||
!!------------------------------------------------
|
||||
!! Transform Slider Set
|
||||
!!------------------------------------------------
|
||||
*IvTransformSliderTrans.labelString: TRANSLATIONS
|
||||
*IvTransformSliderTransX.labelString: X Translation
|
||||
*IvTransformSliderTransY.labelString: Y Translation
|
||||
*IvTransformSliderTransZ.labelString: Z Translation
|
||||
*IvTransformSliderScale.labelString: SCALES
|
||||
*IvTransformSliderScaleX.labelString: X Scale
|
||||
*IvTransformSliderScaleY.labelString: Y Scale
|
||||
*IvTransformSliderScaleZ.labelString: Z Scale
|
||||
*IvTransformSliderRotate.labelString: ROTATIONS
|
||||
*IvTransformSliderRotateX.labelString: X Rotate
|
||||
*IvTransformSliderRotateY.labelString: Y Rotate
|
||||
*IvTransformSliderRotateZ.labelString: Z Rotate
|
||||
*IvTransformSliderScaleOrient.labelString: SCALE ORIENTATION
|
||||
*IvTransformSliderScaleOrientX.labelString: X Rotate
|
||||
*IvTransformSliderScaleOrientY.labelString: Y Rotate
|
||||
*IvTransformSliderScaleOrientZ.labelString: Z Rotate
|
||||
*IvTransformSliderCenter.labelString: CENTER
|
||||
*IvTransformSliderCenterX.labelString: X Center
|
||||
*IvTransformSliderCenterY.labelString: Y Center
|
||||
*IvTransformSliderCenterZ.labelString: Z Center
|
||||
*IvTransformSliderTitle.labelString: Transform Editor
|
||||
*IvTransformSliderIconTitle.labelString: Xf Editor
|
||||
|
||||
|
||||
!!------------------- THE END --------------------
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# This file permits to customize, with commands,
|
||||
# the menu bar of the G4UIXm, G4UIWin32 sessions.
|
||||
# It has no effect with G4UIterminal.
|
||||
#
|
||||
# File :
|
||||
/gui/addMenu file File
|
||||
/gui/addButton file Continue continue
|
||||
/gui/addButton file Exit "exit"
|
||||
#
|
||||
# Run menu :
|
||||
/gui/addMenu run Run
|
||||
/gui/addButton run run1 "/control/execute run1.mac"
|
||||
/gui/addButton run run2 "/control/execute run2.mac"
|
||||
#
|
||||
# Vis menu :
|
||||
/gui/addMenu vis Vis
|
||||
/gui/addButton vis Vis0 "/control/execute exN03Vis0.mac"
|
||||
/gui/addButton vis Vis1 "/control/execute exN03Vis1.mac"
|
||||
/gui/addButton vis Vis2 "/control/execute exN03Vis2.mac"
|
||||
/gui/addButton vis Vis3 "/control/execute exN03Vis3.mac"
|
||||
/gui/addButton vis Vis4 "/control/execute exN03Vis4.mac"
|
||||
/gui/addButton vis Vis5 "/control/execute exN03Vis5.mac"
|
||||
/gui/addButton vis Vis6 "/control/execute exN03Vis6.mac"
|
||||
#
|
||||
# To limit the output flow in the "dump" widget :
|
||||
/event/printModulo 100
|
||||
@@ -0,0 +1,20 @@
|
||||
# $Id: README,v 1.3 2002/06/03 17:34:45 gcosmo Exp $
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
GDML Processor for Geant4
|
||||
-------------------------
|
||||
|
||||
This release is packaged as a G4 extended example including
|
||||
the latest stable version of Xerces-C 1.7.0 XML parser for Linux, see [1].
|
||||
The functionality is as described at the CHEP'01 conference, see [2].
|
||||
|
||||
For more technical details see Release.notes.
|
||||
|
||||
Radovan Chytracek (Radovan.Chytracek@cern.ch)
|
||||
|
||||
References:
|
||||
-----------
|
||||
|
||||
1. http://xml.apache.org
|
||||
2. http://cern.ch/gdml/chep01
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
# $Id: Release.notes,v 1.2 2002/05/31 17:44:42 radoone Exp $
|
||||
GDML Processor for Geant4 RC 1.0 RELEASE NOTES
|
||||
----------------------------------------------
|
||||
|
||||
Platforms
|
||||
---------
|
||||
|
||||
Supported platforms(not final):
|
||||
CERN Linux RH 6.1.1 and RH 7.2.1, compiler GCC 2.95.2, G4SYSTEM: Linux-g++
|
||||
CERN Linux RH 6.1.1, compiler EGCS 1.1.2 (2.91.66), G4SYSTEM: Linux-egcs
|
||||
CERN SUN Solaris, compiler SUN WS 6.1 CC 5.2, G4SYSTEM: SUN-CC
|
||||
|
||||
Additional Requirements
|
||||
-----------------------
|
||||
|
||||
Apache Xerces-C 1.6.0 or better (built with version 1.7.0.)
|
||||
|
||||
Supported GDML Features
|
||||
-----------------------
|
||||
|
||||
GDML Schema 1.0 compatible features include:
|
||||
|
||||
a) Expressions support
|
||||
- constants,physics constants, translations and rotations, numerical expressions
|
||||
- including CLHEP units
|
||||
|
||||
b) Full materials support
|
||||
- isotopes, elements, compounds anf mixtures
|
||||
|
||||
c) CSG solids
|
||||
- standard CSG solids
|
||||
- boolean solids, e.g. union, subtraction, intersection
|
||||
|
||||
d) geometrical structure
|
||||
- volume, assembly, placements (single, so far)
|
||||
|
||||
e) geometry setups
|
||||
- more then one setup is possible
|
||||
- selection based on name-version pair
|
||||
|
||||
Known issues and problems
|
||||
-------------------------
|
||||
|
||||
1.
|
||||
> Current implementation works only when build with shared libraries enabled.
|
||||
> It's understood issue of bootstraping of the components in statically linked
|
||||
> executables. It's being worked on it.
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> THIS HAS BEEN SOLVED!
|
||||
|
||||
2.
|
||||
> Only GDML DTD is here due to lack of time, GDML Schema is work in progress,
|
||||
> hopefully released soon.
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> THIS HAS BEEN SOLVED!
|
||||
|
||||
3.
|
||||
> The Saxana components' interfaces are a bit messy, this issue is being addressed already in the new
|
||||
> development tree together with support for XML Schema.
|
||||
Still an issue. The Saxana engine will be rewritten with generative version of XML Engine.
|
||||
Work on it is in progress.
|
||||
|
||||
4. When linking for Linux-g++ G4SYSTEM on RH 7.2.1 against Xerces-C libraries build on RH 6.1.1 with
|
||||
compiler GCC 2.95.2 the linker warning can be so far ignored as the resulting binary can run.
|
||||
We will look at this issue. Looks like G4SYSTEM needs to be again extended for Linux systems.
|
||||
|
||||
|
||||
Any feedback is welcome
|
||||
|
||||
mailto:Radovan.Chytracek@cern.ch
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# $Id: GNUmakefile,v 1.1.1.1 2002/05/31 00:34:42 radoone Exp $
|
||||
# --------------------------------------------------------------
|
||||
# Makes libraries for each GDML subdomain:
|
||||
# saxana schema management processes subscribers.
|
||||
# GNUmakefile for GDML libraries. Radovan Chytracek, 30/05/2002.
|
||||
|
||||
SUBDIRS = saxana schema management processes subscribers
|
||||
|
||||
all:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE)); done
|
||||
|
||||
clean:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) clean); done
|
||||
|
||||
clean_libs:
|
||||
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) clean_libs); done
|
||||
@@ -0,0 +1,37 @@
|
||||
# $Id: libgdml.gmk,v 1.1.1.1 2002/05/31 00:34:42 radoone Exp $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile settings for GDML libraries. Radovan Chytracek, 30/05/2002.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
GDMLINSTALL := $(G4INSTALL)/examples/extended/gdml
|
||||
GDMLLIBROOT := $(GDMLINSTALL)/libgdml
|
||||
|
||||
CPPFLAGS += \
|
||||
-I$(GDMLINSTALL)/libgdml/saxana/include \
|
||||
-I$(GDMLINSTALL)/libgdml/schema/include \
|
||||
-I$(GDMLINSTALL)/libgdml/management/include \
|
||||
-I$(GDMLINSTALL)/libgdml/processes/include \
|
||||
-I$(GDMLINSTALL)/libgdml/subscribers/include \
|
||||
-I$(XERCESCROOT)/include
|
||||
|
||||
EXTRALIBS += \
|
||||
-lGDMLsaxana \
|
||||
-lGDMLmanagement \
|
||||
-lGDMLschema \
|
||||
-lGDMLprocesses \
|
||||
-lGDMLsubscribers \
|
||||
-L $(XERCESCROOT)/lib -lxerces-c
|
||||
|
||||
EXTRALIBSSOURCEDIRS += \
|
||||
$(GDMLLIBROOT)/saxana \
|
||||
$(GDMLLIBROOT)/schema \
|
||||
$(GDMLLIBROOT)/processes \
|
||||
$(GDMLLIBROOT)/management \
|
||||
$(GDMLLIBROOT)/subscribers
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
@@ -0,0 +1,15 @@
|
||||
# $Id: GNUmakefile,v 1.1.1.1 2002/05/31 00:34:42 radoone Exp $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile for GDML management library. Radovan Chytracek, 30/05/2002.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
name := GDMLmanagement
|
||||
|
||||
CPPFLAGS += \
|
||||
-I$(G4INSTALL)/source/global/management/include \
|
||||
-I$(G4INSTALL)/source/global/HEPGeometry/include \
|
||||
-I$(G4INSTALL)/source/geometry/management/include \
|
||||
-I$(G4INSTALL)/source/geometry/solids/CSG/include \
|
||||
-I$(G4INSTALL)/source/geometry/solids/Boolean/include
|
||||
|
||||
include ../libgdml.gmk
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLDefineTable.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef GDML_DEFINE_TABLE
|
||||
#define GDML_DEFINE_TABLE 1
|
||||
|
||||
// #include "GDMLConstant.hh"
|
||||
// #include "GDMLPhysicalConstant.hh"
|
||||
// #include "GDMLExpression.hh"
|
||||
// #include "GDMLCartesianVectorType.hh"
|
||||
|
||||
#include "define.hh"
|
||||
|
||||
#include <map>
|
||||
|
||||
// typedef std::map< std::string, GDMLConstant > ConstantsTable;
|
||||
// typedef std::map< std::string, GDMLPhysicalConstant > PhysicalConstantsTable;
|
||||
// typedef std::map< std::string, GDMLExpression > ExpressionsTable;
|
||||
// typedef std::map< std::string, GDMLPosition > PositionsTable;
|
||||
// typedef std::map< std::string, GDMLRotation > RotationsTable;
|
||||
typedef std::map< std::string, define::constant > ConstantsTable;
|
||||
typedef std::map< std::string, define::quantity > PhysicalConstantsTable;
|
||||
typedef std::map< std::string, define::expression > ExpressionsTable;
|
||||
typedef std::map< std::string, define::position > PositionsTable;
|
||||
typedef std::map< std::string, define::rotation > RotationsTable;
|
||||
|
||||
#endif // GDML_DEFINE_TABLE
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLExpressionEvaluator.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef GDML_EXPRESSION_EVALUATOR_H
|
||||
#define GDML_EXPRESSION_EVALUATOR_H 1
|
||||
|
||||
#include "CLHEP/Evaluator/Evaluator.h"
|
||||
|
||||
#include "StatusCode.hh"
|
||||
#include "GDMLDefineTable.hh"
|
||||
|
||||
#include "string"
|
||||
|
||||
class GDMLExpressionEvaluator
|
||||
{
|
||||
public:
|
||||
GDMLExpressionEvaluator();
|
||||
~GDMLExpressionEvaluator();
|
||||
|
||||
// StatusCode RegisterConstant( const GDMLConstant* const c );
|
||||
// StatusCode RegisterPhysConstant( const GDMLPhysicalConstant* const physc );
|
||||
// StatusCode RegisterExpression( const GDMLExpression* e );
|
||||
StatusCode RegisterConstant( const define::constant* const c );
|
||||
StatusCode RegisterPhysConstant( const define::quantity* const physc );
|
||||
StatusCode RegisterExpression( const define::expression* e );
|
||||
double Eval( const std::string& expr );
|
||||
double Eval( const char* expr );
|
||||
|
||||
private:
|
||||
HepTool::Evaluator fCalc;
|
||||
ConstantsTable fCTable;
|
||||
PhysicalConstantsTable fPCTable;
|
||||
};
|
||||
|
||||
#endif // GDML_EXPRESSION_EVALUATOR_H
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLLinkResolver.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef GDML_LINK_RESOLVER_H
|
||||
#define GDML_LINK_RESOLVER_H 1
|
||||
|
||||
#include "SAXEventGun.hh"
|
||||
|
||||
class GDMLLinkResolver : virtual public SAXEventGun
|
||||
{
|
||||
public:
|
||||
StatusCode Run();
|
||||
|
||||
public:
|
||||
virtual void characters( const XMLCh* const chars, const unsigned int length );
|
||||
// Receive notification of the #PCDATA characters in element content.
|
||||
|
||||
virtual void endDocument();
|
||||
// Receive notification of the end of the document.
|
||||
|
||||
virtual void endElement(const XMLCh* const name);
|
||||
// Receive notification of the end of an element.
|
||||
|
||||
virtual void ignorableWhitespace( const XMLCh* const chars, const unsigned int length );
|
||||
// Receive notification of ignorable whitespace in element content.
|
||||
|
||||
virtual void startDocument();
|
||||
// Receive notification of the beginning of the document.
|
||||
|
||||
virtual void startElement( const XMLCh* const name, AttributeList& attributes );
|
||||
// Receive notification of the start of an element.
|
||||
|
||||
GDMLLinkResolver( SAXProcessor* target );
|
||||
~GDMLLinkResolver();
|
||||
|
||||
bool Done()
|
||||
{
|
||||
return fIsDone;
|
||||
}
|
||||
|
||||
private:
|
||||
bool fFound;
|
||||
bool fIsDone;
|
||||
};
|
||||
|
||||
#endif // GDML_LINK_RESOLVER_H
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLProcessor.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef GDML_PROCESSOR_H
|
||||
#define GDML_PROCESSOR_H 1
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
#include "GDMLExpressionEvaluator.hh"
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
#include "G4AssemblyVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
// Added here in order to resolve properly link dependecies if G4 build system
|
||||
#include "G4BooleanSolid.hh"
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
class GDMLProcessor
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::string,G4ThreeVector*> Positions;
|
||||
typedef std::map<std::string,G4RotationMatrix*> Rotations;
|
||||
typedef std::map<std::string,G4VSolid*> Solids;
|
||||
typedef std::map<std::string,G4LogicalVolume*> LogicalVolumes;
|
||||
typedef std::map<std::string,G4AssemblyVolume*> AssemblyVolumes;
|
||||
typedef std::map<std::string,G4VPhysicalVolume*> PhysicalVolumes;
|
||||
|
||||
static GDMLProcessor* GetInstance();
|
||||
|
||||
GDMLExpressionEvaluator* GetEvaluator();
|
||||
|
||||
~GDMLProcessor();
|
||||
|
||||
void AddPosition( const std::string& name, G4ThreeVector* p );
|
||||
void AddPosition( const char* name, G4ThreeVector* p );
|
||||
|
||||
void AddRotation( const std::string& name, G4RotationMatrix* p );
|
||||
void AddRotation( const char* name, G4RotationMatrix* p );
|
||||
|
||||
void AddSolid( const std::string& name, G4VSolid* p );
|
||||
void AddSolid( const char* name, G4VSolid* p );
|
||||
|
||||
void AddLogicalVolume( const std::string& name, G4LogicalVolume* p );
|
||||
void AddLogicalVolume( const char* name, G4LogicalVolume* p );
|
||||
|
||||
void AddAssemblyVolume( const std::string& name, G4AssemblyVolume* p );
|
||||
void AddAssemblyVolume( const char* name, G4AssemblyVolume* p );
|
||||
|
||||
void AddPhysicalVolume( const std::string& name, G4VPhysicalVolume* p );
|
||||
void AddPhysicalVolume( const char* name, G4VPhysicalVolume* p );
|
||||
|
||||
const G4ThreeVector* GetPosition( const std::string& name );
|
||||
const G4ThreeVector* GetPosition( const char* name );
|
||||
|
||||
const G4RotationMatrix* GetRotation( const std::string& name );
|
||||
const G4RotationMatrix* GetRotation( const char* name );
|
||||
|
||||
const G4VSolid* GetSolid( const std::string& name );
|
||||
const G4VSolid* GetSolid( const char* name );
|
||||
|
||||
const G4LogicalVolume* GetLogicalVolume( const std::string& name );
|
||||
const G4LogicalVolume* GetLogicalVolume( const char* name );
|
||||
|
||||
const G4AssemblyVolume* GetAssemblyVolume( const std::string& name );
|
||||
const G4AssemblyVolume* GetAssemblyVolume( const char* name );
|
||||
|
||||
const G4VPhysicalVolume* GetPhysicalVolume( const std::string& name );
|
||||
const G4VPhysicalVolume* GetPhysicalVolume( const char* name );
|
||||
|
||||
const G4VPhysicalVolume* GetWorldVolume()
|
||||
{
|
||||
return fWorldVolume;
|
||||
}
|
||||
|
||||
void SetWorldVolume( G4VPhysicalVolume* newWorldVolume )
|
||||
{
|
||||
fWorldVolume = newWorldVolume;
|
||||
}
|
||||
|
||||
protected:
|
||||
GDMLProcessor();
|
||||
|
||||
private:
|
||||
GDMLExpressionEvaluator* fCalc;
|
||||
GDMLProcessor::Positions fPTable;
|
||||
GDMLProcessor::Rotations fRTable;
|
||||
GDMLProcessor::Solids fSolids;
|
||||
GDMLProcessor::LogicalVolumes fLVolumes;
|
||||
GDMLProcessor::AssemblyVolumes fAVolumes;
|
||||
GDMLProcessor::PhysicalVolumes fPVolumes;
|
||||
G4VPhysicalVolume* fWorldVolume;
|
||||
};
|
||||
|
||||
#endif // GDML_PROCESSOR_H
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLExpressionEvaluator.cc,v 1.3 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
#include "GDMLExpressionEvaluator.hh"
|
||||
#include "CLHEP/Units/PhysicalConstants.h"
|
||||
|
||||
GDMLExpressionEvaluator::GDMLExpressionEvaluator()
|
||||
{
|
||||
fCalc.clear();
|
||||
fCalc.setStdMath(); // set standard constants and functions
|
||||
//fCalc.setSystemOfUnits(); // set SI units
|
||||
// Set Geant4 system of units
|
||||
fCalc.setSystemOfUnits(1.e+3, 1./1.60217733e-25, 1.e+9, 1./1.60217733e-10,1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
GDMLExpressionEvaluator::~GDMLExpressionEvaluator()
|
||||
{
|
||||
fCTable.clear();
|
||||
fPCTable.clear();
|
||||
fCalc.clear();
|
||||
}
|
||||
|
||||
//StatusCode GDMLExpressionEvaluator::RegisterConstant( const GDMLConstant* const c )
|
||||
StatusCode GDMLExpressionEvaluator::RegisterConstant( const define::constant* const c )
|
||||
{
|
||||
double value = fCalc.evaluate( c->get_value().c_str() );
|
||||
|
||||
if( fCalc.status() != HepTool::Evaluator::OK )
|
||||
{
|
||||
std::cerr << "Expression evaluator:: Error registering constant " << c->get_name() << std::endl;
|
||||
fCalc.print_error();
|
||||
std::cout << std::endl;
|
||||
return StatusCode::eError;
|
||||
}
|
||||
|
||||
std::cout << "Expression evaluator:: Registering constant "
|
||||
<< c->get_name() << ": " << value << std::endl;
|
||||
|
||||
//fCalc.setVariable( c->get_name().c_str(), c->get_value().c_str() );
|
||||
fCalc.setVariable( c->get_name().c_str(), value );
|
||||
return StatusCode::eOk;
|
||||
}
|
||||
|
||||
//StatusCode GDMLExpressionEvaluator::RegisterPhysConstant( const GDMLPhysicalConstant* const physc )
|
||||
StatusCode GDMLExpressionEvaluator::RegisterPhysConstant( const define::quantity* const physc )
|
||||
{
|
||||
std::string expr = physc->get_value();
|
||||
expr += "*(";
|
||||
expr += physc->get_unit();
|
||||
expr += ")";
|
||||
|
||||
//std::cout << "Expression evaluator:: evaluating string: " << expr << std::endl;
|
||||
|
||||
double value = fCalc.evaluate( expr.c_str() );
|
||||
double unit_value = fCalc.evaluate( physc->get_unit().c_str() );
|
||||
|
||||
if( fCalc.status() != HepTool::Evaluator::OK )
|
||||
{
|
||||
std::cerr << "Expression evaluator:: Error registering quantity "
|
||||
<< physc->get_name() << std::endl;
|
||||
fCalc.print_error();
|
||||
std::cout << std::endl;
|
||||
return StatusCode::eError;
|
||||
}
|
||||
|
||||
std::cout << "Expression evaluator:: Registering quantity "
|
||||
<< physc->get_name() << ": " << (value/unit_value) << physc->get_unit() << std::endl;
|
||||
|
||||
//fCalc.setVariable( physc->get_name().c_str(), expr.c_str() );
|
||||
fCalc.setVariable( physc->get_name().c_str(), value );
|
||||
return StatusCode::eOk;
|
||||
}
|
||||
|
||||
//StatusCode GDMLExpressionEvaluator::RegisterExpression( const GDMLExpression* e )
|
||||
StatusCode GDMLExpressionEvaluator::RegisterExpression( const define::expression* e )
|
||||
{
|
||||
std::string expr = "(";
|
||||
expr += e->get_text();
|
||||
expr += ")";
|
||||
double value = fCalc.evaluate( expr.c_str() );
|
||||
|
||||
if( fCalc.status() != HepTool::Evaluator::OK )
|
||||
{
|
||||
std::cerr << "Expression evaluator:: Error registering expression " << e->get_name() << std::endl;
|
||||
fCalc.print_error();
|
||||
std::cout << std::endl;
|
||||
return StatusCode::eError;
|
||||
}
|
||||
|
||||
std::cout << "Expression evaluator:: Registering expression "
|
||||
<< e->get_name() << ": " << value << std::endl;
|
||||
|
||||
//fCalc.setVariable( e->get_name().c_str(), e->get_text().c_str() );
|
||||
fCalc.setVariable( e->get_name().c_str(), value );
|
||||
return StatusCode::eOk;
|
||||
}
|
||||
|
||||
double GDMLExpressionEvaluator::Eval( const std::string& expr )
|
||||
{
|
||||
return Eval( expr.c_str() );
|
||||
}
|
||||
|
||||
double GDMLExpressionEvaluator::Eval( const char* expr )
|
||||
{
|
||||
double result = fCalc.evaluate( expr );
|
||||
if( fCalc.status() != HepTool::Evaluator::OK )
|
||||
{
|
||||
std::cerr << expr << std::endl;
|
||||
//std::cerr << "------";
|
||||
for (int i=0; i<fCalc.error_position(); i++)
|
||||
{
|
||||
std::cerr << "-";
|
||||
}
|
||||
std::cerr << "^\a" << std::endl;
|
||||
fCalc.print_error();
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLLinkResolver.cc,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
#include <xercesc/framework/XMLPScanToken.hpp>
|
||||
#include <xercesc/parsers/SAXParser.hpp>
|
||||
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
#include <xercesc/sax/AttributeList.hpp>
|
||||
#include <xercesc/sax/SAXParseException.hpp>
|
||||
|
||||
#include "GDMLLinkResolver.hh"
|
||||
|
||||
#include "SAXProcessor.hh"
|
||||
#include "SAXEvents.hh"
|
||||
#include "ASCIIAttributeList.hh"
|
||||
#include "ProcessingConfigurator.hh"
|
||||
|
||||
|
||||
//#include <strstream>
|
||||
|
||||
StatusCode GDMLLinkResolver::Run()
|
||||
{
|
||||
StatusCode sc;
|
||||
|
||||
fParser = new SAXParser();
|
||||
|
||||
fParser->setDocumentHandler( this );
|
||||
fParser->setErrorHandler( this );
|
||||
fParser->setValidationScheme( SAXParser::Val_Auto );
|
||||
|
||||
const std::string& uri = fConfig->URI();
|
||||
const char* xmlfile = uri.c_str();
|
||||
|
||||
try
|
||||
{
|
||||
// Create a progressive scan token
|
||||
XMLPScanToken token;
|
||||
|
||||
if (!fParser->parseFirst(xmlfile, token))
|
||||
{
|
||||
std::cerr << "scanFirst() failed\n" << std::endl;
|
||||
sc = StatusCode::eError;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// We started ok, so lets call scanNext() until we find what we want
|
||||
// or hit the end.
|
||||
//
|
||||
bool gotMore = true;
|
||||
while (gotMore && !Done())
|
||||
gotMore = fParser->parseNext(token);
|
||||
|
||||
//
|
||||
// Reset the parser. In this simple progrma, since we just exit
|
||||
// now, its not technically required. But, in programs which
|
||||
// would remain open, you should reset after a progressive parse
|
||||
// in case you broke out before the end of the file. This insures
|
||||
// that all opened files, sockets, etc... are closed.
|
||||
//
|
||||
fParser->parseReset(token);
|
||||
}
|
||||
}
|
||||
catch (const XMLException& toCatch)
|
||||
{
|
||||
const char* msg = XMLString::transcode( toCatch.getMessage() );
|
||||
std::cerr << "\nAn error occured: '" << xmlfile << "'\n"
|
||||
<< "Exception message is: \n"
|
||||
<< msg
|
||||
<< "\n" << endl;
|
||||
if( msg != 0 )
|
||||
{
|
||||
delete [] msg;
|
||||
}
|
||||
sc = StatusCode::eError;
|
||||
}
|
||||
|
||||
return sc;
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::characters( const XMLCh* const chars
|
||||
, const unsigned int length )
|
||||
// Receive notification of #PCDATA characters in element content.
|
||||
{
|
||||
if( fFound )
|
||||
{
|
||||
SAXEventGun::characters( chars, length );
|
||||
}
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::endDocument()
|
||||
// Receive notification of the end of the document.
|
||||
{
|
||||
if( !fFound && !fIsDone )
|
||||
{
|
||||
std::cerr << "Invalid GDML link!" << std::endl;
|
||||
std::cerr << "Link was: " << fConfig->URI() << " " << fConfig->Type() << " " << fConfig->SetupName() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::endElement( const XMLCh* const name )
|
||||
// Receive notification of the end of an element.
|
||||
{
|
||||
const char* aName = XMLString::transcode( name );
|
||||
|
||||
if( fFound && fConfig->SetupName() == aName )
|
||||
{
|
||||
SAXEventGun::endElement( name );
|
||||
fIsDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::ignorableWhitespace( const XMLCh* const chars
|
||||
, const unsigned int length )
|
||||
// Receive notification of ignorable whitespace in element content.
|
||||
{
|
||||
if( fFound )
|
||||
{
|
||||
SAXEventGun::ignorableWhitespace( chars, length );
|
||||
}
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::startDocument()
|
||||
// Receive notification of the beginning of the document.
|
||||
{
|
||||
fFound = false;
|
||||
fIsDone = false;
|
||||
}
|
||||
|
||||
void GDMLLinkResolver::startElement( const XMLCh* const name
|
||||
, AttributeList& attributes )
|
||||
// Receive notification of the start of an element.
|
||||
{
|
||||
const char* cType = XMLString::transcode( name );
|
||||
|
||||
if( fConfig->Type() == cType )
|
||||
{
|
||||
XMLCh* xName = XMLString::transcode( fConfig->SetupName().c_str() );
|
||||
const XMLCh* xValue = attributes.getValue( xName );
|
||||
const char* aName = XMLString::transcode( xValue );
|
||||
|
||||
if( fConfig->SetupName() == aName )
|
||||
{
|
||||
fFound = true;
|
||||
SAXEventGun::startElement( name, attributes );
|
||||
}
|
||||
|
||||
if( xName != 0 )
|
||||
{
|
||||
delete [] xName;
|
||||
}
|
||||
|
||||
if( aName != 0 )
|
||||
{
|
||||
delete [] aName;
|
||||
}
|
||||
}
|
||||
|
||||
if( cType != 0 )
|
||||
{
|
||||
delete [] cType;
|
||||
}
|
||||
}
|
||||
|
||||
GDMLLinkResolver::GDMLLinkResolver( SAXProcessor* target )
|
||||
: SAXEventGun( target ), fFound( false ), fIsDone( false )
|
||||
{
|
||||
}
|
||||
|
||||
GDMLLinkResolver::~GDMLLinkResolver()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: GDMLProcessor.cc,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "GDMLProcessor.hh"
|
||||
|
||||
// Declare the external component system initialization routines
|
||||
extern "C" void GDMLProcessLibLoad();
|
||||
extern "C" void GDMLSubscriberLibLoad();
|
||||
|
||||
|
||||
static GDMLProcessor* sProcessor = 0;
|
||||
|
||||
GDMLProcessor* GDMLProcessor::GetInstance()
|
||||
{
|
||||
if( sProcessor == 0 )
|
||||
{
|
||||
sProcessor = new GDMLProcessor();
|
||||
}
|
||||
|
||||
return sProcessor;
|
||||
}
|
||||
|
||||
GDMLExpressionEvaluator* GDMLProcessor::GetEvaluator()
|
||||
{
|
||||
return fCalc;
|
||||
}
|
||||
|
||||
GDMLProcessor::~GDMLProcessor()
|
||||
{
|
||||
if( fCalc != 0 )
|
||||
{
|
||||
delete fCalc;
|
||||
fCalc = 0;
|
||||
}
|
||||
|
||||
GDMLProcessor::Positions::iterator pit;
|
||||
GDMLProcessor::Rotations::iterator rit;
|
||||
GDMLProcessor::Solids::iterator sit;
|
||||
GDMLProcessor::LogicalVolumes::iterator lvit;
|
||||
GDMLProcessor::AssemblyVolumes::iterator avit;
|
||||
GDMLProcessor::PhysicalVolumes::iterator pvit;
|
||||
|
||||
for( pit = fPTable.begin(); pit != fPTable.end(); pit++ )
|
||||
{
|
||||
G4ThreeVector* victim = (*pit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
for( rit = fRTable.begin(); rit != fRTable.end(); rit++ )
|
||||
{
|
||||
G4RotationMatrix* victim = (*rit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
for( sit = fSolids.begin(); sit != fSolids.end(); sit++ )
|
||||
{
|
||||
G4VSolid* victim = (*sit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
for( lvit = fLVolumes.begin(); lvit != fLVolumes.end(); lvit++ )
|
||||
{
|
||||
G4LogicalVolume* victim = (*lvit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
for( avit = fAVolumes.begin(); avit != fAVolumes.end(); avit++ )
|
||||
{
|
||||
G4AssemblyVolume* victim = (*avit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
for( pvit = fPVolumes.begin(); pvit != fPVolumes.end(); pvit++ )
|
||||
{
|
||||
G4VPhysicalVolume* victim = (*pvit).second;
|
||||
if( victim != 0 )
|
||||
{
|
||||
delete victim;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddPosition( const std::string& name, G4ThreeVector* p )
|
||||
{
|
||||
fPTable[name] = p;
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddPosition( const char* name, G4ThreeVector* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddPosition( key, p );
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddRotation( const std::string& name, G4RotationMatrix* p )
|
||||
{
|
||||
fRTable[name] = p;
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddRotation( const char* name, G4RotationMatrix* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddRotation( key, p );
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddSolid( const std::string& name, G4VSolid* p )
|
||||
{
|
||||
fSolids[name] = p;
|
||||
}
|
||||
void GDMLProcessor::AddSolid( const char* name, G4VSolid* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddSolid( key, p );
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddLogicalVolume( const std::string& name, G4LogicalVolume* p )
|
||||
{
|
||||
fLVolumes[name] = p;
|
||||
}
|
||||
void GDMLProcessor::AddLogicalVolume( const char* name, G4LogicalVolume* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddLogicalVolume( key, p );
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddAssemblyVolume( const std::string& name, G4AssemblyVolume* p )
|
||||
{
|
||||
fAVolumes[name] = p;
|
||||
}
|
||||
void GDMLProcessor::AddAssemblyVolume( const char* name, G4AssemblyVolume* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddAssemblyVolume( key, p );
|
||||
}
|
||||
|
||||
void GDMLProcessor::AddPhysicalVolume( const std::string& name, G4VPhysicalVolume* p )
|
||||
{
|
||||
fPVolumes[name] = p;
|
||||
}
|
||||
void GDMLProcessor::AddPhysicalVolume( const char* name, G4VPhysicalVolume* p )
|
||||
{
|
||||
std::string key = name;
|
||||
AddPhysicalVolume( key, p );
|
||||
}
|
||||
|
||||
const G4ThreeVector* GDMLProcessor::GetPosition( const std::string& name )
|
||||
{
|
||||
return fPTable[name];
|
||||
}
|
||||
|
||||
const G4ThreeVector* GDMLProcessor::GetPosition( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetPosition( key );
|
||||
}
|
||||
|
||||
const G4RotationMatrix* GDMLProcessor::GetRotation( const std::string& name )
|
||||
{
|
||||
return fRTable[name];
|
||||
}
|
||||
|
||||
const G4RotationMatrix* GDMLProcessor::GetRotation( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetRotation( key );
|
||||
}
|
||||
|
||||
const G4VSolid* GDMLProcessor::GetSolid( const std::string& name )
|
||||
{
|
||||
return fSolids[name];
|
||||
}
|
||||
|
||||
const G4VSolid* GDMLProcessor::GetSolid( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetSolid( key );
|
||||
}
|
||||
|
||||
const G4LogicalVolume* GDMLProcessor::GetLogicalVolume( const std::string& name )
|
||||
{
|
||||
return fLVolumes[name];
|
||||
}
|
||||
|
||||
const G4LogicalVolume* GDMLProcessor::GetLogicalVolume( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetLogicalVolume( key );
|
||||
}
|
||||
|
||||
const G4AssemblyVolume* GDMLProcessor::GetAssemblyVolume( const std::string& name )
|
||||
{
|
||||
return fAVolumes[name];
|
||||
}
|
||||
|
||||
const G4AssemblyVolume* GDMLProcessor::GetAssemblyVolume( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetAssemblyVolume( key );
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume* GDMLProcessor::GetPhysicalVolume( const std::string& name )
|
||||
{
|
||||
return fPVolumes[name];
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume* GDMLProcessor::GetPhysicalVolume( const char* name )
|
||||
{
|
||||
std::string key = name;
|
||||
return GetPhysicalVolume( key );
|
||||
}
|
||||
|
||||
GDMLProcessor::GDMLProcessor()
|
||||
: fCalc( 0 ), fWorldVolume( 0 )
|
||||
{
|
||||
fCalc = new GDMLExpressionEvaluator();
|
||||
|
||||
// We need to initialize our component system
|
||||
GDMLProcessLibLoad();
|
||||
GDMLSubscriberLibLoad();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# $Id: GNUmakefile,v 1.1.1.1 2002/05/31 00:34:42 radoone Exp $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile for GDML processes library. Radovan Chytracek, 30/05/2002.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
name := GDMLprocesses
|
||||
|
||||
CPPFLAGS += \
|
||||
-I$(G4INSTALL)/source/global/management/include \
|
||||
-I$(G4INSTALL)/source/global/HEPGeometry/include \
|
||||
-I$(G4INSTALL)/source/geometry/management/include
|
||||
|
||||
include ../libgdml.gmk
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: BooleanSolidTypeProcess.hh,v 1.3 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef BOOLEANSOLIDTYPEPROCESS_H
|
||||
#define BOOLEANSOLIDTYPEPROCESS_H 1
|
||||
|
||||
#include "BooleanSolidType.hh"
|
||||
|
||||
#include "SolidTypeProcess.hh"
|
||||
|
||||
class BooleanSolidTypeProcess : public SolidTypeProcess
|
||||
{
|
||||
public:
|
||||
BooleanSolidTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SolidTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~BooleanSolidTypeProcess() {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
|
||||
SAXObject** so = Context()->GetTopObject();
|
||||
BooleanSolidType* bsobj = dynamic_cast<BooleanSolidType*>( m_obj );
|
||||
|
||||
if( name == "first" || name == "second" ) {
|
||||
// Add the first and second elements into content model
|
||||
bsobj->add_content( name, *so );
|
||||
} else {
|
||||
// Add either choice of position or rotation elements and their references
|
||||
ContentChoice* choice = new ContentChoice;
|
||||
ContentGroup::ContentItem ci = { name, *so };
|
||||
choice->set_content( ci );
|
||||
//std::cout << "BOOLEAN SOLID PROCESS adding choice " << name << std::endl;
|
||||
bsobj->add_content( "choice", choice );
|
||||
}
|
||||
|
||||
SolidTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BOOLEANSOLIDTYPEPROCESS_H
|
||||
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: MaterialTypeProcess.hh,v 1.3 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef MATERIALTYPEPROCESS_H
|
||||
#define MATERIALTYPEPROCESS_H 1
|
||||
|
||||
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "MaterialType.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class MaterialTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
MaterialTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ), m_obj( 0 )
|
||||
{
|
||||
// This is not a real process, it's a base class for a real process instead
|
||||
// The final inheriting class should set it to a correct value
|
||||
//m_tag = "";
|
||||
}
|
||||
|
||||
virtual ~MaterialTypeProcess()
|
||||
{
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
MaterialType* mt_obj = dynamic_cast<MaterialType*>(m_obj);
|
||||
|
||||
if( mt_obj == 0 ) {
|
||||
// Whoops, fatal problem!
|
||||
std::cerr << "MaterialType PROCESS:: bad_cast trouble at: "
|
||||
<< __FILE__ << ":" << __LINE__ << "\a" << std::endl;
|
||||
// Some exception would fit here...
|
||||
return;
|
||||
}
|
||||
|
||||
//std::cout << "MaterialType PROCESS:: : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
if( name == "RL" || name == "RLref" ) {
|
||||
mt_obj->set_RLorRLref( name, *obj );
|
||||
} else if( name == "AL" || name == "ALref" ) {
|
||||
mt_obj->set_ALorALref( name, *obj );
|
||||
} else if( name == "T" || name == "Tref" ) {
|
||||
mt_obj->set_TorTref( name, *obj );
|
||||
} else if( name == "P" || name == "Pref" ) {
|
||||
mt_obj->set_PorPref( name, *obj );
|
||||
} else {
|
||||
// Invalid input
|
||||
std::cerr << "MaterialType PROCESS:: invalid tag "
|
||||
<< name << " on input at: "
|
||||
<< __FILE__ << ":" << __LINE__ << "\a" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
// virtual const std::string& State() const
|
||||
// {
|
||||
// return m_tag;
|
||||
// }
|
||||
|
||||
protected:
|
||||
// Resulting object, one of isotope, element or material
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
// This is going to be a base class, so no factory is needed
|
||||
//DECLARE_PROCESS_FACTORY(MaterialTypeProcess)
|
||||
|
||||
#endif // MATERIALTYPEPROCESS_H
|
||||
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: QuantityTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef QUANTITYTYPEPROCESS_H
|
||||
#define QUANTITYTYPEPROCESS_H 1
|
||||
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "QuantityType.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class QuantityTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
QuantityTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~QuantityTypeProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
QuantityType* qobj = dynamic_cast<QuantityType*>( m_obj );
|
||||
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string qunit = attrs.getValue( "unit" );
|
||||
std::string qtype = attrs.getValue( "type" );
|
||||
std::string qvalue = attrs.getValue( "value" );
|
||||
|
||||
qobj->set_unit( qunit );
|
||||
qobj->set_type( qtype );
|
||||
qobj->set_value( qvalue );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try {
|
||||
QuantityType* saxobj = dynamic_cast<QuantityType*>( m_obj );
|
||||
|
||||
if( saxobj != 0 )
|
||||
{
|
||||
// std::cout << "PROCESS END OF TAG:: " << name
|
||||
// << saxobj->get_type() << ": "
|
||||
// << saxobj->get_value() << "["
|
||||
// << saxobj->get_unit() << "]"
|
||||
// << " looks OK" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
#endif // QUANTITYTYPEPROCESS_H
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ReferenceTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef REFERENCETYPEPROCESS_H
|
||||
#define REFERENCETYPEPROCESS_H 1
|
||||
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "ReferenceType.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class ReferenceTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
ReferenceTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ), m_obj( 0 ) {
|
||||
}
|
||||
|
||||
virtual ~ReferenceTypeProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "ReferenceTypeProcess PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string ref = attrs.getValue( "ref" );
|
||||
ReferenceType* refobj = dynamic_cast<ReferenceType*>(m_obj);
|
||||
refobj->set_ref( ref );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
//std::cout << "ReferenceTypeProcess PROCESS::END OF TAG : " << name << std::endl;
|
||||
try {
|
||||
ReferenceType* saxobj = dynamic_cast<ReferenceType*>( m_obj );
|
||||
|
||||
if( saxobj != 0 ) {
|
||||
//std::cout << "PROCESS END OF TAG:: "
|
||||
// << name << " ref: " << saxobj->get_ref()
|
||||
// << " looks OK" << std::endl;
|
||||
} else {
|
||||
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
#endif // REFERENCETYPEPROCESS_H
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SinglePlacementTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef SINGLEPLACEMENTTYPEPROCESS_H
|
||||
#define SINGLEPLACEMENTTYPEPROCESS_H 1
|
||||
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "SinglePlacementType.hh"
|
||||
|
||||
class SinglePlacementTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
SinglePlacementTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~SinglePlacementTypeProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
SAXObject** so = Context()->GetTopObject();
|
||||
SinglePlacementType* sptobj = dynamic_cast<SinglePlacementType*>( m_obj );
|
||||
sptobj->add_content( name, *so );
|
||||
}
|
||||
|
||||
protected:
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
#endif // SINGLEPLACEMENTTYPEPROCESS_H
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SolidTypeProcess.hh,v 1.2 2002/06/03 12:09:31 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#ifndef SOLIDTYPEPROCESS_H
|
||||
#define SOLIDTYPEPROCESS_H 1
|
||||
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "SolidType.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class SolidTypeProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
SolidTypeProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ), m_obj( 0 ) {
|
||||
}
|
||||
|
||||
virtual ~SolidTypeProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
std::string lunit = attrs.getValue( "lunit" );
|
||||
std::string aunit = attrs.getValue( "aunit" );
|
||||
std::string sname = attrs.getValue( "name" );
|
||||
|
||||
SolidType* sobj = dynamic_cast<SolidType*>( m_obj );
|
||||
|
||||
sobj->set_lunit( lunit );
|
||||
sobj->set_aunit( aunit );
|
||||
sobj->set_name( sname );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
#endif // SOLIDTYPEPROCESS_H
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "QuantityTypeProcess.hh"
|
||||
|
||||
#include "DorDref.hh"
|
||||
|
||||
class DProcess : public QuantityTypeProcess
|
||||
{
|
||||
public:
|
||||
DProcess( const ProcessingContext* context = 0 )
|
||||
: QuantityTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~DProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new D;
|
||||
m_obj = *obj;
|
||||
|
||||
QuantityTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
QuantityTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string m_tag = "D";
|
||||
return m_tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(DProcess)
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DrefProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "DorDref.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class DrefProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
DrefProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~DrefProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new Dref;
|
||||
m_obj = *obj;
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "Dref";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(DrefProcess)
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: LibLoadProcesses.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GDMLProcessLibLoad() {
|
||||
LOAD_COMPONENT(defineProcess)
|
||||
LOAD_COMPONENT(constantProcess)
|
||||
LOAD_COMPONENT(quantityProcess)
|
||||
LOAD_COMPONENT(expressionProcess)
|
||||
LOAD_COMPONENT(positionProcess)
|
||||
LOAD_COMPONENT(rotationProcess)
|
||||
LOAD_COMPONENT(atomProcess)
|
||||
LOAD_COMPONENT(DProcess)
|
||||
LOAD_COMPONENT(DrefProcess)
|
||||
LOAD_COMPONENT(TProcess)
|
||||
LOAD_COMPONENT(TrefProcess)
|
||||
LOAD_COMPONENT(PProcess)
|
||||
LOAD_COMPONENT(PrefProcess)
|
||||
LOAD_COMPONENT(isotopeProcess)
|
||||
LOAD_COMPONENT(elementProcess)
|
||||
LOAD_COMPONENT(materialProcess)
|
||||
LOAD_COMPONENT(fractionProcess)
|
||||
LOAD_COMPONENT(compositeProcess)
|
||||
LOAD_COMPONENT(firstProcess)
|
||||
LOAD_COMPONENT(secondProcess)
|
||||
LOAD_COMPONENT(positionrefProcess)
|
||||
LOAD_COMPONENT(rotationrefProcess)
|
||||
LOAD_COMPONENT(unionProcess)
|
||||
LOAD_COMPONENT(subtractionProcess)
|
||||
LOAD_COMPONENT(intersectionProcess)
|
||||
LOAD_COMPONENT(boxProcess)
|
||||
LOAD_COMPONENT(sphereProcess)
|
||||
LOAD_COMPONENT(tubeProcess)
|
||||
LOAD_COMPONENT(coneProcess)
|
||||
LOAD_COMPONENT(paraProcess)
|
||||
LOAD_COMPONENT(trdProcess)
|
||||
LOAD_COMPONENT(trapProcess)
|
||||
LOAD_COMPONENT(volumeProcess)
|
||||
LOAD_COMPONENT(assemblyProcess)
|
||||
LOAD_COMPONENT(childProcess)
|
||||
LOAD_COMPONENT(materialrefProcess)
|
||||
LOAD_COMPONENT(solidrefProcess)
|
||||
LOAD_COMPONENT(volumerefProcess)
|
||||
LOAD_COMPONENT(worldProcess)
|
||||
LOAD_COMPONENT(setupProcess)
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: PProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "QuantityTypeProcess.hh"
|
||||
|
||||
#include "PorPref.hh"
|
||||
|
||||
class PProcess : public QuantityTypeProcess
|
||||
{
|
||||
public:
|
||||
PProcess( const ProcessingContext* context = 0 )
|
||||
: QuantityTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~PProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new P;
|
||||
m_obj = *obj;
|
||||
|
||||
QuantityTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
QuantityTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string m_tag = "P";
|
||||
return m_tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(PProcess)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: PrefProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "PorPref.hh"
|
||||
|
||||
class PrefProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
PrefProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~PrefProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new Pref;
|
||||
m_obj = *obj;
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "Pref";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(PrefProcess)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: TProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "QuantityTypeProcess.hh"
|
||||
|
||||
#include "TorTref.hh"
|
||||
|
||||
class TProcess : public QuantityTypeProcess
|
||||
{
|
||||
public:
|
||||
TProcess( const ProcessingContext* context = 0 )
|
||||
: QuantityTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~TProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new T;
|
||||
m_obj = *obj;
|
||||
|
||||
QuantityTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
QuantityTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string m_tag = "T";
|
||||
return m_tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(TProcess)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: TrefProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "TorTref.hh"
|
||||
|
||||
class TrefProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
TrefProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~TrefProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new Tref;
|
||||
m_obj = *obj;
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "Tref";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(TrefProcess)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: assemblyProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "assembly.hh"
|
||||
|
||||
class assemblyProcess : public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
assemblyProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ), m_obj( 0 ) {
|
||||
}
|
||||
|
||||
virtual ~assemblyProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
assembly* ao = new assembly;
|
||||
|
||||
ao->set_name( attrs.getValue( "name" ) );
|
||||
|
||||
m_obj = ao;
|
||||
*obj = ao;
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << " " << std::endl;
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
//std::cout << "PROCESS::assembly NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
SAXObject** so = Context()->GetTopObject();
|
||||
assembly* aobj = dynamic_cast<assembly*>( m_obj );
|
||||
aobj->add_content( name, *so );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "assembly";
|
||||
return tag;
|
||||
}
|
||||
|
||||
private:
|
||||
SAXObject* m_obj;
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(assemblyProcess)
|
||||
@@ -0,0 +1,122 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: atomProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "atom.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class atomProcess : virtual public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
atomProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~atomProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string aunit = attrs.getValue( "unit" );
|
||||
std::string atype = attrs.getValue( "type" );
|
||||
std::string avalue = attrs.getValue( "value" );
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new atom;
|
||||
atom* atom_element = dynamic_cast<atom*>(*obj);
|
||||
atom_element->set_unit( aunit );
|
||||
atom_element->set_type( atype );
|
||||
atom_element->set_value( avalue );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
atom* saxobj = dynamic_cast<atom*>( *obj );
|
||||
|
||||
if( saxobj != 0 )
|
||||
{
|
||||
// std::cout << "PROCESS END OF TAG:: atom "
|
||||
// << saxobj->get_type() << ": "
|
||||
// << saxobj->get_value() << "["
|
||||
// << saxobj->get_unit() << "]"
|
||||
// << " looks OK" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "atom";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(atomProcess)
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: boxProces.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "SolidTypeProcess.hh"
|
||||
|
||||
#include "box.hh"
|
||||
|
||||
class boxProcess : public SolidTypeProcess
|
||||
{
|
||||
public:
|
||||
boxProcess( const ProcessingContext* context = 0 )
|
||||
: SolidTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~boxProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
box* box_element = new box;
|
||||
|
||||
box_element->set_x( attrs.getValue( "x" ) );
|
||||
box_element->set_y( attrs.getValue( "y" ) );
|
||||
box_element->set_z( attrs.getValue( "z" ) );
|
||||
|
||||
m_obj = box_element;
|
||||
*obj = box_element;
|
||||
|
||||
SolidTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
SolidTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
//std::cout << "PROCESS::" << name << " NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
SolidTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "box";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(boxProcess)
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: childProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "SinglePlacementTypeProcess.hh"
|
||||
|
||||
#include "child.hh"
|
||||
|
||||
class childProcess : public SinglePlacementTypeProcess
|
||||
{
|
||||
public:
|
||||
childProcess( const ProcessingContext* context = 0 )
|
||||
: SinglePlacementTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~childProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
child* child_lement = new child;
|
||||
|
||||
m_obj = child_lement;
|
||||
*obj = child_lement;
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
//std::cout << "PROCESS::child NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
SinglePlacementTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "child";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(childProcess)
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: compositeProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "composite.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class compositeProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
compositeProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~compositeProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
composite* co = new composite;
|
||||
|
||||
std::string cn = attrs.getValue( "n" );
|
||||
co->set_n( cn );
|
||||
|
||||
*obj = co;
|
||||
m_obj = co;
|
||||
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
ReferenceTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "composite";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(compositeProcess)
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: coneProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "SolidTypeProcess.hh"
|
||||
|
||||
#include "cone.hh"
|
||||
|
||||
class coneProcess : public SolidTypeProcess
|
||||
{
|
||||
public:
|
||||
coneProcess( const ProcessingContext* context = 0 )
|
||||
: SolidTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~coneProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
cone* cone_element = new cone;
|
||||
|
||||
cone_element->set_rmin1( attrs.getValue( "rmin1" ) );
|
||||
cone_element->set_rmax1( attrs.getValue( "rmax1" ) );
|
||||
cone_element->set_rmin2( attrs.getValue( "rmin2" ) );
|
||||
cone_element->set_rmax2( attrs.getValue( "rmax2" ) );
|
||||
cone_element->set_z( attrs.getValue( "z" ) );
|
||||
cone_element->set_startphi( attrs.getValue( "startphi" ) );
|
||||
cone_element->set_deltaphi( attrs.getValue( "deltaphi" ) );
|
||||
|
||||
m_obj = cone_element;
|
||||
*obj = cone_element;
|
||||
|
||||
SolidTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
SolidTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
//std::cout << "PROCESS::" << name << " NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
SolidTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "cone";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(coneProcess)
|
||||
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: constantProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "define.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class constantProcess : virtual public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
constantProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~constantProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string cname = attrs.getValue( "name" );
|
||||
std::string cvalue = attrs.getValue( "value" );
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new define::constant;
|
||||
define::constant* constant_element = dynamic_cast<define::constant*>(*obj);
|
||||
constant_element->set_name( cname );
|
||||
constant_element->set_value( cvalue );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
define::constant* saxobj = dynamic_cast<define::constant*>( *obj );
|
||||
|
||||
if( saxobj != 0 )
|
||||
{
|
||||
//std::cout << "PROCESS END OF TAG:: Constant " << saxobj->get_name() << " looks OK" << std::endl;
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "constant";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(constantProcess)
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: defineProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "define.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class defineProcess : virtual public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
defineProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~defineProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
m_define = new define;
|
||||
*obj = m_define;
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
defineType* saxobj = dynamic_cast<defineType*>( *obj );
|
||||
|
||||
if( saxobj != 0 )
|
||||
{
|
||||
//std::cout << "PROCESS END OF TAG:: define" << std::endl;
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG:: define:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG:: define:: BAD CAST exception caught...\a" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name )
|
||||
{
|
||||
// Irrelevant in this process
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
// Get the defineType interface
|
||||
defineType* define_element = dynamic_cast<defineType*>( m_define );
|
||||
|
||||
// We can expect the 5 inner elements: constant, quantity, expression, position, rotation
|
||||
// Whenever one of these appears we have to add it as a choice content group into define element
|
||||
SAXObject** so = Context()->GetTopObject();
|
||||
if( name == "constant" || name == "quantity" || name == "expression" || name == "position" || name == "rotation" ) {
|
||||
// Add the element into choice content group of define element
|
||||
define_element->add_to_content( name, *so );
|
||||
} else {
|
||||
// This should not happen, as it's not fatal problem just warn about it
|
||||
std::cerr << "Got unexpected element \"" << name << "\"\a" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string m_tag = "define";
|
||||
return m_tag;
|
||||
}
|
||||
|
||||
private:
|
||||
define* m_define;
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(defineProcess)
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: elementProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "MaterialTypeProcess.hh"
|
||||
|
||||
#include "element.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class elementProcess : public MaterialTypeProcess
|
||||
{
|
||||
public:
|
||||
elementProcess( const ProcessingContext* context = 0 )
|
||||
: MaterialTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~elementProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string ename = attrs.getValue( "name" );
|
||||
std::string ef = attrs.getValue( "formula" );
|
||||
std::string en = attrs.getValue( "N" );
|
||||
std::string ez = attrs.getValue( "Z" );
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
element* el = new element;
|
||||
|
||||
el->set_name( ename );
|
||||
el->set_formula( ef );
|
||||
|
||||
if( !en.empty() )
|
||||
el->set_N( en );
|
||||
if( !ez.empty() )
|
||||
el->set_Z( ez );
|
||||
|
||||
m_obj = el;
|
||||
*obj = el;
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
element* saxobj = dynamic_cast<element*>( *obj );
|
||||
|
||||
if( saxobj != 0 ) {
|
||||
//std::cout << "PROCESS END OF TAG:: element " << saxobj->get_name()
|
||||
// << " looks OK" << std::endl;
|
||||
} else {
|
||||
std::cerr << "PROCESS END OF TAG::element GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
//std::cout << "PROCESS::element NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
if( name == "atom" || name == "fraction" ) {
|
||||
element* el = dynamic_cast<element*>( m_obj );
|
||||
el->set_AtomOrFraction( name, *obj );
|
||||
} else if( name == "D" || name == "Dref" ) {
|
||||
element* saxobj = dynamic_cast<element*>( m_obj );
|
||||
saxobj->set_DorDref( name, *obj );
|
||||
} else {
|
||||
MaterialTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "element";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(elementProcess)
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: expressionProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ProcessingConfigurator.hh"
|
||||
#include "ProcessingContext.hh"
|
||||
#include "SAXProcessor.hh"
|
||||
#include "StateStack.hh"
|
||||
#include "SAXProcessingState.hh"
|
||||
#include "SAXStateProcess.hh"
|
||||
#include "SAXObjectHandle.hh"
|
||||
#include "SAXComponentFactory.hh"
|
||||
|
||||
#include "define.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class expressionProcess : virtual public SAXStateProcess, virtual public SAXComponentObject
|
||||
{
|
||||
public:
|
||||
expressionProcess( const ProcessingContext* context = 0 )
|
||||
: SAXStateProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~expressionProcess() {
|
||||
}
|
||||
|
||||
virtual const SAXComponentObject* Build() const {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
m_expression_value = "(";
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string ename = attrs.getValue( "name" );
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
*obj = new define::expression;
|
||||
define::expression* expression_element = dynamic_cast<define::expression*>(*obj);
|
||||
expression_element->set_name( ename );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
m_expression_value += ")";
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
define::expression* saxobj = dynamic_cast<define::expression*>( *obj );
|
||||
saxobj->set_text( m_expression_value );
|
||||
|
||||
if( saxobj != 0 )
|
||||
{
|
||||
//std::cout << "PROCESS END OF TAG:: expression " << saxobj->get_name()
|
||||
// << " has value:: " << saxobj->get_text() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG:: expression:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
} catch( ... ) {
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& text )
|
||||
{
|
||||
m_expression_value += text;
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string m_tag = "expression";
|
||||
return m_tag;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_expression_value;
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(expressionProcess)
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: firstProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "BooleanSolidType.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class firstProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
firstProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~firstProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
BooleanSolidType::first* co = new BooleanSolidType::first;
|
||||
|
||||
*obj = co;
|
||||
m_obj = co;
|
||||
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
ReferenceTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "first";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(firstProcess)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: fractionProcess.cc,v 1.2 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "ReferenceTypeProcess.hh"
|
||||
|
||||
#include "fraction.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class fractionProcess : public ReferenceTypeProcess
|
||||
{
|
||||
public:
|
||||
fractionProcess( const ProcessingContext* context = 0 )
|
||||
: ReferenceTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~fractionProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
fraction* fr = new fraction;
|
||||
|
||||
std::string fn = attrs.getValue( "n" );
|
||||
fr->set_n( fn );
|
||||
|
||||
*obj = fr;
|
||||
m_obj = fr;
|
||||
|
||||
ReferenceTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
ReferenceTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const {
|
||||
static std::string tag = "fraction";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(fractionProcess)
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: intersectionProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
#include "BooleanSolidTypeProcess.hh"
|
||||
|
||||
#include "boolean_intersection.hh"
|
||||
|
||||
class intersectionProcess : public BooleanSolidTypeProcess
|
||||
{
|
||||
public:
|
||||
intersectionProcess( const ProcessingContext* context = 0 )
|
||||
: BooleanSolidTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~intersectionProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs ) {
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
boolean_intersection* intersection_lement = new boolean_intersection;
|
||||
|
||||
m_obj = intersection_lement;
|
||||
*obj = intersection_lement;
|
||||
|
||||
BooleanSolidTypeProcess::StartElement( name, attrs );
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name ) {
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
BooleanSolidTypeProcess::EndElement( name );
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name ) {
|
||||
//std::cout << "PROCESS::intersection NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
BooleanSolidTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "intersection";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(intersectionProcess)
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: isotopeProcess.cc,v 1.3 2002/06/03 12:09:32 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// #include "ProcessingConfigurator.hh"
|
||||
// #include "ProcessingContext.hh"
|
||||
// #include "SAXProcessor.hh"
|
||||
// #include "StateStack.hh"
|
||||
// #include "SAXProcessingState.hh"
|
||||
// #include "SAXStateProcess.hh"
|
||||
// #include "SAXComponentFactory.hh"
|
||||
// #include "SAXObjectHandle.hh"
|
||||
|
||||
#include "isotope.hh"
|
||||
#include "MaterialTypeProcess.hh"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
class isotopeProcess : public MaterialTypeProcess
|
||||
{
|
||||
public:
|
||||
isotopeProcess( const ProcessingContext* context = 0 )
|
||||
: MaterialTypeProcess( context ) {
|
||||
}
|
||||
|
||||
virtual ~isotopeProcess() {
|
||||
}
|
||||
|
||||
// Analogical to SAX startElement callback
|
||||
virtual void StartElement( const std::string& name, const ASCIIAttributeList& attrs )
|
||||
{
|
||||
//std::cout << "PROCESS::START OF TAG : " << name << std::endl;
|
||||
|
||||
std::string iname = attrs.getValue( "name" );
|
||||
std::string ifo = attrs.getValue( "formula" );
|
||||
std::string in = attrs.getValue( "N" );
|
||||
std::string iz = attrs.getValue( "Z" );
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
isotope* isotope_element = new isotope;
|
||||
|
||||
isotope_element->set_name( iname );
|
||||
isotope_element->set_formula( ifo );
|
||||
isotope_element->set_N( in );
|
||||
isotope_element->set_Z( iz );
|
||||
|
||||
m_obj = isotope_element;
|
||||
*obj = isotope_element;
|
||||
}
|
||||
|
||||
// Analogical to SAX endElement callback
|
||||
virtual void EndElement( const std::string& name )
|
||||
{
|
||||
//std::cout << "PROCESS::END OF TAG : " << name << std::endl;
|
||||
try
|
||||
{
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
isotope* saxobj = dynamic_cast<isotope*>( *obj );
|
||||
|
||||
if( saxobj != 0 ) {
|
||||
//std::cout << "PROCESS END OF TAG:: isotope " << saxobj->get_name()
|
||||
// << " looks OK" << std::endl;
|
||||
;
|
||||
} else {
|
||||
std::cerr << "PROCESS END OF TAG:: GOT ZERO DATA POINTER! " << std::endl;
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
std::cerr << "PROCESS END OF TAG " << name << " ERROR: "
|
||||
<< " Cannot cast properly the data object!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Analogical to SAX characters callback, it's called for ignorableWhitespace too!
|
||||
virtual void Characters( const std::string& name ) {
|
||||
}
|
||||
|
||||
// Invoked whenever one of the daughter state processes has been popped-out of the state stack
|
||||
// The name passed-in as the argument is the name of the XML element for which that's been done
|
||||
virtual void StackPopNotify( const std::string& name )
|
||||
{
|
||||
//std::cout << "PROCESS::isotope NOTIFIED AFTER THE TAG: " << name << std::endl;
|
||||
|
||||
SAXObject** obj = Context()->GetTopObject();
|
||||
|
||||
if( name == "atom" ) {
|
||||
atom* saxobj = dynamic_cast<atom*>( *obj );
|
||||
isotope* isotope_element = dynamic_cast<isotope*>( m_obj );
|
||||
isotope_element->set_atom( *saxobj );
|
||||
} else if( name == "D" || name == "Dref" ) {
|
||||
isotope* saxobj = dynamic_cast<isotope*>( m_obj );
|
||||
saxobj->set_DorDref( name, *obj );
|
||||
} else {
|
||||
MaterialTypeProcess::StackPopNotify( name );
|
||||
}
|
||||
}
|
||||
|
||||
// The name of the state this object will process
|
||||
virtual const std::string& State() const
|
||||
{
|
||||
static std::string tag = "isotope";
|
||||
return tag;
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_PROCESS_FACTORY(isotopeProcess)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user