Import Geant4 7.0.0 source tree
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: g4rwDetectorConstruction.cc,v 1.1 2004/12/06 11:01:14 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
#include "g4rwDetectorConstruction.hh"
|
||||
|
||||
#include "Processor/GDMLProcessor.h"
|
||||
|
||||
// Added here just to help resolve properly dependencies
|
||||
#include "G4BooleanSolid.hh"
|
||||
#include "G4CSGSolid.hh"
|
||||
|
||||
gogdmlDetectorConstruction::gogdmlDetectorConstruction()
|
||||
{
|
||||
sxp.Initialize();
|
||||
config.SetURI( "test.gdml" );
|
||||
config.SetSetupName( "Default" );
|
||||
sxp.Configure( &config );
|
||||
}
|
||||
|
||||
gogdmlDetectorConstruction::~gogdmlDetectorConstruction()
|
||||
{
|
||||
sxp.Finalize();
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* gogdmlDetectorConstruction::Construct()
|
||||
{
|
||||
sxp.Run();
|
||||
|
||||
fWorld = (G4VPhysicalVolume *)GDMLProcessor::GetInstance()->GetWorldVolume();
|
||||
|
||||
fWorld->GetLogicalVolume()->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
|
||||
if( fWorld == 0 ) {
|
||||
G4Exception(
|
||||
"World volume not set properly check your setup selection criteria or GDML input!"
|
||||
);
|
||||
}
|
||||
|
||||
return fWorld;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: g4rwPhysicsList.cc,v 1.1 2004/12/06 11:01:14 radoone Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "g4rwPhysicsList.hh"
|
||||
|
||||
#include "G4ParticleTypes.hh"
|
||||
|
||||
gogdmlPhysicsList::gogdmlPhysicsList()
|
||||
{;}
|
||||
|
||||
gogdmlPhysicsList::~gogdmlPhysicsList()
|
||||
{;}
|
||||
|
||||
void gogdmlPhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
G4Geantino::GeantinoDefinition();
|
||||
}
|
||||
|
||||
void gogdmlPhysicsList::ConstructProcess()
|
||||
{
|
||||
// Define transportation process
|
||||
|
||||
AddTransportation();
|
||||
}
|
||||
|
||||
void gogdmlPhysicsList::SetCuts()
|
||||
{
|
||||
// uppress error messages even in case e/gamma/proton do not exist
|
||||
G4int temp = GetVerboseLevel(); SetVerboseLevel(0);
|
||||
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
|
||||
// Retrieve verbose level
|
||||
SetVerboseLevel(temp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: g4rwPrimaryGeneratorAction.cc,v 1.3 2004/12/07 09:45:15 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
|
||||
#include "g4rwPrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
gogdmlPrimaryGeneratorAction::gogdmlPrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/gun/particle geantino");
|
||||
UI->ApplyCommand("/gun/position 0.0 0.0 0.0 cm");
|
||||
}
|
||||
|
||||
gogdmlPrimaryGeneratorAction::~gogdmlPrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
void gogdmlPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
G4int i = anEvent->GetEventID() % 3;
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
UI->ApplyCommand("/gun/direction 0.2 0.0 1.0");
|
||||
break;
|
||||
case 1:
|
||||
UI->ApplyCommand("/gun/direction 0.0 0.3 1.0");
|
||||
break;
|
||||
case 2:
|
||||
UI->ApplyCommand("/gun/direction 0.1 0.0 1.0");
|
||||
break;
|
||||
}
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: g4rwVisManager.cc,v 1.2 2004/12/06 18:13:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "g4rwVisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4HepRep.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
gogdmlVisManager::gogdmlVisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void gogdmlVisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4HepRep);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
Reference in New Issue
Block a user