Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -0,0 +1,242 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ************************************
// * *
// * PurgMagAnalysisManager.cc *
// * *
// ************************************
//
// $Id: PurgMagAnalysisManager.cc,v 1.2 2004/06/18 09:17:55 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#ifdef G4ANALYSIS_USE
#include <stdlib.h>
#include <fstream>
#include "PurgMagAnalysisManager.hh"
#include "G4ios.hh"
#include "AIDA/IHistogram1D.h"
#include "AIDA/IHistogram2D.h"
#include "AIDA/IManagedObject.h"
#include "AIDA/IAnalysisFactory.h"
#include "AIDA/IHistogramFactory.h"
#include "AIDA/ITupleFactory.h"
#include "AIDA/ITreeFactory.h"
#include "AIDA/ITree.h"
#include "AIDA/ITuple.h"
PurgMagAnalysisManager* PurgMagAnalysisManager::instance = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagAnalysisManager::PurgMagAnalysisManager() :
aFact(0), theTree(0), tupFact(0)
{
// Build the factories
aFact = AIDA_createAnalysisFactory();
AIDA::ITreeFactory *treeFact = aFact->createTreeFactory();
// Parameters for the TreeFactory
std::string fileName="purgmag.hbk";
theTree = treeFact->create(fileName,"hbook",false, true);
delete treeFact;
tupFact = aFact->createTupleFactory ( *theTree );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagAnalysisManager::~PurgMagAnalysisManager()
{
delete tupFact;
tupFact=0;
delete histFact;
histFact=0;
delete theTree;
histFact=0;
delete aFact;
aFact = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagAnalysisManager* PurgMagAnalysisManager::getInstance()
{
if (instance == 0) instance = new PurgMagAnalysisManager;
return instance;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagAnalysisManager::book()
{
// N-tuple
std::string options = "";
// Electrons
std::string columnNames1 = "double ex; double ey; double ez; double ee; double epx; double epy; double epz";
if (tupFact) ntuple1 = tupFact->create("1","1",columnNames1, options);
// check for non-zero ...
if (ntuple1) G4cout<<"N-tuple 1 is non-zero"<<G4endl;
// Photons (gamma)
std::string columnNames2 = "double gx; double gy; double gz; double ge; double gpx; double gpy; double gpz";
if (tupFact) ntuple2 = tupFact->create("2","2",columnNames2, options);
// check for non-zero ...
if (ntuple2) G4cout<<"N-tuple 2 is non-zero"<<G4endl;
// Positrons
std::string columnNames3 = "double px; double py; double pz; double pe; double ppx; double ppy; double ppz";
if (tupFact) ntuple3 = tupFact->create("3","3",columnNames3, options);
// check for non-zero ...
if (ntuple3) G4cout<<"N-tuple 3 is non-zero"<<G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fills a N-tuple with position, energy and momentum of
// electrons entering the measurement volume.
void PurgMagAnalysisManager::fill_Tuple_Electrons(G4double ex, G4double ey, G4double ez, // Position
G4double ee, // Energy
G4double epx, G4double epy, G4double epz) // Momentum
{
if (ntuple1 == 0) {
G4cout << "N-tuple 1 is zero " << "\n";
return;
}
int iex = ntuple1->findColumn( "ex" );
int iey = ntuple1->findColumn( "ey" );
int iez = ntuple1->findColumn( "ez" );
int iee = ntuple1->findColumn( "ee" );
int iepx = ntuple1->findColumn( "epx" );
int iepy = ntuple1->findColumn( "epy" );
int iepz = ntuple1->findColumn( "epz" );
ntuple1->fill(iex, ex); // fill ( int column, double value )
ntuple1->fill(iey, ey);
ntuple1->fill(iez, ez);
ntuple1->fill(iee, ee);
ntuple1->fill(iepx, epx);
ntuple1->fill(iepy, epy);
ntuple1->fill(iepz, epz);
ntuple1->addRow();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fills a N-tuple with position, energy and momentum of
// photons entering the measurement volume.
void PurgMagAnalysisManager::fill_Tuple_Gamma(G4double gx, G4double gy, G4double gz, // Position
G4double ge, // Energy
G4double gpx, G4double gpy, G4double gpz) // Momentum
{
if (ntuple2 == 0) {
G4cout << "N-tuple 2 is zero" << "\n";
return;
}
int igx = ntuple2->findColumn( "gx" );
int igy = ntuple2->findColumn( "gy" );
int igz = ntuple2->findColumn( "gz" );
int ige = ntuple2->findColumn( "ge" );
int igpx = ntuple2->findColumn( "gpx" );
int igpy = ntuple2->findColumn( "gpy" );
int igpz = ntuple2->findColumn( "gpz" );
ntuple2->fill(igx, gx); // fill ( int column, double value )
ntuple2->fill(igy, gy);
ntuple2->fill(igz, gz);
ntuple2->fill(ige, ge);
ntuple2->fill(igpx, gpx);
ntuple2->fill(igpy, gpy);
ntuple2->fill(igpz, gpz);
ntuple2->addRow();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fills a N-tuple with position, energy and momentum of
// positrons entering the measurement volume.
void PurgMagAnalysisManager::fill_Tuple_Positrons(G4double px, G4double py, G4double pz, // Position
G4double pe, // Energy
G4double ppx, G4double ppy, G4double ppz) // Momentum
{
if (ntuple3 == 0) {
G4cout << "N-tuple 3 is zero" << "\n";
return;
}
int ipx = ntuple3->findColumn( "px" );
int ipy = ntuple3->findColumn( "py" );
int ipz = ntuple3->findColumn( "pz" );
int ipe = ntuple3->findColumn( "pe" );
int ippx = ntuple3->findColumn( "ppx" );
int ippy = ntuple3->findColumn( "ppy" );
int ippz = ntuple3->findColumn( "ppz" );
ntuple3->fill(ipx, px); // fill ( int column, double value )
ntuple3->fill(ipy, py);
ntuple3->fill(ipz, pz);
ntuple3->fill(ipe, pe);
ntuple3->fill(ippx, ppx);
ntuple3->fill(ippy, ppy);
ntuple3->fill(ippz, ppz);
ntuple3->addRow();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagAnalysisManager::finish()
{
// Writes all histograms to file
theTree->commit();
// Close (will again commit)
theTree->close();
}
#endif
@@ -0,0 +1,440 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// *****************************************
// * *
// * PurgMagDetectorConstruction.cc *
// * *
// *****************************************
//
// $Id: PurgMagDetectorConstruction.cc,v 1.2 2004/06/18 09:17:56 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "PurgMagDetectorConstruction.hh"
#include "PurgMagTabulatedField3D.hh"
#include "G4ThreeVector.hh"
#include "globals.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4PVParameterised.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4EqMagElectricField.hh"
#include "G4ChordFinder.hh"
#include "G4UniformMagField.hh"
#include "G4ExplicitEuler.hh"
#include "G4ImplicitEuler.hh"
#include "G4SimpleRunge.hh"
#include "G4SimpleHeum.hh"
#include "G4ClassicalRK4.hh"
#include "G4HelixExplicitEuler.hh"
#include "G4HelixImplicitEuler.hh"
#include "G4HelixSimpleRunge.hh"
#include "G4CashKarpRKF45.hh"
#include "G4RKG3_Stepper.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// Possibility to turn off (0) magnetic field and measurement volume.
#define GAP 1 // Magnet geometric volume
#define MAG 1 // Magnetic field grid
#define MEASUREVOL 1 // Volume for measurement
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagDetectorConstruction::PurgMagDetectorConstruction()
:physiWorld(NULL), logicWorld(NULL), solidWorld(NULL),
physiGap1(NULL), logicGap1(NULL), solidGap1(NULL),
physiGap2(NULL), logicGap2(NULL), solidGap2(NULL),
physiMeasureVolume(NULL), logicMeasureVolume(NULL), solidMeasureVolume(NULL),
WorldMaterial(NULL),
GapMaterial(NULL)
{
WorldSizeXY=WorldSizeZ=0;
GapSizeX1=GapSizeX2=GapSizeY1=GapSizeY2=GapSizeZ=0;
MeasureVolumeSizeXY=MeasureVolumeSizeZ=0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagDetectorConstruction::~PurgMagDetectorConstruction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* PurgMagDetectorConstruction::Construct()
{
DefineMaterials();
return ConstructCalorimeter();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagDetectorConstruction::DefineMaterials()
{
//This function illustrates the possible ways to define materials.
//Density and mass per mole taken from Physics Handbook for Science
//and engineering, sixth edition. This is a general material list
//with extra materials for other examples.
G4String name, symbol;
G4double density;
G4int ncomponents, natoms;
G4double fractionmass;
G4double temperature, pressure;
// Define Elements
// Example: G4Element* Notation = new G4Element ("Element", "Notation", z, a);
G4Element* H = new G4Element ("Hydrogen", "H", 1. , 1.01*g/mole);
G4Element* N = new G4Element ("Nitrogen", "N", 7., 14.01*g/mole);
G4Element* O = new G4Element ("Oxygen" , "O", 8. , 16.00*g/mole);
G4Element* Ar = new G4Element ("Argon" , "Ar", 18., 39.948*g/mole );
// Define Material
// Example: G4Material* Notation = new G4Material("Material", z, a, density);
/* Not used in this setup, will be used in further development.
G4Material* He = new G4Material("Helium", 2., 4.00*g/mole, 0.178*mg/cm3);
G4Material* Be = new G4Material("Beryllium", 4., 9.01*g/mole, 1.848*g/cm3);
G4Material* W = new G4Material("Tungsten", 74., 183.85*g/mole, 19.30*g/cm3);
G4Material* Cu = new G4Material("Copper", 29., 63.55*g/mole, 8.96*g/cm3);
*/
G4Material* Fe = new G4Material("Iron", 26., 55.84*g/mole, 7.87*g/cm3);
// Define materials from elements.
// Case 1: chemical molecule
// Water
density = 1.000*g/cm3;
G4Material* H2O = new G4Material(name="H2O" , density, ncomponents=2);
H2O->AddElement(H, natoms=2);
H2O->AddElement(O, natoms=1);
// Case 2: mixture by fractional mass.
// Air
density = 1.290*mg/cm3;
G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
Air->AddElement(N, fractionmass=0.7);
Air->AddElement(O, fractionmass=0.3);
// Vacuum
density = 1.e-5*g/cm3;
pressure = 2.e-2*bar;
temperature = STP_Temperature; //from PhysicalConstants.h
G4Material* vacuum = new G4Material(name="vacuum", density, ncomponents=1,
kStateGas,temperature,pressure);
vacuum->AddMaterial(Air, fractionmass=1.);
// Laboratory vacuum: Dry air (average composition)
density = 1.7836*mg/cm3 ; // STP
G4Material* Argon = new G4Material(name="Argon", density, ncomponents=1);
Argon->AddElement(Ar, 1);
density = 1.25053*mg/cm3 ; // STP
G4Material* Nitrogen = new G4Material(name="N2", density, ncomponents=1);
Nitrogen->AddElement(N, 2);
density = 1.4289*mg/cm3 ; // STP
G4Material* Oxygen = new G4Material(name="O2", density, ncomponents=1);
Oxygen->AddElement(O, 2);
density = 1.2928*mg/cm3 ; // STP
density *= 1.0e-8 ; // pumped vacuum
temperature = STP_Temperature;
pressure = 1.0e-8*STP_Pressure;
G4Material* LaboratoryVacuum = new G4Material(name="LaboratoryVacuum",
density,ncomponents=3,
kStateGas,temperature,pressure);
LaboratoryVacuum->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
LaboratoryVacuum->AddMaterial( Oxygen, fractionmass = 0.2315 ) ;
LaboratoryVacuum->AddMaterial( Argon, fractionmass = 0.0128 ) ;
G4cout << G4endl << *(G4Material::GetMaterialTable()) << G4endl;
// Default materials in setup.
WorldMaterial = LaboratoryVacuum;
GapMaterial = Fe;
G4cout << "end material"<< endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* PurgMagDetectorConstruction::ConstructCalorimeter()
{
// Complete the parameters definition
//The World
WorldSizeXY = 300.*cm; // Cube
WorldSizeZ = 300.*cm;
//Measurement volume
MeasureVolumeSizeXY = 280.*cm; // Cubic slice
MeasureVolumeSizeZ = 1.*cm;
// Position of measurement volume.
// SSD is Source to Surface Distance. Source in origo and measurements 50 cm
// below in the z-direction (symbolizin a patient at SSD = 50 cm)
SSD = 50.*cm;
MeasureVolumePosition = -(SSD + MeasureVolumeSizeZ/2);
// Geometric definition of the gap of the purging magnet. Approximation of
// the shape of the pole gap.
GapSizeY1 = 10.*cm; // length along x at the surface positioned at -dz
GapSizeY2 = 10.*cm; // length along x at the surface positioned at +dz
GapSizeX1 = 10.*cm; // length along y at the surface positioned at -dz
GapSizeX2 = 18.37*cm; // length along y at the surface positioned at +dz
GapSizeZ = 11.5*cm; // length along z axis
Gap1PosY = 0.*cm;
Gap1PosX = -9.55*cm;
Gap1PosZ = -6.89*cm;
Gap2PosY = 0.*cm;
Gap2PosX = 9.55*cm;
Gap2PosZ = -6.89*cm;
// Coordinate correction for field grif.
// Gap opening at z = -11.4 mm.
// In field grid coordonates gap at z = -0.007m in field from z = 0.0m to
// z = 0.087m.
// -> zOffset = -11.4-(-7) = 4.4 mm
zOffset = 4.4*mm;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// Magnetic Field - Purging magnet
//
#if MAG
static G4bool fieldIsInitialized = false;
if(!fieldIsInitialized)
{
G4FieldManager *pFieldMgr;
// G4MagIntegratorStepper *pStepper;
//Field grid in A9.TABLE. File must be in accessible from run urn directory.
G4MagneticField* PurgMagField= new PurgMagTabulatedField3D("PurgMag3D.TABLE", zOffset);
pFieldMgr=G4TransportationManager::GetTransportationManager()->GetFieldManager();
G4cout<< "DeltaStep "<<pFieldMgr->GetDeltaOneStep()/mm <<"mm" <<endl;
G4ChordFinder *pChordFinder = new G4ChordFinder(PurgMagField);
pFieldMgr->SetChordFinder( pChordFinder );
pFieldMgr->SetDetectorField(PurgMagField);
fieldIsInitialized = true;
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// Some out prints of the setup.
G4cout << "\n-----------------------------------------------------------"
<< "\n Geometry and materials"
<< "\n-----------------------------------------------------------"
<< "\n ---> World:"
<< "\n ---> " << WorldMaterial->GetName() << " in World"
<< "\n ---> " << "WorldSizeXY: " << G4BestUnit(WorldSizeXY,"Length")
<< "\n ---> " << "WorldSizeZ: " << G4BestUnit(WorldSizeZ,"Length");
#if GAP
G4cout << "\n-----------------------------------------------------------"
<< "\n ---> Purging Magnet:"
<< "\n ---> " << "Gap made of "<< GapMaterial->GetName()
<< "\n ---> " << "GapSizeY1: " << G4BestUnit(GapSizeY1,"Length")
<< "\n ---> " << "GapSizeY2: " << G4BestUnit(GapSizeY2,"Length")
<< "\n ---> " << "GapSizeX1: " << G4BestUnit(GapSizeX1,"Length")
<< "\n ---> " << "GapSizeX2: " << G4BestUnit(GapSizeX2,"Length");
#endif
#if MEASUREVOL
G4cout << "\n-----------------------------------------------------------"
<< "\n ---> Measurement Volume:"
<< "\n ---> " << WorldMaterial->GetName() << " in Measurement volume"
<< "\n ---> " << "MeasureVolumeXY: " << G4BestUnit(MeasureVolumeSizeXY,"Length")
<< "\n ---> " << "MeasureVolumeZ: " << G4BestUnit(MeasureVolumeSizeZ,"Length")
<< "\n ---> " << "At SSD = " << G4BestUnit(MeasureVolumePosition,"Length");
#endif
G4cout << "\n-----------------------------------------------------------\n";
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// World
//
solidWorld = new G4Box("World", //its name
WorldSizeXY/2,WorldSizeXY/2,WorldSizeZ/2); //its size
logicWorld = new G4LogicalVolume(solidWorld, //its solid
WorldMaterial, //its material
"World"); //its name
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"World", //its name
logicWorld, //its logical volume
NULL, //its mother volume
false, //no boolean operation
0); //copy number
// Visualization attributes
G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
simpleWorldVisAtt->SetVisibility(true);
logicWorld->SetVisAttributes(simpleWorldVisAtt);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// Measurement Volume
//
#if MEASUREVOL
solidMeasureVolume = new G4Box("MeasureVolume", //its name
MeasureVolumeSizeXY/2,MeasureVolumeSizeXY/2,MeasureVolumeSizeZ/2); //its size
logicMeasureVolume = new G4LogicalVolume(solidMeasureVolume, //its solid
WorldMaterial, //its material
"MeasureVolume"); //its name
physiMeasureVolume = new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,MeasureVolumePosition), //at (0,0,0)
"MeasureVolume", //its name
logicMeasureVolume, //its logical volume
physiWorld, //its mother volume
false, //no boolean operation
0); //copy number
// Visualization attributes
G4VisAttributes* simpleMeasureVolumeVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
simpleMeasureVolumeVisAtt->SetVisibility(true);
simpleMeasureVolumeVisAtt->SetForceSolid(true);
logicMeasureVolume->SetVisAttributes(simpleMeasureVolumeVisAtt);
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
//Gap cone. Opening 20 deg. Two separate trapezoids. Iron.
//
#if GAP
//Gap part 1, placed in negative x-direction.
solidGap1 = new G4Trd("Gap1",
GapSizeX1/2, // Half-length along x at the surface positioned at -dz
GapSizeX2/2, // Half-length along x at the surface positioned at +dz
GapSizeY1/2, // Half-length along y at the surface positioned at -dz
GapSizeY2/2, // Half-length along y at the surface positioned at +dz
GapSizeZ/2 ); // Half-length along z axis
logicGap1 = new G4LogicalVolume(solidGap1, //its solid
GapMaterial, //its material
"Gap1"); //its name
physiGap1 = new G4PVPlacement(0, //90 deg rotation
G4ThreeVector(Gap1PosX,Gap1PosY,Gap1PosZ), //position
"Gap1", //its name
logicGap1, //its logical volume
physiWorld, //its mother volume
false, //no boolean operation
0); //copy number
//Gap part 2, placed in positive x-direction.
solidGap2 = new G4Trd("Gap2",
GapSizeX1/2, // Half-length along x at the surface positioned at -dz
GapSizeX2/2, // Half-length along x at the surface positioned at +dz
GapSizeY1/2, // Half-length along y at the surface positioned at -dz
GapSizeY2/2, // Half-length along y at the surface positioned at +dz
GapSizeZ/2 ); // Half-length along z axis
logicGap2 = new G4LogicalVolume(solidGap2, //its solid
GapMaterial, //its material
"Gap2"); //its name
physiGap2 = new G4PVPlacement(0, //no rotation
G4ThreeVector(Gap2PosX,Gap2PosY,Gap2PosZ), //position
"Gap2", //its name
logicGap2, //its logical volume
physiWorld, //its mother volume
false, //no boolean operation
0); //copy number
// Visualization attributes
G4VisAttributes* simpleGap1VisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0)); //yellow
simpleGap1VisAtt->SetVisibility(true);
simpleGap1VisAtt->SetForceSolid(true);
logicGap1->SetVisAttributes(simpleGap1VisAtt);
G4VisAttributes* simpleGap2VisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0)); //yellow
simpleGap2VisAtt->SetVisibility(true);
simpleGap2VisAtt->SetForceSolid(true);
logicGap2->SetVisAttributes(simpleGap2VisAtt);
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,126 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ********************************
// * *
// * PurgMagEventAction.cc *
// * *
// ********************************
//
// $Id: PurgMagEventAction.cc,v 1.2 2004/06/18 09:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "PurgMagEventAction.hh"
#include "PurgMagRunAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "Randomize.hh"
#ifdef G4ANALYSIS_USE
#include"PurgMagAnalysisManager.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagEventAction::PurgMagEventAction(PurgMagRunAction* run)
:PurgMagRun(run),drawFlag("all"),printModulo(10000)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagEventAction::~PurgMagEventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagEventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
G4cout << "\n---> Begin Of Event: " << evtNb << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagEventAction::EndOfEventAction(const G4Event* evt)
{
if (G4VVisManager::GetConcreteInstance())
{
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for (G4int i=0; i<n_trajectories; i++)
{
//G4cout<< "Iteration" << i <<G4endl;
G4Trajectory* trj = (G4Trajectory*)((*(evt->GetTrajectoryContainer()))[i]);
if (drawFlag == "all")
{
trj->DrawTrajectory(50);
}
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
{
trj->DrawTrajectory(50);
}
}
//save rndm status
if (PurgMagRun->GetRndmFreq() == 2)
{
HepRandom::saveEngineStatus("endOfEvent.rndm");
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
{
G4cout << "\n---> End of Event: " << evtNb << G4endl;
HepRandom::showEngineStatus();
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,327 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ********************************
// * *
// * PurgMagPhysicsList.cc *
// * *
// ********************************
//
//
// $Id: PurgMagPhysicsList.cc,v 1.2 2004/06/18 09:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "PurgMagPhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagPhysicsList::PurgMagPhysicsList(): G4VUserPhysicsList()
{
defaultCutValue = 1*micrometer;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForPositron = defaultCutValue;
cutForProton = defaultCutValue;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagPhysicsList::~PurgMagPhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::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();
ConstructBarions();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructBosons()
{
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructBarions()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4MultipleScattering.hh"
// Bosons
#include "G4PhotoElectricEffect.hh"
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
// Leptons
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
//gamma
pmanager->AddDiscreteProcess(new G4GammaConversion);
pmanager->AddDiscreteProcess(new G4ComptonScattering);
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
} else if (particleName == "proton") {
//proton
pmanager->AddProcess(new G4MultipleScattering, -1,1,1);
} else if (particleName == "anti_proton") {
//antiproton
pmanager->AddProcess(new G4MultipleScattering, -1,1,1);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::ConstructGeneral()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForPositron, "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(cutForProton, "proton");
SetCutValue(cutForProton, "anti_proton");
SetCutValueForOthers(defaultCutValue);
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetCuts:";
G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
// G4Gamma::SetEnergyRange(lowcut,1e5);
SetGELowLimit(lowcut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetCuts:";
G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
// G4Electron::SetEnergyRange(lowcut,1e5);
SetGELowLimit(lowcut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetCuts:";
G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl;
G4Exception("Positron Low Limit: not implemented in PurgMagPhysicsList");
//
// G4Positron::SetEnergyRange(lowcut,1e5);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetCuts:";
G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl;
G4Exception("Proton Low Limit: not implemented in PurgMagPhysicsList");
//
// G4Proton::SetEnergyRange(lowcut,1e5);
// G4AntiProton::SetEnergyRange(lowcut,1e5);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetGEPLowLimit:";
G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
// G4Gamma::SetEnergyRange(lowcut,1e5);
// G4Electron::SetEnergyRange(lowcut,1e5);
// G4Positron::SetEnergyRange(lowcut,1e5);
this->SetGELowLimit(lowcut);
G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetGELowLimit(G4double lowcut)
{
if (verboseLevel >0){
G4cout << "PurgMagPhysicsList::SetGELowLimit:";
G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
}
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5);
}
void PurgMagPhysicsList::SetGammaCut(G4double val)
{
ResetCuts();
cutForGamma = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetElectronCut(G4double val)
{
// ResetCuts();
cutForElectron = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetPositronCut(G4double val)
{
// ResetCuts();
cutForPositron = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPhysicsList::SetProtonCut(G4double val)
{
//ResetCuts();
cutForProton = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,104 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ********************************************
// * *
// * PurgMagPrimaryGeneratorAction.cc *
// * *
// ********************************************
//
// $Id: PurgMagPrimaryGeneratorAction.cc,v 1.2 2004/06/18 09:17:59 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "PurgMagPrimaryGeneratorAction.hh"
#include "PurgMagDetectorConstruction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
#include "G4UnitsTable.hh"
//Print position of primaries.
#define POSITION 0
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagPrimaryGeneratorAction::PurgMagPrimaryGeneratorAction(PurgMagDetectorConstruction* PurgMagDC)
:PurgMagDetector(PurgMagDC),rndmVertex(false)
{
//default kinematic
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4ParticleDefinition* particle
=
G4ParticleTable::GetParticleTable()->FindParticle("e-");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleEnergy(50.*MeV);
//Momentum Direction
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,-1.));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagPrimaryGeneratorAction::~PurgMagPrimaryGeneratorAction()
{
delete particleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//Start position of primaries
G4double z0 = 15.*cm;
G4double x0 = 0.*cm;
G4double y0 = 0.*cm;
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
#if POSITION
G4cout << "\n----Particle Gun--------------------------------------------\n";
G4cout << "\n ---> SetParticlePosition(G4ThreeVector(x0,y0,z0)) ";
G4cout << "\n ---> x0 = " << x0 << " "<< G4BestUnit(x0,"Length");
G4cout << "\n ---> y0 = " << y0 << " "<< G4BestUnit(y0,"Length");
G4cout << "\n ---> z0 = " << z0 << " "<< G4BestUnit(z0,"Length");
G4cout << "\n-----------------------------------------------------------\n";
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,132 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ******************************
// * *
// * PurgMagRunAction.cc *
// * *
// ******************************
//
// $Id: PurgMagRunAction.cc,v 1.2 2004/06/18 09:18:00 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "PurgMagRunAction.hh"
#include "G4SteppingManager.hh"
#include "G4Run.hh"
#include "G4Material.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
#include "G4UnitsTable.hh"
#include "Randomize.hh"
#include <iomanip>
#ifdef G4ANALYSIS_USE
#include "PurgMagAnalysisManager.hh"
#endif
#include <assert.h>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagRunAction::PurgMagRunAction(PurgMagDetectorConstruction* det)
:Detector(det)
{
saveRndm = 1;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagRunAction::~PurgMagRunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagRunAction::BeginOfRunAction(const G4Run* aRun)
{
#ifdef G4ANALYSIS_USE
PurgMagAnalysisManager* analysis = PurgMagAnalysisManager::getInstance();
analysis->book();
#endif
G4cout << "---> Run " << aRun->GetRunID() << " start." << G4endl;
// save Rndm status
if (saveRndm > 0)
{ HepRandom::showEngineStatus();
HepRandom::saveEngineStatus("beginOfRun.rndm");
}
//Drawing
//
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/vis/scene/notifyHandlers");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagRunAction::EndOfRunAction(const G4Run* aRun)
{
#ifdef G4ANALYSIS_USE
PurgMagAnalysisManager* analysis = PurgMagAnalysisManager::getInstance();
#endif
G4cout << "number of event = " << aRun->GetNumberOfEvent() << G4endl;
#ifdef G4ANALYSIS_USE
analysis->finish();
#endif
//drawing
if (G4VVisManager::GetConcreteInstance())
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
// save Rndm status
if (saveRndm == 1)
{ HepRandom::showEngineStatus();
HepRandom::saveEngineStatus("endOfRun.rndm");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,166 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ***********************************
// * *
// * PurgMagSteppingAction.cc *
// * *
// ***********************************
//
// $Id: PurgMagSteppingAction.cc,v 1.2 2004/06/18 09:18:01 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "PurgMagSteppingAction.hh"
#include "PurgMagRunAction.hh"
#include "PurgMagDetectorConstruction.hh"
#include "G4SteppingManager.hh"
#include "G4VTouchable.hh"
#include "G4VPhysicalVolume.hh"
#ifdef G4ANALYSIS_USE
#include"PurgMagAnalysisManager.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagSteppingAction::PurgMagSteppingAction(PurgMagRunAction* run,PurgMagDetectorConstruction* det)
:PurgMagRun(run),Detector(det)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagSteppingAction::~PurgMagSteppingAction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagSteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4double gx, gy, gz, ge, gpx, gpy, gpz, ex, ey, ez, ee, epx, epy, epz, px, py, pz, pe, ppx, ppy, ppz;
//Collection at SSD in N-tuples. Electrons and photons separated
//Prestep point in World, next volume MeasureVolume, process transportation
if ((aStep->GetPreStepPoint()->GetPhysicalVolume() == Detector->GetWorld())&&
(aStep->GetTrack()->GetNextVolume() == Detector->GetMeasureVolume())&&
//(aStep->GetTrack()->GetMomentumDirection().z()>0.)&& // only particles with positive momentum
(aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == "Transportation"))
{
// Electrons
if (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "e-")
{
#ifdef G4ANALYSIS_USE
PurgMagAnalysisManager* analysis = PurgMagAnalysisManager::getInstance();
#endif
#ifdef G4ANALYSIS_USE
// Position
ex = (aStep->GetTrack()->GetPosition().x())/cm;
ey = (aStep->GetTrack()->GetPosition().y())/cm;
ez = (aStep->GetTrack()->GetPosition().z())/cm;
// Energy
ee = (aStep->GetTrack()->GetKineticEnergy())/MeV;
// Momentum
epx = aStep->GetTrack()->GetMomentum().x();
epy = aStep->GetTrack()->GetMomentum().y();
epz = aStep->GetTrack()->GetMomentum().z();
// Fill N-tuple electrons
analysis->fill_Tuple_Electrons(ex, ey, ez, ee, epx, epy, epz);
#endif
}
// Photons
if (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "gamma")
{
#ifdef G4ANALYSIS_USE
PurgMagAnalysisManager* analysis = PurgMagAnalysisManager::getInstance();
#endif
#ifdef G4ANALYSIS_USE
// Position
gx = (aStep->GetTrack()->GetPosition().x())/cm;
gy = (aStep->GetTrack()->GetPosition().y())/cm;
gz = (aStep->GetTrack()->GetPosition().z())/cm;
// Energy
ge = (aStep->GetTrack()->GetKineticEnergy())/MeV;
// Momentum
gpx = aStep->GetTrack()->GetMomentum().x();
gpy = aStep->GetTrack()->GetMomentum().y();
gpz = aStep->GetTrack()->GetMomentum().z();
// Fill N-tuple photons
analysis->fill_Tuple_Gamma(gx, gy, gz, ge, gpx, gpy, gpz);
#endif
}
// Positrons
if (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "e+")
{
#ifdef G4ANALYSIS_USE
PurgMagAnalysisManager* analysis = PurgMagAnalysisManager::getInstance();
#endif
#ifdef G4ANALYSIS_USE
// Position
px = (aStep->GetTrack()->GetPosition().x())/cm;
py = (aStep->GetTrack()->GetPosition().y())/cm;
pz = (aStep->GetTrack()->GetPosition().z())/cm;
// Energy
pe = (aStep->GetTrack()->GetKineticEnergy())/MeV;
// Momentum
ppx = aStep->GetTrack()->GetMomentum().x();
ppy = aStep->GetTrack()->GetMomentum().y();
ppz = aStep->GetTrack()->GetMomentum().z();
// Fill Ntuple positrons
analysis->fill_Tuple_Positrons(px, py, pz, pe, ppx, ppy, ppz);
#endif
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,180 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ************************************
// * *
// * PurgMagSteppingVerbose.cc *
// * *
// ************************************
//
// $Id: PurgMagSteppingVerbose.cc,v 1.2 2004/06/18 09:18:02 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "PurgMagSteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagSteppingVerbose::PurgMagSteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagSteppingVerbose::~PurgMagSteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagSteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "NextVolu"
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << "User Limit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
G4cout<< "exit PurgMagSteppingVerbose::StepInfo " <<G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagSteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "NextVolu"
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
if(fTrack->GetNextVolume()){
G4cout << std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
} else {
G4cout << std::setw(10) << "OutOfWorld" << " ";
}
G4cout << std::setw(10) << "initStep" << G4endl;
}
G4cout.precision(prec);
G4cout<< "exit PurgMagSteppingVerbose::TrackingStarted() " <<G4endl;
}
@@ -0,0 +1,223 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson and J. Generowicz.
//
// *************************************
// * *
// * PurgMagTabulatedField3D.cc *
// * *
// *************************************
//
// $Id: PurgMagTabulatedField3D.cc,v 1.2 2004/06/18 09:18:03 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "PurgMagTabulatedField3D.hh"
PurgMagTabulatedField3D::PurgMagTabulatedField3D( const char* filename, double zOffset )
:fZoffset(zOffset),invertX(false),invertY(false),invertZ(false)
{
double lenUnit= meter;
double fieldUnit= tesla;
G4cout << "\n-----------------------------------------------------------"
<< "\n Magnetic field"
<< "\n-----------------------------------------------------------";
G4cout << "\n ---> " "Reading the field grid from " << filename << " ... " << endl;
ifstream file( filename ); // Open the file for reading.
// Ignore first blank line
char buffer[256];
file.getline(buffer,256);
// Read table dimensions
file >> nx >> ny >> nz; // Note dodgy order
G4cout << " [ Number of values x,y,z: "
<< nx << " " << ny << " " << nz << " ] "
<< endl;
// Set up storage space for table
xField.resize( nx );
yField.resize( nx );
zField.resize( nx );
int ix, iy, iz;
for (ix=0; ix<nx; ix++) {
xField[ix].resize(ny);
yField[ix].resize(ny);
zField[ix].resize(ny);
for (iy=0; iy<ny; iy++) {
xField[ix][iy].resize(nz);
yField[ix][iy].resize(nz);
zField[ix][iy].resize(nz);
}
}
// Ignore other header information
// The first line whose second character is '0' is considered to
// be the last line of the header.
do {
file.getline(buffer,256);
} while ( buffer[1]!='0');
// Read in the data
double xval,yval,zval,bx,by,bz;
double permeability; // Not used in this example.
for (ix=0; ix<nx; ix++) {
for (iy=0; iy<ny; iy++) {
for (iz=0; iz<nz; iz++) {
file >> xval >> yval >> zval >> bx >> by >> bz >> permeability;
if ( ix==0 && iy==0 && iz==0 ) {
minx = xval * lenUnit;
miny = yval * lenUnit;
minz = zval * lenUnit;
}
xField[ix][iy][iz] = bx * fieldUnit;
yField[ix][iy][iz] = by * fieldUnit;
zField[ix][iy][iz] = bz * fieldUnit;
}
}
}
file.close();
maxx = xval * lenUnit;
maxy = yval * lenUnit;
maxz = zval * lenUnit;
G4cout << "\n ---> ... done reading " << endl;
// G4cout << " Read values of field from file " << filename << endl;
G4cout << " ---> assumed the order: x, y, z, Bx, By, Bz "
<< "\n ---> Min values x,y,z: "
<< minx/cm << " " << miny/cm << " " << minz/cm << " cm "
<< "\n ---> Max values x,y,z: "
<< maxx/cm << " " << maxy/cm << " " << maxz/cm << " cm "
<< "\n ---> The field will be offset by " << zOffset/cm << " cm " << endl;
// Should really check that the limits are not the wrong way around.
if (maxx < minx) {swap(maxx,minx); invertX = true;}
if (maxy < miny) {swap(maxy,miny); invertY = true;}
if (maxz < minz) {swap(maxz,minz); invertZ = true;}
G4cout << "\nAfter reordering if neccesary"
<< "\n ---> Min values x,y,z: "
<< minx/cm << " " << miny/cm << " " << minz/cm << " cm "
<< " \n ---> Max values x,y,z: "
<< maxx/cm << " " << maxy/cm << " " << maxz/cm << " cm ";
dx = maxx - minx;
dy = maxy - miny;
dz = maxz - minz;
G4cout << "\n ---> Dif values x,y,z (range): "
<< dx/cm << " " << dy/cm << " " << dz/cm << " cm in z "
<< "\n-----------------------------------------------------------" << endl;
}
void PurgMagTabulatedField3D::GetFieldValue(const double point[4],
double *Bfield ) const
{
double x = point[0];
double y = point[1];
double z = point[2] + fZoffset;
// Check that the point is within the defined region
if ( x>=minx && x<=maxx &&
y>=miny && y<=maxy &&
z>=minz && z<=maxz ) {
// Position of given point within region, normalized to the range
// [0,1]
double xfraction = (x - minx) / dx;
double yfraction = (y - miny) / dy;
double zfraction = (z - minz) / dz;
if (invertX) { xfraction = 1 - xfraction;}
if (invertY) { yfraction = 1 - yfraction;}
if (invertZ) { zfraction = 1 - zfraction;}
// Need addresses of these to pass to modf below.
// modf uses its second argument as an OUTPUT argument.
double xdindex, ydindex, zdindex;
// Position of the point within the cuboid defined by the
// nearest surrounding tabulated points
double xlocal = ( modf(xfraction*(nx-1), &xdindex));
double ylocal = ( modf(yfraction*(ny-1), &ydindex));
double zlocal = ( modf(zfraction*(nz-1), &zdindex));
// The indices of the nearest tabulated point whose coordinates
// are all less than those of the given point
int xindex = static_cast<int>(xdindex);
int yindex = static_cast<int>(ydindex);
int zindex = static_cast<int>(zdindex);
#ifdef DEBUG_INTERPOLATING_FIELD
G4cout << "Local x,y,z: " << xlocal << " " << ylocal << " " << zlocal << endl;
G4cout << "Index x,y,z: " << xindex << " " << yindex << " " << zindex << endl;
double valx0z0, mulx0z0, valx1z0, mulx1z0;
double valx0z1, mulx0z1, valx1z1, mulx1z1;
valx0z0= table[xindex ][0][zindex]; mulx0z0= (1-xlocal) * (1-zlocal);
valx1z0= table[xindex+1][0][zindex]; mulx1z0= xlocal * (1-zlocal);
valx0z1= table[xindex ][0][zindex+1]; mulx0z1= (1-xlocal) * zlocal;
valx1z1= table[xindex+1][0][zindex+1]; mulx1z1= xlocal * zlocal;
#endif
// Full 3-dimensional version
Bfield[0] =
xField[xindex ][yindex ][zindex ] * (1-xlocal) * (1-ylocal) * (1-zlocal) +
xField[xindex ][yindex ][zindex+1] * (1-xlocal) * (1-ylocal) * zlocal +
xField[xindex ][yindex+1][zindex ] * (1-xlocal) * ylocal * (1-zlocal) +
xField[xindex ][yindex+1][zindex+1] * (1-xlocal) * ylocal * zlocal +
xField[xindex+1][yindex ][zindex ] * xlocal * (1-ylocal) * (1-zlocal) +
xField[xindex+1][yindex ][zindex+1] * xlocal * (1-ylocal) * zlocal +
xField[xindex+1][yindex+1][zindex ] * xlocal * ylocal * (1-zlocal) +
xField[xindex+1][yindex+1][zindex+1] * xlocal * ylocal * zlocal ;
Bfield[1] =
yField[xindex ][yindex ][zindex ] * (1-xlocal) * (1-ylocal) * (1-zlocal) +
yField[xindex ][yindex ][zindex+1] * (1-xlocal) * (1-ylocal) * zlocal +
yField[xindex ][yindex+1][zindex ] * (1-xlocal) * ylocal * (1-zlocal) +
yField[xindex ][yindex+1][zindex+1] * (1-xlocal) * ylocal * zlocal +
yField[xindex+1][yindex ][zindex ] * xlocal * (1-ylocal) * (1-zlocal) +
yField[xindex+1][yindex ][zindex+1] * xlocal * (1-ylocal) * zlocal +
yField[xindex+1][yindex+1][zindex ] * xlocal * ylocal * (1-zlocal) +
yField[xindex+1][yindex+1][zindex+1] * xlocal * ylocal * zlocal ;
Bfield[2] =
zField[xindex ][yindex ][zindex ] * (1-xlocal) * (1-ylocal) * (1-zlocal) +
zField[xindex ][yindex ][zindex+1] * (1-xlocal) * (1-ylocal) * zlocal +
zField[xindex ][yindex+1][zindex ] * (1-xlocal) * ylocal * (1-zlocal) +
zField[xindex ][yindex+1][zindex+1] * (1-xlocal) * ylocal * zlocal +
zField[xindex+1][yindex ][zindex ] * xlocal * (1-ylocal) * (1-zlocal) +
zField[xindex+1][yindex ][zindex+1] * xlocal * (1-ylocal) * zlocal +
zField[xindex+1][yindex+1][zindex ] * xlocal * ylocal * (1-zlocal) +
zField[xindex+1][yindex+1][zindex+1] * xlocal * ylocal * zlocal ;
} else {
Bfield[0] = 0.0;
Bfield[1] = 0.0;
Bfield[2] = 0.0;
}
}
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// ***********************************
// * *
// * PurgMagTrackingAction.cc *
// * *
// ***********************************
//
// $Id: PurgMagTrackingAction.cc,v 1.2 2004/06/18 09:18:04 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#include "PurgMagTrackingAction.hh"
#include "PurgMagRunAction.hh"
#include "G4TrackingManager.hh"
#include "G4Track.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagTrackingAction::PurgMagTrackingAction(PurgMagRunAction* run)
:PurgMagRun(run)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagTrackingAction::PostUserTrackingAction(const G4Track*)
{
}
@@ -0,0 +1,162 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Code developed by:
// S.Larsson
//
// *******************************
// * *
// * PurgMagVisManager.cc *
// * *
// *******************************
//
// $Id: PurgMagVisManager.cc,v 1.2 2004/06/18 09:18:05 gunter Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
#ifdef G4VIS_USE
#include "PurgMagVisManager.hh"
// Supported drivers...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_DAWNFILE
#include "G4DAWNFILE.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
/*#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OIX
#include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
#ifdef G4VIS_USE_VRMLFILE
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
#endif
#ifdef G4VIS_USE_RAYTRACER
#include "G4RayTracer.hh"
#endif
*/
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
PurgMagVisManager::PurgMagVisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PurgMagVisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_DAWNFILE
RegisterGraphicsSystem (new G4DAWNFILE);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
/*
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OIX
RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
#ifdef G4VIS_USE_VRMLFILE
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
#endif
#ifdef G4VIS_USE_RAYTRACER
RegisterGraphicsSystem (new G4RayTracer);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
*/
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....