Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
$Id: History,v 2.1 1998/07/15 08:24:39 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
OPACS-Category History file
|
||||
---------------------------
|
||||
|
||||
This file should be used by G4 developers and category coordinators
|
||||
to briefly summarize all major modifications introduced in the code
|
||||
at this level and keep track of all relavant 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 *
|
||||
----------------------------------------------------------
|
||||
|
||||
envs-00-01-02 15th July 1998 John Allison
|
||||
- Removed ATLAS files. Retrieve with:
|
||||
cvs update -r pre-beta01-08 ./app/ATLAS.cc ./usr/ATLAS.odb \
|
||||
./usr/ATLASChooser.odb ./usr/ATLASChooser.osh \
|
||||
./usr/ATLAS_EventEnd.osh ./usr/ATLAS_RunEnd.osh
|
||||
|
||||
envs-00-05-00 19th March 1998 John Allison
|
||||
- First creation of this OPACS-category.
|
||||
@@ -0,0 +1,110 @@
|
||||
OPACS as a visualization environment for G4
|
||||
-------------------------------------------
|
||||
The OPACS html address is :
|
||||
|
||||
http://www.lal.in2p3.fr/OPACS
|
||||
|
||||
To have OPACS using G4 :
|
||||
|
||||
- Install the OPACS v3 by following
|
||||
the web installation page.
|
||||
For G4 take the group :
|
||||
WoXoXm if you have MOTIF
|
||||
WoXoXaw if you have Xaw
|
||||
For example on a UNIX with MOTIF only :
|
||||
UNIX> mkdir OPACS
|
||||
UNIX> cd OPACS
|
||||
UNIX> ftp ftp.lal.in2p3.fr
|
||||
anonymous
|
||||
user name
|
||||
ftp> cd pub/OPACS/v3
|
||||
ftp> bin
|
||||
ftp> get WoXoXm.tar.Z
|
||||
( ftp> get WoXoXaw.tar.Z )
|
||||
ftp> quit
|
||||
UNIX> uncompress WoXoXm.tar.Z
|
||||
( UNIX> uncompress WoXoXaw.tar.Z )
|
||||
UNIX> tar xvf WoXoXm.tar
|
||||
( UNIX> tar xvf WoXoXaw.tar )
|
||||
UNIX> rm WoXoXm.tar
|
||||
( UNIX> rm WoXoXaw.tar )
|
||||
UNIX> cd OPACS/v3
|
||||
UNIX> chmod u+x conf.sh
|
||||
UNIX> ./conf.sh
|
||||
csh> source setup.csh
|
||||
(sh> . ./setup.sh)
|
||||
UNIX> make WoXo
|
||||
( UNIX> gmake WoXo )
|
||||
At end of installation you should
|
||||
be able to build a simple Wo application
|
||||
(for exa named Xxx) by doing :
|
||||
csh> mkdir tmp
|
||||
csh> cd tmp
|
||||
with MOTIF :
|
||||
csh> onew Xxx
|
||||
or with Xaw :
|
||||
csh> onew Xxx $WOROOT/usr/template/Xaw/
|
||||
then :
|
||||
csh> gmake `uname`
|
||||
csh> ./Xxx.exe
|
||||
The interpreted interface is described
|
||||
in Xxx.odb.
|
||||
See OPACS doc for more.
|
||||
|
||||
- Execute OPACS setup script :
|
||||
csh> source <OPACS_HOME>/OPACS/v3/setup.csh
|
||||
|
||||
- Bring G4/prototype and reconstruct G4 libraries.
|
||||
|
||||
- Bring G4/environments/OPACS.
|
||||
|
||||
- Reconstruct G4/environments/OPACS :
|
||||
UNIX> cd <G4>/environments/OPACS/mgr
|
||||
UNIX> <edit setup.csh> to change paths.
|
||||
csh> source setup.csh
|
||||
(sh> . ./setup.sh)
|
||||
UNIX> make <config>
|
||||
( UNIX> gmake <config> )
|
||||
where <config> is a compilation "configuration".
|
||||
For example :
|
||||
UNIX> make OSF1
|
||||
UNIX> make HP-UX-aCC
|
||||
The compilation "configs" are defined in the file :
|
||||
mgr/Config.mk
|
||||
If the existing "configs" do not match your environment,
|
||||
edit this file. Existing configs are :
|
||||
OSF1
|
||||
HP-UX
|
||||
HP-UX-aCC
|
||||
ULTRIX
|
||||
Linux
|
||||
AIX
|
||||
IRIX (not tested yet)
|
||||
SunOS (not tested yet)
|
||||
insure
|
||||
Linux-gxx
|
||||
At the end of installation you should
|
||||
find in the parallel <config> directory the
|
||||
G4o library and some executables :
|
||||
EXPO.exe
|
||||
TEST.exe
|
||||
ATLAS.exe
|
||||
Run them by doing :
|
||||
UNIX> cd ../usr
|
||||
UNIX> ../<config>/<app>.exe
|
||||
|
||||
As usual, when you have something in an Xo window
|
||||
you can manipulate it with :
|
||||
Ctrl+button1+move pointer
|
||||
on the window. On button3 you have a popup
|
||||
menu to do things, like changing "Ctrl" action,
|
||||
setting ZBuffer, etc...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EXPO.cc,v 2.3 1998/08/12 14:21:12 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#include <stdlib.h>
|
||||
|
||||
/*G4*/
|
||||
#if defined(SOLVE_TEMPLATES) && !defined(G4_SOLVE_TEMPLATES)
|
||||
#define G4_SOLVE_TEMPLATES
|
||||
#endif
|
||||
#include <g4templates.hh> /*Before any G4 include file.*/
|
||||
#include <G4RunManager.hh>
|
||||
|
||||
/*OPACS*/
|
||||
/*begin Want_h*/
|
||||
#include <WoWo.h>
|
||||
#include <WoXtw.h>
|
||||
#include <WoXm.h>
|
||||
#include <WoXo.h>
|
||||
#include <WoHTML.h>
|
||||
#include <WoXz.h>
|
||||
#include <WoDeX.h>
|
||||
#include <WoCi.h>
|
||||
#include <WoPacksCi.h>
|
||||
#include <Wotcl.h>
|
||||
#include <WoHoXz.h>
|
||||
#include <WoXaw.h>
|
||||
#include <WoG3o.h>
|
||||
#include <WoG4o.h>
|
||||
#include <WoFNAL.h>
|
||||
#include <WoPAW.h> /*Need HAS_XZ and HAS_PAW flags.*/
|
||||
/*end Want_h*/
|
||||
|
||||
#include <OHistogram.h>
|
||||
|
||||
/*G4o*/
|
||||
#include <G4oState.hh>
|
||||
|
||||
/***************************************************************************/
|
||||
/***** G4 EXPO customization ***********************************************/
|
||||
/***************************************************************************/
|
||||
#include <EXPO_Detector.icc>
|
||||
#include <EXPO_Primary.icc>
|
||||
#include <EXPO_PhysicsList.icc>
|
||||
|
||||
#include <G4UserRunAction.hh>
|
||||
#include <G4Run.hh>
|
||||
#include <G4Timer.hh>
|
||||
class EXPO_RunAction : public G4UserRunAction {
|
||||
private:
|
||||
G4Timer* timer;
|
||||
G4int runIDcounter;
|
||||
#ifdef HAS_HO
|
||||
static OHistogram myHisto1D;
|
||||
static OHistogram myHisto2D;
|
||||
#endif /*HAS_HO*/
|
||||
public:
|
||||
EXPO_RunAction() {
|
||||
timer = new G4Timer;
|
||||
runIDcounter = 0;
|
||||
}
|
||||
~EXPO_RunAction() {
|
||||
delete timer;
|
||||
}
|
||||
void BeginOfRunAction(G4Run* aRun) {
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
CWarnF ("### Run %d start.\n",aRun->GetRunID());
|
||||
timer->Start();
|
||||
#ifdef HAS_HO
|
||||
// Histo are created in an osh script somewhere (G4oRunBegin.osh).
|
||||
myHisto1D = OHistogramGetIdentifier("HepJamesRandom1");
|
||||
myHisto2D = OHistogramGetIdentifier("HepJamesVsDRand48");
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
void EndOfRunAction(G4Run* aRun) {
|
||||
timer->Stop();
|
||||
if (timer->IsValid()) {
|
||||
CWarnF ("number of event = %d User=%gs Real=%gs Sys=%gs\n",
|
||||
aRun->GetNumberOfEvent(),
|
||||
timer->GetUserElapsed(),
|
||||
timer->GetRealElapsed(),
|
||||
timer->GetSystemElapsed());
|
||||
} else {
|
||||
CWarnF ("number of event = %d User=****s Real=****s Sys=****s\n",
|
||||
aRun->GetNumberOfEvent());
|
||||
}
|
||||
#ifdef HAS_HO
|
||||
myHisto1D = NULL;
|
||||
myHisto2D = NULL;
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
#ifdef HAS_HO
|
||||
static OHistogram get_1d(){return myHisto1D; }
|
||||
static OHistogram Get2d(){return myHisto2D; }
|
||||
#endif /*HAS_HO*/
|
||||
};
|
||||
#ifdef HAS_HO
|
||||
OHistogram EXPO_RunAction::myHisto1D = NULL;
|
||||
OHistogram EXPO_RunAction::myHisto2D = NULL;
|
||||
#endif /*HAS_HO*/
|
||||
|
||||
#include <G4UserEventAction.hh>
|
||||
class EXPO_EventAction : public G4UserEventAction {
|
||||
public:
|
||||
EXPO_EventAction() {
|
||||
}
|
||||
~EXPO_EventAction() {
|
||||
}
|
||||
void BeginOfEventAction() {
|
||||
}
|
||||
void EndOfEventAction() {
|
||||
}
|
||||
};
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
class EXPO_SteppingAction : public G4UserSteppingAction {
|
||||
private:
|
||||
HepJamesRandom theJamesEngine;
|
||||
DRand48Engine theDRand48Engine;
|
||||
public:
|
||||
EXPO_SteppingAction(){};
|
||||
~EXPO_SteppingAction(){};
|
||||
void UserSteppingAction() {
|
||||
#ifdef HAS_HO
|
||||
OHistogram h1 = EXPO_RunAction::get_1d();
|
||||
OHistogram h2 = EXPO_RunAction::Get2d();
|
||||
|
||||
HepRandom::setTheEngine (&theJamesEngine);
|
||||
double james = RandGauss::shoot(0.3,0.1);
|
||||
OHistogramFillOneDimensional(h1,james,0.01);
|
||||
|
||||
HepRandom::setTheEngine(&theDRand48Engine);
|
||||
double d48 = RandGauss::shoot(0.7,0.1);
|
||||
OHistogramFillTwoDimensional(h2,james,d48,0.01);
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
};
|
||||
|
||||
static char what[] = "@(#)EXPO v3";
|
||||
/***************************************************************************/
|
||||
int main (
|
||||
int a_argn
|
||||
,char** a_args
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
what[0] = '@'; /*c++ no warning.*/
|
||||
/*begin Want_c*/
|
||||
#include <WoWo.ic>
|
||||
#include <WoXtw.ic>
|
||||
#include <WoXm.ic>
|
||||
#include <WoXo.ic>
|
||||
#include <WoHTML.ic>
|
||||
#include <WoXz.ic>
|
||||
#include <WoDeX.ic>
|
||||
#include <WoCi.ic>
|
||||
#include <WoPacksCi.ic>
|
||||
#include <Wotcl.ic>
|
||||
#include <WoHoXz.ic>
|
||||
#include <WoXaw.ic>
|
||||
#include <WoG3o.ic>
|
||||
#include <WoG4o.ic>
|
||||
#include <WoFNAL.ic>
|
||||
#include <WoPAW.ic>
|
||||
/*end Want_c*/
|
||||
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
runManager->SetUserInitialization (new EXPO_DetectorConstruction);
|
||||
runManager->SetUserInitialization (new EXPO_PhysicsList);
|
||||
runManager->SetUserAction (new EXPO_RunAction);
|
||||
runManager->SetUserAction (new EXPO_PrimaryGeneratorAction);
|
||||
runManager->SetUserAction (new EXPO_EventAction);
|
||||
runManager->SetUserAction (new EXPO_SteppingAction);
|
||||
|
||||
G4oState* state = new G4oState("EXPO_");
|
||||
|
||||
WoStartup (a_argn,a_args);
|
||||
WoProcessEvents ();
|
||||
WoClearClass ();
|
||||
|
||||
delete runManager;
|
||||
delete state;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: TEST.cc,v 2.2 1998/08/12 14:20:24 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#include <stdlib.h>
|
||||
|
||||
/*G4*/
|
||||
#if defined(SOLVE_TEMPLATES) && !defined(G4_SOLVE_TEMPLATES)
|
||||
#define G4_SOLVE_TEMPLATES
|
||||
#endif
|
||||
#include <g4templates.hh> /*Before any G4 include file.*/
|
||||
#include <G4RunManager.hh>
|
||||
|
||||
/*OPACS*/
|
||||
/*begin Want_h*/
|
||||
#include <WoWo.h>
|
||||
#include <WoXtw.h>
|
||||
#include <WoXm.h>
|
||||
#include <WoXo.h>
|
||||
#include <WoHTML.h>
|
||||
#include <WoXz.h>
|
||||
#include <WoDeX.h>
|
||||
#include <WoCi.h>
|
||||
#include <WoPacksCi.h>
|
||||
#include <Wotcl.h>
|
||||
#include <WoHoXz.h>
|
||||
#include <WoXaw.h>
|
||||
#include <WoG3o.h>
|
||||
#include <WoG4o.h>
|
||||
#include <WoFNAL.h>
|
||||
#include <WoPAW.h> /*Need HAS_XZ and HAS_PAW flags.*/
|
||||
/*end Want_h*/
|
||||
|
||||
#include <OHistogram.h>
|
||||
|
||||
/*G4o*/
|
||||
#include <G4oState.hh>
|
||||
|
||||
/***************************************************************************/
|
||||
/***** G4 customization ****************************************************/
|
||||
/***************************************************************************/
|
||||
#include <test19DetectorConstruction.hh>
|
||||
#include <MyPhysicsList.hh>
|
||||
#include <MyPrimaryGeneratorAction.hh>
|
||||
|
||||
#include <G4UserRunAction.hh>
|
||||
#include <G4Run.hh>
|
||||
#include <G4Timer.hh>
|
||||
class RunAction : public G4UserRunAction {
|
||||
private:
|
||||
G4Timer* timer;
|
||||
G4int runIDcounter;
|
||||
#ifdef HAS_HO
|
||||
static OHistogram myHisto1D;
|
||||
static OHistogram myHisto2D;
|
||||
#endif /*HAS_HO*/
|
||||
public:
|
||||
RunAction() {
|
||||
timer = new G4Timer;
|
||||
runIDcounter = 0;
|
||||
}
|
||||
~RunAction() {
|
||||
delete timer;
|
||||
}
|
||||
void BeginOfRunAction(G4Run* aRun) {
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
CWarnF ("### Run %d start.\n",aRun->GetRunID());
|
||||
timer->Start();
|
||||
#ifdef HAS_HO
|
||||
// Histo are created in an osh script somewhere (G4oRunBegin.osh).
|
||||
myHisto1D = OHistogramGetIdentifier("HepJamesRandom1");
|
||||
myHisto2D = OHistogramGetIdentifier("HepJamesVsDRand48");
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
void EndOfRunAction(G4Run* aRun) {
|
||||
timer->Stop();
|
||||
if (timer->IsValid()) {
|
||||
CWarnF ("number of event = %d User=%gs Real=%gs Sys=%gs\n",
|
||||
aRun->GetNumberOfEvent(),
|
||||
timer->GetUserElapsed(),
|
||||
timer->GetRealElapsed(),
|
||||
timer->GetSystemElapsed());
|
||||
} else {
|
||||
CWarnF ("number of event = %d User=****s Real=****s Sys=****s\n",
|
||||
aRun->GetNumberOfEvent());
|
||||
}
|
||||
#ifdef HAS_HO
|
||||
myHisto1D = NULL;
|
||||
myHisto2D = NULL;
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
#ifdef HAS_HO
|
||||
static OHistogram get_1d(){return myHisto1D; }
|
||||
static OHistogram Get2d(){return myHisto2D; }
|
||||
#endif /*HAS_HO*/
|
||||
};
|
||||
#ifdef HAS_HO
|
||||
OHistogram RunAction::myHisto1D = NULL;
|
||||
OHistogram RunAction::myHisto2D = NULL;
|
||||
#endif /*HAS_HO*/
|
||||
|
||||
#include <G4UserEventAction.hh>
|
||||
class EventAction : public G4UserEventAction {
|
||||
public:
|
||||
EventAction() {
|
||||
}
|
||||
~EventAction() {
|
||||
}
|
||||
void BeginOfEventAction() {
|
||||
}
|
||||
void EndOfEventAction() {
|
||||
}
|
||||
};
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
class SteppingAction : public G4UserSteppingAction {
|
||||
private:
|
||||
HepJamesRandom theJamesEngine;
|
||||
DRand48Engine theDRand48Engine;
|
||||
public:
|
||||
SteppingAction(){};
|
||||
~SteppingAction(){};
|
||||
void UserSteppingAction() {
|
||||
#ifdef HAS_HO
|
||||
OHistogram h1 = RunAction::get_1d();
|
||||
OHistogram h2 = RunAction::Get2d();
|
||||
|
||||
HepRandom::setTheEngine (&theJamesEngine);
|
||||
double james = RandGauss::shoot(0.3,0.1);
|
||||
OHistogramFillOneDimensional(h1,james,0.01);
|
||||
|
||||
HepRandom::setTheEngine(&theDRand48Engine);
|
||||
double d48 = RandGauss::shoot(0.7,0.1);
|
||||
OHistogramFillTwoDimensional(h2,james,d48,0.01);
|
||||
#endif /*HAS_HO*/
|
||||
}
|
||||
};
|
||||
|
||||
static char what[] = "@(#)TEST";
|
||||
/***************************************************************************/
|
||||
int main (
|
||||
int a_argn
|
||||
,char** a_args
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
what[0] = '@'; /*c++ no warning.*/
|
||||
/*begin Want_c*/
|
||||
#include <WoWo.ic>
|
||||
#include <WoXtw.ic>
|
||||
#include <WoXm.ic>
|
||||
#include <WoXo.ic>
|
||||
#include <WoHTML.ic>
|
||||
#include <WoXz.ic>
|
||||
#include <WoDeX.ic>
|
||||
#include <WoCi.ic>
|
||||
#include <WoPacksCi.ic>
|
||||
#include <Wotcl.ic>
|
||||
#include <WoHoXz.ic>
|
||||
#include <WoXaw.ic>
|
||||
#include <WoG3o.ic>
|
||||
#include <WoG4o.ic>
|
||||
#include <WoFNAL.ic>
|
||||
#include <WoPAW.ic>
|
||||
/*end Want_c*/
|
||||
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
runManager->SetUserInitialization (new test19DetectorConstruction);
|
||||
runManager->SetUserInitialization (new MyPhysicsList);
|
||||
runManager->SetUserAction (new MyPrimaryGeneratorAction);
|
||||
runManager->SetUserAction (new RunAction);
|
||||
runManager->SetUserAction (new EventAction);
|
||||
runManager->SetUserAction (new SteppingAction);
|
||||
|
||||
G4oState* state = new G4oState("TEST_");
|
||||
|
||||
WoStartup (a_argn,a_args);
|
||||
WoProcessEvents ();
|
||||
WoClearClass ();
|
||||
|
||||
delete runManager;
|
||||
delete state;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EXPO_Detector.icc,v 2.1 1998/07/12 02:36:58 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// See also G4/run/example/MyDetectorConstruction.cc.
|
||||
|
||||
#include <G4VUserDetectorConstruction.hh>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <globals.hh>
|
||||
#include <G4Element.hh>
|
||||
#include <G4Material.hh>
|
||||
#include <G4Box.hh>
|
||||
#include <G4Tubs.hh>
|
||||
#include <G4LogicalVolume.hh>
|
||||
#include <G4PVPlacement.hh>
|
||||
#include <G4ThreeVector.hh>
|
||||
|
||||
class EXPO_DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
EXPO_DetectorConstruction()
|
||||
{
|
||||
}
|
||||
~EXPO_DetectorConstruction()
|
||||
{
|
||||
}
|
||||
G4VPhysicalVolume* Construct()
|
||||
{
|
||||
G4String name,symbol;
|
||||
G4double iz,a;
|
||||
G4double z,density;
|
||||
G4int nel;
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : begin.\n");
|
||||
#endif
|
||||
// Elements
|
||||
G4Element* elN = new G4Element (name="Nitrogen" , symbol="N", iz=7., a=14.01*g/mole);
|
||||
G4Element* elO = new G4Element (name="Oxygen" , symbol="O", iz=8., a=16.00*g/mole);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end Elements.\n");
|
||||
#endif
|
||||
// Materials
|
||||
G4Material* Air = new G4Material("Air" , density = 1.29e-03*g/cm3, nel=2);
|
||||
Air->AddElement (elN, .7);
|
||||
Air->AddElement (elO, .3);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end Air.\n");
|
||||
#endif
|
||||
G4Material* Al = new G4Material("Aluminium", z=13., a = 26.98 *g/mole, density = 2.7 *g/cm3);
|
||||
G4Material* Fe = new G4Material("Iron" , z=26., a = 55.85 *g/mole, density = 7.87 *g/cm3);
|
||||
G4Material* Pb = new G4Material("Lead" , z=82., a = 207.19*g/mole, density = 11.35*g/cm3);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end Materials.\n");
|
||||
#endif
|
||||
// Geometry
|
||||
G4Box* myWorldBox = new G4Box ("WorldBox" ,10000*cm,10000*cm,10000*cm);
|
||||
G4Box* myCalorBox = new G4Box ("CalorBox" ,1500*cm ,1500*cm ,1000*cm);
|
||||
G4Tubs* myChambTube = new G4Tubs ("ChambTube" ,50*cm,150*cm,200*cm,0.*deg,360.*deg);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end Geometry.\n");
|
||||
#endif
|
||||
// Logical volumes
|
||||
G4LogicalVolume* myWorldLog = new G4LogicalVolume (myWorldBox ,Air,"WorldLog" ,0,0,0);
|
||||
G4LogicalVolume* myCalorLog = new G4LogicalVolume (myCalorBox ,Air,"CalorLog" ,0,0,0);
|
||||
G4LogicalVolume* myChambLog = new G4LogicalVolume (myChambTube ,Pb ,"ChambLog" ,0,0,0);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end Logical volumes.\n");
|
||||
#endif
|
||||
// Physical volumes
|
||||
G4PVPlacement* myWorldPhys = new G4PVPlacement (0,G4ThreeVector() ,"WorldPhys",myWorldLog,0 ,false,0);
|
||||
G4PVPlacement* myCalorPhys = new G4PVPlacement (0,G4ThreeVector() ,"CalorPhys",myCalorLog,myWorldPhys,false,0);
|
||||
G4PVPlacement* myChambPhys = new G4PVPlacement (0,G4ThreeVector(0*cm,0*cm,0*cm),"ChambPhys",myChambLog,myCalorPhys,false,1);
|
||||
#ifdef DEBUG
|
||||
printf ("debug : EXPO_DetectorConstruction.Construct : end.\n");
|
||||
#endif
|
||||
return myWorldPhys;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EXPO_PhysicsList.hh,v 2.1 1998/07/12 02:36:58 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// This class is a class derived from G4VUserPhysicsList
|
||||
// for constructing all particles and processes.
|
||||
//
|
||||
// History
|
||||
// first version 10 Jan. 1998 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
#ifndef EXPO_PhysicsList_h
|
||||
#define EXPO_PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class EXPO_PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
EXPO_PhysicsList();
|
||||
virtual ~EXPO_PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
|
||||
//
|
||||
virtual void SetCuts(G4double aCut);
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
virtual void ConstructBosons();
|
||||
virtual void ConstructLeptons();
|
||||
virtual void ConstructMesons();
|
||||
virtual void ConstructBarions();
|
||||
virtual void ConstructIons();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
virtual void ConstructGeneral();
|
||||
virtual void ConstructEM();
|
||||
virtual void ConstructHad();
|
||||
virtual void ConstructLeptHad();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EXPO_PhysicsList.icc,v 2.2 1998/07/13 17:29:28 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// This is a version for maximum particle set
|
||||
// History
|
||||
// first version 10 Jan. 1998 by H.Kurashige
|
||||
// add decay at rest 26 Feb. 1998 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "EXPO_PhysicsList.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
|
||||
|
||||
EXPO_PhysicsList::EXPO_PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
EXPO_PhysicsList::~EXPO_PhysicsList()
|
||||
{
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructMesons();
|
||||
ConstructBarions();
|
||||
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// optical photon
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
G4TauMinus::TauMinusDefinition();
|
||||
G4TauPlus::TauPlusDefinition();
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4NeutrinoTau::NeutrinoTauDefinition();
|
||||
G4AntiNeutrinoTau::AntiNeutrinoTauDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4Eta::EtaDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
G4KaonZero::KaonZeroDefinition();
|
||||
G4AntiKaonZero::AntiKaonZeroDefinition();
|
||||
G4KaonZeroLong::KaonZeroLongDefinition();
|
||||
G4KaonZeroShort::KaonZeroShortDefinition();
|
||||
|
||||
G4DMesonPlus::DMesonPlusDefinition();
|
||||
G4DMesonMinus::DMesonMinusDefinition();
|
||||
G4DMesonZero::DMesonZeroDefinition();
|
||||
G4AntiDMesonZero::AntiDMesonZeroDefinition();
|
||||
G4DsMesonPlus::DsMesonPlusDefinition();
|
||||
G4DsMesonMinus::DsMesonMinusDefinition();
|
||||
G4JPsi::JPsiDefinition();
|
||||
|
||||
G4BMesonPlus::BMesonPlusDefinition();
|
||||
G4BMesonMinus::BMesonMinusDefinition();
|
||||
G4BMesonZero::BMesonZeroDefinition();
|
||||
G4AntiBMesonZero::AntiBMesonZeroDefinition();
|
||||
G4BsMesonZero::BsMesonZeroDefinition();
|
||||
G4AntiBsMesonZero::AntiBsMesonZeroDefinition();
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
G4Neutron::NeutronDefinition();
|
||||
G4AntiNeutron::AntiNeutronDefinition();
|
||||
G4Lambda::LambdaDefinition();
|
||||
G4AntiLambda::AntiLambdaDefinition();
|
||||
G4SigmaZero::SigmaZeroDefinition();
|
||||
G4AntiSigmaZero::AntiSigmaZeroDefinition();
|
||||
G4SigmaPlus::SigmaPlusDefinition();
|
||||
G4AntiSigmaPlus::AntiSigmaPlusDefinition();
|
||||
G4SigmaMinus::SigmaMinusDefinition();
|
||||
G4AntiSigmaMinus::AntiSigmaMinusDefinition();
|
||||
G4XiZero::XiZeroDefinition();
|
||||
G4AntiXiZero::AntiXiZeroDefinition();
|
||||
G4XiMinus::XiMinusDefinition();
|
||||
G4AntiXiMinus::AntiXiMinusDefinition();
|
||||
G4OmegaMinus::OmegaMinusDefinition();
|
||||
G4AntiOmegaMinus::AntiOmegaMinusDefinition();
|
||||
|
||||
G4LambdacPlus::LambdacPlusDefinition();
|
||||
G4SigmacPlusPlus::SigmacPlusPlusDefinition();
|
||||
G4SigmacPlus::SigmacPlusDefinition();
|
||||
G4SigmacZero::SigmacZeroDefinition();
|
||||
G4XicPlus::XicPlusDefinition();
|
||||
G4XicZero::XicZeroDefinition();
|
||||
G4OmegacZero::OmegacZeroDefinition();
|
||||
G4AntiLambdacPlus::AntiLambdacPlusDefinition();
|
||||
G4AntiSigmacPlusPlus::AntiSigmacPlusPlusDefinition();
|
||||
G4AntiSigmacPlus::AntiSigmacPlusDefinition();
|
||||
G4AntiSigmacZero::AntiSigmacZeroDefinition();
|
||||
G4AntiXicPlus::AntiXicPlusDefinition();
|
||||
G4AntiXicZero::AntiXicZeroDefinition();
|
||||
G4AntiOmegacZero::AntiOmegacZeroDefinition();
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructIons()
|
||||
{
|
||||
// nuclei
|
||||
G4Alpha::AlphaDefinition();
|
||||
G4Deuteron::DeuteronDefinition();
|
||||
G4Triton::TritonDefinition();
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
ConstructLeptHad();
|
||||
ConstructHad();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
void EXPO_PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
// Construct processes for gamma
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for electron
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
// Construct processes for positron
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
|
||||
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
|
||||
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
|
||||
|
||||
} else if( particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
//muon
|
||||
// Construct processes for muon+
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
|
||||
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
|
||||
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
|
||||
|
||||
} else {
|
||||
if ((particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")) {
|
||||
// all others charged particles except geantino
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::ConstructHad()
|
||||
{;}
|
||||
|
||||
void EXPO_PhysicsList::ConstructLeptHad()
|
||||
{;}
|
||||
|
||||
#include "G4Decay.hh"
|
||||
void EXPO_PhysicsList::ConstructGeneral()
|
||||
{
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (theDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager->AddProcess(theDecayProcess, INT_MAX, -1, INT_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EXPO_PhysicsList::SetCuts(G4double cut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "EXPO_PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << cut/mm << " (mm)" << endl;
|
||||
}
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
SetCutValue(cut, "gamma");
|
||||
SetCutValue(cut, "e-");
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
SetCutValue(cut, "proton");
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
|
||||
if (verboseLevel>1) {
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EXPO_Primary.icc,v 2.1 1998/07/12 02:36:59 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// See also G4/run/example/EXPO_PrimaryGeneratorAction.cc.
|
||||
|
||||
#include <G4VUserPrimaryGeneratorAction.hh>
|
||||
|
||||
#include <globals.hh>
|
||||
#include <G4Event.hh>
|
||||
#include <G4ParticleGun.hh>
|
||||
#include <G4ParticleTable.hh>
|
||||
#include <G4ParticleDefinition.hh>
|
||||
|
||||
class EXPO_PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
public:
|
||||
EXPO_PrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
G4String particleName;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName="e-");
|
||||
particleGun->SetParticleDefinition (particle);
|
||||
particleGun->SetParticleEnergy (1.*GeV);
|
||||
particleGun->SetParticleMomentumDirection (G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticlePosition (G4ThreeVector(0.*cm,0.*cm,0.*cm));
|
||||
}
|
||||
~EXPO_PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
void GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4o.h,v 2.1 1998/07/12 02:36:59 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#ifndef G4o_h
|
||||
#define G4o_h
|
||||
|
||||
#include <OShell.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
void G4oAddCommands (void*);
|
||||
void G4oExecuteScript (char*);
|
||||
OShell G4oGetShell ();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*G4o_h*/
|
||||
@@ -0,0 +1,41 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oCommon.hh,v 2.1 1998/07/12 02:37:00 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
Included by G4o.h.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*G4*/
|
||||
#include <G4UImanager.hh>
|
||||
#include <G4UIcommand.hh>
|
||||
#include <G4UIparameter.hh>
|
||||
#include <G4UIcommandTree.hh>
|
||||
|
||||
/*Co*/
|
||||
#include <CMemory.h>
|
||||
#include <CPrinter.h>
|
||||
#include <CText.h>
|
||||
#include <CFile.h>
|
||||
#include <OType.h>
|
||||
#include <OShell.h>
|
||||
#include <OProcess.h>
|
||||
|
||||
|
||||
static void SetTypes ();
|
||||
static void ExecuteScript (char*);
|
||||
static int Execute_G4 (int,char**,OProcess);
|
||||
static int DoMethod (OIdentifier,char*,void*,int,char**,void*,int*);
|
||||
static G4UIcommand* GetCommandIdentifier (char*);
|
||||
static void GetCommands (G4UIcommandTree*,int*,char***);
|
||||
static int ProduceODB (G4UIcommand*,char*);
|
||||
|
||||
@@ -0,0 +1,463 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oCommon.icc,v 2.2 1998/08/12 14:21:55 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
Included by G4o.cc.
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
void SetTypes (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
OType otype;
|
||||
/*.........................................................................*/
|
||||
if(OTypeGetIdentifier("G4")!=NULL) return; /*Done*/
|
||||
|
||||
otype = OTypeCreate ("G4");
|
||||
OTypeSetDoMethodFunction (otype,DoMethod);
|
||||
OTypeAddNewClassMethodProperty (otype,"getCommandGuidance" ,OPropertyString,NULL);
|
||||
OTypeAddNewClassMethodProperty (otype,"askListOfCommands" ,OPropertyString,NULL);
|
||||
OTypeAddNewClassMethodProperty (otype,"createCommandPanel" ,OPropertyVoid,NULL);
|
||||
|
||||
}
|
||||
/***************************************************************************/
|
||||
int Execute_G4 (
|
||||
int a_argn
|
||||
,char** a_args
|
||||
,OProcess a_process
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*
|
||||
osh> G4 <string:command> <string:param 1> ...
|
||||
*/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
int count;
|
||||
char* string = NULL;
|
||||
/*.........................................................................*/
|
||||
if(a_argn<=1)
|
||||
{
|
||||
CWarnF ("At least one argument expected in:\n%s\n",OProcessGetCommand(a_process));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
for(count=1;count<a_argn;count++)
|
||||
{
|
||||
CStringConcatenate (&string,a_args[count]);
|
||||
CStringConcatenate (&string," ");
|
||||
}
|
||||
ExecuteScript (string);
|
||||
CStringDelete (string);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void ExecuteScript (
|
||||
char* a_string
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4UImanager* UI;
|
||||
int linen = 0;
|
||||
char** lines = NULL;
|
||||
/*.........................................................................*/
|
||||
UI = G4UImanager::GetUIpointer();
|
||||
if(UI==NULL) return;
|
||||
lines = CTextCreateFromString (a_string,&linen);
|
||||
if( (linen!=0) && (lines!=NULL) )
|
||||
{
|
||||
int count;
|
||||
for(count=0;count<linen;count++)
|
||||
{
|
||||
CStringTrim(lines[count]);
|
||||
if( (lines[count]==NULL) || (lines[count][0]=='\0') || (lines[count][0]=='#') ) continue;
|
||||
UI->ApplyCommand(lines[count]);
|
||||
}
|
||||
}
|
||||
CTextDelete (linen,lines);
|
||||
}
|
||||
/***************************************************************************/
|
||||
int DoMethod (
|
||||
OIdentifier This
|
||||
,char* a_name
|
||||
,void* a_user
|
||||
,int a_argn
|
||||
,char** a_args
|
||||
,void* a_addr
|
||||
,int* a_number
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
if(a_number!=NULL) *a_number = 0;
|
||||
if(a_name==NULL) return 0;
|
||||
|
||||
if(This==NULL)
|
||||
{
|
||||
if(strcmp(a_name,"getCommandGuidance")==0)
|
||||
{
|
||||
G4UIcommand* command;
|
||||
char* string = NULL;
|
||||
int count,linen,paramn;
|
||||
if(a_argn!=1)
|
||||
{
|
||||
CWarnF ("One arguments expected for %s property.\n",a_name);
|
||||
return 0;
|
||||
}
|
||||
command = GetCommandIdentifier(a_args[0]);
|
||||
if(command==NULL)
|
||||
{
|
||||
CWarnF ("Unknown G4 command :\n%s\n",a_args[0]);
|
||||
return 0;
|
||||
}
|
||||
linen = command->GetGuidanceEntries();
|
||||
for(count=0;count<linen;count++)
|
||||
{
|
||||
CStringConcatenate (&string,(char*)command->GetGuidanceLine(count).data());
|
||||
CStringConcatenate (&string,"\n");
|
||||
}
|
||||
paramn = command->GetParameterEntries();
|
||||
for(count=0;count<paramn;count++)
|
||||
{
|
||||
char* info;
|
||||
char* line;
|
||||
G4UIparameter* parameter = (G4UIparameter*)command->GetParameter(count);
|
||||
|
||||
info = (char*)parameter->GetParameterName().data();
|
||||
line = CStringCreateF(12+strlen(info)+1,"Parameter : %s\n",info);
|
||||
CStringConcatenate (&string,line);
|
||||
CStringDelete (line);
|
||||
|
||||
if( ! parameter->GetParameterGuidance().isNull() )
|
||||
{
|
||||
CStringConcatenate (&string,(char*)parameter->GetParameterGuidance().data());
|
||||
CStringConcatenate (&string,"\n");
|
||||
}
|
||||
|
||||
line = CStringCreateF(19+1+1," Parameter type : %c\n",parameter->GetParameterType());
|
||||
CStringConcatenate (&string,line);
|
||||
CStringDelete (line);
|
||||
|
||||
if(parameter->IsOmittable()==TRUE)
|
||||
line = CStringDuplicate(" Omittable : true\n");
|
||||
else
|
||||
line = CStringDuplicate(" Omittable : false\n");
|
||||
CStringConcatenate (&string,line);
|
||||
CStringDelete (line);
|
||||
|
||||
if( ! parameter->GetDefaultValue().isNull() )
|
||||
{
|
||||
info = (char*)parameter->GetDefaultValue().data();
|
||||
line = CStringCreateF(19+strlen(info)+1," Default value : %s\n",info);
|
||||
CStringConcatenate (&string,line);
|
||||
CStringDelete (line);
|
||||
}
|
||||
|
||||
if( ! parameter->GetParameterRange().isNull() )
|
||||
{
|
||||
info = (char*)parameter->GetParameterRange().data();
|
||||
line = CStringCreateF(19+strlen(info)+1," Parameter range : %s\n",info);
|
||||
CStringConcatenate (&string,line);
|
||||
CStringDelete (line);
|
||||
}
|
||||
}
|
||||
*((char**)a_addr) = string;
|
||||
return FREE_BLOCK;
|
||||
}
|
||||
else if(strcmp(a_name,"askListOfCommands")==0)
|
||||
{
|
||||
G4UIcommandTree* treeTop;
|
||||
char* string = NULL;
|
||||
G4UImanager* UI;
|
||||
int linen = 0;
|
||||
char** lines = NULL;
|
||||
UI = G4UImanager::GetUIpointer();
|
||||
if(UI==NULL) return 0;
|
||||
treeTop = UI->GetTree();
|
||||
if(treeTop==NULL) return 0;
|
||||
if(a_argn==1) treeTop = treeTop->GetTree(a_args[0]);
|
||||
GetCommands (treeTop,&linen,&lines);
|
||||
string = CTextConvertToString (linen,lines,"\n");
|
||||
CTextDelete (linen,lines);
|
||||
*((char**)a_addr) = string;
|
||||
return FREE_BLOCK;
|
||||
}
|
||||
else if(strcmp(a_name,"createCommandPanel")==0)
|
||||
{
|
||||
if(a_argn!=2)
|
||||
{
|
||||
CWarnF ("Two arguments expected for %s property.\n",a_name);
|
||||
return 0;
|
||||
}
|
||||
return ProduceODB(GetCommandIdentifier(a_args[0]),a_args[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
CInfoF ("G4_DoMethod: %s is not a class routine property.\n",a_name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
CInfoF ("G4_DoMethod: %s is not a routine property.\n",a_name);
|
||||
|
||||
a_user = NULL;
|
||||
a_argn = 0;
|
||||
a_args = NULL;
|
||||
a_addr = NULL;
|
||||
return 0;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void GetCommands (
|
||||
G4UIcommandTree* a_tree
|
||||
,int* a_linen
|
||||
,char*** a_lines
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
if(a_tree==NULL) return;
|
||||
|
||||
int n_commandEntry = a_tree->GetCommandEntry();
|
||||
for( int i_thCommand = 1; i_thCommand <= n_commandEntry; i_thCommand++ )
|
||||
{
|
||||
G4UIcommand* command = a_tree->GetCommand(i_thCommand);
|
||||
CTextAddLine (a_linen,a_lines,(char*)command->GetCommandPath().data());
|
||||
}
|
||||
|
||||
int n_treeEntry = a_tree->GetTreeEntry();
|
||||
for( int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ )
|
||||
{
|
||||
GetCommands (a_tree->GetTree(i_thTree),a_linen,a_lines);
|
||||
}
|
||||
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4UIcommand* GetCommandIdentifier (
|
||||
char* a_name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4UImanager* UI;
|
||||
G4UIcommandTree* treeTop;
|
||||
/*.........................................................................*/
|
||||
if(a_name==NULL) return NULL;
|
||||
UI = G4UImanager::GetUIpointer();
|
||||
if(UI==NULL) return NULL;
|
||||
treeTop = UI->GetTree();
|
||||
if(treeTop==NULL) return NULL;
|
||||
return treeTop->FindPath(a_name);
|
||||
}
|
||||
/***************************************************************************/
|
||||
int ProduceODB (
|
||||
G4UIcommand* a_command
|
||||
,char* a_name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
FILE* file;
|
||||
int paramn,parami;
|
||||
char* top = NULL;
|
||||
/*.........................................................................*/
|
||||
if(a_command==NULL) return 0;
|
||||
|
||||
paramn = a_command->GetParameterEntries();
|
||||
|
||||
file = CFileOpenForWriting (a_name);
|
||||
if(file==NULL) return 0;
|
||||
|
||||
fprintf (file,"\
|
||||
!----------------------------\n\
|
||||
begin OInterface\n\
|
||||
prefix = G4Params_\n\
|
||||
end\n\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_palette\n\
|
||||
type = XmFormDialog\n\
|
||||
children = G4Params_command\
|
||||
");
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
fprintf (file," G4Params_label_%d G4Params_text_%d",parami,parami);
|
||||
}
|
||||
fprintf (file," G4Params_ok G4Params_apply G4Params_cancel\n\
|
||||
autoUnmanage = False\n\
|
||||
dialogTitle = G4 parameters\n\
|
||||
end\n\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_command\n\
|
||||
type = XmPushButton\n\
|
||||
labelString = %s\n\
|
||||
background = black\n\
|
||||
foreground = white\n\
|
||||
leftAttachment = attach_form\n\
|
||||
rightAttachment = attach_form\n\
|
||||
topAttachment = attach_form\n\
|
||||
activateCallback = osh>\\\n\
|
||||
command=`getWidgetResource G4Params_command labelString`\\\n\
|
||||
echo `do G4 getCommandGuidance $command`\n\
|
||||
end\n\
|
||||
",a_command->GetCommandPath().data());
|
||||
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
G4UIparameter* parameter = (G4UIparameter*)a_command->GetParameter(parami);
|
||||
fprintf (file,"\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_label_%d\n\
|
||||
type = XmLabel\n\
|
||||
labelString = %s\n\
|
||||
createCallback = osh> setWidgetResource `thisWidget` height `getWidgetResource G4Params_text_%d height`\n\
|
||||
leftAttachment = attach_form\n\
|
||||
",parami,parameter->GetParameterName().data(),parami);
|
||||
if(parami==0)
|
||||
{
|
||||
fprintf (file,"\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = G4Params_command\n\
|
||||
");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (file,"\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = G4Params_text_%d\n\
|
||||
",parami-1);
|
||||
}
|
||||
fprintf (file,"\
|
||||
end\n\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_text_%d\n\
|
||||
type = XmText\n\
|
||||
leftAttachment = attach_widget\n\
|
||||
leftWidget = G4Params_label_%d\n\
|
||||
rightAttachment = attach_form\n\
|
||||
",parami,parami);
|
||||
if(parami==0)
|
||||
{
|
||||
fprintf (file,"\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = G4Params_command\n\
|
||||
");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (file,"\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = G4Params_text_%d\n\
|
||||
",parami-1);
|
||||
}
|
||||
|
||||
if( ! parameter->GetDefaultValue().isNull() )
|
||||
{
|
||||
fprintf (file,"\
|
||||
value = %s\n\
|
||||
",parameter->GetDefaultValue().data());
|
||||
}
|
||||
|
||||
fprintf (file,"\
|
||||
end\n\
|
||||
");
|
||||
|
||||
}
|
||||
|
||||
if(paramn>=1)
|
||||
{
|
||||
top = CStringCreateF(14+32,"G4Params_text_%d",paramn-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
top = CStringDuplicate("G4Params_command");
|
||||
}
|
||||
|
||||
fprintf (file,"\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_ok\n\
|
||||
type = XmPushButton\n\
|
||||
labelString = Ok\n\
|
||||
activateCallback = osh>\\\n\
|
||||
command=`getWidgetResource G4Params_command labelString`\\\n\
|
||||
");
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
fprintf (file,"\
|
||||
param_%d=`getWidgetResource G4Params_text_%d value`\\\n\
|
||||
",parami,parami);
|
||||
}
|
||||
fprintf (file,"\
|
||||
G4 $command");
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
fprintf (file," $param_%d",parami);
|
||||
}
|
||||
fprintf (file,"\\\n\
|
||||
unmanageWidget `thisWidgetParent`\n\
|
||||
bottomAttachment = attach_form\n\
|
||||
leftAttachment = attach_form\n\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = %s\n\
|
||||
end\n\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_apply\n\
|
||||
type = XmPushButton\n\
|
||||
labelString = Apply\n\
|
||||
activateCallback = osh>\\\n\
|
||||
command=`getWidgetResource G4Params_command labelString`\\\n\
|
||||
",top);
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
fprintf (file,"\
|
||||
param_%d=`getWidgetResource G4Params_text_%d value`\\\n\
|
||||
",parami,parami);
|
||||
}
|
||||
fprintf (file,"\
|
||||
G4 $command");
|
||||
for(parami=0;parami<paramn;parami++)
|
||||
{
|
||||
fprintf (file," $param_%d",parami);
|
||||
}
|
||||
fprintf (file,"\n\
|
||||
bottomAttachment = attach_form\n\
|
||||
leftAttachment = attach_widget\n\
|
||||
leftWidget = G4Params_ok\n\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = %s\n\
|
||||
end\n\
|
||||
!----------------------------\n\
|
||||
begin OWidget\n\
|
||||
name = G4Params_cancel\n\
|
||||
type = XmPushButton\n\
|
||||
labelString = Cancel\n\
|
||||
activateCallback = osh> unmanageWidget `thisWidgetParent`\n\
|
||||
bottomAttachment = attach_form\n\
|
||||
leftAttachment = attach_widget\n\
|
||||
leftWidget = G4Params_apply\n\
|
||||
rightAttachment = attach_form\n\
|
||||
topAttachment = attach_widget\n\
|
||||
topWidget = %s\n\
|
||||
end\n\
|
||||
",top,top);
|
||||
|
||||
CStringDelete (top);
|
||||
|
||||
fclose(file);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oDrawer.hh,v 2.2 1998/09/16 12:06:17 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
|
||||
#ifndef G4ODRAWER_HH
|
||||
#define G4ODRAWER_HH
|
||||
|
||||
#include <G4VVisManager.hh>
|
||||
|
||||
#include <ONode.h>
|
||||
#include <OColormap.h>
|
||||
|
||||
class G4Event;
|
||||
class G4Polyline;
|
||||
class G4Text;
|
||||
class G4Circle;
|
||||
class G4Square;
|
||||
class G4Polymarker;
|
||||
class G4Polyhedron;
|
||||
class G4NURBS;
|
||||
class G4VSolid;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4VisAttributes;
|
||||
class G4Colour;
|
||||
|
||||
class G4oDrawer: public G4VVisManager {
|
||||
|
||||
public:
|
||||
|
||||
static G4oDrawer* GetInstance (); // Access to private constructor.
|
||||
~G4oDrawer ();
|
||||
|
||||
void SetWorldVolume (G4VPhysicalVolume* world);
|
||||
|
||||
void Draw (const G4Polyline&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4Text&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4Circle&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4Square&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4Polymarker&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4Polyhedron&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4NURBS&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
// Now Follow functions for drawing a GEANT4 geometry object. Note
|
||||
// that the 2nd argument overrides any visualization attributes that
|
||||
// are associated with the object itself.
|
||||
|
||||
void Draw (const G4VSolid&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4LogicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void Draw (const G4VPhysicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
|
||||
void GeometryHasChanged ();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Timing messages.
|
||||
|
||||
void EventBegins ();
|
||||
// All stacks are clear and event processing is about to start.
|
||||
|
||||
void EventEnded (G4Event* pEvent);
|
||||
// Event processing has ended and event-persistent data is available.
|
||||
|
||||
void SetNode (ONode);
|
||||
|
||||
private:
|
||||
|
||||
G4oDrawer (); // Private constructor.
|
||||
static G4oDrawer* fpInstance; // Pointer to single instance.
|
||||
static ONode node;
|
||||
static OColormap colormap;
|
||||
void SetColour (const G4Colour&);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oEXPO.h,v 2.1 1998/07/12 02:37:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#ifndef G4oEXPO_h
|
||||
#define G4oEXPO_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
void G4oEXPO_Initialize ();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*G4oEXPO_h*/
|
||||
@@ -0,0 +1,66 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oScene.hh,v 2.2 1998/07/12 02:37:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
|
||||
#ifndef G4OSCENE_HH
|
||||
#define G4OSCENE_HH
|
||||
|
||||
#include <G4VGraphicsScene.hh>
|
||||
|
||||
class G4PhysicalVolumeModel;
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
|
||||
#include <ONode.h>
|
||||
|
||||
class G4oScene : public G4VGraphicsScene {
|
||||
public:
|
||||
//Inherited
|
||||
void AddThis (const G4Box& box);
|
||||
void AddThis (const G4Cons& cons);
|
||||
void AddThis (const G4Tubs& tubs);
|
||||
void AddThis (const G4Trd& trd);
|
||||
void AddThis (const G4Trap& trap);
|
||||
void AddThis (const G4Sphere& sphere);
|
||||
void AddThis (const G4Para& para );
|
||||
void AddThis (const G4Torus& torus );
|
||||
void AddThis (const G4VSolid& solid); // For solids not above.
|
||||
|
||||
void PreAddThis (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes& visAttribs);
|
||||
void PostAddThis ();
|
||||
|
||||
void EstablishSpecials (G4PhysicalVolumeModel&);
|
||||
|
||||
//Local
|
||||
G4oScene ();
|
||||
~G4oScene ();
|
||||
void SetNodeName (char*);
|
||||
ONode GetNode ();
|
||||
|
||||
private:
|
||||
static ONode node;
|
||||
const G4Transform3D* fpAccTransf; // Accumulated transformation.
|
||||
static char* nodeName;
|
||||
void AddPolyhedron (G4Polyhedron*);
|
||||
G4int fCurrentDepth; // Current depth of geom. hierarchy.
|
||||
G4VPhysicalVolume* fpCurrentPV; // Current physical volume.
|
||||
G4LogicalVolume* fpCurrentLV; // Current logical volume.
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oState.hh,v 2.1 1998/07/12 02:37:02 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef G4oState_h
|
||||
#define G4oState_h
|
||||
|
||||
#include <G4VStateDependent.hh>
|
||||
#include <G4UIsession.hh>
|
||||
|
||||
class G4oState : public G4VStateDependent, public G4UIsession {
|
||||
public:
|
||||
G4oState (G4String);
|
||||
G4bool Notify (G4ApplicationState);
|
||||
void PauseSessionStart (G4String);
|
||||
private:
|
||||
G4String name;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: WoG4o.h,v 2.1 1998/07/12 02:37:02 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#ifndef WoG4o_h
|
||||
#define WoG4o_h
|
||||
|
||||
#ifdef HAS_G4O
|
||||
|
||||
/*G4o*/
|
||||
#include <G4o.h>
|
||||
|
||||
/*Wo*/
|
||||
#include <Wo.h>
|
||||
#include <OInterface.h>
|
||||
#include <OInterpreter.h>
|
||||
|
||||
#endif /*HAS_G4O*/
|
||||
|
||||
#endif /*WoG4o_h*/
|
||||
@@ -0,0 +1,23 @@
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#ifndef WoG4o_ic
|
||||
#define WoG4o_ic
|
||||
|
||||
#ifdef HAS_G4O
|
||||
|
||||
G4oAddCommands (WoGetShellInterpreter());
|
||||
|
||||
OInterfaceAddPackage ("G4o");
|
||||
|
||||
OInterpreterAddInterpreter ("G4",G4oExecuteScript);
|
||||
|
||||
#endif /*HAS_G4O*/
|
||||
|
||||
#endif /*WoG4o_ic*/
|
||||
@@ -0,0 +1,510 @@
|
||||
#/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#/* | Copyright (C) 1995, Guy Barrand, LAL Orsay. (barrand@lalcls.in2p3.fr) | */
|
||||
#/* | Permission to use, copy, modify, and distribute this software | */
|
||||
#/* | and its documentation for any purpose and without fee is hereby | */
|
||||
#/* | granted, provided that the above copyright notice appear in all | */
|
||||
#/* | copies and that both that copyright notice and this permission | */
|
||||
#/* | notice appear in supporting documentation. This software is | */
|
||||
#/* | provided "as is" without express or implied warranty. | */
|
||||
#/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# Examples :
|
||||
# UNIX> make OSF1
|
||||
# UNIX> make OSF1 target=all
|
||||
# UNIX> make OSF1 target=clean
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
default :
|
||||
@echo " Type :"
|
||||
@echo " UNIX> make <config>"
|
||||
@echo " where, for the distribution, <config> could be :"
|
||||
@echo " OSF1"
|
||||
@echo " HP-UX"
|
||||
@echo " HP-UX-aCC"
|
||||
@echo " Linux"
|
||||
@echo " ULTRIX"
|
||||
@echo " AIX"
|
||||
@echo " IRIX"
|
||||
@echo " SunOS"
|
||||
@echo " Linux-gxx = Linux compiling with g++."
|
||||
@echo " insure = OSF1 + insure product."
|
||||
@echo " HP-UX-9 = HP-UX A.09.05."
|
||||
@echo " For example : "
|
||||
@echo " UNIX> make OSF1"
|
||||
@echo " If none of the above 'config' matches you environment,"
|
||||
@echo " edit the Co/v3/mgr/Config.mk file."
|
||||
|
||||
# Perfect situation still never reached !!!
|
||||
POSIX : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = cc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = " \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/lib -lXmu" \
|
||||
"libXaw = -L/usr/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
|
||||
# OSF1 asa V4.0 464 alpha
|
||||
# CCLDFLAGS : -non_shared to compell link with .a libs
|
||||
# For cxx 5.x : APP_CXXFLAGS = -define_templates -DSOLVE_TEMPLATES
|
||||
OSF1 : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -std1 -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = cc" \
|
||||
"CCLDFLAGS = -std1" \
|
||||
"CCLDEND = -lots -lSM -lICE -ldnet_stub" \
|
||||
"CXX = cxx" \
|
||||
"CXXFLAGS = -ptr ${OREPOSITORY} -I${RWROOT}/include -g" \
|
||||
"CXXLD = cxx" \
|
||||
"CXXLDFLAGS = -ptr ${OREPOSITORY} -non_shared" \
|
||||
"CXXLDEND = -lots -lSM -lICE -ldnet_stub" \
|
||||
"APP_CXXFLAGS = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w" \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"JAVA_CPPFLAGS = -D_OSF1_SOURCE -I/usr/local/java/include -I/usr/local/java/include/osfport/" \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lfor -lFutil -lUfor" \
|
||||
"libX11 = -L/usr/shlib -lX11" \
|
||||
"libXext = -L/usr/shlib -lXext" \
|
||||
"libXt = -L/usr/shlib -lXt" \
|
||||
"libXmu = -L/usr/shlib -lXmu" \
|
||||
"libXaw = -L/usr/shlib -lXaw" \
|
||||
"libXm = -L/usr/shlib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# HP-UX aleph B.10.20 A 9000/780 2011153535 two-user license
|
||||
#"CCLDFLAGS = -Wl,-a,archive"
|
||||
#"CCLDFLAGS = -Wl,-a,archive_shared"
|
||||
# At least on 10.20, Xm and Xaw are incompatibles.
|
||||
# At load, put "archive_shared" so that linking G4o apps with G4 libs works.
|
||||
#"libXm = -L/usr/lib -lXm" is imcompatible with loading option "-Wl,-a,archive_shared" needed for linking with G4.
|
||||
#"libXm = /usr/lib/Motif1.2_R6/libXm.a"
|
||||
HP-UX : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = sl" \
|
||||
"so = sl" \
|
||||
"CC = c89" \
|
||||
"CFLAGS = +Z -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = c89" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = -ldld -lisamstub" \
|
||||
"CXX = CC" \
|
||||
"CXXFLAGS = +a1 +Z -pta -ptr${OREPOSITORY} -I${RWROOT}/include -O" \
|
||||
"CXXLD = CC" \
|
||||
"CXXLDFLAGS = +a1 +Z -pta -ptr${OREPOSITORY} -O" \
|
||||
"CXXLDEND = -lisamstub" \
|
||||
"APP_CXXFLAGS = -DSOLVE_TEMPLATES" \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w +ppu" \
|
||||
"F77LD = fort77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/contrib/X11R6/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = -I/usr/contrib/X11R6/include -I/usr/contrib/X11R6/include/X11" \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/contrib/X11R6/lib -lXmu" \
|
||||
"libXaw = -L/usr/contrib/X11R6/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# HP-UX aleph B.10.20 A 9000/780 2011153535 two-user license
|
||||
HP-UX-aCC : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = sl" \
|
||||
"so = sl" \
|
||||
"CC = c89" \
|
||||
"CFLAGS = +Z -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = c89" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = -ldld -lisamstub" \
|
||||
"CXX = aCC" \
|
||||
"CXXFLAGS = +Z -O -DRW_NO_STL -DG4_HAVE_BOOL -I/opt/aCC/include" \
|
||||
"CXXLD = aCC" \
|
||||
"CXXLDFLAGS = +Z -O" \
|
||||
"CXXLDEND = -lisamstub" \
|
||||
"APP_CXXFLAGS = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w +ppu" \
|
||||
"F77LD = fort77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/contrib/X11R6/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = -I/usr/contrib/X11R6/include -I/usr/contrib/X11R6/include/X11" \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/contrib/X11R6/lib -lXmu" \
|
||||
"libXaw = -L/usr/contrib/X11R6/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# HP-UX cchp004 A.09.05 A 9000/770 2004200392 two-user license
|
||||
#"CCLDFLAGS = -Wl,-a,archive"
|
||||
#"CCLDFLAGS = -Wl,-a,archive_shared"
|
||||
# At load, put "archive_shared" so that linking G4o apps with G4 libs works.
|
||||
HP-UX-9 : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = sl" \
|
||||
"so = sl" \
|
||||
"CC = c89" \
|
||||
"CFLAGS = +Z -D_HPUX_SOURCE -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = c89" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = -ldld -lisamstub" \
|
||||
"CXX = CC" \
|
||||
"CXXFLAGS = +a1 +Z -pts -ptr${OREPOSITORY} -O" \
|
||||
"CXXLD = CC" \
|
||||
"CXXLDFLAGS = +a1 +Z -pts -ptr${OREPOSITORY} -O -Wl,-a,archive_shared" \
|
||||
"CXXLDEND = " \
|
||||
"APP_CXXFLAGS = -DSOLVE_TEMPLATES" \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w +ppu" \
|
||||
"F77LD = fort77" \
|
||||
"X11_CPPFLAGS = -I/usr/include/X11R5" \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11R5/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I../usr/HP-UX/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = -I../usr/HP-UX/include" \
|
||||
"Xm_CPPFLAGS = -I/usr/include/Motif1.2" \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/lib/X11R5 -lX11" \
|
||||
"libXext = -L/usr/lib/X11R5 -lXext" \
|
||||
"libXt = -L/usr/lib/X11R5 -lXt" \
|
||||
"libXmu = /usr/lib/X11R4/libXmu.sl" \
|
||||
"libXaw = /usr/lib/X11R4/libXaw.sl" \
|
||||
"libXm = -L/usr/lib/Motif1.2 -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
#ULTRIX ux3 4.4 0 RISC
|
||||
ULTRIX : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = a" \
|
||||
"so = so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -YPOSIX -DUNIX" \
|
||||
"CCLD = cc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w -G 3 -static -u" \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lfor -lutil -lUfor -lots -li" \
|
||||
"libX11 = -lX11" \
|
||||
"libXext = -lXext" \
|
||||
"libXt = -lXt" \
|
||||
"libXmu = -lXmu" \
|
||||
"libXaw = -lXaw" \
|
||||
"libXm = -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# "OSF1 asa V4.0 464 alpha" + insight
|
||||
# Do not use shared lib to have source code visibility.
|
||||
# In CXXFLAGS "-ptr ${OREPOSITORY}" should be put in a .insight file with : preprocessor_flag -ptr ${OREPOSITORY}
|
||||
insure : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = insight" \
|
||||
"CFLAGS = -std1 -DUNIX -DHAS_DLD -g" \
|
||||
"CCLD = insight" \
|
||||
"CCLDFLAGS = -std1 -g" \
|
||||
"CCLDEND = -lots -L/lal/insure/3.0.1/lib.alpha -ltqsiiccc" \
|
||||
"CXX = insight" \
|
||||
"CXXFLAGS = -ptr ${OREPOSITORY} -g" \
|
||||
"CXXLD = insight" \
|
||||
"CXXLDFLAGS = -ptr ${OREPOSITORY} -non_shared" \
|
||||
"CXXLDEND = -lcxx -lexc -lots -lSM -lICE -ldnet_stub -L/lal/insure/3.0.1/lib.alpha -ltqsiiccc" \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w -g" \
|
||||
"F77LD = f77" \
|
||||
"F77LDEND = -L/lal/insure/3.0.1/lib.alpha -linsight" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lfor -lFutil -lUfor" \
|
||||
"libX11 = -L/usr/shlib -lX11" \
|
||||
"libXext = -L/usr/shlib -lXext" \
|
||||
"libXt = -L/usr/shlib -lXt" \
|
||||
"libXmu = -L/usr/shlib -lXmu" \
|
||||
"libXaw = -L/usr/shlib -lXaw" \
|
||||
"libXm = -L/usr/shlib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# Linux pcbp.lal.in2p3.fr 2.0.25 #2 Thu Dec 5 09:56:01 MET 1996 i586
|
||||
# CXXFLAGS dedicated to compile G4 include files.
|
||||
#"CCLDFLAGS = -Wl,-Bstatic"
|
||||
# Xm from XiG (previous Xinside).
|
||||
Linux : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -ansi -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = gcc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"CXX = g++" \
|
||||
"CXXFLAGS = -pipe -fno-for-scope -DGNU_GCC -DG4_HAVE_BOOL -O" \
|
||||
"CXXLD = g++" \
|
||||
"CXXLDFLAGS = " \
|
||||
"CXXLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = " \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = -I/usr/X11R6/include" \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/X11R6/lib -lX11 -lSM -lICE" \
|
||||
"libXext = -L/usr/X11R6/lib -lXext" \
|
||||
"libXt = -L/usr/X11R6/lib -lXt" \
|
||||
"libXmu = -L/usr/X11R6/lib -lXmu" \
|
||||
"libXaw = -L/usr/X11R6/lib -lXaw" \
|
||||
"libXm = -L/usr/X11R6/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# Linux PC-Barrand.lal.in2p3.fr 2.0.30 #9 Mon Sep 22 17:53:05 MET DST 1997 i686 unknown
|
||||
#"CCLDFLAGS = -Wl,-Bstatic"
|
||||
# Xm from XiG (previous Xinside).
|
||||
Linux-gxx : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = g++" \
|
||||
"CFLAGS = -x c++ -Wall -ansi -DUNIX -DHAS_DLD -O" \
|
||||
"CCCC = -x c" \
|
||||
"CCLD = g++" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"CXX = g++" \
|
||||
"CXXFLAGS = -Wall -ansi -pipe -fno-for-scope -DGNU_GCC -DG4_HAVE_BOOL -O" \
|
||||
"CXXLD = g++" \
|
||||
"CXXLDFLAGS = " \
|
||||
"CXXLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = " \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = -I/usr/X11R6/include" \
|
||||
"JAVA_CPPFLAGS = -I/usr/local/JDK/jdk-1.1.3/include/ -I/usr/local/JDK/jdk-1.1.3/include/genunix" \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/X11R6/lib -lX11 -lSM -lICE" \
|
||||
"libXext = -L/usr/X11R6/lib -lXext" \
|
||||
"libXt = -L/usr/X11R6/lib -lXt" \
|
||||
"libXmu = -L/usr/X11R6/lib -lXmu" \
|
||||
"libXaw = -L/usr/X11R6/lib -lXaw" \
|
||||
"libXm = -L/usr/X11R6/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
|
||||
# AIX sp070 1 4 000171755700
|
||||
# -D_ALL_SOURCE -D_BSD so that sys/types.h includes sys/select.h and then defines fd_set.
|
||||
# Pb with malloc on AIX 3.2., do a :
|
||||
# csh> setenv MALLOCTYPE "3.1"
|
||||
# to use older version.
|
||||
# -xlf90 seems now needed in addition to -lxlf.
|
||||
# On some system use -bI:/usr/lpp/xlf/lib/lowsys.exp to solve reference .__divus, .__quous, .__mulh
|
||||
# Can do a find/grep over *exp files to find a symbol.
|
||||
AIX : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = a" \
|
||||
"so = so" \
|
||||
"CC = xlc" \
|
||||
"CFLAGS = -D_POSIX_SOURCE -D_ALL_SOURCE -D_BSD -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = xlc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = -lld" \
|
||||
"F77 = xlf" \
|
||||
"F77FLAGS = -w -qextname -qrndsngl" \
|
||||
"F77LD = xlf" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lxlf90 -lxlf" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/lib -lXmu" \
|
||||
"libXaw = -L/usr/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# IRIX fnpspa 5.3 11091810 IP12 mips
|
||||
IRIX : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = so" \
|
||||
"so = so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -w -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = cc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"CXX = CC" \
|
||||
"CXXFLAGS = -ptused -O" \
|
||||
"CXXLD = CC" \
|
||||
"CXXLDFLAGS = " \
|
||||
"CXXLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = -w +ppu" \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lftn -lm -lc" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/lib -lXmu" \
|
||||
"libXaw = -L/usr/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# NOT TESTED YET.
|
||||
# In general SunOS is a nightmare ; cc is not ANSI by default and MOTIF is not usaully in standard place.
|
||||
# We do not attempt to have shared libs !
|
||||
SunOS : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = a" \
|
||||
"so = so" \
|
||||
"CC = acc" \
|
||||
"CFLAGS = -DXTFUNCPROTO -DCOSPRINTF -DUNIX -DHAS_DLD -O" \
|
||||
"CCLD = acc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = " \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = " \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lF77" \
|
||||
"libX11 = -L/usr/lib -lX11" \
|
||||
"libXext = -L/usr/lib -lXext" \
|
||||
"libXt = -L/usr/lib -lXt" \
|
||||
"libXmu = -L/usr/lib -lXmu" \
|
||||
"libXaw = -L/usr/lib -lXaw" \
|
||||
"libXm = -L/usr/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
# LynxOS virgo_vme5.lal.in2p3.fr 2.2.2 2 VGPW2
|
||||
# RAND_MAX not found in /usr/include files.
|
||||
# -lc_p to find mktime which is not in libc.a.
|
||||
# If gcc error 11, try to set TMPDIR to a directory
|
||||
# with more place :
|
||||
# UNIX> setenv TMPDIR `pwd`
|
||||
LynxOS : This_needed
|
||||
@CONFIG=$@;export CONFIG;MAKEFLAGS='';export MAKEFLAGS;$(MAKE) -f This.mk $(t) $(target) \
|
||||
"a_or_so = a" \
|
||||
"so = so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -ansi -DUNIX -DHAS_DLD -DRAND_MAX=32767" \
|
||||
"CCLD = gcc" \
|
||||
"CCLDFLAGS = " \
|
||||
"CCLDEND = -lnetinet -lrpc -lc_p" \
|
||||
"F77 = f77" \
|
||||
"F77FLAGS = " \
|
||||
"F77LD = f77" \
|
||||
"X11_CPPFLAGS = " \
|
||||
"Xext_CPPFLAGS = -I/usr/include/X11/extensions" \
|
||||
"Xmu_CPPFLAGS = -I/usr/include/X11" \
|
||||
"Xt_CPPFLAGS = " \
|
||||
"Xaw_CPPFLAGS = " \
|
||||
"Xm_CPPFLAGS = " \
|
||||
"libc = -lc" \
|
||||
"libm = -lm" \
|
||||
"libf77 = -lf" \
|
||||
"libX11 = -L/usr/X11R6/lib -lX11" \
|
||||
"libXext = -L/usr/X11R6/lib -lXext" \
|
||||
"libXt = -L/usr/X11R6/lib -lXt" \
|
||||
"libXmu = -L/usr/X11R6/lib -lXmu" \
|
||||
"libXaw = -L/usr/X11R6/lib -lXaw" \
|
||||
"libXm = -L/usr/X11R6/lib -lXm" \
|
||||
$(This_macros)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
!----------------------------
|
||||
begin Make
|
||||
package = G4o
|
||||
! has = X11 Xext GL G4 RW
|
||||
has = X11 Xext Xt Xmu Xm GL RW CLHEP G4 G4TEST G4ATLAS Wo WoXm Xo
|
||||
libs = \
|
||||
X11: libX11\
|
||||
Xext: libXext\
|
||||
Xt: libXt\
|
||||
Xmu: libXmu\
|
||||
Xm: libXm\
|
||||
GL: libGL libGLU libGLX\
|
||||
G4: libg4\
|
||||
G4TEST: libg4test\
|
||||
G4ATLAS: libg4atlas\
|
||||
RW: librw\
|
||||
CLHEP: libCLHEP\
|
||||
G4o: libc libm libCo libGo libG4o\
|
||||
Wo: libc libm libCo libXx libWo libWoGL\
|
||||
WoXm: libWoXm\
|
||||
Xo: libwww libhtmlw libHo libGo libXo
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = EXPO
|
||||
type = application
|
||||
language = c++
|
||||
libs = libG4o libg4 libCLHEP librw libWoGL libXo libhtmlw libWoXm libXm libWoXaw libXaw libWo libXx libXmu libXt libGo libGLX libGLU libGL libXext libX11 libHo libCo libwww libm libcxx
|
||||
! distributed = no
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = TEST
|
||||
type = application
|
||||
language = c++
|
||||
libs = libg4test libg4atlas libG4o libg4 libCLHEP librw libWoGL libXo libhtmlw libWoXm libXm libWoXaw libXaw libWo libXx libXmu libXt libGo libGLX libGLU libGL libXext libX11 libHo libCo libwww libm libcxx
|
||||
distributed = no
|
||||
end
|
||||
!----------------------------
|
||||
!----------------------------
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = libG4o
|
||||
type = a
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = G4o
|
||||
inLib = libG4o
|
||||
language = c++
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = G4oScene
|
||||
inLib = libG4o
|
||||
language = c++
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = G4oDrawer
|
||||
inLib = libG4o
|
||||
language = c++
|
||||
end
|
||||
!----------------------------
|
||||
begin OModule
|
||||
name = G4oState
|
||||
inLib = libG4o
|
||||
language = c++
|
||||
end
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#/* +---------------------- Copyright notice -------------------------------+ */
|
||||
#/* | Copyright (C) 1995, Guy Barrand, LAL Orsay. (barrand@lalcls.in2p3.fr) | */
|
||||
#/* | Permission to use, copy, modify, and distribute this software | */
|
||||
#/* | and its documentation for any purpose and without fee is hereby | */
|
||||
#/* | granted, provided that the above copyright notice appear in all | */
|
||||
#/* | copies and that both that copyright notice and this permission | */
|
||||
#/* | notice appear in supporting documentation. This software is | */
|
||||
#/* | provided "as is" without express or implied warranty. | */
|
||||
#/* +---------------------- Copyright notice -------------------------------+ */
|
||||
|
||||
This_macros = \
|
||||
"bin = ../$${CONFIG}" \
|
||||
"mgr = ../mgr" \
|
||||
"src = ../src" \
|
||||
"app = ../app" \
|
||||
"make_so = sh ${COROOT}/mgr/maklibs.sh" \
|
||||
"G4o_CPPFLAGS = -I${COROOT}/include -I${GOROOT}/include -I../include -DHAS_HO -DHAS_G4O" \
|
||||
"libG4o = -L../$${CONFIG} -lG4o" \
|
||||
"RW_CPPFLAGS = -I${RWROOT}/include" \
|
||||
"librw = -L${RWROOT}/lib -lrwtool" \
|
||||
"CLHEP_CPPFLAGS = -I${CLHEPROOT}/include " \
|
||||
"libCLHEP = -L${CLHEPROOT}/lib -lCLHEP" \
|
||||
"GL_CPPFLAGS = -I${GLOROOT}/usr/include" \
|
||||
"libGL = -L${GLOROOT}/$${CONFIG} -lGLo" \
|
||||
"libGLU = -L${GLOROOT}/$${CONFIG} -lGLUo" \
|
||||
"libGLX = -L${GLOROOT}/$${CONFIG} -lGLXo" \
|
||||
"G4_CPPFLAGS = -I${G4INSTALL}/source/global/management/include -I${G4INSTALL}/source/global/HEPRandom/include -I${G4INSTALL}/source/global/HEPGeometry/include -I${G4INSTALL}/source/run/include -I${G4INSTALL}/source/materials/include -I${G4INSTALL}/source/particles/management/include -I${G4INSTALL}/source/particles/bosons/include -I${G4INSTALL}/source/particles/leptons/include -I${G4INSTALL}/source/particles/hadrons/barions/include -I${G4INSTALL}/source/particles/hadrons/ions/include -I${G4INSTALL}/source/particles/hadrons/mesons/include -I${G4INSTALL}/source/processes/management/include -I${G4INSTALL}/source/processes/general/include -I${G4INSTALL}/source/processes/decay/include -I${G4INSTALL}/source/processes/optical/include -I${G4INSTALL}/source/processes/transportation/include -I${G4INSTALL}/source/processes/parameterisation/include -I${G4INSTALL}/source/processes/electromagnetic/standard/include -I${G4INSTALL}/source/processes/electromagnetic/muons/include -I${G4INSTALL}/source/processes/electromagnetic/utils/include -I${G4INSTALL}/source/processes/electromagnetic/xrays/include -I${G4INSTALL}/source/processes/hadronic/management/include -I${G4INSTALL}/source/processes/hadronic/processes/include -I${G4INSTALL}/source/processes/hadronic/util/include -I${G4INSTALL}/source/processes/hadronic/cross_sections/include -I${G4INSTALL}/source/processes/hadronic/models/generator/include -I${G4INSTALL}/source/processes/hadronic/models/high_energy/include -I${G4INSTALL}/source/processes/hadronic/models/low_energy/include -I${G4INSTALL}/source/processes/hadronic/stopping/include -I${G4INSTALL}/source/geometry/management/include -I${G4INSTALL}/source/geometry/solids/CSG/include -I${G4INSTALL}/source/geometry/solids/BREPS/include -I${G4INSTALL}/source/geometry/solids/STEP/include -I${G4INSTALL}/source/geometry/volumes/include -I${G4INSTALL}/source/geometry/magneticfield/include -I${G4INSTALL}/source/track/include -I${G4INSTALL}/source/tracking/include -I${G4INSTALL}/source/digits+hits/detector/include -I${G4INSTALL}/source/digits+hits/hits/include -I${G4INSTALL}/source/digits+hits/digits/include -I${G4INSTALL}/source/readout/include -I${G4INSTALL}/source/event/include -I${G4INSTALL}/source/graphics_reps/include -I${G4INSTALL}/source/persistency/include -I${G4INSTALL}/source/intercoms/include -I${G4INSTALL}/source/visualization/modeling/include" \
|
||||
"libg4 = -L${G4INSTALL}/lib/$${G4SYSTEM} -lG4modeling -lG4readout -lG4run -lG4event -lG4tracking -lG4particles -lG4processes -lG4track -lG4materials -lG4digits+hits -lG4geometry -lG4graphics_reps -lG4intercoms -lG4global" \
|
||||
"G4TEST_CPPFLAGS = -I${G4INSTALL}/source/visualization/test/test_utils/include" \
|
||||
"libg4test = -L${G4INSTALL}/lib/${G4SYSTEM} -lG4vis_utils" \
|
||||
"G4ATLAS_CPPFLAGS = -I${G4ATLAS}//include" \
|
||||
"libg4atlas = -L${G4INSTALL}/lib/${G4SYSTEM} -lG4ATLAS" \
|
||||
"Wo_CPPFLAGS = -I${COROOT}/include -I${XXROOT}/include -I${WOROOT}/include" \
|
||||
"libCo = -L${COROOT}/$${CONFIG} -lCo" \
|
||||
"libXx = -L${XXROOT}/$${CONFIG} -lXx" \
|
||||
"libWo = -L${WOROOT}/$${CONFIG} -lWo" \
|
||||
"libWoGL = -L${WOROOT}/$${CONFIG} -lWoGL" \
|
||||
"WoXm_CPPFLAGS = -DHAS_XM" \
|
||||
"libWoXm = -L${WOROOT}/$${CONFIG} -lWoXm" \
|
||||
"Xo_CPPFLAGS = -DHAS_XO -DHAS_HTML -I${XOROOT}/include -I${GOROOT}/include -I${HOROOT}/include" \
|
||||
"libXo = -L${XOROOT}/$${CONFIG} -lXo" \
|
||||
"libHo = -L${HOROOT}/$${CONFIG} -lHo" \
|
||||
"libGo = -L${GOROOT}/$${CONFIG} -lGo" \
|
||||
"libwww = -L${W3OROOT}/$${CONFIG} -lW3o" \
|
||||
"libhtmlw = -L${HTMLOROOT}/$${CONFIG} -lHTMLo"
|
||||
|
||||
include Config.mk
|
||||
|
||||
|
||||
This_needed :
|
||||
@if test "${COROOT}" = "" ; then echo "COROOT not set" ; exit 1 ; else exit 0 ; fi
|
||||
@if test "${GOROOT}" = "" ; then echo "GOROOT not set"; exit 1 ; else exit 0 ; fi
|
||||
@if test "${G4INSTALL}" = "" ; then echo "G4INSTALL not set" exit 1 ; else exit 0 ; fi
|
||||
@
|
||||
@if test "${GLOROOT}" = "" ; then echo "GLOROOT not set" ; else exit 0 ; fi
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# File produced by the Co/omake tool
|
||||
# using file Make.odb.
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# The soft linked packages has been taken
|
||||
# from the property 'has' of the
|
||||
# 'Make' object of file Make.odb.
|
||||
# It had the value :
|
||||
# X11 Xext Xt Xmu Xm GL RW CLHEP G4 G4TEST G4ATLAS Wo WoXm Xo
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
HAS_CPPFLAGS = \
|
||||
$(G4o_CPPFLAGS)\
|
||||
$(X11_CPPFLAGS)\
|
||||
$(Xext_CPPFLAGS)\
|
||||
$(Xt_CPPFLAGS)\
|
||||
$(Xmu_CPPFLAGS)\
|
||||
$(Xm_CPPFLAGS)\
|
||||
$(GL_CPPFLAGS)\
|
||||
$(RW_CPPFLAGS)\
|
||||
$(CLHEP_CPPFLAGS)\
|
||||
$(G4_CPPFLAGS)\
|
||||
$(G4TEST_CPPFLAGS)\
|
||||
$(G4ATLAS_CPPFLAGS)\
|
||||
$(Wo_CPPFLAGS)\
|
||||
$(WoXm_CPPFLAGS)\
|
||||
$(Xo_CPPFLAGS)
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
all :: mkdir
|
||||
|
||||
clean ::
|
||||
/bin/rm -f $(bin)/*.o;/bin/rm -f $(bin)/*.exe;/bin/rm -f $(bin)/*.class;/bin/rm -f $(bin)/*.a;/bin/rm -f $(bin)/*.so;/bin/rm -f $(bin)/*.sl
|
||||
rmlib ::
|
||||
/bin/rm -f $(bin)/*.a
|
||||
rmo ::
|
||||
/bin/rm -f $(bin)/*.o
|
||||
rmexe ::
|
||||
/bin/rm -f $(bin)/*.exe;/bin/rm -f $(bin)/*.class
|
||||
|
||||
mkdir :
|
||||
@if test -d $(bin) ; then exit ; else mkdir $(bin) ; echo "$(bin) created." ; fi
|
||||
|
||||
libG4o_target = $(bin)/libG4o.a
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
all :: mkdir \
|
||||
$(libG4o_target) \
|
||||
$(bin)/EXPO.exe
|
||||
@echo "G4o : all ok."
|
||||
|
||||
libs :: mkdir \
|
||||
$(libG4o_target)
|
||||
@echo "G4o : libs ok."
|
||||
|
||||
apps :: mkdir \
|
||||
$(bin)/EXPO.exe \
|
||||
$(bin)/TEST.exe
|
||||
@echo "G4o : apps ok."
|
||||
#--------------------------------------------
|
||||
rmexeo :
|
||||
/bin/rm -f $(bin)/EXPO.o
|
||||
/bin/rm -f $(bin)/TEST.o
|
||||
#--------------------------------------------
|
||||
EXPO : $(bin)/EXPO.exe
|
||||
@echo "G4o : EXPO ok."
|
||||
TEST : $(bin)/TEST.exe
|
||||
@echo "G4o : TEST ok."
|
||||
libG4o : $(libG4o_target)
|
||||
@echo "G4o : libG4o ok."
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
#--------------------------------------------
|
||||
$(bin)/EXPO.exe : $(bin)/EXPO.o \
|
||||
$(libG4o_target)
|
||||
$(CXXLD) $(CXXLDFLAGS) $(HAS_CPPFLAGS) -o $(bin)/EXPO.exe $(bin)/EXPO.o \
|
||||
$(libG4o) \
|
||||
$(libg4) \
|
||||
$(libCLHEP) \
|
||||
$(librw) \
|
||||
$(libWoGL) \
|
||||
$(libXo) \
|
||||
$(libhtmlw) \
|
||||
$(libWoXm) \
|
||||
$(libXm) \
|
||||
$(libWo) \
|
||||
$(libXx) \
|
||||
$(libXmu) \
|
||||
$(libXt) \
|
||||
$(libGo) \
|
||||
$(libGLX) \
|
||||
$(libGLU) \
|
||||
$(libGL) \
|
||||
$(libXext) \
|
||||
$(libX11) \
|
||||
$(libHo) \
|
||||
$(libCo) \
|
||||
$(libwww) \
|
||||
$(libm) \
|
||||
$(CXXLDEND)
|
||||
|
||||
$(bin)/EXPO.o : $(app)/EXPO.cc
|
||||
$(CXX) $(CXXFLAGS) $(APP_CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/EXPO.o $(app)/EXPO.cc
|
||||
#--------------------------------------------
|
||||
$(bin)/TEST.exe : $(bin)/TEST.o \
|
||||
$(libG4o_target)
|
||||
$(CXXLD) $(CXXLDFLAGS) $(HAS_CPPFLAGS) -o $(bin)/TEST.exe $(bin)/TEST.o \
|
||||
$(libg4test) \
|
||||
$(libg4atlas) \
|
||||
$(libG4o) \
|
||||
$(libg4) \
|
||||
$(libCLHEP) \
|
||||
$(librw) \
|
||||
$(libWoGL) \
|
||||
$(libXo) \
|
||||
$(libhtmlw) \
|
||||
$(libWoXm) \
|
||||
$(libXm) \
|
||||
$(libWo) \
|
||||
$(libXx) \
|
||||
$(libXmu) \
|
||||
$(libXt) \
|
||||
$(libGo) \
|
||||
$(libGLX) \
|
||||
$(libGLU) \
|
||||
$(libGL) \
|
||||
$(libXext) \
|
||||
$(libX11) \
|
||||
$(libHo) \
|
||||
$(libCo) \
|
||||
$(libwww) \
|
||||
$(libm) \
|
||||
$(CXXLDEND)
|
||||
|
||||
$(bin)/TEST.o : $(app)/TEST.cc
|
||||
$(CXX) $(CXXFLAGS) $(APP_CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/TEST.o $(app)/TEST.cc
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# libraries
|
||||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
.PRECIOUS : $(bin)/libG4o.a
|
||||
#--------------------------------------------
|
||||
|
||||
$(bin)/libG4o.a : \
|
||||
$(bin)/libG4o.a(G4o.o) \
|
||||
$(bin)/libG4o.a(G4oScene.o) \
|
||||
$(bin)/libG4o.a(G4oDrawer.o) \
|
||||
$(bin)/libG4o.a(G4oState.o)
|
||||
@cd $(bin) ; if [ -f /bin/ranlib ] ; then /bin/ranlib libG4o.a ; fi ; cd $(mgr)
|
||||
|
||||
#--------------------------------------------
|
||||
# libG4o dependencies
|
||||
#--------------------------------------------
|
||||
$(bin)/libG4o.a(G4o.o) : $(src)/G4o.cc
|
||||
$(CXX) $(CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/G4o.o $(src)/G4o.cc
|
||||
ar cr $(bin)/libG4o.a $(bin)/G4o.o
|
||||
/bin/rm -f $(bin)/G4o.o
|
||||
|
||||
$(bin)/libG4o.a(G4oScene.o) : $(src)/G4oScene.cc
|
||||
$(CXX) $(CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/G4oScene.o $(src)/G4oScene.cc
|
||||
ar cr $(bin)/libG4o.a $(bin)/G4oScene.o
|
||||
/bin/rm -f $(bin)/G4oScene.o
|
||||
|
||||
$(bin)/libG4o.a(G4oDrawer.o) : $(src)/G4oDrawer.cc
|
||||
$(CXX) $(CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/G4oDrawer.o $(src)/G4oDrawer.cc
|
||||
ar cr $(bin)/libG4o.a $(bin)/G4oDrawer.o
|
||||
/bin/rm -f $(bin)/G4oDrawer.o
|
||||
|
||||
$(bin)/libG4o.a(G4oState.o) : $(src)/G4oState.cc
|
||||
$(CXX) $(CXXFLAGS) $(HAS_CPPFLAGS) -c -o $(bin)/G4oState.o $(src)/G4oState.cc
|
||||
ar cr $(bin)/libG4o.a $(bin)/G4oState.o
|
||||
/bin/rm -f $(bin)/G4oState.o
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Installer, edit this file to set
|
||||
# correctly the product pathes : OPACS,
|
||||
# Geant4, CLHEP, RW, etc...
|
||||
#
|
||||
# User, to use Geant4/environments/OPACS,
|
||||
# execute this script with :
|
||||
# csh> source setup.csh
|
||||
#
|
||||
#-----------------------------
|
||||
#
|
||||
# Execute OPACS setup script :
|
||||
# --------------------------
|
||||
source /projects/OPACS/setup.csh
|
||||
#
|
||||
# Geant4 global path :
|
||||
# ------------------
|
||||
#setenv G4INSTALL /geant4/geant4beta
|
||||
#
|
||||
# If you have one, execute your Geant4 setup script :
|
||||
# -------------------------------------------------
|
||||
#source $G4INSTALL/mgr/setup.csh
|
||||
#source $G4INSTALL/mgr/setsf.csh
|
||||
#source $G4INSTALL/mgr/setiv.csh
|
||||
#
|
||||
# Template repository of Geant4 :
|
||||
# -----------------------------
|
||||
setenv OREPOSITORY $G4INSTALL/tmp/$G4SYSTEM/g4.ptrepository
|
||||
#
|
||||
# CLHEP path :
|
||||
# ----------
|
||||
setenv CLHEPROOT $HOME/`uname`
|
||||
#
|
||||
# Rogue Wave :
|
||||
# ----------
|
||||
setenv RWROOT $HOME/`uname`
|
||||
#
|
||||
# OPACS OPATH variable for finding, at run time, environments/OPACS palettes :
|
||||
# -------------------------------------------------------------------------
|
||||
setenv OPATH "$OPATH $G4INSTALL/environments/OPACS/usr"
|
||||
#
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4o.cc,v 2.3 1998/09/16 12:08:41 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
#define DEBUG
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/*GEANT4*/
|
||||
#include <G4VPhysicalVolume.hh>
|
||||
#include <G4LogicalVolume.hh>
|
||||
#include <G4PhysicalVolumeStore.hh>
|
||||
#include <G4PhysicalVolumeModel.hh>
|
||||
#include <G4ModelingParameters.hh>
|
||||
#include <G4RunManager.hh>
|
||||
|
||||
/*For G4UI.*/
|
||||
#include <G4UImanager.hh>
|
||||
//#include <G4ParticleTblMessenger.hh>
|
||||
#include <G4ParticleTable.hh>
|
||||
|
||||
/*Co*/
|
||||
#include <CPrinter.h>
|
||||
#include <CMemory.h>
|
||||
#include <CString.h>
|
||||
#include <CText.h>
|
||||
#include <CFile.h>
|
||||
#include <CList.h>
|
||||
#include <OType.h>
|
||||
#include <OShell.h>
|
||||
#include <OProcess.h>
|
||||
|
||||
/*Go*/
|
||||
#include <Go.h>
|
||||
#include <GoTypes.h>
|
||||
|
||||
/*G4o*/
|
||||
#include <G4oScene.hh>
|
||||
#include <G4oDrawer.hh>
|
||||
#include <G4o.h>
|
||||
|
||||
#include <G4oCommon.hh>
|
||||
|
||||
static void ClearClass ();
|
||||
static OIdentifier* GetPhysicalVolumeIdentifiers (OType);
|
||||
static int GetPhysicalVolumeProperty (OIdentifier,OType,OProperty,void*,int*);
|
||||
static ONode RepresentPhysicalVolume (OIdentifier,OType);
|
||||
|
||||
static OIdentifier* GetTrajectoryIdentifiers (OType);
|
||||
static int GetTrajectoryProperty (OIdentifier,OType,OProperty,void*,int*);
|
||||
static ONode RepresentTrajectory (OIdentifier,OType);
|
||||
|
||||
|
||||
typedef unsigned long Ulong;
|
||||
|
||||
static struct {
|
||||
void** extent;
|
||||
G4oScene* g4oScene;
|
||||
OShell osh;
|
||||
} Class = {NULL,NULL,NULL};
|
||||
/***************************************************************************/
|
||||
void ClearClass (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
CListDelete (Class.extent);
|
||||
Class.extent = NULL;
|
||||
if(Class.g4oScene!=NULL) delete Class.g4oScene;
|
||||
Class.g4oScene = NULL;
|
||||
Class.osh = NULL;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oAddCommands (
|
||||
void* a_osh
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*
|
||||
Some G4 commands :
|
||||
G4> /particle/
|
||||
G4> /particle/dump
|
||||
G4> /particle/Verbose
|
||||
The definitions of these commands ar in G4o/src/G4oMessenger.cc code.
|
||||
*/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(OCommandGetIdentifier("G4")!=NULL) return; /*Done*/
|
||||
|
||||
GoSetTypes ();
|
||||
SetTypes ();
|
||||
|
||||
if(OTypeGetIdentifier("PhysicalVolume")==NULL)
|
||||
{
|
||||
OType otype;
|
||||
otype = OTypeCreate ("PhysicalVolume");
|
||||
OTypeSetGetIdentifiersFunction (otype,GetPhysicalVolumeIdentifiers);
|
||||
OTypeSetGetPropertyFunction (otype,GetPhysicalVolumeProperty);
|
||||
OTypeSetClearClassFunction (otype,ClearClass);
|
||||
OTypeSetRepresentFunction (otype,(OTypeRepresentFunction)RepresentPhysicalVolume);
|
||||
OTypeAddNewProperty (otype,"identifier" ,OPropertyUnsignedLong ,NULL);
|
||||
OTypeAddNewProperty (otype,"name" ,OPropertyString ,NULL);
|
||||
|
||||
otype = OTypeCreate ("Trajectory");
|
||||
OTypeSetGetIdentifiersFunction (otype,GetTrajectoryIdentifiers);
|
||||
OTypeSetGetPropertyFunction (otype,GetTrajectoryProperty);
|
||||
OTypeSetRepresentFunction (otype,
|
||||
(OTypeRepresentFunction)RepresentTrajectory);
|
||||
OTypeAddNewProperty (otype,"identifier" ,OPropertyUnsignedLong,NULL);
|
||||
OTypeAddNewProperty (otype,"trackID" ,OPropertyInteger ,NULL);
|
||||
OTypeAddNewProperty (otype,"parentID" ,OPropertyInteger ,NULL);
|
||||
OTypeAddNewProperty (otype,"particleName",OPropertyString ,NULL);
|
||||
OTypeAddNewProperty (otype,"charge" ,OPropertyDouble ,NULL);
|
||||
}
|
||||
|
||||
|
||||
OShellAddNewCommand ((OShell)a_osh,"G4o/G4",Execute_G4);
|
||||
|
||||
Class.osh = (OShell)a_osh;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oExecuteScript (
|
||||
char* a_string
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
ExecuteScript (a_string);
|
||||
}
|
||||
/***************************************************************************/
|
||||
OShell G4oGetShell (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
return Class.osh;
|
||||
}
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
OIdentifier* GetPhysicalVolumeIdentifiers (
|
||||
OType a_type
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
int objn = G4PhysicalVolumeStore::GetInstance()->entries();
|
||||
#ifdef DEBUG
|
||||
printf ("debug: GetPhysicalVolumeIdentifiers : %d objects.\n",objn);
|
||||
#endif
|
||||
if(objn<=0) return NULL;
|
||||
CListDelete (Class.extent);
|
||||
Class.extent = CListCreate(objn);
|
||||
if(Class.extent==NULL) return NULL;
|
||||
for(int count=0;count<objn;count++) {
|
||||
Class.extent[count] = (OIdentifier)(count+1);
|
||||
}
|
||||
a_type = NULL;
|
||||
return Class.extent;
|
||||
}
|
||||
/***************************************************************************/
|
||||
int GetPhysicalVolumeProperty (
|
||||
OIdentifier a_obj
|
||||
,OType This
|
||||
,OProperty a_prop
|
||||
,void* a_addr
|
||||
,int* a_number
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(a_number!=NULL) *a_number = 0;
|
||||
if(This==NULL) return 0;
|
||||
char* name = OPropertyGetName (a_prop);
|
||||
if(name==NULL) return 0;
|
||||
|
||||
if(strcmp(name,"identifier")==0) {
|
||||
*((Ulong*)a_addr) = (Ulong)a_obj;
|
||||
} else if(strcmp(name,"name")==0) {
|
||||
*((char**)a_addr) = CStringDuplicate((char*)(G4PhysicalVolumeStore::GetInstance()->at((size_t)a_obj-1)->GetName().data()));
|
||||
return FREE_BLOCK;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/***************************************************************************/
|
||||
ONode RepresentPhysicalVolume (
|
||||
OIdentifier a_obj
|
||||
,OType This
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(This==NULL) return NULL;
|
||||
|
||||
G4VPhysicalVolume* physicalVolume =
|
||||
G4PhysicalVolumeStore::GetInstance()->at((size_t)a_obj-1);
|
||||
|
||||
if(Class.g4oScene==NULL) {
|
||||
Class.g4oScene = new G4oScene;
|
||||
if(Class.g4oScene==NULL) return NULL;
|
||||
}
|
||||
|
||||
char* string = CStringCreateF (15+64,"PhysicalVolume/%lu",a_obj);
|
||||
Class.g4oScene->SetNodeName (string);
|
||||
CStringDelete (string);
|
||||
|
||||
G4ModelingParameters mParams (G4ModelingParameters::wireframe,
|
||||
true, // Global culling.
|
||||
true, // Cull invisible volumes.
|
||||
false, // Density culling.
|
||||
0., // Density (not relevant if density
|
||||
// culling false).
|
||||
true, // Cull daughters of opaque mothers.
|
||||
24); // No of sides (not relevant for
|
||||
// this operation).
|
||||
|
||||
G4PhysicalVolumeModel model (physicalVolume,
|
||||
G4PhysicalVolumeModel::UNLIMITED,
|
||||
G4Transform3D::Identity,
|
||||
&mParams);
|
||||
model.DescribeYourselfTo (*Class.g4oScene);
|
||||
|
||||
return Class.g4oScene->GetNode();
|
||||
}
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
OIdentifier* GetTrajectoryIdentifiers (
|
||||
OType a_type
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
const G4Event* event = G4RunManager::GetRunManager() -> GetCurrentEvent();
|
||||
if(event==NULL) return 0;
|
||||
G4TrajectoryContainer* trajectoryContainer = event->GetTrajectoryContainer();
|
||||
if(trajectoryContainer==NULL) return 0;
|
||||
int objn = trajectoryContainer->entries();
|
||||
#ifdef DEBUG
|
||||
printf ("debug: GetTrajectoryIdentifiers : event : %lu, %d objects.\n",
|
||||
event,objn);
|
||||
#endif
|
||||
if(objn<=0) return NULL;
|
||||
CListDelete (Class.extent);
|
||||
Class.extent = CListCreate(objn);
|
||||
if(Class.extent==NULL) return NULL;
|
||||
for(int count=0;count<objn;count++) {
|
||||
Class.extent[count] = (OIdentifier)(count+1);
|
||||
}
|
||||
a_type = NULL;
|
||||
return Class.extent;
|
||||
}
|
||||
/***************************************************************************/
|
||||
int GetTrajectoryProperty (
|
||||
OIdentifier a_obj
|
||||
,OType This
|
||||
,OProperty a_prop
|
||||
,void* a_addr
|
||||
,int* a_number
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(a_number!=NULL) *a_number = 0;
|
||||
if(This==NULL) return 0;
|
||||
char* name = OPropertyGetName (a_prop);
|
||||
if(name==NULL) return 0;
|
||||
const G4Event* event = G4RunManager::GetRunManager() -> GetCurrentEvent();
|
||||
if(event==NULL) return 0;
|
||||
G4TrajectoryContainer* trajectoryContainer = event->GetTrajectoryContainer();
|
||||
if(trajectoryContainer==NULL) return 0;
|
||||
|
||||
G4Trajectory* trajectory = (*trajectoryContainer)[(size_t)a_obj-1];
|
||||
|
||||
if(strcmp(name,"identifier")==0) {
|
||||
*((Ulong*)a_addr) = (Ulong)a_obj;
|
||||
} else if(strcmp(name,"trackID")==0) {
|
||||
*((int*)a_addr) = trajectory->GetTrackID();
|
||||
} else if(strcmp(name,"parentID")==0) {
|
||||
*((int*)a_addr) = trajectory->GetParentID();
|
||||
} else if(strcmp(name,"particleName")==0) {
|
||||
*((char**)a_addr) = CStringDuplicate(
|
||||
(char*)(trajectory->GetParticleName().data()));
|
||||
return FREE_BLOCK;
|
||||
} else if(strcmp(name,"charge")==0) {
|
||||
*((double*)a_addr) = trajectory->GetCharge();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/***************************************************************************/
|
||||
ONode RepresentTrajectory (
|
||||
OIdentifier a_obj
|
||||
,OType This
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(This==NULL) return NULL;
|
||||
const G4Event* event = G4RunManager::GetRunManager() -> GetCurrentEvent();
|
||||
if(event==NULL) return NULL;
|
||||
G4TrajectoryContainer* trajectoryContainer = event->GetTrajectoryContainer();
|
||||
if(trajectoryContainer==NULL) return NULL;
|
||||
G4oDrawer* drawer = G4oDrawer::GetInstance();
|
||||
if(drawer==NULL) return NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf ("debug: RepresentTrajectory : %d.\n",a_obj);
|
||||
#endif
|
||||
|
||||
ONode node = ONodeCreateF (11+64,"Trajectory/%lu",a_obj);
|
||||
|
||||
drawer->SetNode (node);
|
||||
G4Trajectory* trajectory = (*trajectoryContainer)[(size_t)a_obj-1];
|
||||
|
||||
trajectory->DrawTrajectory(0);
|
||||
|
||||
return node;
|
||||
}
|
||||
#include <G4oCommon.icc>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oDrawer.cc,v 2.2 1998/09/16 12:08:44 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
From geant4/visualization/management/src/G4VisManager.cc.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
#include <G4oDrawer.hh>
|
||||
|
||||
/*G4*/
|
||||
#include <G4Polyline.hh>
|
||||
#include <G4VisAttributes.hh>
|
||||
|
||||
/*Go*/
|
||||
#include <Go.h>
|
||||
|
||||
G4oDrawer* G4oDrawer::fpInstance = 0;
|
||||
ONode G4oDrawer::node = NULL;
|
||||
OColormap G4oDrawer::colormap = NULL;
|
||||
|
||||
/***************************************************************************/
|
||||
G4oDrawer* G4oDrawer::GetInstance (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if (!fpInstance)
|
||||
{
|
||||
fpInstance = new G4oDrawer;
|
||||
fpConcreteInstance = fpInstance;
|
||||
}
|
||||
return fpInstance;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4oDrawer::G4oDrawer (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4oDrawer::~G4oDrawer (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::SetWorldVolume (
|
||||
G4VPhysicalVolume* world
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::EventBegins (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::EventEnded (
|
||||
G4Event * pEvent
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Polyline& line
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
SetColour (line.GetVisAttributes()->GetColour());
|
||||
|
||||
G4int nPoints = line.entries ();
|
||||
if(nPoints<=0) return;
|
||||
OPointList points = OPointListCreate (nPoints);
|
||||
for (G4int iPoint = 0; iPoint < nPoints; iPoint++)
|
||||
{
|
||||
OPointListSetIthEntry (points,iPoint,
|
||||
(double)line(iPoint).x(),
|
||||
(double)line(iPoint).y(),
|
||||
(double)line(iPoint).z());
|
||||
}
|
||||
if(nPoints==1)
|
||||
GoAddMarkersToNode (node,points);
|
||||
else
|
||||
GoAddLinesToNode (node,points);
|
||||
OPointListDelete (points);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Text& text
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Circle& circle
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Square& Square
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Polymarker& polymarker
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4Polyhedron& polyhedron
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4NURBS& nurbs
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4VSolid& solid
|
||||
,const G4VisAttributes& attribs
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4LogicalVolume& logicalVol
|
||||
,const G4VisAttributes& attribs
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::Draw (
|
||||
const G4VPhysicalVolume& physicalVol
|
||||
,const G4VisAttributes& attribs
|
||||
,const G4Transform3D& objectTransform
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::SetNode (
|
||||
ONode a_node
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
node = a_node;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::SetColour (
|
||||
const G4Colour& a_colour
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(colormap==NULL) colormap = OColormapGetIdentifier("ocolormap_X");
|
||||
int index = OColormapGetRGB_Index(colormap,a_colour.GetRed (), a_colour.GetGreen (), a_colour.GetBlue ());
|
||||
OContextSetColorIndex (OContextGetStaticInstance(),index);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oDrawer::GeometryHasChanged (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oScene.cc,v 2.2 1998/07/12 02:37:06 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
/* | Permission to use, copy, modify, and distribute this software | */
|
||||
/* | and its documentation for any purpose and without fee is hereby | */
|
||||
/* | granted, provided that the above copyright notice appear in all | */
|
||||
/* | copies and that both that copyright notice and this permission | */
|
||||
/* | notice appear in supporting documentation. This software is | */
|
||||
/* | provided "as is" without express or implied warranty. | */
|
||||
/* +---------------------- Copyright notice -------------------------------+ */
|
||||
/*
|
||||
#define DEBUG
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
/*Co*/
|
||||
#include <CPrinter.h>
|
||||
#include <CString.h>
|
||||
#include <OMatrix.h>
|
||||
|
||||
/*Go*/
|
||||
#include <Go.h>
|
||||
#include <OCamera.h>
|
||||
|
||||
#include <G4Box.hh>
|
||||
#include <G4Tubs.hh>
|
||||
#include <G4Cons.hh>
|
||||
#include <G4Trd.hh>
|
||||
#include <G4Trap.hh>
|
||||
#include <G4Sphere.hh>
|
||||
#include <G4Para.hh>
|
||||
#include <G4Torus.hh>
|
||||
#include <G4Polyhedron.hh>
|
||||
#include <G4Polyline.hh>
|
||||
#include <G4Transform3D.hh>
|
||||
#include <G4PhysicalVolumeModel.hh>
|
||||
|
||||
#include <G4oScene.hh>
|
||||
|
||||
ONode G4oScene::node = NULL;
|
||||
char* G4oScene::nodeName = NULL;
|
||||
/***************************************************************************/
|
||||
G4oScene::G4oScene (
|
||||
)
|
||||
:fpAccTransf(NULL)
|
||||
,fCurrentDepth(0)
|
||||
,fpCurrentPV(NULL)
|
||||
,fpCurrentLV(NULL)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4oScene::~G4oScene (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
CStringDelete (nodeName);
|
||||
nodeName = NULL;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::PreAddThis (
|
||||
const G4Transform3D& objectTransformation
|
||||
,const G4VisAttributes& /*visAttribs*/
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
fpAccTransf = &objectTransformation;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::PostAddThis (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::EstablishSpecials (
|
||||
G4PhysicalVolumeModel& a_model
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
a_model.DefinePointersToWorkingSpace (&fCurrentDepth,
|
||||
&fpCurrentPV,
|
||||
&fpCurrentLV);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Box& box
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : box.\n");
|
||||
#endif
|
||||
AddPolyhedron (box.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Cons& cons
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : cons.\n");
|
||||
#endif
|
||||
AddPolyhedron (cons.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Tubs& tubs
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : tubs.\n");
|
||||
#endif
|
||||
AddPolyhedron (tubs.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Trd& trd
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : trd.\n");
|
||||
#endif
|
||||
AddPolyhedron (trd.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Trap& trap
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : trap.\n");
|
||||
#endif
|
||||
AddPolyhedron (trap.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Sphere& sphere
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : sphere.\n");
|
||||
#endif
|
||||
AddPolyhedron (sphere.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Para& para
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : para.\n");
|
||||
#endif
|
||||
AddPolyhedron (para.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4Torus& torus
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : torus.\n");
|
||||
#endif
|
||||
AddPolyhedron (torus.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddThis (
|
||||
const G4VSolid& solid
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : solid.\n");
|
||||
#endif
|
||||
AddPolyhedron (solid.CreatePolyhedron());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::SetNodeName (
|
||||
char* a_name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
CStringDelete (nodeName);
|
||||
nodeName = CStringDuplicate (a_name);
|
||||
}
|
||||
/***************************************************************************/
|
||||
ONode G4oScene::GetNode (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
/*.........................................................................*/
|
||||
return node;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oScene::AddPolyhedron (
|
||||
G4Polyhedron* a_polyhedron
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*
|
||||
Loop to get vertices from G4OpenGLScene::AddPrimitive.
|
||||
*/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4bool notLastFace;
|
||||
G4Normal3D SurfaceUnitNormal;
|
||||
double xs[5];
|
||||
double ys[5];
|
||||
double zs[5];
|
||||
/*.........................................................................*/
|
||||
#ifdef DEBUG
|
||||
printf ("debug : G4oScene::AddPolyhedron : ONode : %s\n",nodeName);
|
||||
#endif
|
||||
node = ONodeCreate (nodeName);
|
||||
do
|
||||
{
|
||||
G4int notLastEdge;
|
||||
G4Point3D vertex;
|
||||
G4int edgeFlag (true);
|
||||
int iPoint;
|
||||
iPoint = 0;
|
||||
notLastFace = a_polyhedron->GetNextNormal (SurfaceUnitNormal);
|
||||
do
|
||||
{
|
||||
notLastEdge = a_polyhedron->GetNextVertex (vertex, edgeFlag);
|
||||
xs[iPoint] = vertex.x();
|
||||
ys[iPoint] = vertex.y();
|
||||
zs[iPoint] = vertex.z();
|
||||
iPoint++;
|
||||
} while (notLastEdge);
|
||||
if( (iPoint!=3) && (iPoint!=4) )
|
||||
{
|
||||
CWarnF ("G4oScene::AddPolyhedron : not a quad or a triangle : %d\n",iPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OContextGetModeling(OContextGetStaticInstance())==OModelingWireFrame)
|
||||
{
|
||||
xs[iPoint] = xs[0];
|
||||
ys[iPoint] = ys[0];
|
||||
zs[iPoint] = zs[0];
|
||||
iPoint++;
|
||||
ONodeAddLines (node,OContextGetStaticInstance(),iPoint,xs,ys,zs);
|
||||
}
|
||||
else if (OContextGetModeling(OContextGetStaticInstance())==OModelingSolid)
|
||||
{
|
||||
ONodeAddPolygon (node,OContextGetStaticInstance(),iPoint,xs,ys,zs);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
printf ("debug : G4oScene::AddPrimitive : AddLines : %d\n",iPoint);
|
||||
#endif
|
||||
}
|
||||
} while (notLastFace);
|
||||
|
||||
if(fpAccTransf==NULL) {
|
||||
CWarnF ("G4oScene::AddPolyhedron : no transformation given !\n");
|
||||
} else {
|
||||
G4double g4angle;
|
||||
G4ThreeVector g4axis;
|
||||
G4ThreeVector g4trans;
|
||||
fpAccTransf->getRotation().getAngleAxis(g4angle,g4axis);
|
||||
g4trans = fpAccTransf->getTranslation();
|
||||
OMatrix orot = OMatrixCreate (OMatrixRotationAxis,g4angle,g4axis.x(),g4axis.y(),g4axis.z());
|
||||
OMatrix otra = OMatrixCreate (OMatrixTranslation,g4trans.x(),g4trans.y(),g4trans.z());
|
||||
OMatrix omatrix = OMatrixMultiply (otra,orot);
|
||||
ONodeSetMatrix (node,omatrix);
|
||||
OMatrixDelete (omatrix);
|
||||
OMatrixDelete (orot);
|
||||
OMatrixDelete (otra);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oState.cc,v 2.2 1998/07/13 17:29:32 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//#define DEBUG
|
||||
|
||||
//#include "G4ios.hh"
|
||||
|
||||
//G4
|
||||
#include <globals.hh>
|
||||
#include <G4UImanager.hh>
|
||||
#include <G4StateManager.hh>
|
||||
|
||||
//OPACS
|
||||
#include <CPrinter.h>
|
||||
#include <Wo.h>
|
||||
|
||||
#include <G4o.h>
|
||||
#include <G4oState.hh>
|
||||
|
||||
/***************************************************************************/
|
||||
G4oState::G4oState(
|
||||
G4String a_name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
name = a_name;
|
||||
G4UImanager::GetUIpointer()->SetSession(this); //So that Pause works..
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4bool G4oState::Notify (
|
||||
G4ApplicationState requestedState
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4StateManager* statM = G4StateManager::GetStateManager();
|
||||
G4ApplicationState previousState = statM->GetPreviousState();
|
||||
|
||||
if(previousState==Idle && requestedState==GeomClosed) { //beginOfRun
|
||||
G4String string = "RunBegin.osh";
|
||||
OShellExecuteFile (G4oGetShell(),(char*)(name + string).data());
|
||||
} else if(previousState==GeomClosed && requestedState==Idle) { //endOfRun
|
||||
G4String string = "RunEnd.osh";
|
||||
OShellExecuteFile (G4oGetShell(),(char*)(name + string).data());
|
||||
} else if(previousState==GeomClosed && requestedState==EventProc) { //beginOfEvent
|
||||
G4String string = "EventBegin.osh";
|
||||
OShellExecuteFile (G4oGetShell(),(char*)(name + string).data());
|
||||
} else if(previousState==EventProc && requestedState==GeomClosed) { // EndOfEvent
|
||||
G4String string = "EventEnd.osh";
|
||||
OShellExecuteFile (G4oGetShell(),(char*)(name + string).data());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4oState::PauseSessionStart (
|
||||
G4String a_message
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(a_message=="G4_pause> ") {
|
||||
WoProcessEvents ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
!/* | Permission to use, copy, modify, and distribute this software | */
|
||||
!/* | and its documentation for any purpose and without fee is hereby | */
|
||||
!/* | granted, provided that the above copyright notice appear in all | */
|
||||
!/* | copies and that both that copyright notice and this permission | */
|
||||
!/* | notice appear in supporting documentation. This software is | */
|
||||
!/* | provided "as is" without express or implied warranty. | */
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = EXPO_
|
||||
resources = \
|
||||
Wo**XoCamera.borderWidth:3\
|
||||
Wo*shell_view_panel*XoCamera.borderColor:dimgrey
|
||||
createCallback = osh>\
|
||||
#G4 /init/all\
|
||||
G4 '/run/initialize all'\
|
||||
G4 '/tracking/storeTrajectory 1'\
|
||||
G4 '/gun/particle e-'\
|
||||
#G4 '/gun/particle pi+'\
|
||||
G4 '/gun/direction 0.1 1 0'\
|
||||
G4 '/gun/energy 1 GeV'\
|
||||
create OHistogram name HepJamesRandom1 dimension 1 xAxisTitle James xAxisNumberOfBins 100 xAxisMinimum 0 xAxisMaximum 1 | empty\
|
||||
create OHistogram name HepJamesVsDRand48 dimension 2 xAxisTitle James xAxisNumberOfBins 40 xAxisMinimum 0 xAxisMaximum 1 yAxisTitle DRand48 yAxisNumberOfBins 40 yAxisMinimum 0 yAxisMaximum 1 | empty
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_1
|
||||
type = TopLevelShell
|
||||
children = EXPO_9
|
||||
mappedWhenManaged = true
|
||||
geometry = 700x500+0+0
|
||||
title = Visualization GEANT4 EXPO
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_9
|
||||
type = XmForm
|
||||
children = EXPO_4 EXPO_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_4
|
||||
type = XmMenuBar
|
||||
children = EXPO_5 EXPO_6 EXPO_EXPO_casc EXPO_EXPO_pdm EXPO_g4_casc EXPO_g4_pdm Vis3d_casc<Vis3d.odb Vis3d_pull<Vis3d.odb Wo_casc<G4oWo.odb Wo_pull<G4oWo.odb
|
||||
background = lightgrey
|
||||
shadowThickness = 4
|
||||
topShadowColor = white
|
||||
bottomShadowColor = black
|
||||
topAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_5
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = File
|
||||
subMenuId = EXPO_6
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_6
|
||||
type = XmPulldownMenu
|
||||
children = EXPO_exit
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_exit
|
||||
type = XmPushButton
|
||||
background = lightgrey
|
||||
labelString = Exit
|
||||
activateCallback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_form
|
||||
type = XmForm
|
||||
children = EXPO_camera EXPO_plot1 EXPO_plot2
|
||||
background = grey
|
||||
topAttachment = attach_widget
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
topWidget = EXPO_4
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_camera
|
||||
type = XoCamera
|
||||
viewLimits = -2000. 2000.
|
||||
! depthTreatment = zbuffer
|
||||
createCallback = osh>\
|
||||
set Widget target `thisWidget`\
|
||||
camera=`thisCamera`\
|
||||
#EXPO\
|
||||
setWidgetResource EXPO_camera viewLimits '-2000. 2000.'\
|
||||
set OContext color pink; collect PhysicalVolume where name eq WorldPhys | represent - | viewNode - $camera\
|
||||
set OContext color pink; collect PhysicalVolume where name eq CalorPhys | represent - | viewNode - $camera\
|
||||
set OContext modeling wire_frame\
|
||||
set OContext color lightgrey; collect PhysicalVolume where name eq ChambPhys | represent - | viewNode - $camera
|
||||
background = black
|
||||
collectCallback = osh> getCameraNodes `thisCamera` | collect ONode where highlight eq 1 | get - name | dump -
|
||||
topAttachment = attach_form
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_position
|
||||
rightPosition = 60
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_plot1
|
||||
type = XoPlotter
|
||||
topAttachment = attach_form
|
||||
leftAttachment = attach_widget
|
||||
leftWidget = EXPO_camera
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_position
|
||||
bottomPosition = 50
|
||||
plottedObjects = HepJamesRandom1
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_plot2
|
||||
type = XoPlotter
|
||||
topAttachment = attach_widget
|
||||
topWidget = EXPO_plot1
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_widget
|
||||
leftWidget = EXPO_camera
|
||||
rightAttachment = attach_form
|
||||
plottedObjects = HepJamesVsDRand48
|
||||
valueColorMapping = black 0.05 red 0.1 blue
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = shell_view_panel
|
||||
type = XmFormDialog
|
||||
children = shell_view
|
||||
dialogTitle = Shell view
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = shell_view
|
||||
type = XoCamera
|
||||
background = black
|
||||
referenceCamera = EXPO_camera
|
||||
collectCallback = osh> getCameraNodes `thisCamera` | collect ONode where highlight eq 1 | get - name | dump -
|
||||
topAttachment = attach_form
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_g4ui
|
||||
type = XmPushButton
|
||||
labelString = G4 commands
|
||||
activateCallback = osh> load g4ui.odb | realize -;manageWidget g4ui_palette;raiseWidget g4ui_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_command_chooser
|
||||
type = XmPushButton
|
||||
labelString = G4 command chooser
|
||||
activateCallback = osh> load G4Cmds.odb | realize - ;manageWidget G4Cmds_palette;raiseWidget G4Cmds_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_G4PV
|
||||
type = XmPushButton
|
||||
labelString = G4 volume chooser
|
||||
activateCallback = osh> load G4PV.odb | realize - ;manageWidget G4PV_palette;raiseWidget G4PV_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_osh
|
||||
type = XmPushButton
|
||||
labelString = osh commands
|
||||
activateCallback = osh> load osh.odb | realize -;manageWidget osh_palette;raiseWidget osh_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_g4_casc
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = G4
|
||||
subMenuId = EXPO_g4_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_g4_pdm
|
||||
type = XmPulldownMenu
|
||||
children = EXPO_g4ui EXPO_command_chooser EXPO_G4PV EXPO_osh EXPO_tracking_verbose
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_tracking_verbose
|
||||
type = XmToggleButton
|
||||
labelString = Tracking verbose on/off
|
||||
valueChangedCallback = osh>\
|
||||
test `getWidgetResource EXPO_tracking_verbose set` eq true && G4 '/tracking/verbose 2'\
|
||||
test `getWidgetResource EXPO_tracking_verbose set` eq false && G4 '/tracking/verbose'
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_EXPO_casc
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = EXPO
|
||||
subMenuId = EXPO_EXPO_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_EXPO_pdm
|
||||
type = XmPulldownMenu
|
||||
children = EXPO_startRun EXPO_nextEvent EXPO_abortRun EXPO_cyclic
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_startRun
|
||||
type = XmPushButton
|
||||
labelString = Start run
|
||||
createCallback = osh> setWidgetResource EXPO_nextEvent sensitive False
|
||||
activateCallback = &osh>\
|
||||
setWidgetResource EXPO_exit sensitive False\
|
||||
setWidgetResource EXPO_startRun sensitive False\
|
||||
setWidgetResource EXPO_nextEvent sensitive True\
|
||||
setWidgetResource EXPO_abortRun sensitive True\
|
||||
eventn=`ask 'Number of event' 10`\
|
||||
string=`printf '/run/beamOn %s' $eventn`\
|
||||
G4 $string\
|
||||
setWidgetResource EXPO_exit sensitive True\
|
||||
setWidgetResource EXPO_startRun sensitive True\
|
||||
setWidgetResource EXPO_nextEvent sensitive False\
|
||||
setWidgetResource EXPO_abortRun sensitive False
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_cyclic
|
||||
type = XmPushButton
|
||||
labelString = Cyclic
|
||||
createCallback = osh> setWidgetResource EXPO_nextEvent sensitive False
|
||||
activateCallback = osh>\
|
||||
isValid OCyclic/auto_next && delete OCyclic/auto_next\
|
||||
delay=`ask delay(msec) 1000`\
|
||||
script='G4> /run/beamOn 1'\
|
||||
create OCyclic name auto_next widget `thisWidget` delay $delay script $script\
|
||||
do OCyclic/auto_next start
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_nextEvent
|
||||
type = XmPushButton
|
||||
labelString = Next event
|
||||
activateCallback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_abortRun
|
||||
type = XmPushButton
|
||||
labelString = Abort run
|
||||
createCallback = osh>\
|
||||
setWidgetResource EXPO_nextEvent sensitive False\
|
||||
setWidgetResource EXPO_abortRun sensitive False
|
||||
activateCallback = osh>\
|
||||
G4 /run/abort\
|
||||
do Wo sendExitOnly
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#echo 'notify : begin of event.'
|
||||
@@ -0,0 +1,9 @@
|
||||
#echo 'notify : end of event.'
|
||||
collect ONode where name eq Trajectory* | delete -
|
||||
#collect Trajectory | dump -
|
||||
# Color of a trajectory is decided, according to charge, in representation code.
|
||||
# red -; blue +; green neutral
|
||||
#set OContext markerStyle cross
|
||||
collect Trajectory | represent - | viewNode - EXPO_camera
|
||||
# Enter in a secondary loop
|
||||
do Wo processEvents
|
||||
@@ -0,0 +1 @@
|
||||
#echo 'notify : begin of run.'
|
||||
@@ -0,0 +1,3 @@
|
||||
#echo 'notify : end of run.'
|
||||
updatePlot EXPO_plot1
|
||||
updatePlot EXPO_plot2
|
||||
@@ -0,0 +1,189 @@
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
!/* | Permission to use, copy, modify, and distribute this software | */
|
||||
!/* | and its documentation for any purpose and without fee is hereby | */
|
||||
!/* | granted, provided that the above copyright notice appear in all | */
|
||||
!/* | copies and that both that copyright notice and this permission | */
|
||||
!/* | notice appear in supporting documentation. This software is | */
|
||||
!/* | provided "as is" without express or implied warranty. | */
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = EXPO_
|
||||
resources = \
|
||||
Wo*XoCamera.borderWidth:3
|
||||
createCallback = G4>\
|
||||
/init/all\
|
||||
/tracking/storeTrajectory 1\
|
||||
#/gun/particle gamma\
|
||||
#/gun/particle geantino\
|
||||
/gun/particle e-\
|
||||
/gun/direction 0.1 1 0\
|
||||
/gun/energy 1 GeV\
|
||||
#/particle/dump\
|
||||
#/event/verbose 1\
|
||||
#/tracking/verbose 1
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_1
|
||||
type = TopLevelShell
|
||||
children = EXPO_9
|
||||
mappedWhenManaged = true
|
||||
geometry = 500x500+0+0
|
||||
title = Visualization GEANT4
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_9
|
||||
type = Form
|
||||
children = EXPO_4 EXPO_camera
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_4
|
||||
type = Box
|
||||
children = EXPO_5 EXPO_EXPO_casc EXPO_g4_casc
|
||||
background = lightgrey
|
||||
top = chaintop
|
||||
left = chainleft
|
||||
right = chainright
|
||||
! bottom = chainbottom
|
||||
resizable = true
|
||||
horizDistance = 1
|
||||
vertDistance = 1
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_5
|
||||
type = MenuButton
|
||||
background = lightgrey
|
||||
label = File
|
||||
menuName = EXPO_6
|
||||
children = EXPO_6
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_6
|
||||
type = SimpleMenu
|
||||
mappedWhenManaged = false
|
||||
children = EXPO_exit
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_exit
|
||||
type = SmeBSB
|
||||
label = Exit
|
||||
callback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_camera
|
||||
type = XoCamera
|
||||
! depthTreatment = zbuffer
|
||||
createCallback = osh>\
|
||||
set Widget target `thisWidget`\
|
||||
camera=`thisCamera`\
|
||||
# EXPO\
|
||||
setWidgetResource EXPO_camera viewLimits '-2000. 2000.'\
|
||||
set OContext color pink; collect PhysicalVolume where name eq WorldPhys | represent - | viewNode - $camera\
|
||||
set OContext color pink; collect PhysicalVolume where name eq CalorPhys | represent - | viewNode - $camera\
|
||||
set OContext modeling wire_frame\
|
||||
set OContext color lightgrey; collect PhysicalVolume where name eq ChambPhys | represent - | viewNode - $camera
|
||||
background = black
|
||||
collectCallback = osh> getCameraNodes `thisCamera` | collect ONode where highlight eq 1 | get - name | dump -
|
||||
vertDistance = 1
|
||||
fromVert = EXPO_4
|
||||
height = 1000
|
||||
left = chainleft
|
||||
right = chainright
|
||||
bottom = chainbottom
|
||||
horizDistance = 1
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_g4_casc
|
||||
type = MenuButton
|
||||
background = lightgrey
|
||||
label = G4
|
||||
menuName = EXPO_g4_pdm
|
||||
children = EXPO_g4_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_g4_pdm
|
||||
type = SimpleMenu
|
||||
mappedWhenManaged = false
|
||||
children = EXPO_particles
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_particles
|
||||
type = SmeBSB
|
||||
label = Particle dump
|
||||
callback = G4> /particle/dump
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_EXPO_casc
|
||||
type = MenuButton
|
||||
background = lightgrey
|
||||
label = EXPO
|
||||
menuName = EXPO_EXPO_pdm
|
||||
children = EXPO_EXPO_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_EXPO_pdm
|
||||
type = SimpleMenu
|
||||
mappedWhenManaged = false
|
||||
children = EXPO_startRun EXPO_nextEvent EXPO_abortRun
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_startRun
|
||||
type = SmeBSB
|
||||
label = Start run
|
||||
createCallback = osh> setWidgetResource EXPO_nextEvent sensitive False
|
||||
! SmeBSB is a gadget then &osh> crashes.
|
||||
callback = osh>\
|
||||
setWidgetResource EXPO_exit sensitive False\
|
||||
setWidgetResource EXPO_startRun sensitive False\
|
||||
setWidgetResource EXPO_nextEvent sensitive True\
|
||||
setWidgetResource EXPO_abortRun sensitive True\
|
||||
#eventn=`ask 'Number of event' 10`\
|
||||
eventn='10'\
|
||||
string=`printf '/run/beamOn %s' $eventn`\
|
||||
G4 $string\
|
||||
setWidgetResource EXPO_exit sensitive True\
|
||||
setWidgetResource EXPO_startRun sensitive True\
|
||||
setWidgetResource EXPO_nextEvent sensitive False\
|
||||
setWidgetResource EXPO_abortRun sensitive False
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_nextEvent
|
||||
type = SmeBSB
|
||||
label = Next event
|
||||
callback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = EXPO_abortRun
|
||||
type = SmeBSB
|
||||
label = Abort run
|
||||
createCallback = osh>\
|
||||
setWidgetResource EXPO_nextEvent sensitive False\
|
||||
setWidgetResource EXPO_abortRun sensitive False
|
||||
callback = osh>\
|
||||
G4 /run/abort\
|
||||
do Wo sendExitOnly
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = G4Cmds_
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_palette
|
||||
type = XmFormDialog
|
||||
children = G4Cmds_get_list G4Cmds_path G4Cmds_up G4Cmds_frame_dirs G4Cmds_frame_hists G4Cmds_label G4Cmds_edit G4Cmds_dump G4Cmds_cancel G4Cmds_update
|
||||
autoUnmanage = False
|
||||
dialogTitle = G4 command chooser
|
||||
mapCallback = osh> callWidgetCallbacks G4Cmds_get_list activateCallback
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_get_list
|
||||
type = XmPushButton
|
||||
labelString = Update list
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
topAttachment = attach_form
|
||||
activateCallback = osh>\
|
||||
list=`do G4 askListOfCommands | cutStringBegin - 1`\
|
||||
setWidgetResource G4Cmds_update value $list\
|
||||
setWidgetResource G4Cmds_path value ''\
|
||||
callWidgetCallbacks G4Cmds_update activateCallback
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_path
|
||||
type = XmText
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
topAttachment = attach_form
|
||||
topAttachment = attach_widget
|
||||
topWidget = G4Cmds_get_list
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_update
|
||||
type = XmText
|
||||
editMode = multi_line_edit
|
||||
activateCallback = osh>\
|
||||
setWidgetResource G4Cmds_dirs selectedItems ''\
|
||||
setWidgetResource G4Cmds_objs selectedItems ''\
|
||||
path=`getWidgetResource G4Cmds_path value`\
|
||||
test $path ne '' && path=`printf '%s/' $path`\
|
||||
lpath=`getStringLength $path`\
|
||||
pattern=`printf '%s*' $path`\
|
||||
list=`getWidgetResource G4Cmds_update value | matchString - $pattern | cutStringBegin - $lpath`\
|
||||
pattern=`printf '*/*' `\
|
||||
dirs=`matchString $list $pattern | getStringWord - 1 '/' | removeDuplicates - | sort - `\
|
||||
objs=`matchString $list $pattern no | removeDuplicates - | sort -`\
|
||||
test $dirs eq '' && setWidgetResource G4Cmds_dirs items ''\
|
||||
test $dirs ne '' && setWidgetResource G4Cmds_dirs items $dirs\
|
||||
test $objs eq '' && setWidgetResource G4Cmds_objs items ''\
|
||||
test $objs ne '' && setWidgetResource G4Cmds_objs items $objs
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_up
|
||||
type = XmPushButton
|
||||
labelString = Up directory
|
||||
topAttachment = attach_widget
|
||||
topWidget = G4Cmds_path
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
activateCallback = osh>\
|
||||
path=`getWidgetResource G4Cmds_path value`\
|
||||
path=`removeLastStringWord $path '/'`\
|
||||
setWidgetResource G4Cmds_path value $path\
|
||||
callWidgetCallbacks G4Cmds_update activateCallback
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_frame_dirs
|
||||
type = XmFrame
|
||||
children = G4Cmds_dirs
|
||||
topAttachment = attach_widget
|
||||
topWidget = G4Cmds_up
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_position
|
||||
rightPosition = 50
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4Cmds_label
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_dirs
|
||||
type = XmScrolledList
|
||||
background = lightgrey
|
||||
visibleItemCount = 10
|
||||
selectionPolicy = single_select
|
||||
scrollBarDisplayPolicy = static
|
||||
listSizePolicy = constant
|
||||
singleSelectionCallback = osh>\
|
||||
string=`getWidgetResource G4Cmds_dirs selectedItems`\
|
||||
test $string eq '' && exit \
|
||||
path=`getWidgetResource G4Cmds_path value`\
|
||||
#path=`removeLastStringWord $path '/'`\
|
||||
#setWidgetResource G4Cmds_path value $path\
|
||||
test $path ne '' && appendText G4Cmds_path '/'\
|
||||
appendText G4Cmds_path $string\
|
||||
callWidgetCallbacks G4Cmds_update activateCallback
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_frame_hists
|
||||
type = XmFrame
|
||||
children = G4Cmds_objs
|
||||
topAttachment = attach_widget
|
||||
topWidget = G4Cmds_up
|
||||
leftAttachment = attach_widget
|
||||
leftWidget = G4Cmds_frame_dirs
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4Cmds_label
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_objs
|
||||
type = XmScrolledList
|
||||
background = lightgrey
|
||||
visibleItemCount = 10
|
||||
selectionPolicy = single_select
|
||||
listSizePolicy = constant
|
||||
scrollBarDisplayPolicy = static
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_label
|
||||
type = XmLabel
|
||||
labelString = Operations
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4Cmds_edit
|
||||
background = black
|
||||
foreground = white
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_edit
|
||||
type = XmPushButton
|
||||
labelString = Edit
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4Cmds_dump
|
||||
activateCallback = &osh>\
|
||||
path=`getWidgetResource G4Cmds_path value`\
|
||||
obj=`getWidgetResource G4Cmds_objs selectedItems`\
|
||||
string=`printf '/%s/%s' $path $obj`\
|
||||
name='G4Params.odb'\
|
||||
do G4 createCommandPanel $string $name\
|
||||
odb=`collect OInterface where dataBaseName eq $name`\
|
||||
isValid $odb && destroy $odb\
|
||||
load $name | realize - ;manageWidget G4Params_palette;raiseWidget G4Params_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_dump
|
||||
type = XmPushButton
|
||||
labelString = Guidance
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4Cmds_cancel
|
||||
activateCallback = &osh>\
|
||||
path=`getWidgetResource G4Cmds_path value`\
|
||||
obj=`getWidgetResource G4Cmds_objs selectedItems`\
|
||||
string=`printf '/%s/%s' $path $obj`\
|
||||
echo `do G4 getCommandGuidance $string`
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4Cmds_cancel
|
||||
type = XmPushButton
|
||||
labelString = Cancel
|
||||
activateCallback = osh> unmanageWidget `thisWidgetParent`
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
!/* | Permission to use, copy, modify, and distribute this software | */
|
||||
!/* | and its documentation for any purpose and without fee is hereby | */
|
||||
!/* | granted, provided that the above copyright notice appear in all | */
|
||||
!/* | copies and that both that copyright notice and this permission | */
|
||||
!/* | notice appear in supporting documentation. This software is | */
|
||||
!/* | provided "as is" without express or implied warranty. | */
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = G4PV_
|
||||
packages = Xm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_palette
|
||||
type = XmFormDialog
|
||||
children = G4PV_7 G4PV_11 G4PV_erase G4PV_atbs G4PV_14 G4PV_draw G4PV_draw_all
|
||||
autoUnmanage = False
|
||||
dialogTitle = GEANT
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_7
|
||||
type = XmPushButton
|
||||
labelString = Update list
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
topAttachment = attach_form
|
||||
activateCallback = osh> collect PhysicalVolume | get - name | removeDuplicates - | setWidgetResource G4PV_list items -
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_11
|
||||
type = XmFrame
|
||||
children = G4PV_list
|
||||
topAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4PV_erase
|
||||
topAttachment = attach_widget
|
||||
topWidget = G4PV_7
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_list
|
||||
type = XmScrolledList
|
||||
background = lightgrey
|
||||
visibleItemCount = 5
|
||||
selectionPolicy = single_select
|
||||
scrollBarDisplayPolicy = static
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_erase
|
||||
type = XmPushButton
|
||||
labelString = Erase (in target)
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4PV_draw
|
||||
activateCallback = osh>\
|
||||
widget=`get Widget target`\
|
||||
camera=`get $widget name`\
|
||||
name=`getWidgetResource G4PV_list selectedItems`\
|
||||
string=`collect PhysicalVolume where name eq $name`\
|
||||
getCameraNodes $camera | collect ONode where name in $string | delete -
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_draw
|
||||
type = XmPushButton
|
||||
labelString = Draw (in target)
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4PV_draw_all
|
||||
activateCallback = osh>\
|
||||
widget=`get Widget target`\
|
||||
camera=`get $widget name`\
|
||||
collect PhysicalVolume where name eq `getWidgetResource G4PV_list selectedItems` | represent - | viewNode - $camera
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_draw_all
|
||||
type = XmPushButton
|
||||
labelString = Draw all (in target)
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4PV_atbs
|
||||
activateCallback = osh>\
|
||||
widget=`get Widget target`\
|
||||
camera=`get $widget name`\
|
||||
collect PhysicalVolume | represent - | viewNode - $camera
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_atbs
|
||||
type = XmPushButton
|
||||
labelString = Atbs
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
bottomWidget = G4PV_14
|
||||
labelString = Attributs
|
||||
activateCallback = osh> load OContext.odb| realize -;do Widget/OContext_palette manage;do Widget/OContext_palette_popup raise
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = G4PV_14
|
||||
type = XmPushButton
|
||||
labelString = Cancel
|
||||
activateCallback = osh> do `get Widget thisParent` unmanage
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
@@ -0,0 +1,223 @@
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = Wo_
|
||||
packages = Xm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_casc
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = Wo
|
||||
mnemonic = O
|
||||
subMenuId = Wo_pull
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_pull
|
||||
type = XmPulldownMenu
|
||||
children = Wo_490 Wo_otype Wo_osh Wo_431 Wo_461 Wo_462 Wo_491 Wo_467 Wo_fit
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_490
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = Interface
|
||||
mnemonic = I
|
||||
subMenuId = Wo_491
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_otype
|
||||
type = XmPushButton
|
||||
labelString = Instances
|
||||
activateCallback = osh> load OType.odb | realize -;manageWidget OType_palette;raiseWidget OType_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_osh
|
||||
type = XmPushButton
|
||||
labelString = osh
|
||||
activateCallback = osh> load osh.odb | realize -;manageWidget osh_palette;raiseWidget osh_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_431
|
||||
type = XmPushButton
|
||||
background = lightgrey
|
||||
! labelType = pixmap
|
||||
labelPixmap = book.xpm
|
||||
labelString = Help
|
||||
mnemonic = H
|
||||
accelerator = Ctrl<Key>h
|
||||
acceleratorText = Ctrl/h
|
||||
activateCallback = osh>\
|
||||
load Help.odb | realize -\
|
||||
manageWidget Help_palette;raiseWidget Help_palette_popup\
|
||||
showTopic Help_help 'Wo.htm'
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_461
|
||||
type = XmPushButton
|
||||
background = lightgrey
|
||||
! labelType = pixmap
|
||||
labelPixmap = Print.xpm
|
||||
labelString = Print
|
||||
mnemonic = P
|
||||
accelerator = Ctrl<Key>p
|
||||
acceleratorText = Ctrl/p
|
||||
activateCallback = osh> load CPS.odb | realize -; manageWidget CPS_palette;raiseWidget CPS_palette_popup
|
||||
! activateCallback = osh> load Visps.odb | realize -; manageWidget Visps_palette;raiseWidget Visps_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_462
|
||||
type = XmPushButton
|
||||
labelString = XoCamera
|
||||
activateCallback = osh> load XoCamera.odb | realize -; manageWidget XoCamera_palette;;raiseWidget XoCamera_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_491
|
||||
type = XmPulldownMenu
|
||||
children = Wo_482 Wo_496 Wo_492 Wo_460 Wo_487 Wo_474 Wo_480 Wo_MenuBar Wo_481 Wo_494 Wo_493 Wo_463 Wo_483 Wo_471
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_482
|
||||
type = XmPushButton
|
||||
labelString = Save interface
|
||||
mnemonic = S
|
||||
accelerator = Ctrl<Key>s
|
||||
acceleratorText = Ctrl/s
|
||||
activateCallback = osh> do Wo saveInterface
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_496
|
||||
type = XmPushButton
|
||||
labelString = Reload interface
|
||||
accelerator = Ctrl<Key>l
|
||||
acceleratorText = Ctrl/l
|
||||
activateCallback = &osh> \
|
||||
fname=`get Wo interfaceFile`\
|
||||
collect OInterface where dataBaseName eq $fname | destroy -\
|
||||
load $fname | realize -
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_492
|
||||
type = XmSeparator
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_460
|
||||
type = XmPushButton
|
||||
labelString = Widget
|
||||
mnemonic = W
|
||||
accelerator = Ctrl<Key>w
|
||||
acceleratorText = Ctrl/w
|
||||
activateCallback = osh> load Widget.odb | realize -; manageWidget Widget_palette;raiseWidget Widget_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_487
|
||||
type = XmPushButton
|
||||
labelString = New widget
|
||||
mnemonic = N
|
||||
accelerator = Ctrl<Key>n
|
||||
acceleratorText = Ctrl/n
|
||||
activateCallback = osh> load Create.odb | realize -; manageWidget Create_palette;raiseWidget Create_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_MenuBar
|
||||
type = XmPushButton
|
||||
labelString = Edit menu bar
|
||||
activateCallback = osh> load MenuBar.odb | realize -; manageWidget MenuBar_palette;raiseWidget MenuBar_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_474
|
||||
type = XmPushButton
|
||||
labelString = Resource
|
||||
mnemonic = R
|
||||
accelerator = Ctrl<Key>r
|
||||
acceleratorText = Ctrl/r
|
||||
activateCallback = osh> load ResEd.odb | realize -; manageWidget ResEd_palette;raiseWidget ResEd_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_480
|
||||
type = XmPushButton
|
||||
labelString = Attachment
|
||||
mnemonic = A
|
||||
accelerator = Ctrl<Key>a
|
||||
acceleratorText = Ctrl/a
|
||||
activateCallback = osh> load Attach.odb | realize -; manageWidget Attach_palette;raiseWidget Attach_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_481
|
||||
type = XmPushButton
|
||||
labelString = Compound
|
||||
accelerator = Ctrl<Key>c
|
||||
acceleratorText = Ctrl/c
|
||||
activateCallback = osh> load Compound.odb | realize -; manageWidget Compound_palette;raiseWidget Compound_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_494
|
||||
type = XmPushButton
|
||||
labelString = odb files
|
||||
accelerator = Ctrl<Key>o
|
||||
acceleratorText = Ctrl/o
|
||||
activateCallback = osh> load OInterf.odb | realize -; manageWidget OInterface_palette;raiseWidget OInterface_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_493
|
||||
type = XmPushButton
|
||||
labelString = Save pixmap
|
||||
activateCallback = osh> load Pixmap.odb | realize -; manageWidget Pixmap_palette;raiseWidget Pixmap_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_463
|
||||
type = XmPushButton
|
||||
labelString = Mailbox
|
||||
activateCallback = osh> load XMailbox.odb | realize -; manageWidget XMailbox_palette;raiseWidget XMailbox_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_483
|
||||
type = XmPushButton
|
||||
labelString = Ci
|
||||
activateCallback = osh> load Ci.odb | realize -; manageWidget Ci_palette;raiseWidget Ci_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_471
|
||||
type = XmPushButton
|
||||
labelString = Wo toolkit
|
||||
activateCallback = osh> load Sys.odb | realize -; manageWidget Sys_palette;raiseWidget Sys_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_467
|
||||
type = XmPushButton
|
||||
labelString = XoPlotter
|
||||
activateCallback = osh> load Plotter.odb | realize -; manageWidget Plotter_palette;raiseWidget Plotter_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = Wo_fit
|
||||
type = XmPushButton
|
||||
labelString = Fit
|
||||
activateCallback = osh> load Fit.odb | realize -; manageWidget Fit_palette;raiseWidget Fit_palette_popup
|
||||
end
|
||||
@@ -0,0 +1,330 @@
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
!/* | Permission to use, copy, modify, and distribute this software | */
|
||||
!/* | and its documentation for any purpose and without fee is hereby | */
|
||||
!/* | granted, provided that the above copyright notice appear in all | */
|
||||
!/* | copies and that both that copyright notice and this permission | */
|
||||
!/* | notice appear in supporting documentation. This software is | */
|
||||
!/* | provided "as is" without express or implied warranty. | */
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = TEST_
|
||||
resources = \
|
||||
Wo**XoCamera.borderWidth:3\
|
||||
Wo*shell_view_panel*XoCamera.borderColor:dimgrey
|
||||
createCallback = osh>\
|
||||
create OHistogram name HepJamesRandom1 dimension 1 xAxisTitle James xAxisNumberOfBins 100 xAxisMinimum 0 xAxisMaximum 1 | empty\
|
||||
create OHistogram name HepJamesVsDRand48 dimension 2 xAxisTitle James xAxisNumberOfBins 40 xAxisMinimum 0 xAxisMaximum 1 yAxisTitle DRand48 yAxisNumberOfBins 40 yAxisMinimum 0 yAxisMaximum 1 | empty
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_1
|
||||
type = TopLevelShell
|
||||
children = TEST_9
|
||||
mappedWhenManaged = true
|
||||
geometry = 700x500+0+0
|
||||
title = Visualization GEANT4 TEST19
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_9
|
||||
type = XmForm
|
||||
children = TEST_4 TEST_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_4
|
||||
type = XmMenuBar
|
||||
children = TEST_5 TEST_6 TEST_TEST_casc TEST_TEST_pdm TEST_g4_casc TEST_g4_pdm Vis3d_casc<Vis3d.odb Vis3d_pull<Vis3d.odb Wo_casc<G4oWo.odb Wo_pull<G4oWo.odb
|
||||
background = lightgrey
|
||||
shadowThickness = 4
|
||||
topShadowColor = white
|
||||
bottomShadowColor = black
|
||||
topAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_5
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = File
|
||||
subMenuId = TEST_6
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_6
|
||||
type = XmPulldownMenu
|
||||
children = TEST_exit
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_exit
|
||||
type = XmPushButton
|
||||
background = lightgrey
|
||||
labelString = Exit
|
||||
activateCallback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_form
|
||||
type = XmForm
|
||||
children = TEST_camera TEST_plot1 TEST_plot2
|
||||
background = grey
|
||||
topAttachment = attach_widget
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
topWidget = TEST_4
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_camera
|
||||
type = XoCamera
|
||||
viewLimits = -2000. 2000.
|
||||
! depthTreatment = zbuffer
|
||||
userCallback = osh>\
|
||||
set Widget target `thisWidget`\
|
||||
camera=`thisCamera`\
|
||||
set OContext color grey\
|
||||
# For detector 4\
|
||||
collect PhysicalVolume where name eq calo_phys | represent - | viewNode - $camera\
|
||||
set OContext color grey\
|
||||
collect PhysicalVolume where name eq tracker_phys | represent - | viewNode - $camera\
|
||||
# For detector 5 (ATLAS)\
|
||||
collect PhysicalVolume where name eq ATLexpHall_P | represent - | viewNode - $camera\
|
||||
getCameraNodes $camera | normalizeNode - $camera
|
||||
background = black
|
||||
collectCallback = osh> getCameraNodes `thisCamera` | collect ONode where highlight eq 1 | get - name | dump -
|
||||
topAttachment = attach_form
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_position
|
||||
rightPosition = 60
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_plot1
|
||||
type = XoPlotter
|
||||
topAttachment = attach_form
|
||||
leftAttachment = attach_widget
|
||||
leftWidget = TEST_camera
|
||||
rightAttachment = attach_form
|
||||
bottomAttachment = attach_position
|
||||
bottomPosition = 50
|
||||
plottedObjects = HepJamesRandom1
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_plot2
|
||||
type = XoPlotter
|
||||
topAttachment = attach_widget
|
||||
topWidget = TEST_plot1
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_widget
|
||||
leftWidget = TEST_camera
|
||||
rightAttachment = attach_form
|
||||
plottedObjects = HepJamesVsDRand48
|
||||
valueColorMapping = black 0.05 red 0.1 blue
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = shell_view_panel
|
||||
type = XmFormDialog
|
||||
children = shell_view
|
||||
dialogTitle = Shell view
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = shell_view
|
||||
type = XoCamera
|
||||
background = black
|
||||
referenceCamera = TEST_camera
|
||||
collectCallback = osh> getCameraNodes `thisCamera` | collect ONode where highlight eq 1 | get - name | dump -
|
||||
topAttachment = attach_form
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_g4ui
|
||||
type = XmPushButton
|
||||
labelString = G4 commands
|
||||
activateCallback = osh> load g4ui.odb | realize -;manageWidget g4ui_palette;raiseWidget g4ui_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_command_chooser
|
||||
type = XmPushButton
|
||||
labelString = G4 command chooser
|
||||
activateCallback = osh> load G4Cmds.odb | realize - ;manageWidget G4Cmds_palette;raiseWidget G4Cmds_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_G4PV
|
||||
type = XmPushButton
|
||||
labelString = G4 volume chooser
|
||||
activateCallback = osh> load G4PV.odb | realize - ;manageWidget G4PV_palette;raiseWidget G4PV_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_osh
|
||||
type = XmPushButton
|
||||
labelString = osh commands
|
||||
activateCallback = osh> load osh.odb | realize -;manageWidget osh_palette;raiseWidget osh_palette_popup
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_g4_casc
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = G4
|
||||
subMenuId = TEST_g4_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_g4_pdm
|
||||
type = XmPulldownMenu
|
||||
children = TEST_g4ui TEST_command_chooser TEST_G4PV TEST_osh TEST_tracking_verbose
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_tracking_verbose
|
||||
type = XmToggleButton
|
||||
labelString = Tracking verbose on/off
|
||||
valueChangedCallback = osh>\
|
||||
test `getWidgetResource TEST_tracking_verbose set` eq true && G4 '/tracking/verbose 2'\
|
||||
test `getWidgetResource TEST_tracking_verbose set` eq false && G4 '/tracking/verbose'
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_TEST_casc
|
||||
type = XmCascadeButton
|
||||
background = lightgrey
|
||||
labelString = TEST
|
||||
subMenuId = TEST_TEST_pdm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_TEST_pdm
|
||||
type = XmPulldownMenu
|
||||
children = TEST_det4 TEST_ATLAS TEST_end_selection TEST_sep TEST_init TEST_startRun TEST_nextEvent TEST_abortRun TEST_cyclic
|
||||
background = lightgrey
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_det4
|
||||
type = XmPushButton
|
||||
labelString = Detector 4
|
||||
activateCallback = osh> G4 '/test19det/detector 4'
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_ATLAS
|
||||
type = XmPushButton
|
||||
labelString = ATLAS
|
||||
createCallback = osh> setWidgetResource TEST_end_selection sensitive False
|
||||
activateCallback = &osh>\
|
||||
echo '- Choose sub detectors with'\
|
||||
echo ' G4 commands (chooser) and'\
|
||||
echo '- Click on End selection'\
|
||||
echo ' when finished.'\
|
||||
echo '- Click on Initialize.'\
|
||||
setWidgetResource TEST_end_selection sensitive True\
|
||||
G4 '/test19det/detector 5'
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_end_selection
|
||||
type = XmPushButton
|
||||
labelString = End selection
|
||||
activateCallback = osh>\
|
||||
setWidgetResource TEST_end_selection sensitive False\
|
||||
do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_sep
|
||||
type = XmSeparator
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_init
|
||||
type = XmPushButton
|
||||
labelString = Initialize
|
||||
activateCallback = osh>\
|
||||
G4 '/run/initialize'\
|
||||
G4 '/tracking/storeTrajectory 1'\
|
||||
G4 '/gun/particle e-'\
|
||||
#G4 '/gun/particle pi+'\
|
||||
G4 '/gun/direction 0.1 1 0'\
|
||||
G4 '/gun/energy 1 GeV'\
|
||||
callWidgetCallbacks TEST_camera userCallback
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_represent
|
||||
type = XmPushButton
|
||||
labelString = Represent mother volume
|
||||
activateCallback = osh>\
|
||||
set OContext color pink\
|
||||
collect PhysicalVolume where name eq ATLexpHall_P | represent - | viewNode - TEST_camera\
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_startRun
|
||||
type = XmPushButton
|
||||
labelString = Start run
|
||||
createCallback = osh> setWidgetResource TEST_nextEvent sensitive False
|
||||
activateCallback = &osh>\
|
||||
setWidgetResource TEST_exit sensitive False\
|
||||
setWidgetResource TEST_startRun sensitive False\
|
||||
setWidgetResource TEST_nextEvent sensitive True\
|
||||
setWidgetResource TEST_abortRun sensitive True\
|
||||
eventn=`ask 'Number of event' 10`\
|
||||
string=`printf '/run/beamOn %s' $eventn`\
|
||||
G4 $string\
|
||||
setWidgetResource TEST_exit sensitive True\
|
||||
setWidgetResource TEST_startRun sensitive True\
|
||||
setWidgetResource TEST_nextEvent sensitive False\
|
||||
setWidgetResource TEST_abortRun sensitive False
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_cyclic
|
||||
type = XmPushButton
|
||||
labelString = Cyclic
|
||||
createCallback = osh> setWidgetResource TEST_nextEvent sensitive False
|
||||
activateCallback = osh>\
|
||||
isValid OCyclic/auto_next && delete OCyclic/auto_next\
|
||||
delay=`ask delay(msec) 1000`\
|
||||
script='G4> /run/beamOn 1'\
|
||||
create OCyclic name auto_next widget `thisWidget` delay $delay script $script\
|
||||
do OCyclic/auto_next start
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_nextEvent
|
||||
type = XmPushButton
|
||||
labelString = Next event
|
||||
activateCallback = osh> do Wo sendExitOnly
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = TEST_abortRun
|
||||
type = XmPushButton
|
||||
labelString = Abort run
|
||||
createCallback = osh>\
|
||||
setWidgetResource TEST_nextEvent sensitive False\
|
||||
setWidgetResource TEST_abortRun sensitive False
|
||||
activateCallback = osh>\
|
||||
G4 /run/abort\
|
||||
do Wo sendExitOnly
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#echo 'notify : begin of event.'
|
||||
@@ -0,0 +1,9 @@
|
||||
#echo 'notify : end of event.'
|
||||
collect ONode where name eq Trajectory* | delete -
|
||||
#collect Trajectory | dump -
|
||||
# Color of a trajectory is decided, according to charge, in representation code.
|
||||
# red -; blue +; green neutral
|
||||
#set OContext markerStyle cross
|
||||
collect Trajectory | represent - | viewNode - TEST_camera
|
||||
# Enter in a secondary loop
|
||||
do Wo processEvents
|
||||
@@ -0,0 +1 @@
|
||||
#echo 'notify : begin of run.'
|
||||
@@ -0,0 +1,3 @@
|
||||
#echo 'notify : end of run.'
|
||||
updatePlot TEST_plot1
|
||||
updatePlot TEST_plot2
|
||||
@@ -0,0 +1,56 @@
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
|
||||
!/* | Permission to use, copy, modify, and distribute this software | */
|
||||
!/* | and its documentation for any purpose and without fee is hereby | */
|
||||
!/* | granted, provided that the above copyright notice appear in all | */
|
||||
!/* | copies and that both that copyright notice and this permission | */
|
||||
!/* | notice appear in supporting documentation. This software is | */
|
||||
!/* | provided "as is" without express or implied warranty. | */
|
||||
!/* +---------------------- Copyright notice -------------------------------+ */
|
||||
!----------------------------
|
||||
begin OInterface
|
||||
prefix = g4ui_
|
||||
packages = Xm
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = g4ui_palette
|
||||
type = XmFormDialog
|
||||
children = g4ui_cmd g4ui_39 g4ui_41
|
||||
autoUnmanage = false
|
||||
dialogTitle = G4
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = g4ui_cmd
|
||||
type = XmCommand
|
||||
promptString = Commands
|
||||
commandEnteredCallback = osh> G4 `get Widget thisValue`
|
||||
topAttachment = attach_form
|
||||
bottomAttachment = attach_widget
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_form
|
||||
bottomWidget = g4ui_39
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = g4ui_39
|
||||
type = XmPushButton
|
||||
labelString = Cancel
|
||||
activateCallback = osh> unmanageWidget `get Widget thisParent`
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_form
|
||||
rightAttachment = attach_position
|
||||
rightPosition = 50
|
||||
end
|
||||
!----------------------------
|
||||
begin OWidget
|
||||
name = g4ui_41
|
||||
type = XmPushButton
|
||||
labelString = Help
|
||||
! activateCallback = osh> help 'Commands cmds.ohtx'
|
||||
bottomAttachment = attach_form
|
||||
leftAttachment = attach_position
|
||||
rightAttachment = attach_form
|
||||
leftPosition = 50
|
||||
end
|
||||
Reference in New Issue
Block a user