Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# $Id: GNUmakefile,v 2.1 1998/07/02 15:26:52 gunter Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := exampleN02
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,77 @@
|
||||
$Id: History,v 2.13 1998/12/08 16:37:28 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example N02 History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
4th December 1998 John Apostolakis
|
||||
|
||||
- corrected the Magnetic Field SetField methods
|
||||
- cosmetic change to the name of a volume (chamber), as it was too long.
|
||||
|
||||
12th Sptember 1998 Michel Maire
|
||||
- removed the function SetEmProcess() ( contained cin)
|
||||
and the class ExN02PhysicsListMessenger
|
||||
|
||||
Interchanged N02 and N03.
|
||||
|
||||
9th August 1998 John Allison
|
||||
- Removed trackerChamber_logVisAtt->SetForceWireframe(true);
|
||||
- Removed G4_SOLVE_TEMPLATES macros (now done in architecture.gmk).
|
||||
- Change G4UIterminal to G4UIGAG.
|
||||
|
||||
16th July 1998 John Allison
|
||||
- Changed /vis~/Draw... to /vis~/draw.
|
||||
|
||||
9th July 1998 John Allison
|
||||
- Added G4VIS_USE_DAWNFILE and G4VIS_USE_OPENGLWIN32 to ExN03VisManager.cc.
|
||||
|
||||
8th July 1998 G.Cosmo
|
||||
- Protected visualization code with G4VIS_USE.
|
||||
|
||||
6th July 1998 John Allison
|
||||
- Simplified ExN03VisManager.
|
||||
|
||||
June 29 , 98 H.Kurashige
|
||||
- Modified ExN03PhysicsList.
|
||||
|
||||
May 15, 98 G. Cosmo
|
||||
|
||||
- Added #ifdef protection to ExN03MagneticField.hh. Header now
|
||||
included explicitly in ExN03DetectorConstruction.hh. Example now
|
||||
links.
|
||||
|
||||
May 07, 98 J. Apostolakis
|
||||
|
||||
- Created Physical Volume Parameterisation for Tracker Chambers.
|
||||
- Copied from example6:
|
||||
MyTrackerHit into ExN03TrackerHit
|
||||
|
||||
May 05, 98 J. Apostolakis
|
||||
|
||||
- Changed the geometry in DetectorConstruction.
|
||||
- Created the Magnetic Field
|
||||
|
||||
May 01, 98 J. Apostolakis
|
||||
|
||||
- Files created by copying from exampleEmPhys2, renaming the files
|
||||
and the classes within them, changing the string "My" into
|
||||
|
||||
- Major changes made:
|
||||
* Event action: deleted energy counting.
|
||||
|
||||
|
||||
April 09, 98 G. Cosmo
|
||||
|
||||
- Created.
|
||||
@@ -0,0 +1,12 @@
|
||||
$Id: README,v 2.4 1998/10/09 14:27:35 japost Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleN03
|
||||
----------
|
||||
|
||||
May 4, 1998 John Apostolakis.
|
||||
Started from exampleEmPhys2.
|
||||
@@ -0,0 +1,93 @@
|
||||
// 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: exampleN02.cc,v 2.11 1998/12/08 16:37:28 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - exampleN03
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD Group
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02PhysicsList.hh"
|
||||
#include "ExN02RunAction.hh"
|
||||
#include "ExN02PrimaryGeneratorAction.hh"
|
||||
#include "ExN02EventAction.hh"
|
||||
#include "ExN02SteppingAction.hh"
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#ifdef G4VIS_USE
|
||||
#include "ExN02VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
|
||||
int
|
||||
main(int argc,char** argv) {
|
||||
|
||||
// Run manager
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// UserInitialization classes
|
||||
ExN02DetectorConstruction* ExN02detector = new ExN02DetectorConstruction;
|
||||
runManager->SetUserInitialization(ExN02detector);
|
||||
runManager->SetUserInitialization(new ExN02PhysicsList);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// Visualization, if you choose to have it!
|
||||
G4VisManager* visManager = new ExN02VisManager;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
// UserAction classes
|
||||
runManager->SetUserAction(new ExN02RunAction);
|
||||
runManager->SetUserAction(new ExN02PrimaryGeneratorAction(ExN02detector));
|
||||
|
||||
ExN02EventAction* eventAction = new ExN02EventAction;
|
||||
runManager->SetUserAction(eventAction);
|
||||
runManager->SetUserAction(new ExN02SteppingAction(ExN02detector,eventAction));
|
||||
|
||||
// User interactions
|
||||
G4UImanager * UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if(argc==1)
|
||||
// Define (G)UI terminal for interactive mode
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
UI->ApplyCommand("/control/execute prerun.g4mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else
|
||||
// Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/run/initialize
|
||||
/gun/position 0 0 -100
|
||||
/gun/direction 0 0 1
|
||||
/gun/energy 200 MeV
|
||||
|
||||
/tracking/verbose 1
|
||||
/gun/particle e+
|
||||
/run/beamOn 1
|
||||
|
||||
/run/beamOn 10
|
||||
|
||||
/tracking/verbose 0
|
||||
/run/beamOn 100
|
||||
# /run/beamOn 1000
|
||||
exit
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
// 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: ExN02ChamberParameterisation.hh,v 1.2 1998/11/30 17:18:43 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// A parameterisation that describes a series of boxes along Z
|
||||
// The boxes have equal width, & their lengths are a linear equation.
|
||||
// They are spaced an equal distance apart, starting from given location.
|
||||
//
|
||||
#ifndef ExN02ChamberParameterisation_H
|
||||
#define ExN02ChamberParameterisation_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
class G4VPhysicalVolume;
|
||||
class G4Box;
|
||||
|
||||
class ExN02ChamberParameterisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
ExN02ChamberParameterisation(G4int NoChambers,
|
||||
G4double startZ,
|
||||
G4double spacing,
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal );
|
||||
~ExN02ChamberParameterisation();
|
||||
void ComputeTransformation
|
||||
(const G4int copyNo,G4VPhysicalVolume *physVol) const;
|
||||
void ComputeDimensions
|
||||
(G4Box & trackerLayer, const G4int copyNo,
|
||||
const G4VPhysicalVolume * physVol) const;
|
||||
|
||||
// Functions to get the parameters would be nice.
|
||||
// eg G4int GetNoChambers();
|
||||
|
||||
private:
|
||||
|
||||
G4int fNoChambers; //
|
||||
G4double fStartZ;
|
||||
G4double fHalfWidth; // The half-width of each tracker chamber
|
||||
G4double fSpacing; // The distance between the chambers' center
|
||||
G4double fHalfLengthFirst; // The first half-length
|
||||
G4double fHalfLengthIncr; // The Increment for the half-length
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
// 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: ExN02DetectorConstruction.hh,v 1.3 1998/10/09 14:31:01 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02DetectorConstruction_h
|
||||
#define ExN02DetectorConstruction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
// class G4UniformMagField;
|
||||
#include "ExN02MagneticField.hh"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class ExN02DetectorMessenger;
|
||||
|
||||
class ExN02DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
ExN02DetectorConstruction();
|
||||
~ExN02DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
const G4VPhysicalVolume* GetTracker() {return physiTracker;};
|
||||
G4double GetTargetFullLength() {return fTargetLength;};
|
||||
G4double GetWorldFullLength() {return fWorldLength;};
|
||||
|
||||
void SetDetectorLength(G4double length);
|
||||
// void setMaterial(G4String val);
|
||||
void SetMagField(G4double val);
|
||||
private:
|
||||
|
||||
G4Box* solidWorld; //pointer to the solid enveloppe
|
||||
G4LogicalVolume* logicWorld; //pointer to the logical enveloppe
|
||||
G4VPhysicalVolume* physiWorld; //pointer to the physical enveloppe
|
||||
G4double fullSizeWorld; //full size of the enveloppe
|
||||
|
||||
G4Box* solidTracker; //pointer to the solid Tracker
|
||||
G4LogicalVolume* logicTracker; //pointer to the logical Tracker
|
||||
G4VPhysicalVolume* physiTracker; //pointer to the physical Tracker
|
||||
|
||||
G4Box* solidTarget; //pointer to the solid Target
|
||||
G4LogicalVolume* logicTarget; //pointer to the logical Target
|
||||
G4VPhysicalVolume* physiTarget; //pointer to the physical Target
|
||||
|
||||
G4Box* solidChamber; //pointer to the solid Chamber
|
||||
G4LogicalVolume* logicChamber; //pointer to the logical Chamber
|
||||
G4VPhysicalVolume* physiChamber; //pointer to the physical Chamber
|
||||
|
||||
G4Material* myMaterial; //pointer to the material
|
||||
ExN02MagneticField* fpMagField; //pointer to the mag field
|
||||
|
||||
ExN02DetectorMessenger* detectorMessenger; //pointer to the Messenger object
|
||||
G4double fWorldLength; // Full length of the world volume
|
||||
// Sizes of pieces of the detector
|
||||
G4double fDetectorLength; // Full length of the detector
|
||||
|
||||
G4double fTrackerLength; // Full length of Tracker
|
||||
G4double fTargetLength; // Full length of Target
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// 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: ExN02DetectorMessenger.hh,v 1.3 1998/10/09 14:31:02 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02DetectorMessenger_h
|
||||
#define ExN02DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN02DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
class ExN02DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN02DetectorMessenger(ExN02DetectorConstruction * myDet);
|
||||
~ExN02DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
|
||||
private:
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
|
||||
G4UIdirectory* mydetDir;
|
||||
G4UIcmdWithAString* MatCmd;
|
||||
G4UIcmdWithADoubleAndUnit* SizeCmd;
|
||||
G4UIcmdWithADoubleAndUnit* FieldCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// 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: ExN02EventAction.hh,v 1.3 1998/10/09 14:31:02 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02EventAction_h
|
||||
#define ExN02EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
|
||||
class G4Event;
|
||||
|
||||
class ExN02EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
ExN02EventAction();
|
||||
~ExN02EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction();
|
||||
void EndOfEventAction();
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// 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: ExN02MagneticField.hh,v 1.1 1998/10/09 14:31:03 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// A class for control of the Magnetic Field of the detector.
|
||||
// The field is assumed to be uniform.
|
||||
//
|
||||
// $ Id: $
|
||||
|
||||
// Should this be a:
|
||||
// i) messenger
|
||||
// ii) user class that creates the field ?
|
||||
// iii) simply a derived class of Uniform field ? <== I have chosen this now.
|
||||
// iv) a field manager that creates/updates field (Prefered?)
|
||||
#ifndef ExN02MagneticField_H
|
||||
#define ExN02MagneticField_H
|
||||
|
||||
#include "G4UniformMagField.hh"
|
||||
class G4FieldManager;
|
||||
|
||||
class ExN02MagneticField: public G4UniformMagField
|
||||
{
|
||||
public:
|
||||
ExN02MagneticField(G4ThreeVector); // The value of the field
|
||||
ExN02MagneticField(); // A zero field
|
||||
~ExN02MagneticField();
|
||||
|
||||
// Set the field to (0, 0, fieldValue)
|
||||
void SetFieldValue(G4ThreeVector fieldVector);
|
||||
void SetFieldValue(G4double fieldValue);
|
||||
G4ThreeVector GetConstantFieldValue();
|
||||
|
||||
protected:
|
||||
|
||||
// Find the global Field Manager
|
||||
G4FieldManager* GetGlobalFieldManager(); // static
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,88 @@
|
||||
// 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: ExN02PhysicsList.hh,v 1.4 1998/10/09 14:31:03 japost 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 ExN02PhysicsList_h
|
||||
#define ExN02PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4PhotoElectricEffect;
|
||||
class G4ComptonScattering;
|
||||
class G4GammaConversion;
|
||||
|
||||
class G4MultipleScattering;
|
||||
|
||||
class G4eIonisation;
|
||||
class G4eBremsstrahlung;
|
||||
class G4eplusAnnihilation;
|
||||
|
||||
class G4MuIonisation;
|
||||
class G4MuBremsstrahlung;
|
||||
class G4MuPairProduction;
|
||||
|
||||
class G4hIonisation;
|
||||
|
||||
class ExN02PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN02PhysicsList();
|
||||
virtual ~ExN02PhysicsList();
|
||||
|
||||
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();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
virtual void ConstructGeneral();
|
||||
virtual void ConstructEM();
|
||||
|
||||
private:
|
||||
|
||||
G4PhotoElectricEffect* thePhotoElectricEffect;
|
||||
G4ComptonScattering* theComptonScattering;
|
||||
G4GammaConversion* theGammaConversion;
|
||||
|
||||
G4MultipleScattering* theeminusMultipleScattering;
|
||||
G4eIonisation* theeminusIonisation;
|
||||
G4eBremsstrahlung* theeminusBremsstrahlung;
|
||||
|
||||
G4MultipleScattering* theeplusMultipleScattering;
|
||||
G4eIonisation* theeplusIonisation;
|
||||
G4eBremsstrahlung* theeplusBremsstrahlung;
|
||||
G4eplusAnnihilation* theeplusAnnihilation;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// 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: ExN02PrimaryGeneratorAction.hh,v 1.3 1998/10/09 14:31:04 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02PrimaryGeneratorAction_h
|
||||
#define ExN02PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN02DetectorConstruction;
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class ExN02PrimaryGeneratorMessenger;
|
||||
|
||||
class ExN02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExN02PrimaryGeneratorAction(ExN02DetectorConstruction* myDC);
|
||||
~ExN02PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
|
||||
ExN02PrimaryGeneratorMessenger* gunMessenger;
|
||||
G4String rndmFlag;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// 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: ExN02PrimaryGeneratorMessenger.hh,v 1.3 1998/10/09 14:31:05 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02PrimaryGeneratorMessenger_h
|
||||
#define ExN02PrimaryGeneratorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class ExN02PrimaryGeneratorAction;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
class ExN02PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN02PrimaryGeneratorMessenger(ExN02PrimaryGeneratorAction* myGun);
|
||||
~ExN02PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
|
||||
private:
|
||||
ExN02PrimaryGeneratorAction* myAction;
|
||||
|
||||
G4UIcmdWithAString* RndmCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// 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: ExN02RunAction.hh,v 1.3 1998/10/09 14:31:06 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02RunAction_h
|
||||
#define ExN02RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
class ExN02RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
ExN02RunAction();
|
||||
~ExN02RunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(G4Run* aRun);
|
||||
void EndOfRunAction(G4Run* aRun);
|
||||
|
||||
private:
|
||||
G4int runIDcounter;
|
||||
};
|
||||
|
||||
#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: ExN02SteppingAction.hh,v 1.3 1998/10/09 14:31:06 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef ExN02SteppingAction_h
|
||||
#define ExN02SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN02DetectorConstruction;
|
||||
class ExN02EventAction;
|
||||
|
||||
class ExN02SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
ExN02SteppingAction(ExN02DetectorConstruction* myDC,ExN02EventAction* myEA);
|
||||
~ExN02SteppingAction(){};
|
||||
|
||||
void UserSteppingAction();
|
||||
|
||||
private:
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
ExN02EventAction* eventAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
// 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: ExN02TrackerHit.hh,v 1.1 1998/10/09 14:31:07 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef ExN02TrackerHit_h
|
||||
#define ExN02TrackerHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class ExN02TrackerHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN02TrackerHit();
|
||||
~ExN02TrackerHit();
|
||||
ExN02TrackerHit(const ExN02TrackerHit &right);
|
||||
const ExN02TrackerHit& operator=(const ExN02TrackerHit &right);
|
||||
int operator==(const ExN02TrackerHit &right) const;
|
||||
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
|
||||
public:
|
||||
inline void SetEdep(G4double de)
|
||||
{ edep = de; };
|
||||
inline G4double GetEdep()
|
||||
{ return edep; };
|
||||
inline void SetPos(G4ThreeVector xyz)
|
||||
{ pos = xyz; };
|
||||
inline G4ThreeVector GetPos()
|
||||
{ return pos; };
|
||||
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<ExN02TrackerHit> ExN02TrackerHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN02TrackerHit> ExN02TrackerHitAllocator;
|
||||
|
||||
inline void* ExN02TrackerHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) ExN02TrackerHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void ExN02TrackerHit::operator delete(void *aHit)
|
||||
{
|
||||
ExN02TrackerHitAllocator.FreeSingle((ExN02TrackerHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// 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: ExN02TrackerSD.hh,v 1.1 1998/10/09 14:31:08 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef ExN02TrackerSD_h
|
||||
#define ExN02TrackerSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "ExN02TrackerHit.hh"
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
|
||||
class ExN02TrackerSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
ExN02TrackerSD(G4String name);
|
||||
~ExN02TrackerSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
ExN02TrackerHitsCollection *trackerCollection;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// 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: ExN02VisManager.hh,v 1.3 1998/10/09 14:31:09 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// Example Visualization Manager implementing virtual function
|
||||
// RegisterGraphicsSystems. Exploits C-pre-processor variables
|
||||
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
|
||||
// environment variables of the same name are set.
|
||||
|
||||
// So all you have to do is set environment variables and compile and
|
||||
// instantiate this in your main().
|
||||
|
||||
// Alternatively, you can implement an empty function here and just
|
||||
// register the systems you want in your main(), e.g.:
|
||||
// G4VisManager* myVisManager = new MyVisManager;
|
||||
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef ExN02VisManager_h
|
||||
#define ExN02VisManager_h 1
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class ExN02VisManager: public G4VisManager {
|
||||
|
||||
public:
|
||||
|
||||
ExN02VisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
/control/verbose 2
|
||||
/tracking/verbose 2
|
||||
/tracking/verbose 1
|
||||
/run/initialize
|
||||
@@ -0,0 +1,62 @@
|
||||
// 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: ExN02ChamberParameterisation.cc,v 1.1 1998/10/09 14:35:30 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "ExN02ChamberParameterisation.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Box.hh"
|
||||
|
||||
ExN02ChamberParameterisation::ExN02ChamberParameterisation(
|
||||
G4int NoChambers,
|
||||
G4double startZ, // Z of center of first
|
||||
G4double spacingZ, // Z spacing of centers
|
||||
G4double widthChamber,
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal )
|
||||
{
|
||||
fNoChambers= NoChambers;
|
||||
fStartZ= startZ;
|
||||
fHalfWidth= widthChamber*0.5;
|
||||
fSpacing= spacingZ;
|
||||
fHalfLengthFirst= 0.5 * lengthInitial;
|
||||
// fHalfLengthLast= lengthFinal;
|
||||
if( NoChambers > 1 ){
|
||||
fHalfLengthIncr= 0.5 * (lengthFinal-lengthInitial)/(NoChambers-1);
|
||||
|
||||
if( spacingZ < widthChamber ) {
|
||||
G4Exception( "ExN02ChamberParameterisation construction: Width > Spacing" );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ExN02ChamberParameterisation::~ExN02ChamberParameterisation()
|
||||
{}
|
||||
|
||||
void ExN02ChamberParameterisation::ComputeTransformation
|
||||
(const G4int copyNo,G4VPhysicalVolume *physVol) const
|
||||
{
|
||||
G4double Zposition= fStartZ + copyNo * fSpacing;
|
||||
G4ThreeVector origin(0,0,Zposition);
|
||||
physVol->SetTranslation(origin);
|
||||
physVol->SetRotation(0);
|
||||
}
|
||||
|
||||
void ExN02ChamberParameterisation::ComputeDimensions
|
||||
(G4Box & trackerChamber, const G4int copyNo,
|
||||
const G4VPhysicalVolume * physVol) const
|
||||
{
|
||||
G4double halfLength= fHalfLengthFirst + (copyNo-1) * fHalfLengthIncr;
|
||||
trackerChamber.SetXHalfLength(halfLength);
|
||||
trackerChamber.SetYHalfLength(halfLength);
|
||||
trackerChamber.SetZHalfLength(fHalfWidth);
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
// 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: ExN02DetectorConstruction.cc,v 1.9 1998/12/04 21:26:12 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02DetectorMessenger.hh"
|
||||
#include "ExN02ChamberParameterisation.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4GeometryManager.hh"
|
||||
#include "ExN02MagneticField.hh"
|
||||
#include "G4PVParameterised.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
///#include "G4UserLimits.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "ExN02TrackerSD.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
ExN02DetectorConstruction::ExN02DetectorConstruction()
|
||||
:solidWorld(NULL),logicWorld(NULL),physiWorld(NULL),
|
||||
solidTracker(NULL),logicTracker(NULL),physiTracker(NULL),
|
||||
solidTarget(NULL),logicTarget(NULL),physiTarget(NULL),
|
||||
solidChamber(NULL),logicChamber(NULL),physiChamber(NULL),
|
||||
myMaterial(NULL), fDetectorLength(0.),fWorldLength(0.)
|
||||
{
|
||||
detectorMessenger = new ExN02DetectorMessenger(this);
|
||||
fpMagField = new ExN02MagneticField(); // G4FieldManager();
|
||||
// magFieldManager = new G4FieldManager();
|
||||
}
|
||||
|
||||
ExN02DetectorConstruction::~ExN02DetectorConstruction()
|
||||
{
|
||||
delete detectorMessenger;
|
||||
delete fpMagField;
|
||||
// delete magFieldManager;
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
{
|
||||
//--------- Material definition ---------
|
||||
|
||||
G4double a, iz, z, density;
|
||||
G4String name, symbol;
|
||||
G4int nel;
|
||||
|
||||
//Air
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxigen", symbol="O", iz=8., a);
|
||||
density = 1.29*mg/cm3;
|
||||
G4Material* Air = new G4Material(name="Air", density, nel=2);
|
||||
Air->AddElement(elN, .7);
|
||||
Air->AddElement(elO, .3);
|
||||
|
||||
//Al
|
||||
a = 26.98*g/mole;
|
||||
density = 2.7*g/cm3;
|
||||
G4Material* Aluminium = new G4Material(name="Al", z=13., a, density);
|
||||
|
||||
//Pb
|
||||
a = 207.19*g/mole;
|
||||
density = 11.35*g/cm3;
|
||||
G4Material* Pb = new G4Material(name="Pb", z=82., a, density);
|
||||
|
||||
//Vacuum
|
||||
a = 1.*g/mole;
|
||||
density = 1.e-20*g/cm3;
|
||||
G4Material* Vacuum = new G4Material(name="Vacuum",z=1.,a,density);
|
||||
|
||||
//--------- Sizes of the principal geometrical components (solids) ---------
|
||||
|
||||
fDetectorLength = 750.*cm ; // Full length of the detector
|
||||
fTrackerLength = 500. * cm; // Full length of the Tracker
|
||||
fTargetLength = 5.0 * cm; // Full length of the Target
|
||||
|
||||
G4double detectorSize = 0.5*fDetectorLength;
|
||||
G4double trackerSize = fTrackerLength * 0.5; // Half length of the Tracker
|
||||
G4double targetSize = fTargetLength * 0.5; // Half length of the Target
|
||||
|
||||
|
||||
//--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
|
||||
myMaterial = Aluminium;
|
||||
|
||||
//------------------------------
|
||||
// World
|
||||
//------------------------------
|
||||
fWorldLength= 1.2 * fDetectorLength;
|
||||
G4double HalfWorldLength = 0.5*fWorldLength;
|
||||
|
||||
solidWorld= new G4Box("World",HalfWorldLength,HalfWorldLength,HalfWorldLength);
|
||||
logicWorld= new G4LogicalVolume( solidWorld, Air, "World", 0, 0, 0);
|
||||
|
||||
// Must place the World Physical volume unrotated at (0,0,0).
|
||||
//
|
||||
physiWorld = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
"WorldPV", // its name
|
||||
logicWorld, // its logical volume
|
||||
0, // its mother volume
|
||||
false, // no boolean operations
|
||||
0); // no field specific to volume
|
||||
|
||||
//------------------------------
|
||||
// Target
|
||||
//------------------------------
|
||||
solidTarget = new G4Box("TargetSolid",targetSize,targetSize,targetSize);
|
||||
logicTarget = new G4LogicalVolume(solidTarget ,myMaterial,"TargetLV",0,0,0);
|
||||
physiTarget = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
"TargetPV", // its name
|
||||
logicTarget, // its logical volume
|
||||
physiWorld, // its mother volume
|
||||
false, // no boolean operations
|
||||
0); // no particular field
|
||||
|
||||
G4cout << "Target is " << 2*targetSize/cm << " cm of Al " << endl;
|
||||
|
||||
//------------------------------
|
||||
// Tracker
|
||||
//------------------------------
|
||||
G4ThreeVector positionTracker;
|
||||
solidTracker = new G4Box("Tracker",trackerSize,trackerSize,trackerSize);
|
||||
logicTracker = new G4LogicalVolume(solidTracker , Air, "Tracker",0,0,0);
|
||||
positionTracker= G4ThreeVector(0,0,trackerSize+targetSize);
|
||||
|
||||
physiTracker = new G4PVPlacement(0, // no rotation
|
||||
positionTracker, // at (0,0,0)
|
||||
"Tracker", // its name
|
||||
logicTracker, // its logical volume
|
||||
physiWorld, // its mother volume
|
||||
false, // no boolean operations
|
||||
0); // no particular field
|
||||
|
||||
//------------------------------
|
||||
// Tracker segments
|
||||
//------------------------------
|
||||
// An example of Parameterised volumes
|
||||
// dummy values for G4Box -- modified by parameterised volume
|
||||
G4VSolid * solidChamber
|
||||
= new G4Box("chamberBox", 100*cm, 100*cm, 10*cm);
|
||||
// chamberWidth, chamberWidth, chamberDepth);
|
||||
|
||||
G4LogicalVolume * trackerChamberLV
|
||||
= new G4LogicalVolume(solidChamber, Aluminium, "trackerChamberLV",0,0,0);
|
||||
G4VPVParameterisation * chamberParam
|
||||
= new ExN02ChamberParameterisation(
|
||||
6, // NoChambers,
|
||||
-240.*cm, // Z of center of first
|
||||
80*cm, // Z spacing of centers
|
||||
20*cm, // Width Chamber,
|
||||
50*cm, // lengthInitial,
|
||||
trackerSize*2.); // lengthFinal
|
||||
// dummy value : kXAxis -- modified by parameterised volume
|
||||
G4VPhysicalVolume *trackerChamber_phys
|
||||
= new G4PVParameterised("trkChamber", // TrackerChamber parameterised
|
||||
trackerChamberLV, // Its logical volume
|
||||
physiTracker, // Mother physical volume
|
||||
kZAxis, // Are placed along this axis
|
||||
6, // Number of chambers
|
||||
chamberParam); // The parametrisation
|
||||
G4VisAttributes* trackerChamber_logVisAtt
|
||||
= new G4VisAttributes(G4Colour(0.5,0.0,1.0));
|
||||
trackerChamberLV->SetVisAttributes(trackerChamber_logVisAtt);
|
||||
|
||||
//------------------------------------------------
|
||||
// Sensitive detectors
|
||||
//------------------------------------------------
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
G4String trackerChamberSDname = "ExN02/TrackerChamberSD";
|
||||
ExN02TrackerSD* aTrackerSD = new ExN02TrackerSD( trackerChamberSDname );
|
||||
SDman->AddNewDetector( aTrackerSD );
|
||||
trackerChamberLV->SetSensitiveDetector( aTrackerSD );
|
||||
|
||||
//--------- Visualization attributes -------------------------------
|
||||
|
||||
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
G4VisAttributes * simpleBoxVisAtt
|
||||
= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
logicTracker->SetVisAttributes(simpleBoxVisAtt);
|
||||
|
||||
//set a max Step length in the absorber
|
||||
///G4double maxStep = fDetectorLength/0.7, maxLength=fDetectorLength/0.7;
|
||||
///G4double maxTime = 0.1*ns, minEkin = 10*MeV;
|
||||
///logicAbsorber->SetUserLimits(new G4UserLimits(maxStep,maxLength,maxTime,
|
||||
/// minEkin));
|
||||
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ExN02DetectorConstruction::setMaterial(G4String materialChoice)
|
||||
{
|
||||
const G4MaterialTable*
|
||||
theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
G4Material* pttoMaterial;
|
||||
for (G4int J=0 ; J<theMaterialTable->length() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)(J);
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{myMaterial = pttoMaterial;
|
||||
logicTracker->SetMaterial(pttoMaterial);
|
||||
G4cout << "Absorber is " << fDetectorLength/cm << " cm of " << materialChoice
|
||||
<< endl;}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void ExN02DetectorConstruction::SetDetectorLength(G4double length)
|
||||
{
|
||||
G4GeometryManager::GetInstance()->OpenGeometry();
|
||||
|
||||
fDetectorLength = length;
|
||||
fWorldLength = 1.2*fDetectorLength;
|
||||
|
||||
G4double halfSize = 0.5 * fDetectorLength;
|
||||
G4double halfWorldLength = 0.5*fWorldLength;
|
||||
|
||||
solidWorld -> SetXHalfLength(halfWorldLength);
|
||||
solidWorld -> SetYHalfLength(halfWorldLength);
|
||||
solidWorld -> SetZHalfLength(halfWorldLength);
|
||||
|
||||
solidTracker -> SetXHalfLength(halfSize);
|
||||
solidTracker -> SetYHalfLength(halfSize);
|
||||
solidTracker -> SetZHalfLength(halfSize);
|
||||
|
||||
G4cout << "Absorber is " << fDetectorLength/cm << " cm of " << myMaterial->GetName()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
void ExN02DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
{
|
||||
fpMagField->SetFieldValue(fieldValue);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// 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: ExN02DetectorMessenger.cc,v 1.4 1998/10/09 14:35:32 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02DetectorMessenger.hh"
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
ExN02DetectorMessenger::ExN02DetectorMessenger(ExN02DetectorConstruction * myDet)
|
||||
:myDetector(myDet)
|
||||
{
|
||||
|
||||
mydetDir = new G4UIdirectory("/mydet/");
|
||||
mydetDir->SetGuidance("ExN02 detector control.");
|
||||
|
||||
MatCmd = new G4UIcmdWithAString("/mydet/setMaterial",this);
|
||||
MatCmd->SetGuidance("Select Material of the SimpleBox.");
|
||||
MatCmd->SetGuidance(" Choice : Air, Al(default), Pb, Vacuum");
|
||||
MatCmd->SetParameterName("choice",true);
|
||||
MatCmd->SetDefaultValue("Al");
|
||||
MatCmd->SetCandidates("Air Al Pb Vacuum");
|
||||
MatCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
SizeCmd = new G4UIcmdWithADoubleAndUnit("/mydet/setSize",this);
|
||||
SizeCmd->SetGuidance("Set full Size of the Box");
|
||||
SizeCmd->SetParameterName("Size",false,false);
|
||||
SizeCmd->SetDefaultUnit("cm");
|
||||
SizeCmd->SetUnitCategory("Length");
|
||||
SizeCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
FieldCmd = new G4UIcmdWithADoubleAndUnit("/mydet/setField",this);
|
||||
FieldCmd->SetGuidance("Define magnetic field.");
|
||||
FieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
FieldCmd->SetParameterName("Bz",false,false);
|
||||
FieldCmd->SetDefaultUnit("tesla");
|
||||
FieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
FieldCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
ExN02DetectorMessenger::~ExN02DetectorMessenger()
|
||||
{
|
||||
delete MatCmd;
|
||||
delete SizeCmd;
|
||||
delete FieldCmd;
|
||||
delete mydetDir;
|
||||
}
|
||||
|
||||
void ExN02DetectorMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
// if( command == MatCmd )
|
||||
// { myDetector->setMaterial(newValues);}
|
||||
|
||||
if( command == SizeCmd )
|
||||
{ myDetector->SetDetectorLength(SizeCmd->GetNewDoubleValue(newValues));}
|
||||
|
||||
if( command == FieldCmd )
|
||||
{ myDetector->SetMagField(FieldCmd->GetNewDoubleValue(newValues));}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// 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: ExN02EventAction.cc,v 1.3 1998/10/09 14:35:32 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02EventAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
|
||||
ExN02EventAction::ExN02EventAction()
|
||||
{}
|
||||
|
||||
ExN02EventAction::~ExN02EventAction()
|
||||
{}
|
||||
|
||||
void ExN02EventAction::BeginOfEventAction()
|
||||
{}
|
||||
|
||||
void ExN02EventAction::EndOfEventAction()
|
||||
{
|
||||
const G4Event* evt = fpEventManager->GetConstCurrentEvent();
|
||||
|
||||
G4cout << ">>> Event " << evt->GetEventID() << endl;
|
||||
|
||||
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if(trajectoryContainer)
|
||||
{ n_trajectories = trajectoryContainer->entries(); }
|
||||
G4cout << " " << n_trajectories
|
||||
<< " trajectories stored in this event." << endl;
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ (*(evt->GetTrajectoryContainer()))[i]->DrawTrajectory(50); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
// 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: ExN02MagneticField.cc,v 1.2 1998/12/04 20:25:22 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// User Field class implementation.
|
||||
//
|
||||
#include "ExN02MagneticField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
|
||||
// Constructors:
|
||||
|
||||
ExN02MagneticField::ExN02MagneticField()
|
||||
: G4UniformMagField(G4ThreeVector())
|
||||
{
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
ExN02MagneticField::ExN02MagneticField(G4ThreeVector fieldVector)
|
||||
: G4UniformMagField(fieldVector)
|
||||
{
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
// Set the value of the Global Field to fieldValue along Z
|
||||
//
|
||||
void ExN02MagneticField::SetFieldValue(G4double fieldValue)
|
||||
{
|
||||
G4UniformMagField::SetFieldValue(G4ThreeVector(0,0,fieldValue));
|
||||
}
|
||||
|
||||
// Set the value of the Global Field
|
||||
//
|
||||
void ExN02MagneticField::SetFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
// Find the Field Manager for the global field
|
||||
G4FieldManager* fieldMgr= GetGlobalFieldManager();
|
||||
|
||||
if(fieldVector!=G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
G4UniformMagField::SetFieldValue(fieldVector);
|
||||
fieldMgr->SetDetectorField(this);
|
||||
} else {
|
||||
// If the new field's value is Zero, then it is best to
|
||||
// insure that it is not used for propagation.
|
||||
G4MagneticField* magField = NULL;
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
}
|
||||
}
|
||||
|
||||
ExN02MagneticField::~ExN02MagneticField()
|
||||
{
|
||||
// GetGlobalFieldManager()->SetDetectorField(0);
|
||||
}
|
||||
|
||||
// Utility method
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
G4FieldManager* ExN02MagneticField::GetGlobalFieldManager()
|
||||
{
|
||||
return G4TransportationManager::GetTransportationManager()
|
||||
->GetFieldManager();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
// 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: ExN02PhysicsList.cc,v 1.4 1998/10/09 14:35:33 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// This is a version for maximum particle set
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "ExN02PhysicsList.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>
|
||||
|
||||
|
||||
ExN02PhysicsList::ExN02PhysicsList(): G4VUserPhysicsList(),
|
||||
thePhotoElectricEffect(NULL),theComptonScattering(NULL),
|
||||
theGammaConversion(NULL),
|
||||
theeminusMultipleScattering(NULL),theeminusIonisation(NULL),
|
||||
theeminusBremsstrahlung(NULL),
|
||||
theeplusMultipleScattering(NULL),theeplusIonisation(NULL),
|
||||
theeplusBremsstrahlung(NULL),
|
||||
theeplusAnnihilation(NULL)
|
||||
{
|
||||
defaultCutValue = 2.0*mm;
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
ExN02PhysicsList::~ExN02PhysicsList()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02PhysicsList::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 ExN02PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// optical photon
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
void ExN02PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
void ExN02PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4Eta::EtaDefinition();
|
||||
G4EtaPrime::EtaPrimeDefinition();
|
||||
G4RhoZero::RhoZeroDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
G4KaonZero::KaonZeroDefinition();
|
||||
G4AntiKaonZero::AntiKaonZeroDefinition();
|
||||
G4KaonZeroLong::KaonZeroLongDefinition();
|
||||
G4KaonZeroShort::KaonZeroShortDefinition();
|
||||
}
|
||||
|
||||
void ExN02PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
G4Neutron::NeutronDefinition();
|
||||
G4AntiNeutron::AntiNeutronDefinition();
|
||||
}
|
||||
|
||||
|
||||
void ExN02PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
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"
|
||||
///#include "G4UserSpecialCuts.hh"
|
||||
|
||||
void ExN02PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theComptonScattering = new G4ComptonScattering();
|
||||
theGammaConversion = new G4GammaConversion();
|
||||
// add processes
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for electron
|
||||
theeminusMultipleScattering = new G4MultipleScattering();
|
||||
theeminusIonisation = new G4eIonisation();
|
||||
theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
// add processes
|
||||
pmanager->AddProcess(theeminusMultipleScattering);
|
||||
pmanager->AddProcess(theeminusIonisation);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung);
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2);
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2);
|
||||
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
// Construct processes for positron
|
||||
theeplusMultipleScattering = new G4MultipleScattering();
|
||||
theeplusIonisation = new G4eIonisation();
|
||||
theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
// add processes
|
||||
pmanager->AddProcess(theeplusMultipleScattering);
|
||||
pmanager->AddProcess(theeplusIonisation);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung);
|
||||
pmanager->AddProcess(theeplusAnnihilation);
|
||||
// set ordering for AtRestDoIt
|
||||
pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2);
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2);
|
||||
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3);
|
||||
pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);
|
||||
|
||||
} else if( particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
//muon
|
||||
// Construct processes for muon+
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
|
||||
G4VProcess* aPairProduction = new G4MuPairProduction();
|
||||
G4VProcess* anIonisation = new G4MuIonisation();
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
pmanager->AddProcess(aBremsstrahlung);
|
||||
pmanager->AddProcess(aPairProduction);
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
|
||||
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3);
|
||||
pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4);
|
||||
|
||||
} else if ((!particle->IsShortLived()) &&
|
||||
(particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")) {
|
||||
// all others charged particles except geantino
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* anIonisation = new G4hIonisation();
|
||||
//>>G4VProcess* theUserSpecialCuts = new G4UserSpecialCuts();
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
/// pmanager->AddProcess(theUserSpecialCuts);
|
||||
// set ordering for AtRestDoIt
|
||||
//>>pmanager->SetProcessOrderingToFirst(theUserSpecialCuts, idxAtRest);
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
|
||||
//>>pmanager->SetProcessOrdering(theUserSpecialCuts, idxPostStep, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4Decay.hh"
|
||||
void ExN02PhysicsList::ConstructGeneral()
|
||||
{
|
||||
// Add Decay Process
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (theDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ExN02PhysicsList::SetCuts(G4double cut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "ExN02PhysicsList::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,70 @@
|
||||
// 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: ExN02PrimaryGeneratorAction.cc,v 1.3 1998/10/09 14:35:34 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// $ Id: $
|
||||
//
|
||||
// From exampleEmPhys2/MyPrimaryGeneratorAction.cc,v 1.1 1998/02/06 maire
|
||||
|
||||
#include "ExN02PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
ExN02PrimaryGeneratorAction::ExN02PrimaryGeneratorAction(ExN02DetectorConstruction* myDC)
|
||||
:myDetector(myDC),rndmFlag("off")
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
gunMessenger = new ExN02PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="proton");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleEnergy(3.0*GeV);
|
||||
G4double position = -0.5*(myDetector->GetWorldFullLength());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
}
|
||||
|
||||
ExN02PrimaryGeneratorAction::~ExN02PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
void ExN02PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
// The Target is a box placed at (0,0,0)
|
||||
//
|
||||
G4double x0 = -0.5*(myDetector->GetTargetFullLength());
|
||||
G4double y0 = 0.*cm, z0 = 0.*cm;
|
||||
if (rndmFlag == "on")
|
||||
{y0 = (myDetector->GetTargetFullLength())*(G4UniformRand()-0.5);
|
||||
z0 = (myDetector->GetTargetFullLength())*(G4UniformRand()-0.5);
|
||||
}
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// 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: ExN02PrimaryGeneratorMessenger.cc,v 1.3 1998/10/09 14:35:34 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "ExN02PrimaryGeneratorAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
ExN02PrimaryGeneratorMessenger::ExN02PrimaryGeneratorMessenger(ExN02PrimaryGeneratorAction* myGun)
|
||||
:myAction(myGun)
|
||||
{
|
||||
|
||||
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
|
||||
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
|
||||
RndmCmd->SetGuidance(" Choice : on, off(default)");
|
||||
RndmCmd->SetParameterName("choice",true);
|
||||
RndmCmd->SetDefaultValue("off");
|
||||
RndmCmd->SetCandidates("on off");
|
||||
RndmCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
ExN02PrimaryGeneratorMessenger::~ExN02PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
}
|
||||
|
||||
void ExN02PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ myAction->SetRndmFlag(newValues);}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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: ExN02RunAction.cc,v 1.3 1998/10/09 14:35:34 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02RunAction.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
ExN02RunAction::ExN02RunAction()
|
||||
{
|
||||
runIDcounter = 0;
|
||||
}
|
||||
|
||||
ExN02RunAction::~ExN02RunAction()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02RunAction::BeginOfRunAction(G4Run* aRun)
|
||||
{
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << endl;
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/tracking/storeTrajectory 1");
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
UI->ApplyCommand("/vis~/clear/view");
|
||||
UI->ApplyCommand("/vis~/draw/current");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ExN02RunAction::EndOfRunAction(G4Run* aRun)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/show/view");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: ExN02SteppingAction.cc,v 1.3 1998/10/09 14:35:35 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "ExN02SteppingAction.hh"
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02EventAction.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
|
||||
ExN02SteppingAction::ExN02SteppingAction(ExN02DetectorConstruction* myDC, ExN02EventAction* myEA)
|
||||
:myDetector(myDC), eventAction(myEA)
|
||||
{ }
|
||||
|
||||
void ExN02SteppingAction::UserSteppingAction()
|
||||
{
|
||||
G4Step* aStep = GetSteppingManager()->GetStep();
|
||||
|
||||
// collect the energy deposited in the absorber
|
||||
|
||||
const G4VPhysicalVolume* currentVolume = aStep->GetPreStepPoint()-> GetPhysicalVolume();
|
||||
|
||||
#if 0
|
||||
const G4VPhysicalVolume* absorber = myDetector->getAbsorber();
|
||||
|
||||
if (currentVolume == absorber)
|
||||
{
|
||||
G4double EdepStep = aStep->GetTotalEnergyDeposit();
|
||||
eventAction->addEdep(EdepStep);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
// 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: ExN02TrackerHit.cc,v 1.1 1998/10/09 14:35:35 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "ExN02TrackerHit.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
|
||||
G4Allocator<ExN02TrackerHit> ExN02TrackerHitAllocator;
|
||||
|
||||
ExN02TrackerHit::ExN02TrackerHit()
|
||||
{;}
|
||||
|
||||
ExN02TrackerHit::~ExN02TrackerHit()
|
||||
{;}
|
||||
|
||||
ExN02TrackerHit::ExN02TrackerHit(const ExN02TrackerHit &right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
}
|
||||
|
||||
const ExN02TrackerHit& ExN02TrackerHit::operator=(const ExN02TrackerHit &right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int ExN02TrackerHit::operator==(const ExN02TrackerHit &right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ExN02TrackerHit::Draw()
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4Circle circle(pos);
|
||||
circle.SetScreenSize(0.04);
|
||||
circle.SetFillStyle(G4Circle::filled);
|
||||
G4Colour colour(1.,0.,0.);
|
||||
G4VisAttributes attribs(colour);
|
||||
circle.SetVisAttributes(attribs);
|
||||
pVVisManager->Draw(circle);
|
||||
}
|
||||
}
|
||||
|
||||
void ExN02TrackerHit::Print()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// This is a forward declarations of an instantiated G4Allocator<Type> object.
|
||||
// It has been added in order to make code portable for the GNU g++
|
||||
// (release 2.7.2) compiler.
|
||||
// Whenever a new Type is instantiated via G4Allocator, it has to be forward
|
||||
// declared to make object code (compiled with GNU g++) link successfully.
|
||||
//
|
||||
#ifdef GNU_GCC
|
||||
template class G4Allocator<ExN02TrackerHit>;
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
// 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: ExN02TrackerSD.cc,v 1.1 1998/10/09 14:35:35 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#include "ExN02TrackerSD.hh"
|
||||
#include "ExN02TrackerHit.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
ExN02TrackerSD::ExN02TrackerSD(G4String name)
|
||||
:G4VSensitiveDetector(name)
|
||||
{
|
||||
G4String HCname;
|
||||
collectionName.insert(HCname="trackerCollection");
|
||||
}
|
||||
|
||||
ExN02TrackerSD::~ExN02TrackerSD(){;}
|
||||
|
||||
void ExN02TrackerSD::Initialize(G4HCofThisEvent*HCE)
|
||||
{
|
||||
trackerCollection = new ExN02TrackerHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0)
|
||||
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
|
||||
HCE->AddHitsCollection( HCID, trackerCollection );
|
||||
}
|
||||
|
||||
G4bool ExN02TrackerSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
|
||||
{
|
||||
G4Track* aTrack = aStep->GetTrack();
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
|
||||
if(edep==0.) return true;
|
||||
|
||||
ExN02TrackerHit* newHit = new ExN02TrackerHit();
|
||||
newHit->SetEdep( edep );
|
||||
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
|
||||
trackerCollection->insert( newHit );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::EndOfEvent(G4HCofThisEvent*HCE)
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::clear()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::DrawAll()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::PrintAll()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
// 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: ExN02VisManager.cc,v 1.4 1998/11/30 10:21:31 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "ExN02VisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_DAWNFILE
|
||||
#include "G4DAWNFILE.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
#include "G4Wo.hh"
|
||||
#include "G4Xo.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_RAYX
|
||||
#include "G4RayX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRMLFILE
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
ExN02VisManager::ExN02VisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02VisManager::RegisterGraphicsSystems () {
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_DAWNFILE
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
RegisterGraphicsSystem (new G4Wo);
|
||||
RegisterGraphicsSystem (new G4Xo);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_RAYX
|
||||
RegisterGraphicsSystem (new G4RayX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRMLFILE
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
Reference in New Issue
Block a user