Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.8 2000/06/19 16:32:05 stesting Exp $
|
||||
$Id: History,v 1.13 2000/12/06 12:33:38 stesting Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -15,6 +15,42 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
06-12-00 S.O'Neale (exampleN02-V02-00-03)
|
||||
-update reference output for Batch Mode system testing
|
||||
in this context 0 trajectories stored is normal.
|
||||
03-12-00 M.Maire (exampleN02-V02-00-02)
|
||||
-README updated
|
||||
-prerun.g4mac updated for new vis commands, and renamed initInter.mac
|
||||
-new examples of macro: run1.mac, run2.mac
|
||||
-G4UItcsh in the main, under the control of G4UI_USE_TCSH (for Linux)
|
||||
-visualisation on interactive mode
|
||||
-DetectorConstruction: tracker region in the centre of the world.
|
||||
default target material: Pb, chamber material: Xenon
|
||||
-interactive commands to change the materials and to setup a magnetic field
|
||||
-the magnetic field is transverse to the beam (i.e. along x)
|
||||
-PhysicsList: copy of N03. defaultCut = 1 cm
|
||||
-PrimaryGenerator: default momentum direction corrected: along z.
|
||||
Suppress the possibility of random impact and the associated messenger.
|
||||
-RunAction and EventAction updated for vis commands
|
||||
-SteppingAction: cleanup because no specific actions
|
||||
-SteppingVerbose: see README
|
||||
-TrackerHit: a Hit = 4 informations: trackID, chamberNb, edep, position.
|
||||
Draw and Print
|
||||
-TrackerSD: ProcessHits.
|
||||
Print HitsCollection at end of event
|
||||
|
||||
25th November 2000 Steve O'Neale (tagset210)
|
||||
- Update test outputs for min.delta energy cut
|
||||
- Update test outputs for emlowen-V02-00-22 and stand,muon,xray,utils.
|
||||
|
||||
Nov 09, 2000 V.Grichine (exampleN02-V02-00-00)
|
||||
- Fix in ExN02MagneticField constructors: added call to SetDetectorField()
|
||||
to activate user-defined magnetic-field.
|
||||
- Updated exampleN02.out.
|
||||
|
||||
June 24, 2000 John Allison (exampleN02-V01-01-03)
|
||||
- Updated exampleN02.out for stand-V01-01-05 and utils-V01-01-03.
|
||||
|
||||
June 17, 2000 John Allison (exampleN02-V01-01-02)
|
||||
- Updated exampleN02.out for exampleN02-V01-01-01.
|
||||
|
||||
|
||||
+135
-3
@@ -1,4 +1,4 @@
|
||||
$Id: README,v 1.2 2000/03/14 10:19:09 gcosmo Exp $
|
||||
$Id: README,v 1.4 2000/12/04 16:24:03 maire Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -8,5 +8,137 @@ $Id: README,v 1.2 2000/03/14 10:19:09 gcosmo Exp $
|
||||
ExampleN02
|
||||
----------
|
||||
|
||||
May 4, 1998 John Apostolakis.
|
||||
Started from exampleEmPhys2.
|
||||
|
||||
This example simulates a simplified fixe target experiment.
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
The setup consists of a target followed by six chambers of increasing
|
||||
transverse size. These chambers are located in a region called Tracker
|
||||
region. Their shape are boxes, constructed as parametrised volumes
|
||||
(ChamberParametrisation class).
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class.
|
||||
One can change the material of the target and of the chambers
|
||||
interactively via the commands defined in the DetectorMessenger class.
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied (see
|
||||
N02MagneticField and DetectorMessenger classes).
|
||||
|
||||
|
||||
2- PHYSICS LIST
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
In this example, all the so called 'electromagnetic processes' are
|
||||
introduced for gamma, charged leptons, and charged hadrons (see the
|
||||
method PhysicsList::ConstructEM()).
|
||||
|
||||
An important data member of this class is the defaultCutValue which
|
||||
defines the production threshold of secondary particles
|
||||
(mainly Ionisation and Bremsstrahlung processes are concerned by this
|
||||
CutValue).
|
||||
Notice that the CutValue must be given in unit of length, corresponding
|
||||
to the stopping range of the particle. It is automatically converted
|
||||
in energy for each material, and a table is printed in the method
|
||||
PhysicsList::SetCuts()
|
||||
|
||||
In addition the build-in interactive command:
|
||||
/process/(in)activate processName
|
||||
allows to activate/inactivate the processes one by one.
|
||||
|
||||
|
||||
3- RUNS and EVENTS
|
||||
|
||||
The primary kinematic consists of a single particle which hits the
|
||||
target perpendicular to the input face. The type of the particle
|
||||
and its energy are set in the PrimaryGeneratorAction class, and can
|
||||
be changed via the G4 build-in commands of ParticleGun class.
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
The user has control:
|
||||
-at Begin and End of each run (class RunAction)
|
||||
-at Begin and End of each event (class EventAction)
|
||||
-at Begin and End of each track (class TrackingAction, not used here)
|
||||
-at End of each step (class SteppingAction)
|
||||
|
||||
The class SteppingVerbose prints some informations step per step,
|
||||
under the control of the command: /tracking/verbose 1
|
||||
It inherits from G4SteppingVerbose, and has been setup here in order
|
||||
to illustrate how to extract informations from the G4 kernel during
|
||||
the tracking of a particle.
|
||||
|
||||
|
||||
4- DETECTOR RESPONSE
|
||||
|
||||
A HIT is a record, track per track (even step per step), of all the
|
||||
informations needed to simulate and analyse the detector response.
|
||||
|
||||
In this example the Tracker chambers are considered as the detector.
|
||||
Therefore the chambers are declared 'sensitive detectors' (SD) in
|
||||
the DetectorConstruction class.
|
||||
|
||||
Then, a Hit is defined as a set of 4 informations per step, inside
|
||||
the chambers, namely:
|
||||
- the track identifier (an integer),
|
||||
- the chamber number,
|
||||
- the total energy deposit in this step,
|
||||
- the position of the deposit.
|
||||
|
||||
A given hit is an instance of the class TrackerHit which is created
|
||||
during the tracking of a particle, step by step, in the method
|
||||
TrackerSD::ProcessHits(). This hit is inserted in a HitsCollection.
|
||||
|
||||
The HitsCollection is printed at the end of event (via the method
|
||||
TrackerSD::EndOfEvent()), under the control of the command: /hits/verbose 1
|
||||
|
||||
|
||||
5- VISUALIZATION
|
||||
|
||||
The Visualization Manager is set in the main().
|
||||
The initialisation of the drawing is done via a set of /vis commands
|
||||
in the macro initInter.mac. This macro is automatically read from
|
||||
the main in case of interactive running mode.
|
||||
|
||||
The tracks are automatically drawn at the end of event, and erased at
|
||||
the beginning of the next run.
|
||||
|
||||
The visualization (with OpenGL driver) assumes two things:
|
||||
1- the visualisation & interfaces categories have been compiled
|
||||
with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
|
||||
2- exampleN02.cc has been compiled with G4VIS_USE_OPENGLX.
|
||||
|
||||
(The same with DAWNFILE instead of OPENGLX)
|
||||
|
||||
|
||||
6- USER INTERFACES
|
||||
|
||||
The default command interface, called G4UIterminal, is done via
|
||||
standart cin/G4cout.
|
||||
On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
|
||||
It is enough to set the environment variable G4UI_USE_TCSH before
|
||||
compiling exampleN02.cc
|
||||
|
||||
|
||||
7- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd N02
|
||||
% gmake
|
||||
|
||||
- execute N02 in 'batch' mode from macro files (without visualization)
|
||||
% exampleN02 run1.mac
|
||||
|
||||
- execute N02 in 'interactive mode' with visualization
|
||||
% exampleN02
|
||||
....
|
||||
Idle> type your commands. For instance:
|
||||
Idle> /run/beamOn 10
|
||||
....
|
||||
Idle> /control/execute run2.mac
|
||||
....
|
||||
Idle> exit
|
||||
|
||||
|
||||
|
||||
@@ -5,41 +5,33 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: exampleN02.cc,v 1.3 1999/12/15 14:49:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - exampleN03
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD Group
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
// $Id: exampleN02.cc,v 1.4 2000/12/04 16:24:03 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02PhysicsList.hh"
|
||||
#include "ExN02RunAction.hh"
|
||||
#include "ExN02PrimaryGeneratorAction.hh"
|
||||
#include "ExN02RunAction.hh"
|
||||
#include "ExN02EventAction.hh"
|
||||
#include "ExN02SteppingAction.hh"
|
||||
#include "ExN02SteppingVerbose.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#ifdef G4VIS_USE
|
||||
#include "ExN02VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "G4ios.hh"
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
int
|
||||
main(int argc,char** argv) {
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
//my Verbose output class
|
||||
G4VSteppingVerbose::SetInstance(new ExN02SteppingVerbose);
|
||||
@@ -47,7 +39,7 @@ main(int argc,char** argv) {
|
||||
// Run manager
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// UserInitialization classes
|
||||
// UserInitialization classes (mandatory)
|
||||
ExN02DetectorConstruction* ExN02detector = new ExN02DetectorConstruction;
|
||||
runManager->SetUserInitialization(ExN02detector);
|
||||
runManager->SetUserInitialization(new ExN02PhysicsList);
|
||||
@@ -59,22 +51,29 @@ main(int argc,char** argv) {
|
||||
#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();
|
||||
runManager->SetUserAction(new ExN02RunAction);
|
||||
runManager->SetUserAction(new ExN02EventAction);
|
||||
runManager->SetUserAction(new ExN02SteppingAction);
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
|
||||
//get the pointer to the User Interface manager
|
||||
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");
|
||||
G4UIsession * session = 0;
|
||||
#ifdef G4UI_USE_TCSH
|
||||
session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
session = new G4UIterminal();
|
||||
#endif
|
||||
|
||||
UI->ApplyCommand("/control/execute initInter.mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
@@ -94,4 +93,5 @@ main(int argc,char** argv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/run/initialize
|
||||
/gun/position 0 0 -100
|
||||
/gun/direction 0 0 1
|
||||
|
||||
/tracking/verbose 1
|
||||
|
||||
/gun/energy 200 MeV
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/run/initialize
|
||||
/gun/position 0 0 -100
|
||||
/gun/direction 0 0 1
|
||||
|
||||
/tracking/verbose 1
|
||||
|
||||
/gun/energy 200 MeV
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+8796
-6467
File diff suppressed because it is too large
Load Diff
@@ -5,44 +5,51 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02ChamberParameterisation.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02ChamberParameterisation.hh,v 1.3 2000/12/04 16:24:04 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-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.
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02ChamberParameterisation_H
|
||||
#define ExN02ChamberParameterisation_H 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Box;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
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;
|
||||
|
||||
~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; //
|
||||
G4int fNoChambers;
|
||||
G4double fStartZ;
|
||||
G4double fHalfWidth; // The half-width of each tracker chamber
|
||||
G4double fSpacing; // The distance between the chambers' center
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02DetectorConstruction.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02DetectorConstruction.hh,v 1.3 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02DetectorConstruction_h
|
||||
#define ExN02DetectorConstruction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
// class G4UniformMagField;
|
||||
#include "ExN02MagneticField.hh"
|
||||
|
||||
class G4Box;
|
||||
@@ -24,53 +24,59 @@ class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class ExN02DetectorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
ExN02DetectorConstruction();
|
||||
|
||||
ExN02DetectorConstruction();
|
||||
~ExN02DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
const G4VPhysicalVolume* GetTracker() {return physiTracker;};
|
||||
G4double GetTargetFullLength() {return fTargetLength;};
|
||||
G4double GetWorldFullLength() {return fWorldLength;};
|
||||
const
|
||||
G4VPhysicalVolume* GetTracker() {return physiTracker;};
|
||||
G4double GetTrackerFullLength() {return fTrackerLength;};
|
||||
G4double GetTargetFullLength() {return fTargetLength;};
|
||||
G4double GetWorldFullLength() {return fWorldLength;};
|
||||
|
||||
void setTargetMaterial (G4String);
|
||||
void setChamberMaterial(G4String);
|
||||
void SetMagField(G4double);
|
||||
|
||||
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* solidTracker; //pointer to the solid Tracker
|
||||
G4LogicalVolume* logicTracker; //pointer to the logical Tracker
|
||||
G4VPhysicalVolume* physiTracker; //pointer to the physical Tracker
|
||||
|
||||
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
|
||||
G4Material* TargetMater; //pointer to the target material
|
||||
G4Material* ChamberMater; //pointer to the chamber material
|
||||
ExN02MagneticField* fpMagField; //pointer to the magnetic 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
|
||||
|
||||
ExN02DetectorMessenger* detectorMessenger; //pointer to the Messenger
|
||||
|
||||
G4double fWorldLength; // Full length of the world volume
|
||||
G4double fTargetLength; // Full length of Target
|
||||
G4double fTrackerLength; // Full length of Tracker
|
||||
G4int NbOfChambers; // Nb of chambers in the tracker region
|
||||
G4double ChamberWidth; // width of the chambers
|
||||
G4double ChamberSpacing; // distance between chambers
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02DetectorMessenger.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02DetectorMessenger.hh,v 1.3 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02DetectorMessenger_h
|
||||
#define ExN02DetectorMessenger_h 1
|
||||
@@ -21,20 +22,22 @@ class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
ExN02DetectorMessenger(ExN02DetectorConstruction * myDet);
|
||||
~ExN02DetectorMessenger();
|
||||
ExN02DetectorMessenger(ExN02DetectorConstruction*);
|
||||
~ExN02DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
|
||||
G4UIdirectory* mydetDir;
|
||||
G4UIcmdWithAString* MatCmd;
|
||||
G4UIcmdWithADoubleAndUnit* SizeCmd;
|
||||
G4UIcmdWithAString* TargMatCmd;
|
||||
G4UIcmdWithAString* ChamMatCmd;
|
||||
G4UIcmdWithADoubleAndUnit* FieldCmd;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02EventAction.hh,v 1.3 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02EventAction.hh,v 1.4 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02EventAction_h
|
||||
#define ExN02EventAction_h 1
|
||||
|
||||
@@ -17,18 +18,17 @@
|
||||
|
||||
class G4Event;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
ExN02EventAction();
|
||||
~ExN02EventAction();
|
||||
~ExN02EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,37 +5,39 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02MagneticField.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02MagneticField.hh,v 1.3 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// A class for control of the Magnetic Field of the detector.
|
||||
// The field is assumed to be uniform.
|
||||
//
|
||||
// $ Id: $
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
// 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;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
class ExN02MagneticField: public G4UniformMagField
|
||||
{
|
||||
public:
|
||||
ExN02MagneticField(G4ThreeVector); // The value of the field
|
||||
ExN02MagneticField(); // A zero field
|
||||
~ExN02MagneticField();
|
||||
|
||||
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();
|
||||
//Set the field (fieldValue,0,0)
|
||||
void SetFieldValue(G4double fieldValue);
|
||||
void SetFieldValue(G4ThreeVector fieldVector);
|
||||
|
||||
G4ThreeVector GetConstantFieldValue();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -5,85 +5,47 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02PhysicsList.hh,v 1.6 2000/02/29 12:01:52 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02PhysicsList.hh,v 1.7 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-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
|
||||
// ------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#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;
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class ExN02PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExN02PhysicsList();
|
||||
virtual ~ExN02PhysicsList();
|
||||
~ExN02PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
|
||||
//
|
||||
virtual void SetCuts();
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
virtual void ConstructBosons();
|
||||
virtual void ConstructLeptons();
|
||||
virtual void ConstructMesons();
|
||||
virtual void ConstructBaryons();
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBaryons();
|
||||
|
||||
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;
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,38 +5,35 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02PrimaryGeneratorAction.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02PrimaryGeneratorAction.hh,v 1.3 2000/12/04 16:24:05 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02PrimaryGeneratorAction_h
|
||||
#define ExN02PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN02DetectorConstruction;
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class ExN02PrimaryGeneratorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExN02PrimaryGeneratorAction(ExN02DetectorConstruction* myDC);
|
||||
~ExN02PrimaryGeneratorAction();
|
||||
ExN02PrimaryGeneratorAction(ExN02DetectorConstruction*);
|
||||
~ExN02PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
void GeneratePrimaries(G4Event*);
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
|
||||
ExN02PrimaryGeneratorMessenger* gunMessenger;
|
||||
G4String rndmFlag;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
// 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: ExN02PrimaryGeneratorMessenger.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02RunAction.hh,v 1.3 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02RunAction.hh,v 1.4 2000/12/04 16:24:06 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02RunAction_h
|
||||
#define ExN02RunAction_h 1
|
||||
@@ -16,20 +17,19 @@
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class G4Run;
|
||||
|
||||
class ExN02RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
ExN02RunAction();
|
||||
virtual ~ExN02RunAction();
|
||||
~ExN02RunAction();
|
||||
|
||||
public:
|
||||
virtual void BeginOfRunAction(const G4Run* aRun);
|
||||
virtual void EndOfRunAction(const G4Run* aRun);
|
||||
|
||||
private:
|
||||
G4int runIDcounter;
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,31 +5,26 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02SteppingAction.hh,v 1.3 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02SteppingAction.hh,v 1.4 2000/12/04 16:24:06 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02SteppingAction_h
|
||||
#define ExN02SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExN02DetectorConstruction;
|
||||
class ExN02EventAction;
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
ExN02SteppingAction(ExN02DetectorConstruction* myDC,ExN02EventAction* myEA);
|
||||
virtual ~ExN02SteppingAction(){};
|
||||
ExN02SteppingAction();
|
||||
~ExN02SteppingAction(){};
|
||||
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
ExN02DetectorConstruction* myDetector;
|
||||
ExN02EventAction* eventAction;
|
||||
void UserSteppingAction(const G4Step*);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,19 +5,15 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02SteppingVerbose.hh,v 1.3 2000/02/28 17:58:49 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02SteppingVerbose.hh,v 1.4 2000/12/04 16:24:06 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
// This class manages the verbose outputs in G4SteppingManager.
|
||||
// It inherits from G4SteppingVerbose.
|
||||
// It shows how to extract informations during the tracking of a particle.
|
||||
//
|
||||
// ExN02SteppingVerbose.hh
|
||||
//
|
||||
// Description:
|
||||
// This class manages the vervose outputs in G4SteppingManager.
|
||||
// It inherits from G4SteppingVerbose
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02SteppingVerbose;
|
||||
|
||||
@@ -26,16 +22,17 @@ class ExN02SteppingVerbose;
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02SteppingVerbose : public G4SteppingVerbose {
|
||||
public:
|
||||
// Constructor/Destructor
|
||||
|
||||
public:
|
||||
|
||||
ExN02SteppingVerbose();
|
||||
~ExN02SteppingVerbose();
|
||||
//
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02TrackerHit.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02TrackerHit.hh,v 1.3 2000/12/04 16:24:06 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02TrackerHit_h
|
||||
#define ExN02TrackerHit_h 1
|
||||
@@ -17,43 +19,52 @@
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02TrackerHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
ExN02TrackerHit();
|
||||
~ExN02TrackerHit();
|
||||
ExN02TrackerHit(const ExN02TrackerHit &right);
|
||||
const ExN02TrackerHit& operator=(const ExN02TrackerHit &right);
|
||||
int operator==(const ExN02TrackerHit &right) const;
|
||||
~ExN02TrackerHit();
|
||||
ExN02TrackerHit(const ExN02TrackerHit&);
|
||||
const ExN02TrackerHit& operator=(const ExN02TrackerHit&);
|
||||
int operator==(const ExN02TrackerHit&) const;
|
||||
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
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; };
|
||||
|
||||
|
||||
void SetTrackID (G4int track) { trackID = track; };
|
||||
void SetChamberNb(G4int chamb) { chamberNb = chamb; };
|
||||
void SetEdep (G4double de) { edep = de; };
|
||||
void SetPos (G4ThreeVector xyz){ pos = xyz; };
|
||||
|
||||
G4int GetTrackID() { return trackID; };
|
||||
G4int GetChamberNb() { return chamberNb; };
|
||||
G4double GetEdep() { return edep; };
|
||||
G4ThreeVector GetPos(){ return pos; };
|
||||
|
||||
private:
|
||||
|
||||
G4int trackID;
|
||||
G4int chamberNb;
|
||||
G4double edep;
|
||||
G4ThreeVector pos;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
typedef G4THitsCollection<ExN02TrackerHit> ExN02TrackerHitsCollection;
|
||||
|
||||
extern G4Allocator<ExN02TrackerHit> ExN02TrackerHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
inline void* ExN02TrackerHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
@@ -61,11 +72,15 @@ inline void* ExN02TrackerHit::operator new(size_t)
|
||||
return aHit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
inline void ExN02TrackerHit::operator delete(void *aHit)
|
||||
{
|
||||
ExN02TrackerHitAllocator.FreeSingle((ExN02TrackerHit*) aHit);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -5,40 +5,38 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02TrackerSD.hh,v 1.2 1999/12/15 14:49:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02TrackerSD.hh,v 1.3 2000/12/04 16:24:06 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#ifndef ExN02TrackerSD_h
|
||||
#define ExN02TrackerSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "ExN02TrackerHit.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
class ExN02TrackerSD : public G4VSensitiveDetector
|
||||
{
|
||||
|
||||
public:
|
||||
ExN02TrackerSD(G4String name);
|
||||
~ExN02TrackerSD();
|
||||
ExN02TrackerSD(G4String);
|
||||
~ExN02TrackerSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*HCE);
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void EndOfEvent(G4HCofThisEvent*HCE);
|
||||
void clear();
|
||||
void DrawAll();
|
||||
void PrintAll();
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*, G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
|
||||
private:
|
||||
ExN02TrackerHitsCollection *trackerCollection;
|
||||
ExN02TrackerHitsCollection* trackerCollection;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02VisManager.hh,v 1.3 1999/12/15 14:49:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Macro file for the initialization phase of "exampleN02.cc"
|
||||
# when runing in interactive mode
|
||||
#
|
||||
# Sets some default verbose
|
||||
#
|
||||
/control/verbose 2
|
||||
/run/verbose 2
|
||||
#
|
||||
# create empty scene
|
||||
#
|
||||
/vis/scene/create
|
||||
#
|
||||
# Create a scene handler for a specific graphics system
|
||||
# (Edit the next line(s) to choose another graphic system)
|
||||
#
|
||||
/vis/open OGLIX
|
||||
#/vis/open DAWNFILE
|
||||
#
|
||||
# draw scene
|
||||
#
|
||||
/vis/camera/zoom 1.4
|
||||
/vis/camera/viewpoint 90 180
|
||||
/vis/drawVolume
|
||||
#
|
||||
# for drawing the tracks
|
||||
# (if too many tracks cause core dump => storeTrajectory 0)
|
||||
/tracking/storeTrajectory 1
|
||||
/vis/scene/add/trajectories
|
||||
@@ -1,4 +0,0 @@
|
||||
/control/verbose 2
|
||||
/tracking/verbose 2
|
||||
/tracking/verbose 1
|
||||
/run/initialize
|
||||
@@ -0,0 +1,23 @@
|
||||
# $Id: run1.mac,v 1.1 2000/12/04 16:24:04 maire Exp $
|
||||
#
|
||||
# Macro file for "exampleN02.cc"
|
||||
#
|
||||
# can be run in batch, without graphic
|
||||
# or interactively: Idle> /control/execute run1.mac
|
||||
#
|
||||
/run/verbose 2
|
||||
/event/verbose 0
|
||||
#
|
||||
# proton 3 GeV to the direction (0.,0.,1.) (default kinematic)
|
||||
# 1 event with detailled printing
|
||||
#
|
||||
/tracking/verbose 1
|
||||
/run/beamOn 1
|
||||
#
|
||||
# muon 300 MeV to the direction (0.,0.,1.)
|
||||
# 3 events (no printing)
|
||||
#
|
||||
/gun/particle mu-
|
||||
/gun/energy 300 MeV
|
||||
/tracking/verbose 0
|
||||
/run/beamOn 3
|
||||
@@ -0,0 +1,23 @@
|
||||
# $Id: run2.mac,v 1.1 2000/12/04 16:24:04 maire Exp $
|
||||
#
|
||||
# Macro file for "exampleN02.cc"
|
||||
#
|
||||
# can be run in batch, without graphic
|
||||
# or interactively: Idle> /control/execute run2.mac
|
||||
#
|
||||
/run/verbose 2
|
||||
/event/verbose 0
|
||||
#
|
||||
# proton 3 GeV to the direction (0.,0.,1.) (default kinematic)
|
||||
# 1 event with detailled printing
|
||||
#
|
||||
/tracking/verbose 1
|
||||
/run/beamOn 1
|
||||
#
|
||||
# set a magnetic field
|
||||
# 1 events; print the hits
|
||||
#
|
||||
/mydet/setField 2 tesla
|
||||
/tracking/verbose 0
|
||||
/hits/verbose 1
|
||||
/run/beamOn 1
|
||||
@@ -5,9 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02ChamberParameterisation.cc,v 1.2 1999/12/15 14:49:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02ChamberParameterisation.cc,v 1.3 2000/12/04 16:24:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02ChamberParameterisation.hh"
|
||||
|
||||
@@ -15,6 +17,8 @@
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Box.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02ChamberParameterisation::ExN02ChamberParameterisation(
|
||||
G4int NoChambers,
|
||||
G4double startZ, // Z of center of first
|
||||
@@ -23,14 +27,14 @@ ExN02ChamberParameterisation::ExN02ChamberParameterisation(
|
||||
G4double lengthInitial,
|
||||
G4double lengthFinal )
|
||||
{
|
||||
fNoChambers= NoChambers;
|
||||
fStartZ= startZ;
|
||||
fHalfWidth= widthChamber*0.5;
|
||||
fSpacing= spacingZ;
|
||||
fHalfLengthFirst= 0.5 * lengthInitial;
|
||||
// fHalfLengthLast= 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);
|
||||
fHalfLengthIncr = 0.5 * (lengthFinal-lengthInitial)/(NoChambers-1);
|
||||
|
||||
if( spacingZ < widthChamber ) {
|
||||
G4Exception( "ExN02ChamberParameterisation construction: Width > Spacing" );
|
||||
@@ -39,9 +43,13 @@ ExN02ChamberParameterisation::ExN02ChamberParameterisation(
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02ChamberParameterisation::~ExN02ChamberParameterisation()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02ChamberParameterisation::ComputeTransformation
|
||||
(const G4int copyNo,G4VPhysicalVolume *physVol) const
|
||||
{
|
||||
@@ -51,6 +59,8 @@ void ExN02ChamberParameterisation::ComputeTransformation
|
||||
physVol->SetRotation(0);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02ChamberParameterisation::ComputeDimensions
|
||||
(G4Box & trackerChamber, const G4int copyNo,
|
||||
const G4VPhysicalVolume * physVol) const
|
||||
@@ -60,3 +70,5 @@ void ExN02ChamberParameterisation::ComputeDimensions
|
||||
trackerChamber.SetYHalfLength(halfLength);
|
||||
trackerChamber.SetZHalfLength(fHalfWidth);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,53 +5,57 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02DetectorConstruction.cc,v 1.4 2000/05/15 14:02:10 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02DetectorConstruction.cc,v 1.5 2000/12/04 16:24:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02DetectorMessenger.hh"
|
||||
#include "ExN02ChamberParameterisation.hh"
|
||||
#include "ExN02MagneticField.hh"
|
||||
#include "ExN02TrackerSD.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 "G4UserLimits.hh"
|
||||
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02DetectorConstruction::ExN02DetectorConstruction()
|
||||
:solidWorld(NULL),logicWorld(NULL),physiWorld(NULL),
|
||||
:solidWorld(NULL), logicWorld(NULL), physiWorld(NULL),
|
||||
solidTarget(NULL), logicTarget(NULL), physiTarget(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.)
|
||||
TargetMater(NULL), ChamberMater(NULL),fpMagField(NULL),
|
||||
fWorldLength(0.), fTargetLength(0.), fTrackerLength(0.),
|
||||
NbOfChambers(0) , ChamberWidth(0.), ChamberSpacing(0.)
|
||||
{
|
||||
fpMagField = new ExN02MagneticField();
|
||||
detectorMessenger = new ExN02DetectorMessenger(this);
|
||||
fpMagField = new ExN02MagneticField(); // G4FieldManager();
|
||||
// magFieldManager = new G4FieldManager();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02DetectorConstruction::~ExN02DetectorConstruction()
|
||||
{
|
||||
delete detectorMessenger;
|
||||
delete fpMagField;
|
||||
// delete magFieldManager;
|
||||
delete fpMagField;
|
||||
delete detectorMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
{
|
||||
//--------- Material definition ---------
|
||||
@@ -81,13 +85,12 @@ G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
density = 11.35*g/cm3;
|
||||
G4Material* Pb = new G4Material(name="Pb", z=82., a, density);
|
||||
|
||||
//Vacuum
|
||||
density = universe_mean_density; //from PhysicalConstants.h
|
||||
pressure = 3.e-18*pascal;
|
||||
temperature = 2.73*kelvin;
|
||||
G4Material* Vacuum =
|
||||
new G4Material(name="Vacuum", z=1., a=1.01*g/mole, density,
|
||||
kStateGas,temperature,pressure);
|
||||
//Xenon gas
|
||||
density = 5.458*mg/cm3;
|
||||
pressure = 1*atmosphere;
|
||||
temperature = 293.15*kelvin;
|
||||
G4Material* Xenon = new G4Material(name="XenonGas", z=54., a=131.29*g/mole,
|
||||
density, kStateGas,temperature,pressure);
|
||||
|
||||
// Print all the materials defined.
|
||||
//
|
||||
@@ -96,22 +99,27 @@ G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
|
||||
//--------- Sizes of the principal geometrical components (solids) ---------
|
||||
|
||||
fDetectorLength = 1250.*cm ; // Full length of the detector
|
||||
fTrackerLength = 500. * cm; // Full length of the Tracker
|
||||
fTargetLength = 5.0 * cm; // Full length of the Target
|
||||
NbOfChambers = 6;
|
||||
ChamberWidth = 20*cm;
|
||||
ChamberSpacing = 80*cm;
|
||||
|
||||
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
|
||||
fTrackerLength = NbOfChambers*ChamberSpacing; // Full length of the Tracker
|
||||
fTargetLength = 5.0 * cm; // Full length of the Target
|
||||
|
||||
TargetMater = Pb;
|
||||
ChamberMater = Xenon;
|
||||
|
||||
fWorldLength= 1.2 *(fTargetLength+fTrackerLength);
|
||||
|
||||
G4double targetSize = 0.5*fTargetLength; // Half length of the Target
|
||||
G4double trackerSize = 0.5*fTrackerLength; // Half length of the Tracker
|
||||
|
||||
//--------- 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);
|
||||
@@ -126,32 +134,36 @@ G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
0, // its mother volume
|
||||
false, // no boolean operations
|
||||
0); // no field specific to volume
|
||||
|
||||
|
||||
//------------------------------
|
||||
// Target
|
||||
//------------------------------
|
||||
//------------------------------
|
||||
|
||||
G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetSize+trackerSize));
|
||||
|
||||
solidTarget = new G4Box("TargetSolid",targetSize,targetSize,targetSize);
|
||||
logicTarget = new G4LogicalVolume(solidTarget ,myMaterial,"TargetLV",0,0,0);
|
||||
logicTarget = new G4LogicalVolume(solidTarget,TargetMater,"TargetLV",0,0,0);
|
||||
physiTarget = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
positionTarget, // at (x,y,z)
|
||||
"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 " << G4endl;
|
||||
G4cout << "Target is " << fTargetLength/cm << " cm of "
|
||||
<< TargetMater->GetName() << G4endl;
|
||||
|
||||
//------------------------------
|
||||
// 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);
|
||||
//------------------------------
|
||||
|
||||
G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
|
||||
|
||||
solidTracker = new G4Box("Tracker",trackerSize,trackerSize,trackerSize);
|
||||
logicTracker = new G4LogicalVolume(solidTracker , Air, "Tracker",0,0,0);
|
||||
physiTracker = new G4PVPlacement(0, // no rotation
|
||||
positionTracker, // at (0,0,0)
|
||||
positionTracker, // at (x,y,z)
|
||||
"Tracker", // its name
|
||||
logicTracker, // its logical volume
|
||||
physiWorld, // its mother volume
|
||||
@@ -160,35 +172,41 @@ G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
|
||||
//------------------------------
|
||||
// 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);
|
||||
|
||||
solidChamber = new G4Box("chamber", 100*cm, 100*cm, 10*cm);
|
||||
logicChamber = new G4LogicalVolume(solidChamber,ChamberMater,"Chamber",0,0,0);
|
||||
|
||||
G4double firstPosition = -trackerSize + 0.5*ChamberWidth;
|
||||
G4double firstLength = fTrackerLength/10;
|
||||
G4double lastLength = fTrackerLength;
|
||||
|
||||
G4VPVParameterisation* chamberParam = new ExN02ChamberParameterisation(
|
||||
NbOfChambers, // NoChambers
|
||||
firstPosition, // Z of center of first
|
||||
ChamberSpacing, // Z spacing of centers
|
||||
ChamberWidth, // Width Chamber
|
||||
firstLength, // lengthInitial
|
||||
lastLength); // lengthFinal
|
||||
|
||||
// dummy value : kZAxis -- modified by parameterised volume
|
||||
//
|
||||
physiChamber = new G4PVParameterised(
|
||||
"Chamber", // their name
|
||||
logicChamber, // their logical volume
|
||||
physiTracker, // Mother physical volume
|
||||
kZAxis, // Are placed along this axis
|
||||
NbOfChambers, // Number of chambers
|
||||
chamberParam); // The parametrisation
|
||||
|
||||
G4cout << "There are " << NbOfChambers << " chambers in the tracker region. "
|
||||
<< "The chambers are " << ChamberWidth/mm << " mm of "
|
||||
<< ChamberMater->GetName() << "\n The distance between chamber is "
|
||||
<< ChamberSpacing/cm << " cm" << G4endl;
|
||||
|
||||
//------------------------------------------------
|
||||
// Sensitive detectors
|
||||
//------------------------------------------------
|
||||
@@ -198,68 +216,65 @@ G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
|
||||
G4String trackerChamberSDname = "ExN02/TrackerChamberSD";
|
||||
ExN02TrackerSD* aTrackerSD = new ExN02TrackerSD( trackerChamberSDname );
|
||||
SDman->AddNewDetector( aTrackerSD );
|
||||
trackerChamberLV->SetSensitiveDetector( aTrackerSD );
|
||||
logicChamber->SetSensitiveDetector( aTrackerSD );
|
||||
|
||||
//--------- Visualization attributes -------------------------------
|
||||
|
||||
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
|
||||
logicWorld ->SetVisAttributes(BoxVisAtt);
|
||||
logicTarget ->SetVisAttributes(BoxVisAtt);
|
||||
logicTracker->SetVisAttributes(BoxVisAtt);
|
||||
|
||||
G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
|
||||
logicChamber->SetVisAttributes(ChamberVisAtt);
|
||||
|
||||
//--------- example of User Limits -------------------------------
|
||||
|
||||
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;
|
||||
//below is an example of how to set tracking constraints in a given
|
||||
//logical volume(see also in N02PhysicsList how to setup the process
|
||||
//G4UserSpecialCuts).
|
||||
//set a max Step length in the tracker region
|
||||
///G4double maxStep = 0.5*ChamberWidth, maxLength = 2*fTrackerLength;
|
||||
///G4double maxTime = 0.1*ns, minEkin = 10*MeV;
|
||||
///logicAbsorber->SetUserLimits(new G4UserLimits(maxStep,maxLength,maxTime,
|
||||
///logicTracker->SetUserLimits(new G4UserLimits(maxStep,maxLength,maxTime,
|
||||
/// minEkin));
|
||||
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ExN02DetectorConstruction::setMaterial(G4String materialChoice)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02DetectorConstruction::setTargetMaterial(G4String materialName)
|
||||
{
|
||||
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
|
||||
<< G4endl;}
|
||||
}
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
|
||||
if (pttoMaterial)
|
||||
{TargetMater = pttoMaterial;
|
||||
logicTarget->SetMaterial(pttoMaterial);
|
||||
G4cout << "\n----> The target is " << fTargetLength/cm << " cm of "
|
||||
<< materialName << G4endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02DetectorConstruction::SetDetectorLength(G4double length)
|
||||
void ExN02DetectorConstruction::setChamberMaterial(G4String materialName)
|
||||
{
|
||||
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()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
|
||||
if (pttoMaterial)
|
||||
{ChamberMater = pttoMaterial;
|
||||
logicChamber->SetMaterial(pttoMaterial);
|
||||
G4cout << "\n----> The chambers are " << ChamberWidth/cm << " cm of "
|
||||
<< materialName << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
{
|
||||
fpMagField->SetFieldValue(fieldValue);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02DetectorMessenger.cc,v 1.2 1999/12/15 14:49:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02DetectorMessenger.cc,v 1.3 2000/12/04 16:24:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02DetectorMessenger.hh"
|
||||
|
||||
@@ -18,6 +19,8 @@
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02DetectorMessenger::ExN02DetectorMessenger(ExN02DetectorConstruction * myDet)
|
||||
:myDetector(myDet)
|
||||
{
|
||||
@@ -25,47 +28,47 @@ ExN02DetectorMessenger::ExN02DetectorMessenger(ExN02DetectorConstruction * 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);
|
||||
TargMatCmd = new G4UIcmdWithAString("/mydet/setTargetMate",this);
|
||||
TargMatCmd->SetGuidance("Select Material of the Target.");
|
||||
TargMatCmd->SetParameterName("choice",false);
|
||||
TargMatCmd->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);
|
||||
ChamMatCmd = new G4UIcmdWithAString("/mydet/setChamberMate",this);
|
||||
ChamMatCmd->SetGuidance("Select Material of the Target.");
|
||||
ChamMatCmd->SetParameterName("choice",false);
|
||||
ChamMatCmd->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->SetParameterName("Bz",false);
|
||||
FieldCmd->SetDefaultUnit("tesla");
|
||||
FieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
FieldCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02DetectorMessenger::~ExN02DetectorMessenger()
|
||||
{
|
||||
delete MatCmd;
|
||||
delete SizeCmd;
|
||||
delete TargMatCmd;
|
||||
delete ChamMatCmd;
|
||||
delete FieldCmd;
|
||||
delete mydetDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02DetectorMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
|
||||
{
|
||||
// if( command == MatCmd )
|
||||
// { myDetector->setMaterial(newValues);}
|
||||
|
||||
if( command == SizeCmd )
|
||||
{ myDetector->SetDetectorLength(SizeCmd->GetNewDoubleValue(newValues));}
|
||||
if( command == TargMatCmd )
|
||||
{ myDetector->setTargetMaterial(newValues);}
|
||||
|
||||
if( command == ChamMatCmd )
|
||||
{ myDetector->setChamberMaterial(newValues);}
|
||||
|
||||
if( command == FieldCmd )
|
||||
{ myDetector->SetMagField(FieldCmd->GetNewDoubleValue(newValues));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,31 +5,37 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02EventAction.cc,v 1.4 2000/01/24 14:45:51 stesting Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02EventAction.cc,v 1.5 2000/12/04 16:24:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02EventAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02EventAction::ExN02EventAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02EventAction::~ExN02EventAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02EventAction::BeginOfEventAction(const G4Event*)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int event_id = evt->GetEventID();
|
||||
@@ -45,12 +51,6 @@ void ExN02EventAction::EndOfEventAction(const G4Event* evt)
|
||||
G4cout << " " << n_trajectories
|
||||
<< " trajectories stored in this event." << G4endl;
|
||||
}
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ (*(evt->GetTrajectoryContainer()))[i]->DrawTrajectory(50); }
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,36 +5,46 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02MagneticField.cc,v 1.2 1999/12/15 14:49:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02MagneticField.cc,v 1.4 2000/12/04 16:24:07 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// User Field class implementation.
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02MagneticField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
|
||||
// Constructors:
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02MagneticField::ExN02MagneticField()
|
||||
: G4UniformMagField(G4ThreeVector())
|
||||
{
|
||||
GetGlobalFieldManager()->SetDetectorField(this);
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02MagneticField::ExN02MagneticField(G4ThreeVector fieldVector)
|
||||
: G4UniformMagField(fieldVector)
|
||||
{
|
||||
{
|
||||
GetGlobalFieldManager()->SetDetectorField(this);
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
// Set the value of the Global Field to fieldValue along Z
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
// Set the value of the Global Field to fieldValue along X
|
||||
//
|
||||
void ExN02MagneticField::SetFieldValue(G4double fieldValue)
|
||||
{
|
||||
G4UniformMagField::SetFieldValue(G4ThreeVector(0,0,fieldValue));
|
||||
G4UniformMagField::SetFieldValue(G4ThreeVector(fieldValue,0,0));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
// Set the value of the Global Field
|
||||
//
|
||||
void ExN02MagneticField::SetFieldValue(G4ThreeVector fieldVector)
|
||||
@@ -54,17 +64,19 @@ void ExN02MagneticField::SetFieldValue(G4ThreeVector fieldVector)
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02MagneticField::~ExN02MagneticField()
|
||||
{
|
||||
// GetGlobalFieldManager()->SetDetectorField(0);
|
||||
}
|
||||
|
||||
// Utility method
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
G4FieldManager* ExN02MagneticField::GetGlobalFieldManager()
|
||||
{
|
||||
return G4TransportationManager::GetTransportationManager()
|
||||
->GetFieldManager();
|
||||
return G4TransportationManager::GetTransportationManager()->GetFieldManager();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,15 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02PhysicsList.cc,v 1.7 2000/02/29 12:03:30 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02PhysicsList.cc,v 1.8 2000/12/04 16:24:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// This is a version for maximum particle set
|
||||
// ------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "globals.hh"
|
||||
#include "ExN02PhysicsList.hh"
|
||||
@@ -25,27 +21,23 @@
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
ExN02PhysicsList::ExN02PhysicsList(): G4VUserPhysicsList(),
|
||||
thePhotoElectricEffect(NULL),theComptonScattering(NULL),
|
||||
theGammaConversion(NULL),
|
||||
theeminusMultipleScattering(NULL),theeminusIonisation(NULL),
|
||||
theeminusBremsstrahlung(NULL),
|
||||
theeplusMultipleScattering(NULL),theeplusIonisation(NULL),
|
||||
theeplusBremsstrahlung(NULL),
|
||||
theeplusAnnihilation(NULL)
|
||||
ExN02PhysicsList::ExN02PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
defaultCutValue = 2.0*mm;
|
||||
defaultCutValue = 1.0*cm;
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
ExN02PhysicsList::~ExN02PhysicsList()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructParticle()
|
||||
{
|
||||
@@ -61,6 +53,8 @@ void ExN02PhysicsList::ConstructParticle()
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
@@ -71,6 +65,8 @@ void ExN02PhysicsList::ConstructBosons()
|
||||
G4Gamma::GammaDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
@@ -88,6 +84,8 @@ void ExN02PhysicsList::ConstructLeptons()
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
@@ -105,6 +103,8 @@ void ExN02PhysicsList::ConstructMesons()
|
||||
G4KaonZeroShort::KaonZeroShortDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructBaryons()
|
||||
{
|
||||
// barions
|
||||
@@ -115,6 +115,7 @@ void ExN02PhysicsList::ConstructBaryons()
|
||||
G4AntiNeutron::AntiNeutronDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructProcess()
|
||||
{
|
||||
@@ -123,6 +124,8 @@ void ExN02PhysicsList::ConstructProcess()
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
@@ -138,7 +141,10 @@ void ExN02PhysicsList::ConstructProcess()
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
///#include "G4UserSpecialCuts.hh"
|
||||
|
||||
////#include "G4UserSpecialCuts.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::ConstructEM()
|
||||
{
|
||||
@@ -150,101 +156,116 @@ void ExN02PhysicsList::ConstructEM()
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theComptonScattering = new G4ComptonScattering();
|
||||
theGammaConversion = new G4GammaConversion();
|
||||
// add processes
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for electron
|
||||
theeminusMultipleScattering = new G4MultipleScattering();
|
||||
theeminusIonisation = new G4eIonisation();
|
||||
theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeminusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeminusMultipleScattering);
|
||||
pmanager->AddProcess(theeminusIonisation);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2);
|
||||
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);
|
||||
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();
|
||||
G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeplusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeplusMultipleScattering);
|
||||
pmanager->AddProcess(theeplusIonisation);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung);
|
||||
pmanager->AddProcess(theeplusAnnihilation);
|
||||
//
|
||||
// set ordering for AtRestDoIt
|
||||
pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2);
|
||||
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);
|
||||
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();
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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();
|
||||
G4VProcess* anIonisation = new G4hIonisation();
|
||||
|
||||
////G4VProcess* theUserCuts = new G4UserSpecialCuts();
|
||||
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
/// pmanager->AddProcess(theUserSpecialCuts);
|
||||
|
||||
/// pmanager->AddProcess(theUserCuts);
|
||||
|
||||
//
|
||||
// set ordering for AtRestDoIt
|
||||
//>>pmanager->SetProcessOrderingToFirst(theUserSpecialCuts, idxAtRest);
|
||||
////pmanager->SetProcessOrderingToFirst(theUserCuts,idxAtRest);
|
||||
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
|
||||
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);
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
|
||||
////pmanager->SetProcessOrdering(theUserCuts, idxPostStep,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4Decay.hh"
|
||||
void ExN02PhysicsList::ConstructGeneral()
|
||||
{
|
||||
@@ -263,13 +284,17 @@ void ExN02PhysicsList::ConstructGeneral()
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void ExN02PhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >1){
|
||||
G4cout << "ExN02PhysicsList::SetCuts:";
|
||||
}
|
||||
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
|
||||
//G4VUserPhysicsList::SetCutsWithDefault method sets
|
||||
//the default cut value for all particle types
|
||||
//
|
||||
SetCutsWithDefault();
|
||||
|
||||
if (verboseLevel>0) DumpCutValuesTable();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -5,66 +5,55 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02PrimaryGeneratorAction.cc,v 1.2 1999/12/15 14:49:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02PrimaryGeneratorAction.cc,v 1.3 2000/12/04 16:24:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// $ Id: $
|
||||
//
|
||||
// From exampleEmPhys2/MyPrimaryGeneratorAction.cc,v 1.1 1998/02/06 maire
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#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"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02PrimaryGeneratorAction::ExN02PrimaryGeneratorAction(ExN02DetectorConstruction* myDC)
|
||||
:myDetector(myDC),rndmFlag("off")
|
||||
:myDetector(myDC)
|
||||
{
|
||||
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");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle("proton");
|
||||
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
particleGun->SetParticleEnergy(3.0*GeV);
|
||||
G4double position = -0.5*(myDetector->GetWorldFullLength());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02PrimaryGeneratorAction::~ExN02PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
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));
|
||||
|
||||
G4double position = -0.5*(myDetector->GetWorldFullLength());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,position));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// 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: ExN02PrimaryGeneratorMessenger.cc,v 1.2 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-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);}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02RunAction.cc,v 1.3 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02RunAction.cc,v 1.4 2000/12/04 16:24:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02RunAction.hh"
|
||||
|
||||
@@ -17,45 +18,42 @@
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02RunAction::ExN02RunAction()
|
||||
{
|
||||
runIDcounter = 0;
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02RunAction::~ExN02RunAction()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
((G4Run *)(aRun))->SetRunID(runIDcounter++);
|
||||
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
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");
|
||||
}
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02RunAction::EndOfRunAction(const G4Run*)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
if(G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/show/view");
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,35 +5,27 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02SteppingAction.cc,v 1.3 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// $Id: ExN02SteppingAction.cc,v 1.4 2000/12/04 16:24:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02SteppingAction.hh"
|
||||
#include "ExN02DetectorConstruction.hh"
|
||||
#include "ExN02EventAction.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
|
||||
ExN02SteppingAction::ExN02SteppingAction(ExN02DetectorConstruction* myDC, ExN02EventAction* myEA)
|
||||
:myDetector(myDC), eventAction(myEA)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02SteppingAction::ExN02SteppingAction()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
// 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
|
||||
{
|
||||
const G4VPhysicalVolume* currentVolume =
|
||||
aStep->GetPreStepPoint()->GetPhysicalVolume();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
@@ -5,39 +5,30 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02SteppingVerbose.cc,v 1.3 2000/02/28 17:58:50 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02SteppingVerbose.cc,v 1.4 2000/12/04 16:24:08 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// ExN02SteppingVerbose.cc
|
||||
//
|
||||
// Description:
|
||||
// Implementation of the ExN02SteppingVerbose class
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02SteppingVerbose.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
////////////////////////////////////////////////
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02SteppingVerbose::ExN02SteppingVerbose()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
ExN02SteppingVerbose::~ExN02SteppingVerbose()
|
||||
//////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
/////////////////////////////////////////
|
||||
void ExN02SteppingVerbose::StepInfo()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
CopyState();
|
||||
|
||||
@@ -126,9 +117,9 @@ void ExN02SteppingVerbose::StepInfo()
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02SteppingVerbose::TrackingStarted()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
CopyState();
|
||||
@@ -164,3 +155,5 @@ G4int prec = G4cout.precision(3);
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -5,43 +5,59 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02TrackerHit.cc,v 1.2 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02TrackerHit.cc,v 1.4 2000/12/06 07:54:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02TrackerHit.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Circle.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
|
||||
|
||||
G4Allocator<ExN02TrackerHit> ExN02TrackerHitAllocator;
|
||||
|
||||
ExN02TrackerHit::ExN02TrackerHit()
|
||||
{;}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02TrackerHit::~ExN02TrackerHit()
|
||||
{;}
|
||||
ExN02TrackerHit::ExN02TrackerHit() {}
|
||||
|
||||
ExN02TrackerHit::ExN02TrackerHit(const ExN02TrackerHit &right)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02TrackerHit::~ExN02TrackerHit() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02TrackerHit::ExN02TrackerHit(const ExN02TrackerHit& right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
trackID = right.trackID;
|
||||
chamberNb = right.chamberNb;
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
}
|
||||
|
||||
const ExN02TrackerHit& ExN02TrackerHit::operator=(const ExN02TrackerHit &right)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
const ExN02TrackerHit& ExN02TrackerHit::operator=(const ExN02TrackerHit& right)
|
||||
{
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
trackID = right.trackID;
|
||||
chamberNb = right.chamberNb;
|
||||
edep = right.edep;
|
||||
pos = right.pos;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int ExN02TrackerHit::operator==(const ExN02TrackerHit &right) const
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
int ExN02TrackerHit::operator==(const ExN02TrackerHit& right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02TrackerHit::Draw()
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
@@ -57,17 +73,14 @@ void ExN02TrackerHit::Draw()
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02TrackerHit::Print()
|
||||
{
|
||||
G4cout << " trackID: " << trackID << " chamberNb: " << chamberNb
|
||||
<< " energy deposit: " << G4BestUnit(edep,"Energy")
|
||||
<< " position: " << G4BestUnit(pos,"Length") << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
// 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
|
||||
|
||||
@@ -5,18 +5,21 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02TrackerSD.cc,v 1.2 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: ExN02TrackerSD.cc,v 1.3 2000/12/04 16:24:09 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "ExN02TrackerSD.hh"
|
||||
#include "ExN02TrackerHit.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
ExN02TrackerSD::ExN02TrackerSD(G4String name)
|
||||
:G4VSensitiveDetector(name)
|
||||
{
|
||||
@@ -24,9 +27,13 @@ ExN02TrackerSD::ExN02TrackerSD(G4String name)
|
||||
collectionName.insert(HCname="trackerCollection");
|
||||
}
|
||||
|
||||
ExN02TrackerSD::~ExN02TrackerSD(){;}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02TrackerSD::Initialize(G4HCofThisEvent*HCE)
|
||||
ExN02TrackerSD::~ExN02TrackerSD(){ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02TrackerSD::Initialize(G4HCofThisEvent* HCE)
|
||||
{
|
||||
trackerCollection = new ExN02TrackerHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
@@ -36,34 +43,38 @@ void ExN02TrackerSD::Initialize(G4HCofThisEvent*HCE)
|
||||
HCE->AddHitsCollection( HCID, trackerCollection );
|
||||
}
|
||||
|
||||
G4bool ExN02TrackerSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4bool ExN02TrackerSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4Track* aTrack = aStep->GetTrack();
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
|
||||
if(edep==0.) return true;
|
||||
if(edep==0.) return false;
|
||||
|
||||
ExN02TrackerHit* newHit = new ExN02TrackerHit();
|
||||
newHit->SetEdep( edep );
|
||||
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
|
||||
newHit->SetTrackID (aStep->GetTrack()->GetTrackID());
|
||||
newHit->SetChamberNb(aStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber());
|
||||
newHit->SetEdep (edep);
|
||||
newHit->SetPos (aStep->GetPostStepPoint()->GetPosition());
|
||||
trackerCollection->insert( newHit );
|
||||
|
||||
//newHit->Print();
|
||||
//newHit->Draw();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::EndOfEvent(G4HCofThisEvent*HCE)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void ExN02TrackerSD::EndOfEvent(G4HCofThisEvent* HCE)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4int NbHits = trackerCollection->entries();
|
||||
G4cout << "\n-------->Hits Collection: in this event they are " << NbHits
|
||||
<< " hits in the tracker chambers: " << G4endl;
|
||||
for (G4int i=0;i<NbHits;i++) (*trackerCollection)[i]->Print();
|
||||
}
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::clear()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::DrawAll()
|
||||
{
|
||||
}
|
||||
|
||||
void ExN02TrackerSD::PrintAll()
|
||||
{
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: ExN02VisManager.cc,v 1.3 1999/12/15 14:49:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
Reference in New Issue
Block a user