Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# $Id: GNUmakefile,v 1.3 2001/10/15 17:20:32 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := field01
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,24 @@
|
||||
$Id: History,v 1.3 2001/11/07 16:36:30 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field01 History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov 7th, 2001 - G.Cosmo
|
||||
-----------------------
|
||||
- More cleanup and fixes to primary generator gun (V.Grichine).
|
||||
|
||||
Oct 15th, 2001 - G.Cosmo
|
||||
------------------------
|
||||
- Cleaned from test code.
|
||||
@@ -0,0 +1,84 @@
|
||||
$Id: README,v 1.3 2001/10/25 08:10:19 grichine Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field01
|
||||
-------
|
||||
|
||||
Test for investigation of tracking using magnetic field
|
||||
and field dependent electromagnetic processes.
|
||||
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
The "absorber" is a solid made of a given material.
|
||||
|
||||
Three parameters define the absorber :
|
||||
- the material of the absorber,
|
||||
- the thickness of an absorber,
|
||||
- the transverse size of the absorber (the input face is a square).
|
||||
|
||||
The volume "World" contains the "absorber".
|
||||
In this test the parameters of the "World" can be changed , too.
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class,
|
||||
but all the parameters can be changed via
|
||||
the commands defined in the DetectorMessenger class.
|
||||
|
||||
2- AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
The primary kinematic consists of a single particle (proton, Ekin = 1 GeV)
|
||||
which hits the
|
||||
absorber 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 (see
|
||||
the macros provided with this example).
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
3- DETECTOR RESPONSE
|
||||
|
||||
The spatial distribution of charged particles transported in magnetic
|
||||
field is envistigated.
|
||||
A HIT is a record, event per event , of all the
|
||||
informations needed to simulate and analyse the detector response.
|
||||
|
||||
In this example a CalorHit is defined as a set of 2 informations:
|
||||
- the total energy deposit in the absorber,
|
||||
- the total tracklength of all charged particles in the absorber,
|
||||
|
||||
Therefore the absorber is declared
|
||||
'sensitive detector' (SD), which means they can contribute to the hit.
|
||||
|
||||
4- PHYSICS DEMO
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
The messenger classes introduce interactive commands . Using these
|
||||
commands the geometry of the detector, the data of the primary
|
||||
particle, etc. can be changed.
|
||||
|
||||
|
||||
5- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd $G4INSTALL/example/extended/field/field01
|
||||
% gmake
|
||||
|
||||
- execute field01 in 'batch' mode from macro file e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field01 field01.in
|
||||
|
||||
- execute field01 in 'interactive' mode with visualization e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field01
|
||||
....
|
||||
Idle> type your commands
|
||||
....
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: field01.cc,v 1.4 2001/11/07 16:36:30 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - TestF01
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "F01VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "F01DetectorConstruction.hh"
|
||||
#include "F01ElectroMagneticField.hh"
|
||||
#include "F01PhysicsList.hh"
|
||||
#include "F01PrimaryGeneratorAction.hh"
|
||||
#include "F01RunAction.hh"
|
||||
#include "F01EventAction.hh"
|
||||
#include "F01SteppingAction.hh"
|
||||
#include "F01SteppingVerbose.hh"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
|
||||
//choose the Random engine
|
||||
|
||||
HepRandom::setTheEngine(new RanecuEngine);
|
||||
|
||||
//my Verbose output class
|
||||
|
||||
G4VSteppingVerbose::SetInstance(new F01SteppingVerbose);
|
||||
|
||||
// Construct the default run manager
|
||||
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// Costruct electromagnetic field
|
||||
|
||||
F01ElectroMagneticField* field = new F01ElectroMagneticField() ;
|
||||
|
||||
// Set mandatory initialization classes
|
||||
|
||||
F01DetectorConstruction* detector;
|
||||
detector = new F01DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new F01PhysicsList(detector));
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
// visualization manager
|
||||
|
||||
G4VisManager* visManager = new F01VisManager;
|
||||
visManager->Initialize();
|
||||
|
||||
#endif
|
||||
|
||||
// Set user action classes
|
||||
|
||||
runManager->SetUserAction(new F01PrimaryGeneratorAction(detector));
|
||||
|
||||
F01RunAction* runAction = new F01RunAction;
|
||||
|
||||
runManager->SetUserAction(runAction);
|
||||
|
||||
F01EventAction* eventAction = new F01EventAction(runAction);
|
||||
|
||||
runManager->SetUserAction(eventAction);
|
||||
|
||||
F01SteppingAction* steppingAction = new F01SteppingAction();
|
||||
runManager->SetUserAction(steppingAction);
|
||||
|
||||
// Initialize G4 kernel, physics tables ...
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc==1) // Define UI terminal for interactive mode
|
||||
{
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete field;
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Macro file for the initialization phase of field01
|
||||
#
|
||||
# It creates the default geometry (simple absorber cylinder )
|
||||
#
|
||||
/tracking/verbose 1
|
||||
/run/verbose 1
|
||||
#
|
||||
#
|
||||
#
|
||||
/field/setStepperType 4
|
||||
#
|
||||
#/field/setMinStep 10 mm
|
||||
#
|
||||
/field/setMinStep 1 mm
|
||||
#
|
||||
/field/update
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/run/particle/dumpCutValues
|
||||
#
|
||||
/gun/particle e-
|
||||
#
|
||||
#/gun/particle proton
|
||||
#
|
||||
#/gun/particle chargedgeantino
|
||||
#
|
||||
/gun/energy 500.0 MeV
|
||||
#
|
||||
#/event/printModulo 1
|
||||
/run/beamOn 100
|
||||
#
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01CalorHit.hh,v 1.2 2001/07/11 09:57:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01CalorHit_h
|
||||
#define F01CalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01CalorHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
F01CalorHit();
|
||||
~F01CalorHit();
|
||||
F01CalorHit(const F01CalorHit&);
|
||||
const F01CalorHit& operator=(const F01CalorHit&);
|
||||
int operator==(const F01CalorHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
void Print();
|
||||
|
||||
public:
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
|
||||
|
||||
G4double GetEdepAbs() { return EdepAbs; };
|
||||
G4double GetTrakAbs() { return TrackLengthAbs; };
|
||||
G4double GetEdepGap() { return EdepGap; };
|
||||
G4double GetTrakGap() { return TrackLengthGap; };
|
||||
|
||||
private:
|
||||
|
||||
G4double EdepAbs, TrackLengthAbs;
|
||||
G4double EdepGap, TrackLengthGap;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
typedef G4THitsCollection<F01CalorHit> F01CalorHitsCollection;
|
||||
|
||||
extern G4Allocator<F01CalorHit> F01CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void* F01CalorHit::operator new(size_t)
|
||||
{
|
||||
void* aHit;
|
||||
aHit = (void*) F01CalorHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F01CalorHit::operator delete(void* aHit)
|
||||
{
|
||||
F01CalorHitAllocator.FreeSingle((F01CalorHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01CalorimeterSD.hh,v 1.3 2001/10/15 17:20:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01CalorimeterSD_h
|
||||
#define F01CalorimeterSD_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "F01CalorHit.hh"
|
||||
|
||||
class F01DetectorConstruction;
|
||||
class G4HCofThisEvent;
|
||||
class G4Step;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
F01CalorimeterSD(G4String, F01DetectorConstruction* );
|
||||
~F01CalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void clear();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
|
||||
F01CalorHitsCollection* CalCollection;
|
||||
F01DetectorConstruction* Detector;
|
||||
G4int* HitID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01DetectorConstruction.hh,v 1.5 2001/10/25 08:10:20 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef F01DetectorConstruction_h
|
||||
#define F01DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4Box;
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4UniformMagField;
|
||||
class F01DetectorMessenger;
|
||||
class F01CalorimeterSD;
|
||||
class F01ElectroMagneticField;
|
||||
|
||||
|
||||
class F01DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
F01DetectorConstruction();
|
||||
~F01DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
void SetAbsorberMaterial (G4String);
|
||||
void SetAbsorberThickness(G4double);
|
||||
void SetAbsorberRadius(G4double);
|
||||
|
||||
void SetAbsorberZpos(G4double);
|
||||
|
||||
void SetWorldMaterial(G4String);
|
||||
void SetWorldSizeZ(G4double);
|
||||
void SetWorldSizeR(G4double);
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
void UpdateGeometry();
|
||||
|
||||
public:
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4Material* GetWorldMaterial() {return WorldMaterial;};
|
||||
G4double GetWorldSizeZ() {return WorldSizeZ;};
|
||||
G4double GetWorldSizeR() {return WorldSizeR;};
|
||||
|
||||
G4double GetAbsorberZpos() {return zAbsorber;};
|
||||
G4double GetzstartAbs() {return zstartAbs;};
|
||||
G4double GetzendAbs() {return zendAbs;};
|
||||
|
||||
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
|
||||
G4double GetAbsorberThickness() {return AbsorberThickness;};
|
||||
G4double GetAbsorberRadius() {return AbsorberRadius;};
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
|
||||
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
|
||||
G4LogicalVolume* GetLogicalAbsorber() {return logicAbsorber;};
|
||||
|
||||
private:
|
||||
|
||||
G4Tubs* solidWorld; // pointer to the solid World
|
||||
G4LogicalVolume* logicWorld; // pointer to the logical World
|
||||
G4VPhysicalVolume* physiWorld; // pointer to the physical World
|
||||
|
||||
G4Tubs* solidAbsorber; // pointer to the solid Absorber
|
||||
G4LogicalVolume* logicAbsorber; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* physiAbsorber; // pointer to the physical Absorber
|
||||
|
||||
G4UniformMagField* magField; // pointer to the magnetic field
|
||||
F01ElectroMagneticField* fEmField;
|
||||
F01DetectorMessenger* detectorMessenger; // pointer to the Messenger
|
||||
F01CalorimeterSD* calorimeterSD; // pointer to the sensitive detector
|
||||
|
||||
G4Material* AbsorberMaterial;
|
||||
G4double AbsorberThickness;
|
||||
G4double AbsorberRadius;
|
||||
G4bool worldchanged;
|
||||
|
||||
G4double zAbsorber ;
|
||||
G4double zstartAbs , zendAbs ;
|
||||
|
||||
G4Material* WorldMaterial;
|
||||
G4double WorldSizeR;
|
||||
G4double WorldSizeZ;
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F01DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
|
||||
zstartAbs = zAbsorber-0.5*AbsorberThickness;
|
||||
zendAbs = zAbsorber+0.5*AbsorberThickness;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01DetectorMessenger.hh,v 1.3 2001/10/25 08:10:20 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01DetectorMessenger_h
|
||||
#define F01DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F01DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F01DetectorMessenger(F01DetectorConstruction* );
|
||||
~F01DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F01DetectorConstruction* F01Detector;
|
||||
|
||||
G4UIdirectory* F01detDir;
|
||||
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsRadCmd;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* AbsZposCmd;
|
||||
|
||||
G4UIcmdWithAString* WorldMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldZCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldRCmd;
|
||||
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01ElectroMagneticField.hh,v 1.4 2001/07/11 09:57:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// A class for control of the Magnetic Field of the detector.
|
||||
// The field is assumed to be uniform.
|
||||
//
|
||||
// $ Id: $
|
||||
|
||||
// Should this be a:
|
||||
// i) messenger
|
||||
// ii) user class that creates the field ?
|
||||
// iii) simply a derived class of Uniform field ? <== I have chosen this now.
|
||||
// iv) a field manager that creates/updates field (Prefered?)
|
||||
//
|
||||
|
||||
|
||||
#ifndef F01ElectroMagneticField_H
|
||||
#define F01ElectroMagneticField_H
|
||||
|
||||
#include "G4MagneticField.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
|
||||
class G4FieldManager;
|
||||
class G4ChordFinder;
|
||||
class G4Mag_UsualEqRhs;
|
||||
class G4MagIntegratorStepper;
|
||||
class F01FieldMessenger;
|
||||
|
||||
class F01ElectroMagneticField: public G4MagneticField
|
||||
{
|
||||
public:
|
||||
F01ElectroMagneticField(G4ThreeVector) ; // The value of the field
|
||||
F01ElectroMagneticField() ; // A zero field
|
||||
|
||||
~F01ElectroMagneticField() ;
|
||||
|
||||
void GetFieldValue( const G4double Point[3],
|
||||
G4double *Bfield ) const {;} ;
|
||||
|
||||
void SetStepperType( G4int i) { fStepperType = i ; } ;
|
||||
|
||||
void SetStepper();
|
||||
|
||||
void SetMinStep(G4double s) { fMinStep = s ; } ;
|
||||
|
||||
void UpdateField();
|
||||
|
||||
void SetFieldValue(G4ThreeVector fieldVector) ;
|
||||
void SetFieldValue(G4double fieldValue) ;
|
||||
G4ThreeVector GetConstantFieldValue();
|
||||
|
||||
protected:
|
||||
|
||||
// Find the global Field Manager
|
||||
|
||||
G4FieldManager* GetGlobalFieldManager() ; // static
|
||||
|
||||
G4FieldManager* fFieldManager ;
|
||||
G4ChordFinder* fChordFinder ;
|
||||
G4Mag_UsualEqRhs* fEquation ;
|
||||
G4MagneticField* fMagneticField ;
|
||||
|
||||
G4MagIntegratorStepper* fStepper ;
|
||||
G4int fStepperType ;
|
||||
|
||||
G4double fMinStep ;
|
||||
|
||||
F01FieldMessenger* fFieldMessenger;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01EventAction.hh,v 1.4 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01EventAction_h
|
||||
#define F01EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F01RunAction;
|
||||
class F01EventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
F01EventAction(F01RunAction* F01RA);
|
||||
~F01EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
|
||||
G4int GetEventno();
|
||||
void setEventVerbose(G4int level);
|
||||
|
||||
void SetDrawFlag(G4String val) {drawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {printModulo = val;};
|
||||
|
||||
private:
|
||||
G4int calorimeterCollID;
|
||||
F01EventActionMessenger* eventMessenger;
|
||||
F01RunAction* runaction;
|
||||
G4int verboselevel;
|
||||
|
||||
G4String drawFlag;
|
||||
G4int printModulo;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01EventActionMessenger.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01EventActionMessenger_h
|
||||
#define F01EventActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F01EventAction;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01EventActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F01EventActionMessenger(F01EventAction*);
|
||||
~F01EventActionMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F01EventAction* eventAction;
|
||||
G4UIcmdWithAnInteger* setVerboseCmd;
|
||||
G4UIcmdWithAString* DrawCmd;
|
||||
G4UIcmdWithAnInteger* PrintCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01FieldMessenger.hh,v 1.5 2001/10/15 17:20:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01FieldMessenger_h
|
||||
#define F01FieldMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F01ElectroMagneticField;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
|
||||
class F01FieldMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F01FieldMessenger(F01ElectroMagneticField* );
|
||||
~F01FieldMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
void SetNewValue(G4UIcommand*, G4int);
|
||||
|
||||
private:
|
||||
|
||||
F01ElectroMagneticField* fEMfield;
|
||||
|
||||
G4UIdirectory* F01detDir;
|
||||
|
||||
G4UIcmdWithAnInteger* StepperCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MinStepCmd;
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,133 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PhysicsList.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#ifndef F01PhysicsList_h
|
||||
#define F01PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4PhotoElectricEffect;
|
||||
class G4ComptonScattering;
|
||||
class G4GammaConversion;
|
||||
|
||||
class G4MultipleScattering;
|
||||
|
||||
class G4PAIonisation ;
|
||||
class G4ForwardXrayTR ;
|
||||
class G4eIonisation;
|
||||
class G4eBremsstrahlung;
|
||||
class G4eplusAnnihilation;
|
||||
|
||||
class G4MuIonisation;
|
||||
class G4MuBremsstrahlung;
|
||||
class G4MuPairProduction;
|
||||
|
||||
class G4hIonisation;
|
||||
class G4hIonisationPlus;
|
||||
|
||||
class F01StepCut;
|
||||
|
||||
class F01DetectorConstruction;
|
||||
class F01PhysicsListMessenger;
|
||||
|
||||
|
||||
class F01PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
F01PhysicsList( F01DetectorConstruction*);
|
||||
~F01PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBarions();
|
||||
|
||||
protected:
|
||||
|
||||
// these methods Construct physics processes and register them
|
||||
|
||||
void AddParameterisation();
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
|
||||
public:
|
||||
|
||||
void SetGammaCut(G4double);
|
||||
void SetElectronCut(G4double);
|
||||
void SetProtonCut(G4double);
|
||||
void SetCutsByEnergy(G4double);
|
||||
void GetRange(G4double);
|
||||
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
public:
|
||||
|
||||
G4double MaxChargedStep;
|
||||
|
||||
private:
|
||||
|
||||
G4PhotoElectricEffect* thePhotoElectricEffect;
|
||||
G4ComptonScattering* theComptonScattering;
|
||||
G4GammaConversion* theGammaConversion;
|
||||
|
||||
G4MultipleScattering* theeminusMultipleScattering;
|
||||
G4eIonisation* theeminusIonisation;
|
||||
G4eBremsstrahlung* theeminusBremsstrahlung;
|
||||
|
||||
G4PAIonisation* fPAIonisation ;
|
||||
G4ForwardXrayTR* fForwardXrayTR ;
|
||||
|
||||
G4MultipleScattering* theeplusMultipleScattering;
|
||||
G4eIonisation* theeplusIonisation;
|
||||
G4eBremsstrahlung* theeplusBremsstrahlung;
|
||||
G4eplusAnnihilation* theeplusAnnihilation;
|
||||
|
||||
F01StepCut* theeminusStepCut ;
|
||||
F01StepCut* theeplusStepCut ;
|
||||
|
||||
G4double cutForGamma;
|
||||
G4double cutForElectron;
|
||||
G4double cutForProton;
|
||||
|
||||
F01DetectorConstruction* pDet;
|
||||
F01PhysicsListMessenger* physicsListMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PhysicsListMessenger.hh,v 1.3 2001/10/15 17:20:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01PhysicsListMessenger_h
|
||||
#define F01PhysicsListMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F01PhysicsList;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithADouble;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01PhysicsListMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F01PhysicsListMessenger(F01PhysicsList*);
|
||||
~F01PhysicsListMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F01PhysicsList* F01List;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* setMaxStepCmd;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* cutGCmd;
|
||||
G4UIcmdWithADoubleAndUnit* cutECmd;
|
||||
G4UIcmdWithADoubleAndUnit* cutPCmd;
|
||||
G4UIcmdWithADoubleAndUnit* rCmd;
|
||||
G4UIcmdWithADoubleAndUnit* eCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PrimaryGeneratorAction.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01PrimaryGeneratorAction_h
|
||||
#define F01PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class F01DetectorConstruction;
|
||||
class F01PrimaryGeneratorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
F01PrimaryGeneratorAction(F01DetectorConstruction*);
|
||||
~F01PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event*);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
void Setxvertex(G4double x) ;
|
||||
void Setyvertex(G4double y) ;
|
||||
void Setzvertex(G4double z) ;
|
||||
|
||||
static G4String GetPrimaryName() ;
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun; //pointer a to G4 service class
|
||||
F01DetectorConstruction* F01Detector; //pointer to the geometry
|
||||
|
||||
F01PrimaryGeneratorMessenger* gunMessenger; //messenger of this class
|
||||
G4String rndmFlag; //flag for a random impact point
|
||||
|
||||
static G4String thePrimaryParticleName ;
|
||||
G4double xvertex,yvertex,zvertex;
|
||||
G4bool vertexdefined ;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PrimaryGeneratorMessenger.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01PrimaryGeneratorMessenger_h
|
||||
#define F01PrimaryGeneratorMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F01PrimaryGeneratorAction;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F01PrimaryGeneratorMessenger(F01PrimaryGeneratorAction*);
|
||||
~F01PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F01PrimaryGeneratorAction* F01Action;
|
||||
G4UIcmdWithAString* RndmCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setxvertexCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setyvertexCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setzvertexCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01RunAction.hh,v 1.4 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01RunAction_h
|
||||
#define F01RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
#include "g4std/iostream"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01RunMessenger;
|
||||
class G4Run;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
F01RunAction();
|
||||
~F01RunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
void SetRndmFreq(G4int val) {saveRndm = val;}
|
||||
G4int GetRndmFreq() {return saveRndm;}
|
||||
|
||||
private:
|
||||
|
||||
F01RunMessenger* runMessenger;
|
||||
G4int saveRndm;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
//
|
||||
// $Id: F01RunMessenger.hh,v 1.3 2001/10/15 17:20:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01RunMessenger_h
|
||||
#define F01RunMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01RunAction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01RunMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
F01RunMessenger(F01RunAction* );
|
||||
~F01RunMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
F01RunAction* runAction;
|
||||
|
||||
G4UIdirectory* RndmDir;
|
||||
G4UIcmdWithAnInteger* RndmSaveCmd;
|
||||
G4UIcmdWithAString* RndmReadCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01StepCut.hh,v 1.3 2001/10/15 17:20:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef F01StepCut_h
|
||||
#define F01StepCut_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class F01StepCut : public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
F01StepCut(const G4String& processName ="UserStepCut" );
|
||||
F01StepCut(F01StepCut &);
|
||||
|
||||
~F01StepCut();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
protected:
|
||||
|
||||
// it is not needed here !
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator as private
|
||||
F01StepCut & operator=(const F01StepCut &right);
|
||||
|
||||
private:
|
||||
|
||||
G4double MaxChargedStep ;
|
||||
};
|
||||
|
||||
// inlined function members implementation
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
inline G4double F01StepCut::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
G4double ProposedStep = DBL_MAX;
|
||||
|
||||
if((MaxChargedStep > 0.) &&
|
||||
(aTrack.GetVolume() != 0) &&
|
||||
(aTrack.GetVolume()->GetName() == "Absorber") &&
|
||||
(aTrack.GetDynamicParticle()->GetDefinition()->GetPDGCharge() != 0.))
|
||||
ProposedStep = MaxChargedStep ;
|
||||
|
||||
return ProposedStep;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* F01StepCut::PostStepDoIt(
|
||||
const G4Track& aTrack,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// do nothing
|
||||
aParticleChange.Initialize(aTrack);
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
inline G4double F01StepCut::GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingAction.hh,v 1.3 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01SteppingAction_h
|
||||
#define F01SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F01SteppingMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
F01SteppingAction();
|
||||
~F01SteppingAction();
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
|
||||
F01SteppingMessenger* steppingMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingMessenger.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01SteppingMessenger_h
|
||||
#define F01SteppingMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01SteppingAction;
|
||||
class G4UIdirectory;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01SteppingMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
F01SteppingMessenger(F01SteppingAction* );
|
||||
~F01SteppingMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
F01SteppingAction* steppingAction;
|
||||
|
||||
G4UIdirectory* steppingDir;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingVerbose.hh,v 1.3 2001/10/15 17:20:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// F01SteppingVerbose.hh
|
||||
//
|
||||
// Description:
|
||||
// This class manages the vervose outputs in G4SteppingManager.
|
||||
//
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef F01SteppingVerbose_h
|
||||
#define F01SteppingVerbose_h 1
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
class F01SteppingVerbose : public G4SteppingVerbose
|
||||
{
|
||||
public:
|
||||
|
||||
F01SteppingVerbose();
|
||||
~F01SteppingVerbose();
|
||||
// Constructor/Destructor
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01VisManager.hh,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// Example Visualization Manager implementing virtual function
|
||||
// RegisterGraphicsSystems. Exploits C-pre-processor variables
|
||||
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
|
||||
// environment variables of the same name are set.
|
||||
|
||||
// So all you have to do is set environment variables and compile and
|
||||
// instantiate this in your main().
|
||||
|
||||
// Alternatively, you can implement an empty function here and just
|
||||
// register the systems you want in your main(), e.g.:
|
||||
// G4VisManager* myVisManager = new MyVisManager;
|
||||
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F01VisManager_h
|
||||
#define F01VisManager_h 1
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F01VisManager: public G4VisManager
|
||||
{
|
||||
public:
|
||||
|
||||
F01VisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01CalorHit.cc,v 1.2 2001/07/11 09:57:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01CalorHit.hh"
|
||||
|
||||
G4Allocator<F01CalorHit> F01CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01CalorHit::F01CalorHit()
|
||||
{
|
||||
EdepAbs = 0.; TrackLengthAbs = 0.;
|
||||
EdepGap = 0.; TrackLengthGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01CalorHit::~F01CalorHit()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01CalorHit::F01CalorHit(const F01CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const F01CalorHit& F01CalorHit::operator=(const F01CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
int F01CalorHit::operator==(const F01CalorHit& right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01CalorHit::Print()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01CalorimeterSD.cc,v 1.4 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01CalorimeterSD.hh"
|
||||
|
||||
#include "F01CalorHit.hh"
|
||||
#include "F01DetectorConstruction.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01CalorimeterSD::F01CalorimeterSD(G4String name,
|
||||
F01DetectorConstruction* det)
|
||||
:G4VSensitiveDetector(name),Detector(det)
|
||||
{
|
||||
collectionName.insert("CalCollection");
|
||||
HitID = new G4int[500];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01CalorimeterSD::~F01CalorimeterSD()
|
||||
{
|
||||
delete [] HitID;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
|
||||
{
|
||||
CalCollection = new F01CalorHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
for (G4int j=0;j<1; j++) {HitID[j] = -1;};
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool F01CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
G4double stepl = 0.;
|
||||
|
||||
stepl = aStep->GetStepLength();
|
||||
|
||||
if ((edep == 0.) && (stepl == 0.) ) return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
|
||||
G4int F01Number = 0 ;
|
||||
if (HitID[F01Number]==-1)
|
||||
{
|
||||
F01CalorHit* calHit = new F01CalorHit();
|
||||
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
|
||||
HitID[F01Number] = CalCollection->insert(calHit) - 1;
|
||||
if (verboseLevel>0)
|
||||
G4cout << " New Calorimeter Hit on F01: " << F01Number << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (physVol == Detector->GetAbsorber())
|
||||
(*CalCollection)[HitID[F01Number]]->AddAbs(edep,stepl);
|
||||
if (verboseLevel>0)
|
||||
G4cout << " Energy added to F01: " << F01Number << G4endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
|
||||
{
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0)
|
||||
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
|
||||
HCE->AddHitsCollection(HCID,CalCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01CalorimeterSD::clear()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
void F01CalorimeterSD::PrintAll()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,414 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01DetectorConstruction.cc,v 1.8 2001/10/26 13:42:44 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "F01DetectorConstruction.hh"
|
||||
#include "F01DetectorMessenger.hh"
|
||||
|
||||
#include "F01CalorimeterSD.hh"
|
||||
#include "F01ElectroMagneticField.hh"
|
||||
|
||||
#include "G4VClusterModel.hh"
|
||||
#include "G4PAIclusterModel.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F01DetectorConstruction::F01DetectorConstruction()
|
||||
: solidWorld(0), logicWorld(0), physiWorld(0),
|
||||
solidAbsorber(0),logicAbsorber(0), physiAbsorber(0),
|
||||
magField(0), fEmField(0), calorimeterSD(0),
|
||||
AbsorberMaterial(0), worldchanged(false), WorldMaterial(0)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
|
||||
WorldSizeZ = 44000.*mm;
|
||||
WorldSizeR = 22000.*mm;
|
||||
|
||||
AbsorberThickness = 1.0*mm;
|
||||
|
||||
AbsorberRadius = 20000.*mm;
|
||||
|
||||
zAbsorber = 21990.0*mm ;
|
||||
|
||||
// create commands for interactive definition of the calorimeter
|
||||
|
||||
detectorMessenger = new F01DetectorMessenger(this);
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F01DetectorConstruction::~F01DetectorConstruction()
|
||||
{
|
||||
delete detectorMessenger;
|
||||
if (fEmField) delete fEmField ;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* F01DetectorConstruction::Construct()
|
||||
{
|
||||
DefineMaterials();
|
||||
return ConstructCalorimeter();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
//This function illustrates the possible ways to define materials
|
||||
|
||||
G4String name, symbol ; // a=mass of a mole;
|
||||
G4double a, z, density ; // z=mean number of protons;
|
||||
G4int nel ;
|
||||
G4int ncomponents;
|
||||
G4double fractionmass, pressure, temperature;
|
||||
|
||||
//
|
||||
// define Elements
|
||||
//
|
||||
|
||||
a = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
||||
|
||||
a = 6.01*g/mole;
|
||||
G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
||||
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
||||
|
||||
a = 39.948*g/mole;
|
||||
G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
|
||||
|
||||
//
|
||||
// define simple materials
|
||||
//
|
||||
|
||||
// Mylar
|
||||
|
||||
density = 1.39*g/cm3;
|
||||
G4Material* Mylar = new G4Material(name="Mylar", density, nel=3);
|
||||
Mylar->AddElement(elO,2);
|
||||
Mylar->AddElement(elC,5);
|
||||
Mylar->AddElement(elH,4);
|
||||
|
||||
// Polypropelene
|
||||
|
||||
G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
|
||||
CH2->AddElement(elH,2);
|
||||
CH2->AddElement(elC,1);
|
||||
|
||||
// Krypton as detector gas, STP
|
||||
|
||||
density = 3.700*mg/cm3 ;
|
||||
a = 83.80*g/mole ;
|
||||
G4Material* Kr = new G4Material(name="Kr",z=36., a, density );
|
||||
|
||||
// Dry air (average composition)
|
||||
|
||||
density = 1.7836*mg/cm3 ; // STP
|
||||
G4Material* Argon = new G4Material(name="Argon" , density, ncomponents=1);
|
||||
Argon->AddElement(elAr, 1);
|
||||
|
||||
density = 1.25053*mg/cm3 ; // STP
|
||||
G4Material* Nitrogen = new G4Material(name="N2" , density, ncomponents=1);
|
||||
Nitrogen->AddElement(elN, 2);
|
||||
|
||||
density = 1.4289*mg/cm3 ; // STP
|
||||
G4Material* Oxygen = new G4Material(name="O2" , density, ncomponents=1);
|
||||
Oxygen->AddElement(elO, 2);
|
||||
|
||||
density = 1.2928*mg/cm3 ; // STP
|
||||
density *= 1.0e-8 ; // pumped vacuum
|
||||
|
||||
temperature = STP_Temperature;
|
||||
pressure = 1.0e-8*STP_Pressure;
|
||||
|
||||
G4Material* Air = new G4Material(name="Air" , density, ncomponents=3,
|
||||
kStateGas,temperature,pressure);
|
||||
Air->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
|
||||
Air->AddMaterial( Oxygen, fractionmass = 0.2315 ) ;
|
||||
Air->AddMaterial( Argon, fractionmass = 0.0128 ) ;
|
||||
|
||||
// Xenon as detector gas, STP
|
||||
|
||||
density = 5.858*mg/cm3 ;
|
||||
a = 131.29*g/mole ;
|
||||
G4Material* Xe = new G4Material(name="Xenon",z=54., a, density );
|
||||
|
||||
// Carbon dioxide, STP
|
||||
|
||||
density = 1.977*mg/cm3;
|
||||
G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
|
||||
CarbonDioxide->AddElement(elC,1);
|
||||
CarbonDioxide->AddElement(elO,2);
|
||||
|
||||
// 80% Xe + 20% CO2, STP
|
||||
|
||||
density = 5.0818*mg/cm3 ;
|
||||
G4Material* Xe20CO2 = new G4Material(name="Xe20CO2", density, ncomponents=2);
|
||||
Xe20CO2->AddMaterial( Xe, fractionmass = 0.922 ) ;
|
||||
Xe20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.078 ) ;
|
||||
|
||||
// 80% Kr + 20% CO2, STP
|
||||
|
||||
density = 3.601*mg/cm3 ;
|
||||
G4Material* Kr20CO2 = new G4Material(name="Kr20CO2", density, ncomponents=2);
|
||||
Kr20CO2->AddMaterial( Kr, fractionmass = 0.89 ) ;
|
||||
Kr20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.11 ) ;
|
||||
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
// default materials of the calorimeter
|
||||
|
||||
AbsorberMaterial = Air ; // Kr20CO2 ; // XeCO2CF4 ;
|
||||
|
||||
WorldMaterial = Air ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* F01DetectorConstruction::ConstructCalorimeter()
|
||||
{
|
||||
// complete the Calor parameters definition and Print
|
||||
|
||||
ComputeCalorParameters();
|
||||
PrintCalorParameters();
|
||||
|
||||
// World
|
||||
|
||||
if(solidWorld) delete solidWorld ;
|
||||
if(logicWorld) delete logicWorld ;
|
||||
if(physiWorld) delete physiWorld ;
|
||||
|
||||
solidWorld = new G4Tubs("World", // its name
|
||||
0.,WorldSizeR,WorldSizeZ/2.,0.,twopi); // its size
|
||||
|
||||
logicWorld = new G4LogicalVolume(solidWorld, // its solid
|
||||
WorldMaterial, // its material
|
||||
"World"); // its name
|
||||
|
||||
physiWorld = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
"World", // its name
|
||||
logicWorld, // its logical volume
|
||||
0, // its mother volume
|
||||
false, // no boolean operation
|
||||
0); // copy number
|
||||
|
||||
// Absorber
|
||||
|
||||
if (AbsorberThickness > 0.)
|
||||
{
|
||||
if(solidAbsorber) delete solidAbsorber ;
|
||||
if(logicAbsorber) delete logicAbsorber ;
|
||||
if(physiAbsorber) delete physiAbsorber ;
|
||||
|
||||
solidAbsorber = new G4Tubs("Absorber", 1.0*mm,
|
||||
AbsorberRadius,
|
||||
AbsorberThickness/2.,
|
||||
0.0,twopi);
|
||||
|
||||
logicAbsorber = new G4LogicalVolume(solidAbsorber,
|
||||
AbsorberMaterial,
|
||||
"Absorber");
|
||||
|
||||
physiAbsorber = new G4PVPlacement(0,
|
||||
G4ThreeVector(0.,0.,zAbsorber),
|
||||
"Absorber",
|
||||
logicAbsorber,
|
||||
physiWorld,
|
||||
false,
|
||||
0);
|
||||
|
||||
}
|
||||
|
||||
// Sensitive Detectors: Absorber
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
if(!calorimeterSD)
|
||||
{
|
||||
calorimeterSD = new F01CalorimeterSD("CalorSD",this);
|
||||
SDman->AddNewDetector( calorimeterSD );
|
||||
}
|
||||
if (logicAbsorber) logicAbsorber->SetSensitiveDetector(calorimeterSD);
|
||||
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n The WORLD is made of "
|
||||
<< WorldSizeZ/mm << "mm of " << WorldMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) of the world is " << WorldSizeR/mm << " mm. " << G4endl;
|
||||
G4cout << " The ABSORBER is made of "
|
||||
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) is " << AbsorberRadius/mm << " mm. " << G4endl;
|
||||
G4cout << " Z position of the (middle of the) absorber " << zAbsorber/mm << " mm." << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)[J];
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{
|
||||
AbsorberMaterial = pttoMaterial;
|
||||
logicAbsorber->SetMaterial(pttoMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetWorldMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)[J];
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{
|
||||
WorldMaterial = pttoMaterial;
|
||||
logicWorld->SetMaterial(pttoMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetAbsorberThickness(G4double val)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
AbsorberThickness = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetAbsorberRadius(G4double val)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
AbsorberRadius = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetWorldSizeZ(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeZ = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetWorldSizeR(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeR = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::SetAbsorberZpos(G4double val)
|
||||
{
|
||||
zAbsorber = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,148 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01DetectorMessenger.cc,v 1.3 2001/10/25 08:10:20 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01DetectorMessenger.hh"
|
||||
|
||||
#include "F01DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01DetectorMessenger::F01DetectorMessenger(F01DetectorConstruction * F01Det)
|
||||
:F01Detector(F01Det)
|
||||
{
|
||||
F01detDir = new G4UIdirectory("/calor/");
|
||||
F01detDir->SetGuidance("F01 detector control.");
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Lead");
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
|
||||
WorldMaterCmd->SetGuidance("Select Material of the World.");
|
||||
WorldMaterCmd->SetParameterName("wchoice",true);
|
||||
WorldMaterCmd->SetDefaultValue("Air");
|
||||
WorldMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
AbsThickCmd->SetParameterName("SizeZ",false,false);
|
||||
AbsThickCmd->SetDefaultUnit("mm");
|
||||
AbsThickCmd->SetRange("SizeZ>0.");
|
||||
AbsThickCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
|
||||
AbsRadCmd->SetGuidance("Set radius of the Absorber");
|
||||
AbsRadCmd->SetParameterName("SizeR",false,false);
|
||||
AbsRadCmd->SetDefaultUnit("mm");
|
||||
AbsRadCmd->SetRange("SizeR>0.");
|
||||
AbsRadCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
|
||||
AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
|
||||
AbsZposCmd->SetParameterName("Zpos",false,false);
|
||||
AbsZposCmd->SetDefaultUnit("mm");
|
||||
AbsZposCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
|
||||
WorldZCmd->SetGuidance("Set Z size of the World");
|
||||
WorldZCmd->SetParameterName("WSizeZ",false,false);
|
||||
WorldZCmd->SetDefaultUnit("mm");
|
||||
WorldZCmd->SetRange("WSizeZ>0.");
|
||||
WorldZCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
|
||||
WorldRCmd->SetGuidance("Set R size of the World");
|
||||
WorldRCmd->SetParameterName("WSizeR",false,false);
|
||||
WorldRCmd->SetDefaultUnit("mm");
|
||||
WorldRCmd->SetRange("WSizeR>0.");
|
||||
WorldRCmd->AvailableForStates(Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01DetectorMessenger::~F01DetectorMessenger()
|
||||
{
|
||||
delete AbsMaterCmd;
|
||||
delete AbsThickCmd;
|
||||
delete AbsRadCmd;
|
||||
delete AbsZposCmd;
|
||||
delete WorldMaterCmd;
|
||||
delete WorldZCmd;
|
||||
delete WorldRCmd;
|
||||
delete UpdateCmd;
|
||||
delete F01detDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == AbsMaterCmd )
|
||||
{ F01Detector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == WorldMaterCmd )
|
||||
{ F01Detector->SetWorldMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ F01Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsRadCmd )
|
||||
{ F01Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsZposCmd )
|
||||
{ F01Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldZCmd )
|
||||
{ F01Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldRCmd )
|
||||
{ F01Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ F01Detector->UpdateGeometry(); }
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,226 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01ElectroMagneticField.cc,v 1.8 2001/10/15 17:20:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// User Field class implementation.
|
||||
//
|
||||
|
||||
|
||||
#include "F01ElectroMagneticField.hh"
|
||||
#include "F01FieldMessenger.hh"
|
||||
|
||||
#include "G4UniformMagField.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4Mag_UsualEqRhs.hh"
|
||||
#include "G4MagIntegratorStepper.hh"
|
||||
#include "G4ChordFinder.hh"
|
||||
|
||||
#include "G4ExplicitEuler.hh"
|
||||
#include "G4ImplicitEuler.hh"
|
||||
#include "G4SimpleRunge.hh"
|
||||
#include "G4SimpleHeum.hh"
|
||||
#include "G4ClassicalRK4.hh"
|
||||
#include "G4HelixExplicitEuler.hh"
|
||||
#include "G4HelixImplicitEuler.hh"
|
||||
#include "G4HelixSimpleRunge.hh"
|
||||
#include "G4CashKarpRKF45.hh"
|
||||
#include "G4RKG3_Stepper.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructors:
|
||||
|
||||
F01ElectroMagneticField::F01ElectroMagneticField()
|
||||
: fChordFinder(0), fStepper(0)
|
||||
{
|
||||
fMagneticField = new G4UniformMagField(
|
||||
G4ThreeVector(3.3*tesla,
|
||||
0.0, // 0.5*tesla,
|
||||
0.0 ));
|
||||
|
||||
fFieldMessenger = new F01FieldMessenger(this) ;
|
||||
|
||||
fEquation = new G4Mag_UsualEqRhs(fMagneticField);
|
||||
|
||||
fMinStep = 1.0*mm ; // minimal step of 1 mm is default
|
||||
|
||||
fStepperType = 4 ; // ClassicalRK4 is default stepper
|
||||
|
||||
fFieldManager = G4TransportationManager::GetTransportationManager()
|
||||
->GetFieldManager();
|
||||
|
||||
UpdateField();
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01ElectroMagneticField::F01ElectroMagneticField(G4ThreeVector fieldVector)
|
||||
{
|
||||
fMagneticField = new G4UniformMagField(fieldVector);
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01ElectroMagneticField::~F01ElectroMagneticField()
|
||||
{
|
||||
// GetGlobalFieldManager()->SetDetectorField(0);
|
||||
|
||||
if(fMagneticField) delete fMagneticField;
|
||||
if(fChordFinder) delete fChordFinder;
|
||||
if(fStepper) delete fStepper;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Update field
|
||||
//
|
||||
|
||||
void F01ElectroMagneticField::UpdateField()
|
||||
{
|
||||
SetStepper();
|
||||
G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl ;
|
||||
|
||||
fFieldManager->SetDetectorField(fMagneticField );
|
||||
|
||||
if(fChordFinder) delete fChordFinder;
|
||||
|
||||
fChordFinder = new G4ChordFinder( fMagneticField, fMinStep,fStepper);
|
||||
|
||||
fFieldManager->SetChordFinder( fChordFinder );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set stepper according to the stepper type
|
||||
//
|
||||
|
||||
void F01ElectroMagneticField::SetStepper()
|
||||
{
|
||||
if(fStepper) delete fStepper;
|
||||
|
||||
switch ( fStepperType )
|
||||
{
|
||||
case 0:
|
||||
fStepper = new G4ExplicitEuler( fEquation );
|
||||
G4cout<<"G4ExplicitEuler is calledS"<<G4endl;
|
||||
break;
|
||||
case 1:
|
||||
fStepper = new G4ImplicitEuler( fEquation );
|
||||
G4cout<<"G4ImplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 2:
|
||||
fStepper = new G4SimpleRunge( fEquation );
|
||||
G4cout<<"G4SimpleRunge is called"<<G4endl;
|
||||
break;
|
||||
case 3:
|
||||
fStepper = new G4SimpleHeum( fEquation );
|
||||
G4cout<<"G4SimpleHeum is called"<<G4endl;
|
||||
break;
|
||||
case 4:
|
||||
fStepper = new G4ClassicalRK4( fEquation );
|
||||
G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
|
||||
break;
|
||||
case 5:
|
||||
fStepper = new G4HelixExplicitEuler( fEquation );
|
||||
G4cout<<"G4HelixExplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 6:
|
||||
fStepper = new G4HelixImplicitEuler( fEquation );
|
||||
G4cout<<"G4HelixImplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 7:
|
||||
fStepper = new G4HelixSimpleRunge( fEquation );
|
||||
G4cout<<"G4HelixSimpleRunge is called"<<G4endl;
|
||||
break;
|
||||
case 8:
|
||||
fStepper = new G4CashKarpRKF45( fEquation );
|
||||
G4cout<<"G4CashKarpRKF45 is called"<<G4endl;
|
||||
break;
|
||||
case 9:
|
||||
fStepper = new G4RKG3_Stepper( fEquation );
|
||||
G4cout<<"G4RKG3_Stepper is called"<<G4endl;
|
||||
break;
|
||||
default: fStepper = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set the value of the Global Field to fieldValue along Z
|
||||
//
|
||||
|
||||
void F01ElectroMagneticField::SetFieldValue(G4double fieldValue)
|
||||
{
|
||||
if(fMagneticField) delete fMagneticField;
|
||||
fMagneticField = new G4UniformMagField(G4ThreeVector(0,0,fieldValue));
|
||||
// UpdateField();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set the value of the Global Field
|
||||
//
|
||||
|
||||
void F01ElectroMagneticField::SetFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
// Find the Field Manager for the global field
|
||||
G4FieldManager* fieldMgr= GetGlobalFieldManager();
|
||||
|
||||
if(fieldVector != G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
if(fMagneticField) delete fMagneticField;
|
||||
fMagneticField = new G4UniformMagField(fieldVector);
|
||||
|
||||
// UpdateField();
|
||||
|
||||
fieldMgr->SetDetectorField(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the new field's value is Zero, then it is best to
|
||||
// insure that it is not used for propagation.
|
||||
|
||||
G4MagneticField* fMagneticField = 0;
|
||||
fieldMgr->SetDetectorField(fMagneticField);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Utility method
|
||||
|
||||
G4FieldManager* F01ElectroMagneticField::GetGlobalFieldManager()
|
||||
{
|
||||
return G4TransportationManager::GetTransportationManager()
|
||||
->GetFieldManager();
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01EventAction.cc,v 1.4 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01EventAction.hh"
|
||||
|
||||
#include "F01RunAction.hh"
|
||||
|
||||
#include "F01CalorHit.hh"
|
||||
#include "F01EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01EventAction::F01EventAction(F01RunAction* F01RA)
|
||||
: calorimeterCollID(-1), eventMessenger(0),
|
||||
runaction(F01RA), verboselevel(0),
|
||||
drawFlag("all"), printModulo(10000)
|
||||
{
|
||||
eventMessenger = new F01EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01EventAction::~F01EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
|
||||
|
||||
if(verboselevel>1)
|
||||
G4cout << "<<< Event " << evtNb << " started." << G4endl;
|
||||
|
||||
if (calorimeterCollID==-1)
|
||||
{
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
calorimeterCollID = SDman->GetCollectionID("CalCollection");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
|
||||
if (drawFlag == "all") trj->DrawTrajectory(50);
|
||||
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
|
||||
trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
|
||||
if(verboselevel>0)
|
||||
G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
|
||||
|
||||
|
||||
//save rndm status
|
||||
if (runaction->GetRndmFreq() == 2)
|
||||
{
|
||||
HepRandom::saveEngineStatus("endOfEvent.rndm");
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
{
|
||||
G4cout << "\n---> End of Event: " << evtNb << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4int F01EventAction::GetEventno()
|
||||
{
|
||||
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
|
||||
return evno ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01EventAction::setEventVerbose(G4int level)
|
||||
{
|
||||
verboselevel = level ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01EventActionMessenger.cc,v 1.2 2001/07/11 09:58:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01EventActionMessenger.hh"
|
||||
|
||||
#include "F01EventAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01EventActionMessenger::F01EventActionMessenger(F01EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
setVerboseCmd = new G4UIcmdWithAnInteger("/event/setverbose",this);
|
||||
setVerboseCmd->SetGuidance("Set verbose level ." );
|
||||
setVerboseCmd->SetParameterName("level",true);
|
||||
setVerboseCmd->SetDefaultValue(0);
|
||||
|
||||
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged all");
|
||||
DrawCmd->AvailableForStates(Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01EventActionMessenger::~F01EventActionMessenger()
|
||||
{
|
||||
delete setVerboseCmd;
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if(command == setVerboseCmd)
|
||||
{eventAction->setEventVerbose(setVerboseCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01FieldMessenger.cc,v 1.5 2001/10/15 17:20:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "F01FieldMessenger.hh"
|
||||
|
||||
#include "F01ElectroMagneticField.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01FieldMessenger::F01FieldMessenger(F01ElectroMagneticField* pEMfield)
|
||||
:fEMfield(pEMfield)
|
||||
{
|
||||
F01detDir = new G4UIdirectory("/field/");
|
||||
F01detDir->SetGuidance("F01 field tracking control.");
|
||||
|
||||
StepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
|
||||
StepperCmd->SetGuidance("Select stepper type for magnetic field");
|
||||
StepperCmd->SetParameterName("choice",true);
|
||||
StepperCmd->SetDefaultValue(4);
|
||||
StepperCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
|
||||
MagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MagFieldCmd->SetParameterName("Bz",false,false);
|
||||
MagFieldCmd->SetDefaultUnit("tesla");
|
||||
MagFieldCmd->AvailableForStates(Idle);
|
||||
|
||||
MinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
|
||||
MinStepCmd->SetGuidance("Define minimal step");
|
||||
MinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MinStepCmd->SetParameterName("min step",false,false);
|
||||
MinStepCmd->SetDefaultUnit("mm");
|
||||
MinStepCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/field/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Xe");
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01FieldMessenger::~F01FieldMessenger()
|
||||
{
|
||||
delete StepperCmd;
|
||||
delete MagFieldCmd;
|
||||
delete MinStepCmd;
|
||||
delete F01detDir;
|
||||
delete UpdateCmd;
|
||||
|
||||
delete AbsMaterCmd;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01FieldMessenger::SetNewValue( G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == StepperCmd )
|
||||
{
|
||||
fEMfield->SetStepperType(StepperCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
if( command == UpdateCmd )
|
||||
{
|
||||
fEMfield->UpdateField();
|
||||
}
|
||||
if( command == MagFieldCmd )
|
||||
{
|
||||
fEMfield->SetFieldValue(MagFieldCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
if( command == MinStepCmd )
|
||||
{
|
||||
fEMfield->SetMinStep(MinStepCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,477 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PhysicsList.cc,v 1.5 2001/11/07 14:33:21 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "G4Timer.hh"
|
||||
|
||||
#include "F01PhysicsList.hh"
|
||||
#include "F01DetectorConstruction.hh"
|
||||
#include "F01PhysicsListMessenger.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
#include "G4FastSimulationManagerProcess.hh"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F01PhysicsList::F01PhysicsList(F01DetectorConstruction* p)
|
||||
: G4VUserPhysicsList(), MaxChargedStep(DBL_MAX),
|
||||
thePhotoElectricEffect(0), theComptonScattering(0), theGammaConversion(0),
|
||||
theeminusMultipleScattering(0), theeminusIonisation(0),
|
||||
theeminusBremsstrahlung(0),
|
||||
theeplusMultipleScattering(0),theeplusIonisation(0),
|
||||
theeplusBremsstrahlung(0), theeplusAnnihilation(0),
|
||||
theeminusStepCut(0),theeplusStepCut(0)
|
||||
{
|
||||
pDet = p;
|
||||
|
||||
defaultCutValue = 1.000*mm ;
|
||||
|
||||
cutForGamma = defaultCutValue ;
|
||||
cutForElectron = defaultCutValue ;
|
||||
cutForProton = defaultCutValue ;
|
||||
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new F01PhysicsListMessenger(this);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F01PhysicsList::~F01PhysicsList()
|
||||
{
|
||||
delete physicsListMessenger;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructMesons();
|
||||
ConstructBarions();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01PhysicsList::ConstructBosons()
|
||||
{
|
||||
// gamma
|
||||
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// charged geantino
|
||||
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void F01PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
void F01PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
}
|
||||
|
||||
|
||||
void F01PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F01PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
AddParameterisation();
|
||||
|
||||
ConstructEM();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
#include "G4PAIonisation.hh"
|
||||
#include "G4ForwardXrayTR.hh"
|
||||
|
||||
#include "F01StepCut.hh"
|
||||
|
||||
#include "G4IonisationByLogicalVolume.hh"
|
||||
|
||||
void F01PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma")
|
||||
{
|
||||
// Construct processes for gamma
|
||||
|
||||
thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theComptonScattering = new G4ComptonScattering();
|
||||
theGammaConversion = new G4GammaConversion();
|
||||
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
|
||||
}
|
||||
else if (particleName == "e-")
|
||||
{
|
||||
// Construct processes for electron
|
||||
|
||||
// theeminusMultipleScattering = new G4MultipleScattering();
|
||||
theeminusIonisation = new G4eIonisation();
|
||||
theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
|
||||
|
||||
theeminusStepCut = new F01StepCut();
|
||||
|
||||
// pmanager->AddProcess(theeminusMultipleScattering,-1,1,1);
|
||||
|
||||
pmanager->AddProcess(theeminusIonisation,-1,2,2);
|
||||
|
||||
|
||||
pmanager->AddProcess(theeminusBremsstrahlung,-1,1,1);
|
||||
|
||||
|
||||
pmanager->AddProcess(theeminusStepCut,-1,-1,4);
|
||||
theeminusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (particleName == "e+")
|
||||
{
|
||||
// Construct processes for positron
|
||||
|
||||
// theeplusMultipleScattering = new G4MultipleScattering();
|
||||
theeplusIonisation = new G4eIonisation();
|
||||
theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
// theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
|
||||
|
||||
theeplusStepCut = new F01StepCut();
|
||||
|
||||
// pmanager->AddProcess(theeplusMultipleScattering,-1,1,1);
|
||||
pmanager->AddProcess(theeplusIonisation,-1,2,2);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung,-1,-1,3);
|
||||
// pmanager->AddProcess(theeplusAnnihilation,0,-1,4);
|
||||
|
||||
|
||||
pmanager->AddProcess(theeplusStepCut,-1,-1,5);
|
||||
theeplusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if( particleName == "mu+" ||
|
||||
particleName == "mu-" )
|
||||
{
|
||||
// Construct processes for muon+
|
||||
|
||||
F01StepCut* muonStepCut = new F01StepCut();
|
||||
|
||||
G4MuIonisation* themuIonisation = new G4MuIonisation() ;
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(themuIonisation,-1,2,2);
|
||||
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
|
||||
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
|
||||
|
||||
pmanager->AddProcess( muonStepCut,-1,-1,3);
|
||||
muonStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (
|
||||
particleName == "proton"
|
||||
|| particleName == "antiproton"
|
||||
|| particleName == "pi+"
|
||||
|| particleName == "pi-"
|
||||
|| particleName == "kaon+"
|
||||
|| particleName == "kaon-"
|
||||
)
|
||||
{
|
||||
F01StepCut* thehadronStepCut = new F01StepCut();
|
||||
|
||||
G4hIonisation* thehIonisation = new G4hIonisation() ;
|
||||
G4MultipleScattering* thehMultipleScattering =
|
||||
new G4MultipleScattering() ;
|
||||
|
||||
|
||||
pmanager->AddProcess(thehMultipleScattering,-1,1,1);
|
||||
pmanager->AddProcess(thehIonisation,-1,2,2);
|
||||
|
||||
|
||||
pmanager->AddProcess( thehadronStepCut,-1,-1,3);
|
||||
thehadronStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
thehadronStepCut->SetMaxStep(10*mm) ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void F01PhysicsList::ConstructGeneral()
|
||||
{
|
||||
// Add Decay Process
|
||||
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
if (theDecayProcess->IsApplicable(*particle))
|
||||
{
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::AddParameterisation()
|
||||
{
|
||||
G4FastSimulationManagerProcess* theFastSimulationManagerProcess =
|
||||
new G4FastSimulationManagerProcess() ;
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value() ;
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager() ;
|
||||
|
||||
// both postStep and alongStep action are required: because
|
||||
// of the use of ghost volumes. If no ghost, the postStep is sufficient.
|
||||
|
||||
pmanager->AddProcess(theFastSimulationManagerProcess, -1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetCuts()
|
||||
{
|
||||
G4Timer theTimer ;
|
||||
theTimer.Start() ;
|
||||
if (verboseLevel >0)
|
||||
{
|
||||
G4cout << "F01PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
|
||||
}
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
SetCutValue(cutForGamma,"gamma");
|
||||
|
||||
SetCutValue(cutForElectron,"e-");
|
||||
SetCutValue(cutForElectron,"e+");
|
||||
|
||||
SetCutValue(defaultCutValue,"mu-");
|
||||
SetCutValue(defaultCutValue,"mu+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
SetCutValue(defaultCutValue, "proton");
|
||||
SetCutValue(defaultCutValue, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(defaultCutValue);
|
||||
|
||||
if (verboseLevel>1) DumpCutValuesTable();
|
||||
|
||||
theTimer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout << G4endl ;
|
||||
G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed() << " s " <<G4endl;
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetGammaCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForGamma = val;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetElectronCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForElectron = val;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetProtonCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForProton = val;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetCutsByEnergy(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e-");
|
||||
|
||||
part = theParticleTable->FindParticle("e+");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
part = theParticleTable->FindParticle("proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "proton");
|
||||
|
||||
part = theParticleTable->FindParticle("anti_proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::GetRange(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
G4cout << "material : " << currMat->GetName() << G4endl;
|
||||
G4cout << "particle : " << part->GetParticleName() << G4endl;
|
||||
G4cout << "energy : " << val / keV << " (keV)" << G4endl;
|
||||
G4cout << "range : " << cut / mm << " (mm)" << G4endl;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01PhysicsList::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
G4cout << " MaxChargedStep=" << MaxChargedStep << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PhysicsListMessenger.cc,v 1.3 2001/10/15 17:20:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01PhysicsListMessenger.hh"
|
||||
|
||||
#include "F01PhysicsList.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PhysicsListMessenger::F01PhysicsListMessenger(F01PhysicsList * List)
|
||||
: F01List(List)
|
||||
{
|
||||
cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this);
|
||||
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
|
||||
cutGCmd->SetParameterName("range",true);
|
||||
cutGCmd->SetDefaultValue(1.);
|
||||
cutGCmd->SetDefaultUnit("mm");
|
||||
cutGCmd->AvailableForStates(Idle);
|
||||
|
||||
cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this);
|
||||
cutECmd->SetGuidance("Set cut values by RANGE for e- e+.");
|
||||
cutECmd->SetParameterName("range",true);
|
||||
cutECmd->SetDefaultValue(1.);
|
||||
cutECmd->SetDefaultUnit("mm");
|
||||
cutECmd->AvailableForStates(Idle);
|
||||
|
||||
cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this);
|
||||
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
|
||||
cutPCmd->SetParameterName("range",true);
|
||||
cutPCmd->SetDefaultValue(1.);
|
||||
cutPCmd->SetDefaultUnit("mm");
|
||||
cutPCmd->AvailableForStates(Idle);
|
||||
|
||||
eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this);
|
||||
eCmd->SetGuidance("Set cut values by ENERGY for charged particles.");
|
||||
eCmd->SetParameterName("energy",true);
|
||||
eCmd->SetDefaultValue(10.);
|
||||
eCmd->SetDefaultUnit("keV");
|
||||
eCmd->AvailableForStates(Idle);
|
||||
|
||||
rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this);
|
||||
rCmd->SetGuidance("Display the RANGE of Electron for the current material.");
|
||||
rCmd->SetParameterName("energy",true);
|
||||
rCmd->SetDefaultValue(10.);
|
||||
rCmd->SetDefaultUnit("keV");
|
||||
rCmd->AvailableForStates(Idle);
|
||||
|
||||
setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this);
|
||||
setMaxStepCmd->SetGuidance("Set max. step length in the detector");
|
||||
setMaxStepCmd->SetParameterName("mxStep",true);
|
||||
setMaxStepCmd->SetDefaultUnit("mm");
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PhysicsListMessenger::~F01PhysicsListMessenger()
|
||||
{
|
||||
|
||||
delete setMaxStepCmd;
|
||||
|
||||
delete cutGCmd;
|
||||
delete cutECmd;
|
||||
delete cutPCmd;
|
||||
delete rCmd;
|
||||
delete eCmd;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == cutGCmd)
|
||||
{ F01List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutECmd)
|
||||
{ F01List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutPCmd)
|
||||
{ F01List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == eCmd)
|
||||
{ F01List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));}
|
||||
if(command == rCmd)
|
||||
{ F01List->GetRange(rCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == setMaxStepCmd)
|
||||
{ F01List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PrimaryGeneratorAction.cc,v 1.6 2001/11/07 14:33:21 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "F01DetectorConstruction.hh"
|
||||
#include "F01PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4String F01PrimaryGeneratorAction::thePrimaryParticleName = "e-" ;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PrimaryGeneratorAction::F01PrimaryGeneratorAction(
|
||||
F01DetectorConstruction* F01DC)
|
||||
: F01Detector(F01DC), rndmFlag("off"),
|
||||
xvertex(0.), yvertex(0.), zvertex(0.),
|
||||
vertexdefined(false)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
// create a messenger for this class
|
||||
gunMessenger = new F01PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="e-");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
|
||||
thePrimaryParticleName = particle->GetParticleName() ;
|
||||
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,-1.));
|
||||
particleGun->SetParticleEnergy(0.5*GeV);
|
||||
|
||||
zvertex = F01Detector->GetAbsorberZpos() -0.5*(F01Detector->GetAbsorberThickness());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(xvertex,yvertex,zvertex));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PrimaryGeneratorAction::~F01PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
// this function is called at the begining of event
|
||||
//
|
||||
thePrimaryParticleName = particleGun->GetParticleDefinition()->
|
||||
GetParticleName() ;
|
||||
G4double x0,y0,z0 ;
|
||||
if(vertexdefined)
|
||||
{
|
||||
x0 = xvertex ;
|
||||
y0 = yvertex ;
|
||||
z0 = zvertex ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x0 = 0. ;
|
||||
y0 = 0. ;
|
||||
z0 = F01Detector->GetAbsorberZpos()-0.5*(F01Detector->GetAbsorberThickness());
|
||||
}
|
||||
G4double r0,phi0 ;
|
||||
|
||||
if (rndmFlag == "on")
|
||||
{
|
||||
r0 = (F01Detector->GetAbsorberRadius())*sqrt(G4UniformRand());
|
||||
phi0 = twopi*G4UniformRand();
|
||||
x0 = r0*cos(phi0);
|
||||
y0 = r0*sin(phi0);
|
||||
}
|
||||
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4String F01PrimaryGeneratorAction::GetPrimaryName()
|
||||
{
|
||||
return thePrimaryParticleName ;
|
||||
}
|
||||
|
||||
void F01PrimaryGeneratorAction::Setzvertex(G4double z)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
zvertex = z ;
|
||||
G4cout << " Z coordinate of the primary vertex = " << zvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
void F01PrimaryGeneratorAction::Setxvertex(G4double x)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
xvertex = x ;
|
||||
G4cout << " X coordinate of the primary vertex = " << xvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
|
||||
void F01PrimaryGeneratorAction::Setyvertex(G4double y)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
yvertex = y ;
|
||||
G4cout << " Y coordinate of the primary vertex = " << yvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01PrimaryGeneratorMessenger.cc,v 1.3 2001/10/15 17:20:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "F01PrimaryGeneratorAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PrimaryGeneratorMessenger::F01PrimaryGeneratorMessenger(F01PrimaryGeneratorAction* F01Gun)
|
||||
: F01Action(F01Gun)
|
||||
{
|
||||
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);
|
||||
|
||||
setxvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
|
||||
setxvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
|
||||
setxvertexCmd->SetParameterName("xv",true);
|
||||
setxvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setyvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
|
||||
setyvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
|
||||
setyvertexCmd->SetParameterName("yv",true);
|
||||
setyvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setzvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
|
||||
setzvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
|
||||
setzvertexCmd->SetParameterName("zv",true);
|
||||
setzvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01PrimaryGeneratorMessenger::~F01PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
delete setxvertexCmd;
|
||||
delete setyvertexCmd;
|
||||
delete setzvertexCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ F01Action->SetRndmFlag(newValue);}
|
||||
if( command == setxvertexCmd)
|
||||
{ F01Action->Setxvertex(setxvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setyvertexCmd)
|
||||
{ F01Action->Setyvertex(setyvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setzvertexCmd)
|
||||
{ F01Action->Setzvertex(setzvertexCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01RunAction.cc,v 1.6 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#include "F01RunAction.hh"
|
||||
#include "F01RunMessenger.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01RunAction::F01RunAction()
|
||||
: saveRndm(0)
|
||||
{
|
||||
runMessenger = new F01RunMessenger(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F01RunAction::~F01RunAction()
|
||||
{
|
||||
delete runMessenger;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
// save Rndm status
|
||||
if (saveRndm > 0)
|
||||
{
|
||||
HepRandom::showEngineStatus();
|
||||
HepRandom::saveEngineStatus("beginOfRun.rndm");
|
||||
}
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager) UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F01RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
|
||||
}
|
||||
|
||||
// save Rndm status
|
||||
|
||||
if (saveRndm == 1)
|
||||
{
|
||||
HepRandom::showEngineStatus();
|
||||
HepRandom::saveEngineStatus("endOfRun.rndm");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01RunMessenger.cc,v 1.3 2001/10/15 17:20:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01RunMessenger.hh"
|
||||
|
||||
#include "F01RunAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01RunMessenger::F01RunMessenger(F01RunAction* RA)
|
||||
: runAction (RA)
|
||||
{
|
||||
RndmDir = new G4UIdirectory("/rndm/");
|
||||
RndmDir->SetGuidance("Rndm status control.");
|
||||
|
||||
RndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
|
||||
RndmSaveCmd->SetGuidance("set frequency to save rndm status on external files.");
|
||||
RndmSaveCmd->SetGuidance("freq = 0 not saved");
|
||||
RndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
|
||||
RndmSaveCmd->SetParameterName("frequency",false);
|
||||
RndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
|
||||
RndmSaveCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
RndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
|
||||
RndmReadCmd->SetGuidance("get rndm status from an external file.");
|
||||
RndmReadCmd->SetParameterName("fileName",true);
|
||||
RndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
|
||||
RndmReadCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01RunMessenger::~F01RunMessenger()
|
||||
{
|
||||
delete RndmSaveCmd; delete RndmReadCmd; delete RndmDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01RunMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{
|
||||
if (command == RndmSaveCmd)
|
||||
runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValues));
|
||||
|
||||
if (command == RndmReadCmd)
|
||||
{ G4cout << "\n---> rndm status restored from file: " << newValues << G4endl;
|
||||
HepRandom::restoreEngineStatus(newValues);
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01StepCut.cc,v 1.2 2001/07/11 09:58:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "F01StepCut.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
F01StepCut::F01StepCut(const G4String& aName)
|
||||
: G4VDiscreteProcess(aName),MaxChargedStep(DBL_MAX)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created "<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
F01StepCut::~F01StepCut()
|
||||
{
|
||||
}
|
||||
|
||||
F01StepCut::F01StepCut(F01StepCut& right)
|
||||
:G4VDiscreteProcess(right)
|
||||
{}
|
||||
|
||||
void F01StepCut::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingAction.cc,v 1.5 2001/11/07 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01SteppingAction.hh"
|
||||
#include "F01SteppingMessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01SteppingAction::F01SteppingAction()
|
||||
: steppingMessenger(0)
|
||||
{
|
||||
steppingMessenger = new F01SteppingMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01SteppingAction::~F01SteppingAction()
|
||||
{
|
||||
delete steppingMessenger ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01SteppingAction::UserSteppingAction(const G4Step*)
|
||||
{
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingMessenger.cc,v 1.2 2001/07/11 09:58:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F01SteppingMessenger.hh"
|
||||
|
||||
#include "F01SteppingAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01SteppingMessenger::F01SteppingMessenger(F01SteppingAction* SA)
|
||||
:steppingAction (SA)
|
||||
{
|
||||
steppingDir = new G4UIdirectory("/stepping/");
|
||||
steppingDir->SetGuidance("stepping control");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01SteppingMessenger::~F01SteppingMessenger()
|
||||
{
|
||||
delete steppingDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01SteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01SteppingVerbose.cc,v 1.4 2001/10/15 17:20:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#include "F01SteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
F01SteppingVerbose::F01SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
F01SteppingVerbose::~F01SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void F01SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(8);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << G4std::setw( 5) << "#Step#" << " "
|
||||
<< G4std::setw(10) << "X" << " "
|
||||
<< G4std::setw(10) << "Y" << " "
|
||||
<< G4std::setw(10) << "Z" << " "
|
||||
<< G4std::setw(10) << "KineE" << " "
|
||||
<< G4std::setw(10) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "NextVolu"
|
||||
<< G4std::setw(10) << "Process"
|
||||
<< G4std::setw(10) << "Dir_x" << " "
|
||||
<< G4std::setw(10) << "Dir_y" << " "
|
||||
<< G4std::setw(10) << "Dir_z" << " "
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw(10) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw(10) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw(10) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw(10) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw(10) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << G4std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << G4std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
G4cout << " "
|
||||
<< G4std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << " UserLimit";
|
||||
}
|
||||
|
||||
G4cout << G4std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().x(),"Length")
|
||||
<< G4std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().y(),"Length")
|
||||
<< G4std::setw(12) << G4BestUnit(fTrack->GetMomentumDirection().z(),"Length");
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << " :----- List of 2ndaries - "
|
||||
<< "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot
|
||||
<< "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt
|
||||
<< ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt
|
||||
<< ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt
|
||||
<< "), "
|
||||
<< "#SpawnTotal=" << G4std::setw(3) << (*fSecondary).size()
|
||||
<< " ---------------"
|
||||
<< G4endl;
|
||||
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++)
|
||||
{
|
||||
G4cout << " : "
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
||||
<< G4std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw(10)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :-----------------------------"
|
||||
<< "----------------------------------"
|
||||
<< "-- EndOf2ndaries Info ---------------"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void F01SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << G4std::setw( 5) << "Step#" << " "
|
||||
<< G4std::setw( 6) << "X" << " "
|
||||
<< G4std::setw( 6) << "Y" << " "
|
||||
<< G4std::setw( 6) << "Z" << " "
|
||||
<< G4std::setw( 9) << "KineE" << " "
|
||||
<< G4std::setw( 9) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "Volume" << " "
|
||||
<< G4std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << G4std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << G4std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
G4cout << " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F01VisManager.cc,v 1.3 2001/12/12 15:22:30 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "F01VisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
#include "G4Wo.hh"
|
||||
#include "G4Xo.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F01VisManager::F01VisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F01VisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
RegisterGraphicsSystem (new G4Wo);
|
||||
RegisterGraphicsSystem (new G4Xo);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,19 @@
|
||||
# $Id: GNUmakefile,v 1.3 2001/10/15 17:20:39 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := field02
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,33 @@
|
||||
$Id: History,v 1.6 2001/12/04 18:43:41 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field02 History file
|
||||
------------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Dec 4th, 2001 - G.Cosmo (field02-V03-02-01)
|
||||
-----------------------
|
||||
- Fix in F02ElectroMagneticField.hh for compilation on Win/VC++.
|
||||
|
||||
Nov 13th, 2001 - V.Grichine (field02-V03-02-00)
|
||||
---------------------------
|
||||
- Added number of variables to steppers in F02ElectroMagneticField.cc.
|
||||
Coworks with tag "field-V03-02-03" of geometry/magneticfield.
|
||||
|
||||
Nov 7th, 2001 - G.Cosmo
|
||||
-----------------------
|
||||
- More cleanup and fixes to primary generator gun (V.Grichine).
|
||||
|
||||
Oct 15th, 2001 - G.Cosmo
|
||||
------------------------
|
||||
- Cleaned from test code.
|
||||
@@ -0,0 +1,79 @@
|
||||
$Id: README,v 1.3 2001/10/25 09:30:12 grichine Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field02
|
||||
-------
|
||||
|
||||
Test for investigation of tracking in electric field
|
||||
and field dependent electromagnetic processes.
|
||||
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
The "absorber" is a solid made of a given material.
|
||||
|
||||
Three parameters define the absorber :
|
||||
- the material of the absorber,
|
||||
- the thickness of an absorber,
|
||||
- the transverse size of the absorber (the input face is a square).
|
||||
|
||||
The volume "World" contains the "absorber".
|
||||
In this test the parameters of the "World" can be changed , too.
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class,
|
||||
but all the parameters can be changed via
|
||||
the commands defined in the DetectorMessenger class.
|
||||
|
||||
2- AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
The primary kinematic consists of a single particle which hits the
|
||||
absorber 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 (see
|
||||
the macros provided with this example).
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
3- DETECTOR RESPONSE
|
||||
|
||||
|
||||
A HIT is a record, event per event , of all the
|
||||
informations needed to simulate and analyse the detector response.
|
||||
|
||||
In this example a CalorHit is defined as a set of 2 informations:
|
||||
- the total energy deposit in the absorber,
|
||||
- the total tracklength of all charged particles in the absorber,
|
||||
|
||||
Therefore the absorber is declared
|
||||
'sensitive detector' (SD), which means they can contribute to the hit.
|
||||
|
||||
4- PHYSICS DEMO
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
The messenger classes introduce interactive commands . Using these
|
||||
commands the geometry of the detector, the data of the primary
|
||||
particle, etc. can be changed.
|
||||
|
||||
|
||||
5- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd $G4INSTALL/example/extended/field/field02
|
||||
% gmake
|
||||
|
||||
- execute field01 in 'batch' mode from macro file e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field02 field02.in
|
||||
|
||||
- execute field01 in 'interactive' mode with visualization e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field02
|
||||
....
|
||||
Idle> type your commands
|
||||
....
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: field02.cc,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - TestF02
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "F02VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "F02DetectorConstruction.hh"
|
||||
#include "F02ElectroMagneticField.hh"
|
||||
#include "F02PhysicsList.hh"
|
||||
#include "F02PrimaryGeneratorAction.hh"
|
||||
#include "F02RunAction.hh"
|
||||
#include "F02EventAction.hh"
|
||||
#include "F02SteppingAction.hh"
|
||||
#include "F02SteppingVerbose.hh"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
|
||||
//choose the Random engine
|
||||
|
||||
HepRandom::setTheEngine(new RanecuEngine);
|
||||
|
||||
//my Verbose output class
|
||||
|
||||
G4VSteppingVerbose::SetInstance(new F02SteppingVerbose);
|
||||
|
||||
// Construct the default run manager
|
||||
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// Construct the electro magnetic field
|
||||
|
||||
F02ElectroMagneticField* field = new F02ElectroMagneticField() ;
|
||||
|
||||
// Set mandatory initialization classes
|
||||
|
||||
F02DetectorConstruction* detector;
|
||||
detector = new F02DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new F02PhysicsList(detector));
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
// visualization manager
|
||||
|
||||
G4VisManager* visManager = new F02VisManager;
|
||||
visManager->Initialize();
|
||||
|
||||
#endif
|
||||
|
||||
// Set user action classes
|
||||
|
||||
runManager->SetUserAction(new F02PrimaryGeneratorAction(detector));
|
||||
|
||||
F02RunAction* runAction = new F02RunAction;
|
||||
|
||||
runManager->SetUserAction(runAction);
|
||||
|
||||
F02EventAction* eventAction = new F02EventAction(runAction);
|
||||
|
||||
runManager->SetUserAction(eventAction);
|
||||
|
||||
F02SteppingAction* steppingAction = new F02SteppingAction();
|
||||
runManager->SetUserAction(steppingAction);
|
||||
|
||||
// Initialize G4 kernel, physics tables ...
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
// get the pointer to the User Interface manager
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc==1) // Define UI terminal for interactive mode
|
||||
{
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete field;
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Macro file for the initialization phase of field02.
|
||||
#
|
||||
# It creates the default geometry (simple absorber cylinder )
|
||||
#
|
||||
/tracking/verbose 1
|
||||
/run/verbose 1
|
||||
#
|
||||
#
|
||||
#
|
||||
/field/setStepperType 4
|
||||
/field/setMinStep 10 mm
|
||||
#
|
||||
/field/update
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/run/particle/dumpCutValues
|
||||
#
|
||||
/gun/particle e-
|
||||
/gun/energy 50.0 MeV
|
||||
#
|
||||
/event/printModulo 50
|
||||
/run/beamOn 100
|
||||
#
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02CalorHit.hh,v 1.2 2001/07/11 09:58:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02CalorHit_h
|
||||
#define F02CalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02CalorHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
F02CalorHit();
|
||||
~F02CalorHit();
|
||||
F02CalorHit(const F02CalorHit&);
|
||||
const F02CalorHit& operator=(const F02CalorHit&);
|
||||
int operator==(const F02CalorHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
void Print();
|
||||
|
||||
public:
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
|
||||
|
||||
G4double GetEdepAbs() { return EdepAbs; };
|
||||
G4double GetTrakAbs() { return TrackLengthAbs; };
|
||||
G4double GetEdepGap() { return EdepGap; };
|
||||
G4double GetTrakGap() { return TrackLengthGap; };
|
||||
|
||||
private:
|
||||
|
||||
G4double EdepAbs, TrackLengthAbs;
|
||||
G4double EdepGap, TrackLengthGap;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
typedef G4THitsCollection<F02CalorHit> F02CalorHitsCollection;
|
||||
|
||||
extern G4Allocator<F02CalorHit> F02CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void* F02CalorHit::operator new(size_t)
|
||||
{
|
||||
void* aHit;
|
||||
aHit = (void*) F02CalorHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F02CalorHit::operator delete(void* aHit)
|
||||
{
|
||||
F02CalorHitAllocator.FreeSingle((F02CalorHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02CalorimeterSD.hh,v 1.3 2001/10/15 17:20:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02CalorimeterSD_h
|
||||
#define F02CalorimeterSD_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "F02CalorHit.hh"
|
||||
|
||||
class F02DetectorConstruction;
|
||||
class G4HCofThisEvent;
|
||||
class G4Step;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
F02CalorimeterSD(G4String, F02DetectorConstruction* );
|
||||
~F02CalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void clear();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
|
||||
F02CalorHitsCollection* CalCollection;
|
||||
F02DetectorConstruction* Detector;
|
||||
G4int* HitID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02DetectorConstruction.hh,v 1.4 2001/10/25 09:30:13 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef F02DetectorConstruction_h
|
||||
#define F02DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4Box;
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4UniformMagField;
|
||||
class F02DetectorMessenger;
|
||||
class F02CalorimeterSD;
|
||||
class F02ElectroMagneticField;
|
||||
|
||||
|
||||
class F02DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
F02DetectorConstruction();
|
||||
~F02DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
void SetAbsorberMaterial (G4String);
|
||||
void SetAbsorberThickness(G4double);
|
||||
void SetAbsorberRadius(G4double);
|
||||
|
||||
void SetAbsorberZpos(G4double);
|
||||
|
||||
void SetWorldMaterial(G4String);
|
||||
void SetWorldSizeZ(G4double);
|
||||
void SetWorldSizeR(G4double);
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
void UpdateGeometry();
|
||||
|
||||
public:
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4Material* GetWorldMaterial() {return WorldMaterial;};
|
||||
G4double GetWorldSizeZ() {return WorldSizeZ;};
|
||||
G4double GetWorldSizeR() {return WorldSizeR;};
|
||||
|
||||
G4double GetAbsorberZpos() {return zAbsorber;};
|
||||
G4double GetzstartAbs() {return zstartAbs;};
|
||||
G4double GetzendAbs() {return zendAbs;};
|
||||
|
||||
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
|
||||
G4double GetAbsorberThickness() {return AbsorberThickness;};
|
||||
G4double GetAbsorberRadius() {return AbsorberRadius;};
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
|
||||
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
|
||||
G4LogicalVolume* GetLogicalAbsorber() {return logicAbsorber;};
|
||||
|
||||
private:
|
||||
|
||||
G4Tubs* solidWorld; // pointer to the solid World
|
||||
G4LogicalVolume* logicWorld; // pointer to the logical World
|
||||
G4VPhysicalVolume* physiWorld; // pointer to the physical World
|
||||
|
||||
G4Tubs* solidAbsorber; // pointer to the solid Absorber
|
||||
G4LogicalVolume* logicAbsorber; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* physiAbsorber; // pointer to the physical Absorber
|
||||
|
||||
G4UniformMagField* magField; // pointer to the magnetic field
|
||||
F02ElectroMagneticField* fEmField;
|
||||
F02DetectorMessenger* detectorMessenger; // pointer to the Messenger
|
||||
F02CalorimeterSD* calorimeterSD; // pointer to the sensitive detector
|
||||
|
||||
G4Material* AbsorberMaterial;
|
||||
G4double AbsorberThickness;
|
||||
G4double AbsorberRadius;
|
||||
G4bool worldchanged;
|
||||
|
||||
G4double zAbsorber ;
|
||||
G4double zstartAbs , zendAbs ;
|
||||
|
||||
G4Material* WorldMaterial;
|
||||
G4double WorldSizeR;
|
||||
G4double WorldSizeZ;
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F02DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
|
||||
zstartAbs = zAbsorber-0.5*AbsorberThickness;
|
||||
zendAbs = zAbsorber+0.5*AbsorberThickness;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02DetectorMessenger.hh,v 1.3 2001/10/25 09:30:13 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02DetectorMessenger_h
|
||||
#define F02DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F02DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F02DetectorMessenger(F02DetectorConstruction* );
|
||||
~F02DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F02DetectorConstruction* F02Detector;
|
||||
|
||||
G4UIdirectory* F02detDir;
|
||||
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsRadCmd;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* AbsZposCmd;
|
||||
|
||||
G4UIcmdWithAString* WorldMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldZCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldRCmd;
|
||||
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02ElectroMagneticField.hh,v 1.6 2001/12/04 17:53:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// A class for control of the Magnetic Field of the detector.
|
||||
// The field is assumed to be uniform.
|
||||
//
|
||||
// $ Id: $
|
||||
|
||||
// Should this be a:
|
||||
// i) messenger
|
||||
// ii) user class that creates the field ?
|
||||
// iii) simply a derived class of Uniform field ? <== I have chosen this now.
|
||||
// iv) a field manager that creates/updates field (Prefered?)
|
||||
//
|
||||
|
||||
|
||||
#ifndef F02ElectroMagneticField_H
|
||||
#define F02ElectroMagneticField_H
|
||||
|
||||
#include "G4MagneticField.hh"
|
||||
// #include "G4ElectroMagneticField.hh"
|
||||
#include "G4UniformElectricField.hh"
|
||||
|
||||
class G4FieldManager;
|
||||
class G4ChordFinder;
|
||||
class G4EquationOfMotion;
|
||||
class G4Mag_EqRhs;
|
||||
class G4EqMagElectricField;
|
||||
class G4MagIntegratorStepper;
|
||||
class F02FieldMessenger;
|
||||
|
||||
class F02ElectroMagneticField : public G4UniformElectricField
|
||||
{
|
||||
public:
|
||||
|
||||
F02ElectroMagneticField(G4ThreeVector) ; // The value of the field
|
||||
F02ElectroMagneticField() ; // A zero field
|
||||
|
||||
~F02ElectroMagneticField() ;
|
||||
|
||||
void GetFieldValue( const G4double [4], G4double * ) const {;}
|
||||
|
||||
void SetStepperType( G4int i) { fStepperType = i ; }
|
||||
|
||||
void SetStepper();
|
||||
|
||||
void SetMinStep(G4double s) { fMinStep = s ; }
|
||||
|
||||
void UpdateField();
|
||||
|
||||
void SetFieldValue(G4ThreeVector fieldVector);
|
||||
void SetFieldValue(G4double fieldValue);
|
||||
G4ThreeVector GetConstantFieldValue();
|
||||
|
||||
protected:
|
||||
|
||||
// Find the global Field Manager
|
||||
|
||||
G4FieldManager* GetGlobalFieldManager() ;
|
||||
|
||||
G4FieldManager* fFieldManager ;
|
||||
|
||||
G4ChordFinder* fChordFinder ;
|
||||
|
||||
G4EqMagElectricField* fEquation ;
|
||||
|
||||
G4UniformElectricField* fEMfield ;
|
||||
|
||||
G4MagIntegratorStepper* fStepper ;
|
||||
|
||||
G4int fStepperType ;
|
||||
|
||||
G4double fMinStep ;
|
||||
|
||||
F02FieldMessenger* fFieldMessenger;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02EventAction.hh,v 1.3 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02EventAction_h
|
||||
#define F02EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F02RunAction;
|
||||
class F02EventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
F02EventAction(F02RunAction* F02RA);
|
||||
~F02EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
G4int GetEventno();
|
||||
void setEventVerbose(G4int level);
|
||||
|
||||
void SetDrawFlag(G4String val) {drawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {printModulo = val;};
|
||||
|
||||
private:
|
||||
G4int calorimeterCollID;
|
||||
F02EventActionMessenger* eventMessenger;
|
||||
F02RunAction* runaction;
|
||||
G4int verboselevel;
|
||||
|
||||
G4String drawFlag;
|
||||
G4int printModulo;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02EventActionMessenger.hh,v 1.2 2001/07/11 09:58:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02EventActionMessenger_h
|
||||
#define F02EventActionMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F02EventAction;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02EventActionMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F02EventActionMessenger(F02EventAction*);
|
||||
~F02EventActionMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F02EventAction* eventAction;
|
||||
G4UIcmdWithAnInteger* setVerboseCmd;
|
||||
G4UIcmdWithAString* DrawCmd;
|
||||
G4UIcmdWithAnInteger* PrintCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02FieldMessenger.hh,v 1.2 2001/07/11 09:58:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02FieldMessenger_h
|
||||
#define F02FieldMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F02ElectroMagneticField;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
|
||||
class F02FieldMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F02FieldMessenger(F02ElectroMagneticField* );
|
||||
~F02FieldMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
void SetNewValue(G4UIcommand*, G4int);
|
||||
|
||||
private:
|
||||
|
||||
F02ElectroMagneticField* fEMfield;
|
||||
|
||||
G4UIdirectory* F02detDir;
|
||||
|
||||
G4UIcmdWithAnInteger* StepperCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MinStepCmd;
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PhysicsList.hh,v 1.2 2001/07/11 09:58:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#ifndef F02PhysicsList_h
|
||||
#define F02PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4PhotoElectricEffect;
|
||||
class G4ComptonScattering;
|
||||
class G4GammaConversion;
|
||||
|
||||
class G4MultipleScattering;
|
||||
|
||||
class G4PAIonisation ;
|
||||
class G4ForwardXrayTR ;
|
||||
class G4eIonisation;
|
||||
class G4eBremsstrahlung;
|
||||
class G4eplusAnnihilation;
|
||||
|
||||
class G4MuIonisation;
|
||||
class G4MuBremsstrahlung;
|
||||
class G4MuPairProduction;
|
||||
|
||||
class G4hIonisation;
|
||||
class G4hIonisationPlus;
|
||||
|
||||
class F02StepCut;
|
||||
|
||||
class F02DetectorConstruction;
|
||||
class F02PhysicsListMessenger;
|
||||
|
||||
|
||||
class F02PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
F02PhysicsList( F02DetectorConstruction*);
|
||||
~F02PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
|
||||
void SetCuts();
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBarions();
|
||||
|
||||
protected:
|
||||
|
||||
// these methods Construct physics processes and register them
|
||||
|
||||
void AddParameterisation();
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
|
||||
public:
|
||||
|
||||
void SetGammaCut(G4double);
|
||||
void SetElectronCut(G4double);
|
||||
void SetProtonCut(G4double);
|
||||
void SetCutsByEnergy(G4double);
|
||||
void GetRange(G4double);
|
||||
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
public:
|
||||
|
||||
G4double MaxChargedStep;
|
||||
|
||||
private:
|
||||
|
||||
G4PhotoElectricEffect* thePhotoElectricEffect;
|
||||
G4ComptonScattering* theComptonScattering;
|
||||
G4GammaConversion* theGammaConversion;
|
||||
|
||||
G4MultipleScattering* theeminusMultipleScattering;
|
||||
G4eIonisation* theeminusIonisation;
|
||||
G4eBremsstrahlung* theeminusBremsstrahlung;
|
||||
|
||||
G4PAIonisation* fPAIonisation ;
|
||||
G4ForwardXrayTR* fForwardXrayTR ;
|
||||
|
||||
G4MultipleScattering* theeplusMultipleScattering;
|
||||
G4eIonisation* theeplusIonisation;
|
||||
G4eBremsstrahlung* theeplusBremsstrahlung;
|
||||
G4eplusAnnihilation* theeplusAnnihilation;
|
||||
|
||||
F02StepCut* theeminusStepCut ;
|
||||
F02StepCut* theeplusStepCut ;
|
||||
|
||||
G4double cutForGamma;
|
||||
G4double cutForElectron;
|
||||
G4double cutForProton;
|
||||
|
||||
F02DetectorConstruction* pDet;
|
||||
F02PhysicsListMessenger* physicsListMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PhysicsListMessenger.hh,v 1.3 2001/10/15 17:20:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02PhysicsListMessenger_h
|
||||
#define F02PhysicsListMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F02PhysicsList;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithADouble;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02PhysicsListMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F02PhysicsListMessenger(F02PhysicsList*);
|
||||
~F02PhysicsListMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F02PhysicsList* F02List;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* setMaxStepCmd;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* cutGCmd;
|
||||
G4UIcmdWithADoubleAndUnit* cutECmd;
|
||||
G4UIcmdWithADoubleAndUnit* cutPCmd;
|
||||
G4UIcmdWithADoubleAndUnit* rCmd;
|
||||
G4UIcmdWithADoubleAndUnit* eCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PrimaryGeneratorAction.hh,v 1.3 2001/10/15 17:20:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02PrimaryGeneratorAction_h
|
||||
#define F02PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class F02DetectorConstruction;
|
||||
class F02PrimaryGeneratorMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
F02PrimaryGeneratorAction(F02DetectorConstruction*);
|
||||
~F02PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event*);
|
||||
void SetRndmFlag(G4String val) { rndmFlag = val;}
|
||||
void Setxvertex(G4double x) ;
|
||||
void Setyvertex(G4double y) ;
|
||||
void Setzvertex(G4double z) ;
|
||||
|
||||
static G4String GetPrimaryName() ;
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun; // pointer a to G4 service class
|
||||
F02DetectorConstruction* F02Detector; // pointer to the geometry
|
||||
|
||||
F02PrimaryGeneratorMessenger* gunMessenger; // messenger of this class
|
||||
G4String rndmFlag; // flag for a random impact point
|
||||
|
||||
static G4String thePrimaryParticleName ;
|
||||
G4double xvertex,yvertex,zvertex;
|
||||
G4bool vertexdefined ;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PrimaryGeneratorMessenger.hh,v 1.2 2001/07/11 09:58:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02PrimaryGeneratorMessenger_h
|
||||
#define F02PrimaryGeneratorMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F02PrimaryGeneratorAction;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02PrimaryGeneratorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F02PrimaryGeneratorMessenger(F02PrimaryGeneratorAction*);
|
||||
~F02PrimaryGeneratorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F02PrimaryGeneratorAction* F02Action;
|
||||
G4UIcmdWithAString* RndmCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setxvertexCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setyvertexCmd;
|
||||
G4UIcmdWithADoubleAndUnit* setzvertexCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02RunAction.hh,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02RunAction_h
|
||||
#define F02RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
#include "g4std/iostream"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02RunMessenger;
|
||||
class G4Run;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
F02RunAction();
|
||||
~F02RunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
void SetRndmFreq(G4int val) {saveRndm = val;}
|
||||
G4int GetRndmFreq() {return saveRndm;}
|
||||
|
||||
private:
|
||||
|
||||
F02RunMessenger* runMessenger;
|
||||
G4int saveRndm;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
//
|
||||
// $Id: F02RunMessenger.hh,v 1.3 2001/10/15 17:20:41 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02RunMessenger_h
|
||||
#define F02RunMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02RunAction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02RunMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
F02RunMessenger(F02RunAction* );
|
||||
~F02RunMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
F02RunAction* runAction;
|
||||
G4UIdirectory* RndmDir;
|
||||
G4UIcmdWithAnInteger* RndmSaveCmd;
|
||||
G4UIcmdWithAString* RndmReadCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02StepCut.hh,v 1.3 2001/10/15 17:20:42 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef F02StepCut_h
|
||||
#define F02StepCut_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
class F02StepCut : public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
F02StepCut(const G4String& processName ="UserStepCut" );
|
||||
F02StepCut(F02StepCut &);
|
||||
|
||||
~F02StepCut();
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
protected:
|
||||
|
||||
// it is not needed here !
|
||||
G4double GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator as private
|
||||
F02StepCut & operator=(const F02StepCut &right);
|
||||
|
||||
private:
|
||||
|
||||
G4double MaxChargedStep ;
|
||||
};
|
||||
|
||||
// inlined function members implementation
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
inline G4double F02StepCut::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
G4double ProposedStep = DBL_MAX;
|
||||
|
||||
if((MaxChargedStep > 0.) &&
|
||||
(aTrack.GetVolume() != 0) &&
|
||||
(aTrack.GetVolume()->GetName() == "Absorber") &&
|
||||
(aTrack.GetDynamicParticle()->GetDefinition()->GetPDGCharge() != 0.))
|
||||
ProposedStep = MaxChargedStep ;
|
||||
|
||||
return ProposedStep;
|
||||
}
|
||||
|
||||
inline G4VParticleChange* F02StepCut::PostStepDoIt(
|
||||
const G4Track& aTrack,
|
||||
const G4Step&
|
||||
)
|
||||
{
|
||||
// do nothing
|
||||
aParticleChange.Initialize(aTrack);
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
inline G4double F02StepCut::GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
)
|
||||
{
|
||||
return 0.;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingAction.hh,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02SteppingAction_h
|
||||
#define F02SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F02SteppingMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
F02SteppingAction();
|
||||
~F02SteppingAction();
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
F02SteppingMessenger* steppingMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingMessenger.hh,v 1.2 2001/07/11 09:58:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02SteppingMessenger_h
|
||||
#define F02SteppingMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02SteppingAction;
|
||||
class G4UIdirectory;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02SteppingMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
F02SteppingMessenger(F02SteppingAction* );
|
||||
~F02SteppingMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
F02SteppingAction* steppingAction;
|
||||
|
||||
G4UIdirectory* steppingDir;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingVerbose.hh,v 1.3 2001/10/15 17:20:42 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// F02SteppingVerbose.hh
|
||||
//
|
||||
// Description:
|
||||
// This class manages the vervose outputs in G4SteppingManager.
|
||||
//
|
||||
//
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef F02SteppingVerbose_h
|
||||
#define F02SteppingVerbose_h 1
|
||||
|
||||
#include "G4SteppingVerbose.hh"
|
||||
|
||||
class F02SteppingVerbose : public G4SteppingVerbose
|
||||
{
|
||||
public:
|
||||
|
||||
F02SteppingVerbose();
|
||||
~F02SteppingVerbose();
|
||||
// Constructor/Destructor
|
||||
|
||||
void StepInfo();
|
||||
void TrackingStarted();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02VisManager.hh,v 1.2 2001/07/11 09:58:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
// Example Visualization Manager implementing virtual function
|
||||
// RegisterGraphicsSystems. Exploits C-pre-processor variables
|
||||
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
|
||||
// environment variables of the same name are set.
|
||||
|
||||
// So all you have to do is set environment variables and compile and
|
||||
// instantiate this in your main().
|
||||
|
||||
// Alternatively, you can implement an empty function here and just
|
||||
// register the systems you want in your main(), e.g.:
|
||||
// G4VisManager* myVisManager = new MyVisManager;
|
||||
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F02VisManager_h
|
||||
#define F02VisManager_h 1
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F02VisManager: public G4VisManager
|
||||
{
|
||||
public:
|
||||
|
||||
F02VisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02CalorHit.cc,v 1.2 2001/07/11 09:58:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02CalorHit.hh"
|
||||
|
||||
G4Allocator<F02CalorHit> F02CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02CalorHit::F02CalorHit()
|
||||
{
|
||||
EdepAbs = 0.; TrackLengthAbs = 0.;
|
||||
EdepGap = 0.; TrackLengthGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02CalorHit::~F02CalorHit()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02CalorHit::F02CalorHit(const F02CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const F02CalorHit& F02CalorHit::operator=(const F02CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
int F02CalorHit::operator==(const F02CalorHit& right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02CalorHit::Print()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02CalorimeterSD.cc,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02CalorimeterSD.hh"
|
||||
|
||||
#include "F02CalorHit.hh"
|
||||
#include "F02DetectorConstruction.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02CalorimeterSD::F02CalorimeterSD(G4String name,
|
||||
F02DetectorConstruction* det)
|
||||
: G4VSensitiveDetector(name), Detector(det)
|
||||
{
|
||||
collectionName.insert("CalCollection");
|
||||
HitID = new G4int[500];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02CalorimeterSD::~F02CalorimeterSD()
|
||||
{
|
||||
delete [] HitID;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
|
||||
{
|
||||
CalCollection = new F02CalorHitsCollection(SensitiveDetectorName,
|
||||
collectionName[0]);
|
||||
for (G4int j=0;j<1; j++)
|
||||
{
|
||||
HitID[j] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool F02CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
G4double stepl = 0.;
|
||||
|
||||
stepl = aStep->GetStepLength();
|
||||
|
||||
if ((edep == 0.) && (stepl == 0.) ) return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
|
||||
G4int F02Number = 0 ;
|
||||
if (HitID[F02Number]==-1)
|
||||
{
|
||||
F02CalorHit* calHit = new F02CalorHit();
|
||||
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
|
||||
HitID[F02Number] = CalCollection->insert(calHit) - 1;
|
||||
if (verboseLevel>0)
|
||||
G4cout << " New Calorimeter Hit on F02: " << F02Number << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (physVol == Detector->GetAbsorber())
|
||||
(*CalCollection)[HitID[F02Number]]->AddAbs(edep,stepl);
|
||||
if (verboseLevel>0)
|
||||
G4cout << " Energy added to F02: " << F02Number << G4endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
|
||||
{
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0)
|
||||
{
|
||||
HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
|
||||
}
|
||||
HCE->AddHitsCollection(HCID,CalCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02CalorimeterSD::clear()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
void F02CalorimeterSD::PrintAll()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,410 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02DetectorConstruction.cc,v 1.5 2001/10/26 13:42:45 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "F02DetectorConstruction.hh"
|
||||
#include "F02DetectorMessenger.hh"
|
||||
|
||||
#include "F02CalorimeterSD.hh"
|
||||
#include "F02ElectroMagneticField.hh"
|
||||
|
||||
#include "G4VClusterModel.hh"
|
||||
#include "G4PAIclusterModel.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F02DetectorConstruction::F02DetectorConstruction()
|
||||
: solidWorld(0), logicWorld(0), physiWorld(0),
|
||||
solidAbsorber(0),logicAbsorber(0), physiAbsorber(0),
|
||||
magField(0), fEmField(0), calorimeterSD(0),
|
||||
AbsorberMaterial(0), worldchanged(false), WorldMaterial(0)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
|
||||
WorldSizeZ = 80.*cm;
|
||||
WorldSizeR = 20.*cm;
|
||||
|
||||
AbsorberThickness = 40.0*mm;
|
||||
|
||||
AbsorberRadius = 10.*cm;
|
||||
zAbsorber = 36.*cm ;
|
||||
|
||||
// create commands for interactive definition of the calorimeter
|
||||
|
||||
detectorMessenger = new F02DetectorMessenger(this);
|
||||
|
||||
// fEmField = new F02ElectroMagneticField() ;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F02DetectorConstruction::~F02DetectorConstruction()
|
||||
{
|
||||
delete detectorMessenger;
|
||||
if (fEmField) delete fEmField ;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* F02DetectorConstruction::Construct()
|
||||
{
|
||||
DefineMaterials();
|
||||
return ConstructCalorimeter();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
//This function illustrates the possible ways to define materials
|
||||
|
||||
G4String name, symbol ; // a=mass of a mole;
|
||||
G4double a, z, density ; // z=mean number of protons;
|
||||
G4int nel;
|
||||
G4int ncomponents;
|
||||
G4double fractionmass, pressure, temperature;
|
||||
|
||||
//
|
||||
// define Elements
|
||||
//
|
||||
|
||||
a = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
||||
|
||||
a = 6.01*g/mole;
|
||||
G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
||||
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
||||
|
||||
a = 39.948*g/mole;
|
||||
G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
|
||||
|
||||
//
|
||||
// define simple materials
|
||||
//
|
||||
|
||||
// Mylar
|
||||
|
||||
density = 1.39*g/cm3;
|
||||
G4Material* Mylar = new G4Material(name="Mylar", density, nel=3);
|
||||
Mylar->AddElement(elO,2);
|
||||
Mylar->AddElement(elC,5);
|
||||
Mylar->AddElement(elH,4);
|
||||
|
||||
// Polypropelene
|
||||
|
||||
G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
|
||||
CH2->AddElement(elH,2);
|
||||
CH2->AddElement(elC,1);
|
||||
|
||||
// Krypton as detector gas, STP
|
||||
|
||||
density = 3.700*mg/cm3 ;
|
||||
a = 83.80*g/mole ;
|
||||
G4Material* Kr = new G4Material(name="Kr",z=36., a, density );
|
||||
|
||||
// Dry air (average composition)
|
||||
|
||||
density = 1.7836*mg/cm3 ; // STP
|
||||
G4Material* Argon = new G4Material(name="Argon" , density, ncomponents=1);
|
||||
Argon->AddElement(elAr, 1);
|
||||
|
||||
density = 1.25053*mg/cm3 ; // STP
|
||||
G4Material* Nitrogen = new G4Material(name="N2" , density, ncomponents=1);
|
||||
Nitrogen->AddElement(elN, 2);
|
||||
|
||||
density = 1.4289*mg/cm3 ; // STP
|
||||
G4Material* Oxygen = new G4Material(name="O2" , density, ncomponents=1);
|
||||
Oxygen->AddElement(elO, 2);
|
||||
|
||||
|
||||
density = 1.2928*mg/cm3 ; // STP
|
||||
|
||||
temperature = STP_Temperature;
|
||||
pressure = 1.0e-0*STP_Pressure;
|
||||
|
||||
G4Material* Air = new G4Material(name="Air" , density, ncomponents=3,
|
||||
kStateGas,temperature,pressure);
|
||||
Air->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
|
||||
Air->AddMaterial( Oxygen, fractionmass = 0.2315 ) ;
|
||||
Air->AddMaterial( Argon, fractionmass = 0.0128 ) ;
|
||||
|
||||
// Xenon as detector gas, STP
|
||||
|
||||
density = 5.858*mg/cm3 ;
|
||||
a = 131.29*g/mole ;
|
||||
G4Material* Xe = new G4Material(name="Xenon",z=54., a, density );
|
||||
|
||||
// Carbon dioxide, STP
|
||||
|
||||
density = 1.977*mg/cm3;
|
||||
G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
|
||||
CarbonDioxide->AddElement(elC,1);
|
||||
CarbonDioxide->AddElement(elO,2);
|
||||
|
||||
// 80% Xe + 20% CO2, STP
|
||||
|
||||
density = 5.0818*mg/cm3 ;
|
||||
G4Material* Xe20CO2 = new G4Material(name="Xe20CO2" , density, ncomponents=2);
|
||||
Xe20CO2->AddMaterial( Xe, fractionmass = 0.922 ) ;
|
||||
Xe20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.078 ) ;
|
||||
|
||||
// 80% Kr + 20% CO2, STP
|
||||
|
||||
density = 3.601*mg/cm3 ;
|
||||
G4Material* Kr20CO2 = new G4Material(name="Kr20CO2" , density,
|
||||
ncomponents=2);
|
||||
Kr20CO2->AddMaterial( Kr, fractionmass = 0.89 ) ;
|
||||
Kr20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.11 ) ;
|
||||
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
AbsorberMaterial = Kr20CO2 ; // XeCO2CF4 ;
|
||||
|
||||
WorldMaterial = Air ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* F02DetectorConstruction::ConstructCalorimeter()
|
||||
{
|
||||
// complete the Calor parameters definition and Print
|
||||
|
||||
ComputeCalorParameters();
|
||||
PrintCalorParameters();
|
||||
|
||||
// World
|
||||
|
||||
if(solidWorld) delete solidWorld ;
|
||||
if(logicWorld) delete logicWorld ;
|
||||
if(physiWorld) delete physiWorld ;
|
||||
|
||||
solidWorld = new G4Tubs("World", //its name
|
||||
0.,WorldSizeR,WorldSizeZ/2.,0.,twopi) ;//its size
|
||||
|
||||
logicWorld = new G4LogicalVolume(solidWorld, //its solid
|
||||
WorldMaterial, //its material
|
||||
"World"); //its name
|
||||
|
||||
physiWorld = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
"World", //its name
|
||||
logicWorld, //its logical volume
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
// Absorber
|
||||
|
||||
if (AbsorberThickness > 0.)
|
||||
{
|
||||
if(solidAbsorber) delete solidAbsorber ;
|
||||
if(logicAbsorber) delete logicAbsorber ;
|
||||
if(physiAbsorber) delete physiAbsorber ;
|
||||
|
||||
solidAbsorber = new G4Tubs("Absorber",
|
||||
0.,AbsorberRadius,AbsorberThickness/2.,0.,twopi);
|
||||
|
||||
logicAbsorber = new G4LogicalVolume(solidAbsorber,
|
||||
AbsorberMaterial,
|
||||
"Absorber");
|
||||
|
||||
physiAbsorber = new G4PVPlacement(0,
|
||||
G4ThreeVector(0.,0.,zAbsorber),
|
||||
"Absorber",
|
||||
logicAbsorber,
|
||||
physiWorld,
|
||||
false,
|
||||
0);
|
||||
|
||||
}
|
||||
|
||||
// Sensitive Detectors: Absorber
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
if(!calorimeterSD)
|
||||
{
|
||||
calorimeterSD = new F02CalorimeterSD("CalorSD",this);
|
||||
SDman->AddNewDetector( calorimeterSD );
|
||||
}
|
||||
if (logicAbsorber) logicAbsorber->SetSensitiveDetector(calorimeterSD);
|
||||
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n The WORLD is made of "
|
||||
<< WorldSizeZ/mm << "mm of " << WorldMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) of the world is " << WorldSizeR/mm << " mm. " << G4endl;
|
||||
G4cout << " The ABSORBER is made of "
|
||||
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) is " << AbsorberRadius/mm << " mm. " << G4endl;
|
||||
G4cout << " Z position of the (middle of the) absorber " << zAbsorber/mm << " mm." << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)[J];
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{
|
||||
AbsorberMaterial = pttoMaterial;
|
||||
logicAbsorber->SetMaterial(pttoMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetWorldMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)[J];
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{
|
||||
WorldMaterial = pttoMaterial;
|
||||
logicWorld->SetMaterial(pttoMaterial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetAbsorberThickness(G4double val)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
AbsorberThickness = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetAbsorberRadius(G4double val)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
AbsorberRadius = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetWorldSizeZ(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeZ = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetWorldSizeR(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeR = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::SetAbsorberZpos(G4double val)
|
||||
{
|
||||
zAbsorber = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02DetectorMessenger.cc,v 1.3 2001/10/25 09:30:39 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02DetectorMessenger.hh"
|
||||
|
||||
#include "F02DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02DetectorMessenger::F02DetectorMessenger(F02DetectorConstruction * F02Det)
|
||||
:F02Detector(F02Det)
|
||||
{
|
||||
F02detDir = new G4UIdirectory("/calor/");
|
||||
F02detDir->SetGuidance("F02 detector control.");
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Lead");
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
|
||||
WorldMaterCmd->SetGuidance("Select Material of the World.");
|
||||
WorldMaterCmd->SetParameterName("wchoice",true);
|
||||
WorldMaterCmd->SetDefaultValue("Air");
|
||||
WorldMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
AbsThickCmd->SetParameterName("SizeZ",false,false);
|
||||
AbsThickCmd->SetDefaultUnit("mm");
|
||||
AbsThickCmd->SetRange("SizeZ>0.");
|
||||
AbsThickCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
|
||||
AbsRadCmd->SetGuidance("Set radius of the Absorber");
|
||||
AbsRadCmd->SetParameterName("SizeR",false,false);
|
||||
AbsRadCmd->SetDefaultUnit("mm");
|
||||
AbsRadCmd->SetRange("SizeR>0.");
|
||||
AbsRadCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
|
||||
AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
|
||||
AbsZposCmd->SetParameterName("Zpos",false,false);
|
||||
AbsZposCmd->SetDefaultUnit("mm");
|
||||
AbsZposCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
|
||||
WorldZCmd->SetGuidance("Set Z size of the World");
|
||||
WorldZCmd->SetParameterName("WSizeZ",false,false);
|
||||
WorldZCmd->SetDefaultUnit("mm");
|
||||
WorldZCmd->SetRange("WSizeZ>0.");
|
||||
WorldZCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
|
||||
WorldRCmd->SetGuidance("Set R size of the World");
|
||||
WorldRCmd->SetParameterName("WSizeR",false,false);
|
||||
WorldRCmd->SetDefaultUnit("mm");
|
||||
WorldRCmd->SetRange("WSizeR>0.");
|
||||
WorldRCmd->AvailableForStates(Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02DetectorMessenger::~F02DetectorMessenger()
|
||||
{
|
||||
delete AbsMaterCmd;
|
||||
delete AbsThickCmd;
|
||||
delete AbsRadCmd;
|
||||
delete AbsZposCmd;
|
||||
delete WorldMaterCmd;
|
||||
delete WorldZCmd;
|
||||
delete WorldRCmd;
|
||||
delete UpdateCmd;
|
||||
delete F02detDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == AbsMaterCmd )
|
||||
{ F02Detector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == WorldMaterCmd )
|
||||
{ F02Detector->SetWorldMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ F02Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsRadCmd )
|
||||
{ F02Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsZposCmd )
|
||||
{ F02Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldZCmd )
|
||||
{ F02Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldRCmd )
|
||||
{ F02Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ F02Detector->UpdateGeometry(); }
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02ElectroMagneticField.cc,v 1.5 2001/11/12 09:41:26 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// User Field class implementation.
|
||||
//
|
||||
|
||||
|
||||
#include "F02ElectroMagneticField.hh"
|
||||
#include "F02FieldMessenger.hh"
|
||||
|
||||
#include "G4UniformElectricField.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4EquationOfMotion.hh"
|
||||
#include "G4EqMagElectricField.hh"
|
||||
#include "G4Mag_UsualEqRhs.hh"
|
||||
#include "G4MagIntegratorStepper.hh"
|
||||
#include "G4ChordFinder.hh"
|
||||
|
||||
#include "G4ExplicitEuler.hh"
|
||||
#include "G4ImplicitEuler.hh"
|
||||
#include "G4SimpleRunge.hh"
|
||||
#include "G4SimpleHeum.hh"
|
||||
#include "G4ClassicalRK4.hh"
|
||||
#include "G4HelixExplicitEuler.hh"
|
||||
#include "G4HelixImplicitEuler.hh"
|
||||
#include "G4HelixSimpleRunge.hh"
|
||||
#include "G4CashKarpRKF45.hh"
|
||||
#include "G4RKG3_Stepper.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructors:
|
||||
|
||||
F02ElectroMagneticField::F02ElectroMagneticField()
|
||||
: G4UniformElectricField(G4ThreeVector(0.0,100000.0*kilovolt/cm,0.0)),
|
||||
fChordFinder(0), fStepper(0)
|
||||
{
|
||||
fEMfield = new G4UniformElectricField(
|
||||
G4ThreeVector(0.0,100000.0*kilovolt/cm,0.0));
|
||||
fFieldMessenger = new F02FieldMessenger(this) ;
|
||||
fEquation = new G4EqMagElectricField(fEMfield);
|
||||
fMinStep = 1.0*mm ; // minimal step of 1 mm is default
|
||||
fStepperType = 4 ; // ClassicalRK4 is default stepper
|
||||
|
||||
fFieldManager = GetGlobalFieldManager();
|
||||
UpdateField();
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02ElectroMagneticField::F02ElectroMagneticField(G4ThreeVector pFV)
|
||||
: G4UniformElectricField(pFV)
|
||||
{
|
||||
fEMfield = new G4UniformElectricField(pFV);
|
||||
GetGlobalFieldManager()->CreateChordFinder(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02ElectroMagneticField::~F02ElectroMagneticField()
|
||||
{
|
||||
if(fEMfield) delete fEMfield;
|
||||
if(fChordFinder) delete fChordFinder;
|
||||
if(fStepper) delete fStepper;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Update field
|
||||
//
|
||||
|
||||
void F02ElectroMagneticField::UpdateField()
|
||||
{
|
||||
SetStepper();
|
||||
G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl ;
|
||||
|
||||
fFieldManager->SetDetectorField(fEMfield );
|
||||
if(fChordFinder) delete fChordFinder;
|
||||
fChordFinder = new G4ChordFinder( fEMfield, fMinStep,fStepper);
|
||||
fFieldManager->SetChordFinder( fChordFinder );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set stepper according to the stepper type
|
||||
//
|
||||
|
||||
void F02ElectroMagneticField::SetStepper()
|
||||
{
|
||||
G4int nvar = 8;
|
||||
|
||||
if(fStepper) delete fStepper;
|
||||
|
||||
switch ( fStepperType )
|
||||
{
|
||||
case 0:
|
||||
fStepper = new G4ExplicitEuler( fEquation, nvar );
|
||||
G4cout<<"G4ExplicitEuler is calledS"<<G4endl;
|
||||
break;
|
||||
case 1:
|
||||
fStepper = new G4ImplicitEuler( fEquation, nvar );
|
||||
G4cout<<"G4ImplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 2:
|
||||
fStepper = new G4SimpleRunge( fEquation, nvar );
|
||||
G4cout<<"G4SimpleRunge is called"<<G4endl;
|
||||
break;
|
||||
case 3:
|
||||
fStepper = new G4SimpleHeum( fEquation, nvar );
|
||||
G4cout<<"G4SimpleHeum is called"<<G4endl;
|
||||
break;
|
||||
case 4:
|
||||
fStepper = new G4ClassicalRK4( fEquation, nvar );
|
||||
G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
|
||||
break;
|
||||
case 5:
|
||||
fStepper = new G4CashKarpRKF45( fEquation, nvar );
|
||||
G4cout<<"G4CashKarpRKF45 is called"<<G4endl;
|
||||
break;
|
||||
/* ***********************************
|
||||
case 6:
|
||||
fStepper = new G4RKG3_Stepper( fEquation, nvar );
|
||||
G4cout<<"G4RKG3_Stepper is called"<<G4endl;
|
||||
break;
|
||||
case 7:
|
||||
fStepper = new G4HelixExplicitEuler( fEquation );
|
||||
G4cout<<"G4HelixExplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 8:
|
||||
fStepper = new G4HelixImplicitEuler( fEquation );
|
||||
G4cout<<"G4HelixImplicitEuler is called"<<G4endl;
|
||||
break;
|
||||
case 9:
|
||||
fStepper = new G4HelixSimpleRunge( fEquation );
|
||||
G4cout<<"G4HelixSimpleRunge is called"<<G4endl;
|
||||
break;
|
||||
****************************************** */
|
||||
default: fStepper = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set the value of the Global Field to fieldValue along Z
|
||||
//
|
||||
|
||||
void F02ElectroMagneticField::SetFieldValue(G4double fieldValue)
|
||||
{
|
||||
if(fEMfield) delete fEMfield;
|
||||
fEMfield = new G4UniformElectricField(G4ThreeVector(0,0,fieldValue));
|
||||
// UpdateField();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set the value of the Global Field
|
||||
//
|
||||
|
||||
void F02ElectroMagneticField::SetFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
// Find the Field Manager for the global field
|
||||
G4FieldManager* fieldMgr= GetGlobalFieldManager();
|
||||
|
||||
if(fieldVector != G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
if(fEMfield) delete fEMfield;
|
||||
fEMfield = new G4UniformElectricField(fieldVector);
|
||||
|
||||
// UpdateField();
|
||||
|
||||
fieldMgr->SetDetectorField(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the new field's value is Zero, then it is best to
|
||||
// insure that it is not used for propagation.
|
||||
|
||||
G4MagneticField* fEMfield = 0;
|
||||
fieldMgr->SetDetectorField(fEMfield);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Utility method
|
||||
|
||||
G4FieldManager* F02ElectroMagneticField::GetGlobalFieldManager()
|
||||
{
|
||||
return G4TransportationManager::GetTransportationManager()
|
||||
->GetFieldManager();
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02EventAction.cc,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02EventAction.hh"
|
||||
|
||||
#include "F02RunAction.hh"
|
||||
|
||||
#include "F02CalorHit.hh"
|
||||
#include "F02EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02EventAction::F02EventAction(F02RunAction* F02RA)
|
||||
: calorimeterCollID(-1), eventMessenger(0),
|
||||
runaction(F02RA), verboselevel(0),
|
||||
drawFlag("all"), printModulo(10000)
|
||||
{
|
||||
eventMessenger = new F02EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02EventAction::~F02EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
|
||||
|
||||
if(verboselevel>1)
|
||||
G4cout << "<<< Event " << evtNb << " started." << G4endl;
|
||||
|
||||
if (calorimeterCollID==-1)
|
||||
{
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
calorimeterCollID = SDman->GetCollectionID("CalCollection");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
|
||||
if (drawFlag == "all") trj->DrawTrajectory(50);
|
||||
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
|
||||
trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
|
||||
if(verboselevel>0)
|
||||
G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
|
||||
|
||||
// save rndm status
|
||||
if (runaction->GetRndmFreq() == 2)
|
||||
{
|
||||
HepRandom::saveEngineStatus("endOfEvent.rndm");
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
{
|
||||
G4cout << "\n---> End of Event: " << evtNb << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4int F02EventAction::GetEventno()
|
||||
{
|
||||
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
|
||||
return evno ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02EventAction::setEventVerbose(G4int level)
|
||||
{
|
||||
verboselevel = level ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02EventActionMessenger.cc,v 1.3 2001/10/15 17:20:43 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "globals.hh"
|
||||
#include "F02EventActionMessenger.hh"
|
||||
|
||||
#include "F02EventAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02EventActionMessenger::F02EventActionMessenger(F02EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
setVerboseCmd = new G4UIcmdWithAnInteger("/event/setverbose",this);
|
||||
setVerboseCmd->SetGuidance("Set verbose level ." );
|
||||
setVerboseCmd->SetParameterName("level",true);
|
||||
setVerboseCmd->SetDefaultValue(0);
|
||||
|
||||
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged all");
|
||||
DrawCmd->AvailableForStates(Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02EventActionMessenger::~F02EventActionMessenger()
|
||||
{
|
||||
delete setVerboseCmd;
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if(command == setVerboseCmd)
|
||||
{eventAction->setEventVerbose(setVerboseCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02FieldMessenger.cc,v 1.3 2001/10/15 17:20:43 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "F02FieldMessenger.hh"
|
||||
|
||||
#include "F02ElectroMagneticField.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02FieldMessenger::F02FieldMessenger(F02ElectroMagneticField* pEMfield)
|
||||
:fEMfield(pEMfield)
|
||||
{
|
||||
F02detDir = new G4UIdirectory("/field/");
|
||||
F02detDir->SetGuidance("F02 field tracking control.");
|
||||
|
||||
StepperCmd = new G4UIcmdWithAnInteger("/field/setStepperType",this);
|
||||
StepperCmd->SetGuidance("Select stepper type for electric field");
|
||||
StepperCmd->SetParameterName("choice",true);
|
||||
StepperCmd->SetDefaultValue(4);
|
||||
StepperCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/field/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
|
||||
MagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MagFieldCmd->SetParameterName("Bz",false,false);
|
||||
MagFieldCmd->SetDefaultUnit("tesla");
|
||||
MagFieldCmd->AvailableForStates(Idle);
|
||||
|
||||
MinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
|
||||
MinStepCmd->SetGuidance("Define minimal step");
|
||||
MinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MinStepCmd->SetParameterName("min step",false,false);
|
||||
MinStepCmd->SetDefaultUnit("mm");
|
||||
MinStepCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/field/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Xe");
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02FieldMessenger::~F02FieldMessenger()
|
||||
{
|
||||
delete StepperCmd;
|
||||
delete MagFieldCmd;
|
||||
delete MinStepCmd;
|
||||
delete F02detDir;
|
||||
delete UpdateCmd;
|
||||
|
||||
delete AbsMaterCmd;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02FieldMessenger::SetNewValue( G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == StepperCmd )
|
||||
{
|
||||
fEMfield->SetStepperType(StepperCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
if( command == UpdateCmd )
|
||||
{
|
||||
fEMfield->UpdateField();
|
||||
}
|
||||
if( command == MagFieldCmd )
|
||||
{
|
||||
fEMfield->SetFieldValue(MagFieldCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
if( command == MinStepCmd )
|
||||
{
|
||||
fEMfield->SetMinStep(MinStepCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,457 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PhysicsList.cc,v 1.4 2001/10/25 09:30:53 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "G4Timer.hh"
|
||||
|
||||
#include "F02PhysicsList.hh"
|
||||
#include "F02DetectorConstruction.hh"
|
||||
#include "F02PhysicsListMessenger.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
#include "G4FastSimulationManagerProcess.hh"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F02PhysicsList::F02PhysicsList(F02DetectorConstruction* p)
|
||||
: G4VUserPhysicsList(), MaxChargedStep(DBL_MAX),
|
||||
thePhotoElectricEffect(0), theComptonScattering(0), theGammaConversion(0),
|
||||
theeminusMultipleScattering(0), theeminusIonisation(0),
|
||||
theeminusBremsstrahlung(0),
|
||||
theeplusMultipleScattering(0), theeplusIonisation(0),
|
||||
theeplusBremsstrahlung(0), theeplusAnnihilation(0),
|
||||
theeminusStepCut(0), theeplusStepCut(0)
|
||||
{
|
||||
pDet = p;
|
||||
|
||||
defaultCutValue = 1.000*mm ;
|
||||
|
||||
cutForGamma = defaultCutValue ;
|
||||
cutForElectron = defaultCutValue ;
|
||||
cutForProton = defaultCutValue ;
|
||||
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new F02PhysicsListMessenger(this);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
F02PhysicsList::~F02PhysicsList()
|
||||
{
|
||||
delete physicsListMessenger;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructMesons();
|
||||
ConstructBarions();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02PhysicsList::ConstructBosons()
|
||||
{
|
||||
// gamma
|
||||
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// charged geantino
|
||||
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void F02PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
void F02PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
}
|
||||
|
||||
|
||||
void F02PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void F02PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
AddParameterisation();
|
||||
|
||||
ConstructEM();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
#include "G4PAIonisation.hh"
|
||||
#include "G4ForwardXrayTR.hh"
|
||||
|
||||
#include "F02StepCut.hh"
|
||||
|
||||
#include "G4IonisationByLogicalVolume.hh"
|
||||
|
||||
void F02PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma")
|
||||
{
|
||||
// Construct processes for gamma
|
||||
|
||||
thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theComptonScattering = new G4ComptonScattering();
|
||||
theGammaConversion = new G4GammaConversion();
|
||||
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
|
||||
}
|
||||
else if (particleName == "e-")
|
||||
{
|
||||
// Construct processes for electron
|
||||
|
||||
theeminusIonisation = new G4eIonisation();
|
||||
theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
theeminusStepCut = new F02StepCut();
|
||||
|
||||
pmanager->AddProcess(theeminusIonisation,-1,2,2);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung,-1,1,1);
|
||||
pmanager->AddProcess(theeminusStepCut,-1,-1,4);
|
||||
theeminusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (particleName == "e+")
|
||||
{
|
||||
// Construct processes for positron
|
||||
|
||||
theeplusIonisation = new G4eIonisation();
|
||||
theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
theeplusStepCut = new F02StepCut();
|
||||
|
||||
pmanager->AddProcess(theeplusIonisation,-1,2,2);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung,-1,-1,3);
|
||||
pmanager->AddProcess(theeplusStepCut,-1,-1,5);
|
||||
theeplusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if( particleName == "mu+" ||
|
||||
particleName == "mu-" )
|
||||
{
|
||||
// Construct processes for muon+
|
||||
|
||||
F02StepCut* muonStepCut = new F02StepCut();
|
||||
|
||||
G4MuIonisation* themuIonisation = new G4MuIonisation() ;
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(themuIonisation,-1,2,2);
|
||||
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
|
||||
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
|
||||
|
||||
pmanager->AddProcess( muonStepCut,-1,-1,3);
|
||||
muonStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (
|
||||
particleName == "proton"
|
||||
|| particleName == "antiproton"
|
||||
|| particleName == "pi+"
|
||||
|| particleName == "pi-"
|
||||
|| particleName == "kaon+"
|
||||
|| particleName == "kaon-"
|
||||
)
|
||||
{
|
||||
F02StepCut* thehadronStepCut = new F02StepCut();
|
||||
|
||||
G4hIonisation* thehIonisation = new G4hIonisation() ;
|
||||
G4MultipleScattering* thehMultipleScattering =
|
||||
new G4MultipleScattering() ;
|
||||
|
||||
|
||||
pmanager->AddProcess(thehMultipleScattering,-1,1,1);
|
||||
pmanager->AddProcess(thehIonisation,-1,2,2);
|
||||
|
||||
pmanager->AddProcess( thehadronStepCut,-1,-1,3);
|
||||
thehadronStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void F02PhysicsList::ConstructGeneral()
|
||||
{
|
||||
// Add Decay Process
|
||||
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
if (theDecayProcess->IsApplicable(*particle))
|
||||
{
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::AddParameterisation()
|
||||
{
|
||||
G4FastSimulationManagerProcess* theFastSimulationManagerProcess =
|
||||
new G4FastSimulationManagerProcess() ;
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value() ;
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager() ;
|
||||
|
||||
// both postStep and alongStep action are required: because
|
||||
// of the use of ghost volumes. If no ghost, the postStep is sufficient.
|
||||
|
||||
pmanager->AddProcess(theFastSimulationManagerProcess, -1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetCuts()
|
||||
{
|
||||
G4Timer theTimer ;
|
||||
theTimer.Start() ;
|
||||
if (verboseLevel >0)
|
||||
{
|
||||
G4cout << "F02PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
|
||||
}
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
SetCutValue(cutForGamma,"gamma");
|
||||
|
||||
SetCutValue(cutForElectron,"e-");
|
||||
SetCutValue(cutForElectron,"e+");
|
||||
|
||||
SetCutValue(defaultCutValue,"mu-");
|
||||
SetCutValue(defaultCutValue,"mu+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
SetCutValue(defaultCutValue, "proton");
|
||||
SetCutValue(defaultCutValue, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(defaultCutValue);
|
||||
|
||||
if (verboseLevel>1) DumpCutValuesTable();
|
||||
|
||||
theTimer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout << G4endl ;
|
||||
G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed() << " s " <<G4endl;
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetGammaCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForGamma = val;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetElectronCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForElectron = val;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetProtonCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForProton = val;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetCutsByEnergy(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e-");
|
||||
|
||||
part = theParticleTable->FindParticle("e+");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
part = theParticleTable->FindParticle("proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "proton");
|
||||
|
||||
part = theParticleTable->FindParticle("anti_proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::GetRange(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
G4cout << "material : " << currMat->GetName() << G4endl;
|
||||
G4cout << "particle : " << part->GetParticleName() << G4endl;
|
||||
G4cout << "energy : " << val / keV << " (keV)" << G4endl;
|
||||
G4cout << "range : " << cut / mm << " (mm)" << G4endl;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02PhysicsList::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
G4cout << " MaxChargedStep=" << MaxChargedStep << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PhysicsListMessenger.cc,v 1.3 2001/10/15 17:20:44 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02PhysicsListMessenger.hh"
|
||||
|
||||
#include "F02PhysicsList.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PhysicsListMessenger::F02PhysicsListMessenger(F02PhysicsList * List)
|
||||
: F02List(List)
|
||||
{
|
||||
cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this);
|
||||
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
|
||||
cutGCmd->SetParameterName("range",true);
|
||||
cutGCmd->SetDefaultValue(1.);
|
||||
cutGCmd->SetDefaultUnit("mm");
|
||||
cutGCmd->AvailableForStates(Idle);
|
||||
|
||||
cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this);
|
||||
cutECmd->SetGuidance("Set cut values by RANGE for e- e+.");
|
||||
cutECmd->SetParameterName("range",true);
|
||||
cutECmd->SetDefaultValue(1.);
|
||||
cutECmd->SetDefaultUnit("mm");
|
||||
cutECmd->AvailableForStates(Idle);
|
||||
|
||||
cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this);
|
||||
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
|
||||
cutPCmd->SetParameterName("range",true);
|
||||
cutPCmd->SetDefaultValue(1.);
|
||||
cutPCmd->SetDefaultUnit("mm");
|
||||
cutPCmd->AvailableForStates(Idle);
|
||||
|
||||
eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this);
|
||||
eCmd->SetGuidance("Set cut values by ENERGY for charged particles.");
|
||||
eCmd->SetParameterName("energy",true);
|
||||
eCmd->SetDefaultValue(10.);
|
||||
eCmd->SetDefaultUnit("keV");
|
||||
eCmd->AvailableForStates(Idle);
|
||||
|
||||
rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this);
|
||||
rCmd->SetGuidance("Display the RANGE of Electron for the current material.");
|
||||
rCmd->SetParameterName("energy",true);
|
||||
rCmd->SetDefaultValue(10.);
|
||||
rCmd->SetDefaultUnit("keV");
|
||||
rCmd->AvailableForStates(Idle);
|
||||
|
||||
setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this);
|
||||
setMaxStepCmd->SetGuidance("Set max. step length in the detector");
|
||||
setMaxStepCmd->SetParameterName("mxStep",true);
|
||||
setMaxStepCmd->SetDefaultUnit("mm");
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PhysicsListMessenger::~F02PhysicsListMessenger()
|
||||
{
|
||||
|
||||
delete setMaxStepCmd;
|
||||
|
||||
delete cutGCmd;
|
||||
delete cutECmd;
|
||||
delete cutPCmd;
|
||||
delete rCmd;
|
||||
delete eCmd;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == cutGCmd)
|
||||
{ F02List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutECmd)
|
||||
{ F02List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutPCmd)
|
||||
{ F02List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == eCmd)
|
||||
{ F02List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));}
|
||||
if(command == rCmd)
|
||||
{ F02List->GetRange(rCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == setMaxStepCmd)
|
||||
{ F02List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PrimaryGeneratorAction.cc,v 1.3 2001/10/15 17:20:44 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "F02DetectorConstruction.hh"
|
||||
#include "F02PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4String F02PrimaryGeneratorAction::thePrimaryParticleName = "proton" ;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PrimaryGeneratorAction::F02PrimaryGeneratorAction(
|
||||
F02DetectorConstruction* F02DC)
|
||||
: F02Detector(F02DC), rndmFlag("off"),
|
||||
xvertex(0.),yvertex(0.),zvertex(0.),
|
||||
vertexdefined(false)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
// create a messenger for this class
|
||||
//
|
||||
gunMessenger = new F02PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="proton");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
|
||||
thePrimaryParticleName = particle->GetParticleName() ;
|
||||
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
particleGun->SetParticleEnergy(100.*GeV);
|
||||
|
||||
zvertex = 0. ; // -0.5*(F02Detector->GetAbsorberThickness());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(xvertex,yvertex,zvertex));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PrimaryGeneratorAction::~F02PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
// this function is called at the begining of event
|
||||
//
|
||||
thePrimaryParticleName = particleGun->GetParticleDefinition()->
|
||||
GetParticleName() ;
|
||||
G4double x0,y0,z0 ;
|
||||
if(vertexdefined)
|
||||
{
|
||||
x0 = xvertex ;
|
||||
y0 = yvertex ;
|
||||
z0 = zvertex ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x0 = 0. ;
|
||||
y0 = 0. ;
|
||||
z0 = 0. ; // -0.5*(F02Detector->GetWorldSizeZ()) ;
|
||||
}
|
||||
G4double r0,phi0 ;
|
||||
|
||||
if (rndmFlag == "on")
|
||||
{
|
||||
r0 = (F02Detector->GetAbsorberRadius())*sqrt(G4UniformRand());
|
||||
phi0 = twopi*G4UniformRand();
|
||||
x0 = r0*cos(phi0);
|
||||
y0 = r0*sin(phi0);
|
||||
}
|
||||
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4String F02PrimaryGeneratorAction::GetPrimaryName()
|
||||
{
|
||||
return thePrimaryParticleName ;
|
||||
}
|
||||
|
||||
void F02PrimaryGeneratorAction::Setzvertex(G4double z)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
zvertex = z ;
|
||||
G4cout << " Z coordinate of the primary vertex = " << zvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
void F02PrimaryGeneratorAction::Setxvertex(G4double x)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
xvertex = x ;
|
||||
G4cout << " X coordinate of the primary vertex = " << xvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
|
||||
void F02PrimaryGeneratorAction::Setyvertex(G4double y)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
yvertex = y ;
|
||||
G4cout << " Y coordinate of the primary vertex = " << yvertex/mm <<
|
||||
" mm." << G4endl;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02PrimaryGeneratorMessenger.cc,v 1.3 2001/10/15 17:20:44 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "F02PrimaryGeneratorAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PrimaryGeneratorMessenger::F02PrimaryGeneratorMessenger(F02PrimaryGeneratorAction* F02Gun)
|
||||
: F02Action(F02Gun)
|
||||
{
|
||||
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);
|
||||
|
||||
setxvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
|
||||
setxvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
|
||||
setxvertexCmd->SetParameterName("xv",true);
|
||||
setxvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setyvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
|
||||
setyvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
|
||||
setyvertexCmd->SetParameterName("yv",true);
|
||||
setyvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setzvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
|
||||
setzvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
|
||||
setzvertexCmd->SetParameterName("zv",true);
|
||||
setzvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02PrimaryGeneratorMessenger::~F02PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
delete setxvertexCmd;
|
||||
delete setyvertexCmd;
|
||||
delete setzvertexCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ F02Action->SetRndmFlag(newValue);}
|
||||
if( command == setxvertexCmd)
|
||||
{ F02Action->Setxvertex(setxvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setyvertexCmd)
|
||||
{ F02Action->Setyvertex(setyvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setzvertexCmd)
|
||||
{ F02Action->Setzvertex(setzvertexCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02RunAction.cc,v 1.4 2001/11/07 16:36:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#include "F02RunAction.hh"
|
||||
#include "F02RunMessenger.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02RunAction::F02RunAction()
|
||||
: saveRndm(0)
|
||||
{
|
||||
runMessenger = new F02RunMessenger(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
F02RunAction::~F02RunAction()
|
||||
{
|
||||
delete runMessenger;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
// save Rndm status
|
||||
if (saveRndm > 0)
|
||||
{
|
||||
HepRandom::showEngineStatus();
|
||||
HepRandom::saveEngineStatus("beginOfRun.rndm");
|
||||
}
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager) UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void F02RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
|
||||
}
|
||||
|
||||
// save Rndm status
|
||||
|
||||
if (saveRndm == 1)
|
||||
{
|
||||
HepRandom::showEngineStatus();
|
||||
HepRandom::saveEngineStatus("endOfRun.rndm");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02RunMessenger.cc,v 1.3 2001/10/15 17:20:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02RunMessenger.hh"
|
||||
|
||||
#include "F02RunAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02RunMessenger::F02RunMessenger(F02RunAction* RA)
|
||||
:runAction (RA)
|
||||
{
|
||||
RndmDir = new G4UIdirectory("/rndm/");
|
||||
RndmDir->SetGuidance("Rndm status control.");
|
||||
|
||||
RndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
|
||||
RndmSaveCmd->SetGuidance("set frequency to save rndm status on external files.");
|
||||
RndmSaveCmd->SetGuidance("freq = 0 not saved");
|
||||
RndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
|
||||
RndmSaveCmd->SetParameterName("frequency",false);
|
||||
RndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
|
||||
RndmSaveCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
RndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
|
||||
RndmReadCmd->SetGuidance("get rndm status from an external file.");
|
||||
RndmReadCmd->SetParameterName("fileName",true);
|
||||
RndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
|
||||
RndmReadCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02RunMessenger::~F02RunMessenger()
|
||||
{
|
||||
delete RndmSaveCmd; delete RndmReadCmd; delete RndmDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02RunMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{
|
||||
if (command == RndmSaveCmd)
|
||||
runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValues));
|
||||
|
||||
if (command == RndmReadCmd)
|
||||
{ G4cout << "\n---> rndm status restored from file: "
|
||||
<< newValues << G4endl;
|
||||
HepRandom::restoreEngineStatus(newValues);
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02StepCut.cc,v 1.2 2001/07/11 09:58:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "F02StepCut.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
F02StepCut::F02StepCut(const G4String& aName)
|
||||
: G4VDiscreteProcess(aName),MaxChargedStep(DBL_MAX)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created "<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
F02StepCut::~F02StepCut()
|
||||
{
|
||||
}
|
||||
|
||||
F02StepCut::F02StepCut(F02StepCut& right)
|
||||
:G4VDiscreteProcess(right)
|
||||
{}
|
||||
|
||||
void F02StepCut::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingAction.cc,v 1.4 2001/11/07 16:36:33 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02SteppingAction.hh"
|
||||
#include "F02SteppingMessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02SteppingAction::F02SteppingAction()
|
||||
: steppingMessenger(0)
|
||||
{
|
||||
steppingMessenger = new F02SteppingMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02SteppingAction::~F02SteppingAction()
|
||||
{
|
||||
delete steppingMessenger ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02SteppingAction::UserSteppingAction(const G4Step*)
|
||||
{
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingMessenger.cc,v 1.2 2001/07/11 09:58:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F02SteppingMessenger.hh"
|
||||
|
||||
#include "F02SteppingAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02SteppingMessenger::F02SteppingMessenger(F02SteppingAction* SA)
|
||||
:steppingAction (SA)
|
||||
{
|
||||
steppingDir = new G4UIdirectory("/stepping/");
|
||||
steppingDir->SetGuidance("stepping control");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02SteppingMessenger::~F02SteppingMessenger()
|
||||
{
|
||||
delete steppingDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02SteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02SteppingVerbose.cc,v 1.4 2001/10/15 17:20:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// F02SteppingVerbose.cc
|
||||
//
|
||||
// Description:
|
||||
// Implementation of the F02SteppingVerbose class
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "F02SteppingVerbose.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
////////////////////////////////////////////////
|
||||
F02SteppingVerbose::F02SteppingVerbose()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
F02SteppingVerbose::~F02SteppingVerbose()
|
||||
//////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
void F02SteppingVerbose::StepInfo()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << G4endl;
|
||||
G4cout << G4std::setw( 5) << "#Step#" << " "
|
||||
<< G4std::setw( 6) << "X" << " "
|
||||
<< G4std::setw( 6) << "Y" << " "
|
||||
<< G4std::setw( 6) << "Z" << " "
|
||||
<< G4std::setw( 9) << "KineE" << " "
|
||||
<< G4std::setw( 9) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "NextVolu"
|
||||
<< G4std::setw(10) << "Process" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
// if( fStepStatus != fWorldBoundary){
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName();
|
||||
} else {
|
||||
G4cout << G4std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
G4cout << G4std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << "User Limit";
|
||||
}
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << " :----- List of 2ndaries - "
|
||||
<< "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot
|
||||
<< "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt
|
||||
<< ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt
|
||||
<< ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt
|
||||
<< "), "
|
||||
<< " ---------------"
|
||||
<< G4endl;
|
||||
G4cout << " :-----------------------------"
|
||||
<< "----------------------------------"
|
||||
<< "-- EndOf2ndaries Info ---------------"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
void F02SteppingVerbose::TrackingStarted()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << G4std::setw( 5) << "Step#" << " "
|
||||
<< G4std::setw( 6) << "X" << " "
|
||||
<< G4std::setw( 6) << "Y" << " "
|
||||
<< G4std::setw( 6) << "Z" << " "
|
||||
<< G4std::setw( 9) << "KineE" << " "
|
||||
<< G4std::setw( 9) << "dEStep" << " "
|
||||
<< G4std::setw(10) << "StepLeng"
|
||||
<< G4std::setw(10) << "TrakLeng"
|
||||
<< G4std::setw(10) << "NextVolu"
|
||||
<< G4std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
|
||||
} else {
|
||||
G4cout << G4std::setw(10) << "OutOfWorld" << " ";
|
||||
}
|
||||
G4cout << G4std::setw(10) << "initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F02VisManager.cc,v 1.3 2001/12/12 15:22:31 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "F02VisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
#include "G4Wo.hh"
|
||||
#include "G4Xo.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F02VisManager::F02VisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F02VisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPACS
|
||||
RegisterGraphicsSystem (new G4Wo);
|
||||
RegisterGraphicsSystem (new G4Xo);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,19 @@
|
||||
# $Id: GNUmakefile,v 1.2 2001/10/15 17:20:46 gcosmo Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := field03
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
@@ -0,0 +1,24 @@
|
||||
$Id: History,v 1.3 2001/11/07 16:36:33 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field03 History file
|
||||
--------------------
|
||||
This file should be used by the G4 example coordinator to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Nov 7th, 2001 - G.Cosmo
|
||||
-----------------------
|
||||
- More cleanup and fixes to primary generator gun (V.Grichine).
|
||||
|
||||
Oct 15th, 2001 - G.Cosmo
|
||||
------------------------
|
||||
- Cleaned from test code.
|
||||
@@ -0,0 +1,80 @@
|
||||
$Id: README,v 1.3 2001/10/25 10:03:53 grichine Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
field03
|
||||
-------
|
||||
|
||||
Example of tracking in magnetic field where field associated
|
||||
to selected logical volumes varies.
|
||||
|
||||
|
||||
1- GEOMETRY DEFINITION
|
||||
|
||||
The "absorber" is a solid made of a given material.
|
||||
|
||||
Three parameters define the absorber :
|
||||
- the material of the absorber,
|
||||
- the thickness of an absorber,
|
||||
- the transverse size of the absorber (the input face is a square).
|
||||
|
||||
The volume "World" contains the "absorber".
|
||||
In this test the parameters of the "World" can be changed , too.
|
||||
|
||||
In addition a transverse uniform magnetic field can be applied.
|
||||
|
||||
The default geometry is constructed in DetectorConstruction class,
|
||||
but all the parameters can be changed via
|
||||
the commands defined in the DetectorMessenger class.
|
||||
|
||||
2- AN EVENT : THE PRIMARY GENERATOR
|
||||
|
||||
The primary kinematic consists of a single particle which hits the
|
||||
absorber 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 (see
|
||||
the macros provided with this example).
|
||||
|
||||
A RUN is a set of events.
|
||||
|
||||
3- DETECTOR RESPONSE
|
||||
|
||||
|
||||
A HIT is a record, event per event , of all the
|
||||
informations needed to simulate and analyse the detector response.
|
||||
|
||||
In this example a CalorHit is defined as a set of 2 informations:
|
||||
- the total energy deposit in the absorber,
|
||||
- the total tracklength of all charged particles in the absorber,
|
||||
|
||||
Therefore the absorber is declared
|
||||
'sensitive detector' (SD), which means they can contribute to the hit.
|
||||
|
||||
|
||||
4- PHYSICS DEMO
|
||||
|
||||
The particle's type and the physic processes which will be available
|
||||
in this example are set in PhysicsList class.
|
||||
|
||||
The messenger classes introduce interactive commands . Using these
|
||||
commands the geometry of the detector, the data of the primary
|
||||
particle, etc. can be changed.
|
||||
|
||||
|
||||
5- HOW TO START ?
|
||||
|
||||
- compile and link to generate an executable
|
||||
% cd $G4INSTALL/example/extended/field/field03
|
||||
% gmake
|
||||
|
||||
- execute field01 in 'batch' mode from macro files e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field03 field03.in
|
||||
|
||||
- execute field01 in 'interactive' mode with visualization e.g.
|
||||
% $(G4INSTALL)/bin/$(G4SYSTEM)/field03
|
||||
....
|
||||
Idle> type your commands
|
||||
....
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: field03.cc,v 1.4 2001/11/07 16:36:33 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Example F03
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "F03VisManager.hh"
|
||||
#endif
|
||||
|
||||
#include "F03DetectorConstruction.hh"
|
||||
#include "F03ElectroMagneticField.hh"
|
||||
#include "F03PhysicsList.hh"
|
||||
#include "F03PrimaryGeneratorAction.hh"
|
||||
#include "F03RunAction.hh"
|
||||
#include "F03EventAction.hh"
|
||||
#include "F03SteppingAction.hh"
|
||||
#include "F03SteppingVerbose.hh"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
|
||||
//choose the Random engine
|
||||
|
||||
HepRandom::setTheEngine(new RanecuEngine);
|
||||
|
||||
//my Verbose output class
|
||||
|
||||
G4VSteppingVerbose::SetInstance(new F03SteppingVerbose);
|
||||
|
||||
// Construct the default run manager
|
||||
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// Construct the electromagnetic field
|
||||
|
||||
F03ElectroMagneticField* field = new F03ElectroMagneticField() ;
|
||||
|
||||
// Set mandatory initialization classes
|
||||
|
||||
F03DetectorConstruction* detector;
|
||||
detector = new F03DetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new F03PhysicsList(detector));
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
// visualization manager
|
||||
|
||||
G4VisManager* visManager = new F03VisManager;
|
||||
visManager->Initialize();
|
||||
|
||||
#endif
|
||||
|
||||
// Set user action classes
|
||||
|
||||
runManager->SetUserAction(new F03PrimaryGeneratorAction(detector));
|
||||
|
||||
F03RunAction* runAction = new F03RunAction;
|
||||
|
||||
runManager->SetUserAction(runAction);
|
||||
|
||||
F03EventAction* eventAction = new F03EventAction(runAction);
|
||||
|
||||
runManager->SetUserAction(eventAction);
|
||||
|
||||
F03SteppingAction* steppingAction = new F03SteppingAction();
|
||||
runManager->SetUserAction(steppingAction);
|
||||
|
||||
// Initialize G4 kernel, physics tables ...
|
||||
|
||||
runManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc==1) // Define UI terminal for interactive mode
|
||||
{
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete field;
|
||||
delete runManager;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Macro file for the initialization phase of field03
|
||||
#
|
||||
# It creates the default geometry (simple absorber cylinder )
|
||||
#
|
||||
/tracking/verbose 1
|
||||
/run/verbose 1
|
||||
#
|
||||
#
|
||||
#
|
||||
/field/setStepperType 4
|
||||
/field/setMinStep 10 mm
|
||||
#
|
||||
/field/update
|
||||
#
|
||||
/run/initialize
|
||||
#
|
||||
/run/particle/dumpCutValues
|
||||
#
|
||||
/gun/particle e-
|
||||
/gun/energy 500.0 MeV
|
||||
#
|
||||
/event/printModulo 50
|
||||
/run/beamOn 100
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03CalorHit.hh,v 1.2 2001/07/11 09:58:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F03CalorHit_h
|
||||
#define F03CalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F03CalorHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
|
||||
F03CalorHit();
|
||||
~F03CalorHit();
|
||||
F03CalorHit(const F03CalorHit&);
|
||||
const F03CalorHit& operator=(const F03CalorHit&);
|
||||
int operator==(const F03CalorHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
|
||||
void Print();
|
||||
|
||||
public:
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
|
||||
|
||||
G4double GetEdepAbs() { return EdepAbs; };
|
||||
G4double GetTrakAbs() { return TrackLengthAbs; };
|
||||
G4double GetEdepGap() { return EdepGap; };
|
||||
G4double GetTrakGap() { return TrackLengthGap; };
|
||||
|
||||
private:
|
||||
|
||||
G4double EdepAbs, TrackLengthAbs;
|
||||
G4double EdepGap, TrackLengthGap;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
typedef G4THitsCollection<F03CalorHit> F03CalorHitsCollection;
|
||||
|
||||
extern G4Allocator<F03CalorHit> F03CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void* F03CalorHit::operator new(size_t)
|
||||
{
|
||||
void* aHit;
|
||||
aHit = (void*) F03CalorHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F03CalorHit::operator delete(void* aHit)
|
||||
{
|
||||
F03CalorHitAllocator.FreeSingle((F03CalorHit*) aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03CalorimeterSD.hh,v 1.3 2001/10/15 17:20:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F03CalorimeterSD_h
|
||||
#define F03CalorimeterSD_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "F03CalorHit.hh"
|
||||
|
||||
class F03DetectorConstruction;
|
||||
class G4HCofThisEvent;
|
||||
class G4Step;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F03CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
F03CalorimeterSD(G4String, F03DetectorConstruction* );
|
||||
~F03CalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void clear();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
|
||||
F03CalorHitsCollection* CalCollection;
|
||||
F03DetectorConstruction* Detector;
|
||||
G4int* HitID;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03DetectorConstruction.hh,v 1.4 2001/10/25 10:03:53 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef F03DetectorConstruction_h
|
||||
#define F03DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4Box;
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4UniformMagField;
|
||||
class F03DetectorMessenger;
|
||||
class F03CalorimeterSD;
|
||||
class F03ElectroMagneticField;
|
||||
|
||||
|
||||
class F03DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
F03DetectorConstruction();
|
||||
~F03DetectorConstruction();
|
||||
|
||||
public:
|
||||
|
||||
void SetAbsorberMaterial (G4String);
|
||||
void SetAbsorberThickness(G4double);
|
||||
void SetAbsorberRadius(G4double);
|
||||
|
||||
void SetAbsorberZpos(G4double);
|
||||
|
||||
void SetWorldMaterial(G4String);
|
||||
void SetWorldSizeZ(G4double);
|
||||
void SetWorldSizeR(G4double);
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
void UpdateGeometry();
|
||||
|
||||
public:
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4Material* GetWorldMaterial() {return WorldMaterial;};
|
||||
G4double GetWorldSizeZ() {return WorldSizeZ;};
|
||||
G4double GetWorldSizeR() {return WorldSizeR;};
|
||||
|
||||
G4double GetAbsorberZpos() {return zAbsorber;};
|
||||
G4double GetzstartAbs() {return zstartAbs;};
|
||||
G4double GetzendAbs() {return zendAbs;};
|
||||
|
||||
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
|
||||
G4double GetAbsorberThickness() {return AbsorberThickness;};
|
||||
G4double GetAbsorberRadius() {return AbsorberRadius;};
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
|
||||
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
|
||||
G4LogicalVolume* GetLogicalAbsorber() {return logicAbsorber;};
|
||||
|
||||
private:
|
||||
|
||||
G4Tubs* solidWorld; // pointer to the solid World
|
||||
G4LogicalVolume* logicWorld; // pointer to the logical World
|
||||
G4VPhysicalVolume* physiWorld; // pointer to the physical World
|
||||
|
||||
G4Tubs* solidAbsorber; // pointer to the solid Absorber
|
||||
G4LogicalVolume* logicAbsorber; // pointer to the logical Absorber
|
||||
G4VPhysicalVolume* physiAbsorber; // pointer to the physical Absorber
|
||||
|
||||
G4UniformMagField* magField; // pointer to the magnetic field
|
||||
F03ElectroMagneticField* fEmField;
|
||||
F03DetectorMessenger* detectorMessenger; // pointer to the Messenger
|
||||
F03CalorimeterSD* calorimeterSD; // pointer to the sensitive detector
|
||||
|
||||
// TR radiator volumes and dimensions
|
||||
|
||||
G4Tubs* fSolidRadSlice; // pointer to the solid z-slice
|
||||
G4LogicalVolume* fLogicRadSlice; // pointer to the logical z-slide
|
||||
G4VPhysicalVolume* fPhysicRadSlice; // pointer to the physical z-slide
|
||||
|
||||
G4Tubs* solidRadiator;
|
||||
G4LogicalVolume* logicRadiator;
|
||||
G4VPhysicalVolume* physiRadiator;
|
||||
|
||||
G4Material* AbsorberMaterial;
|
||||
G4double AbsorberThickness;
|
||||
G4double AbsorberRadius;
|
||||
G4Material* fRadiatorMat; // pointer to the TR radiator material
|
||||
G4bool worldchanged;
|
||||
|
||||
G4double zAbsorber ;
|
||||
G4double zstartAbs , zendAbs ;
|
||||
|
||||
G4Material* WorldMaterial;
|
||||
G4double WorldSizeR;
|
||||
G4double WorldSizeZ;
|
||||
|
||||
G4double fRadThickness ;
|
||||
G4double fGasGap ;
|
||||
|
||||
G4int fFoilNumber ;
|
||||
|
||||
G4double fDetGap ;
|
||||
|
||||
G4double fStartR ;
|
||||
G4double fStartZ ;
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void F03DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
|
||||
zstartAbs = zAbsorber-0.5*AbsorberThickness;
|
||||
zendAbs = zAbsorber+0.5*AbsorberThickness;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03DetectorMessenger.hh,v 1.3 2001/10/25 10:03:53 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F03DetectorMessenger_h
|
||||
#define F03DetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class F03DetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F03DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
F03DetectorMessenger(F03DetectorConstruction* );
|
||||
~F03DetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
F03DetectorConstruction* F03Detector;
|
||||
|
||||
G4UIdirectory* F03detDir;
|
||||
|
||||
G4UIcmdWithAString* AbsMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* AbsRadCmd;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* AbsZposCmd;
|
||||
|
||||
G4UIcmdWithAString* WorldMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldZCmd;
|
||||
G4UIcmdWithADoubleAndUnit* WorldRCmd;
|
||||
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03ElectroMagneticField.hh,v 1.3 2001/10/15 17:20:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
// A class for control of the Magnetic Field of the detector.
|
||||
// The field is assumed to be uniform.
|
||||
//
|
||||
|
||||
#ifndef F03ElectroMagneticField_H
|
||||
#define F03ElectroMagneticField_H
|
||||
|
||||
#include "G4MagneticField.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
|
||||
class G4FieldManager;
|
||||
class G4ChordFinder;
|
||||
class G4Mag_UsualEqRhs;
|
||||
class G4MagIntegratorStepper;
|
||||
class F03FieldMessenger;
|
||||
|
||||
class F03ElectroMagneticField : public G4MagneticField
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
F03ElectroMagneticField() ; // A zero field
|
||||
F03ElectroMagneticField(G4ThreeVector) ; // The value of the field
|
||||
~F03ElectroMagneticField() ;
|
||||
|
||||
void GetFieldValue( const G4double Point[3],
|
||||
G4double *Bfield ) const {;}
|
||||
|
||||
void SetStepperType( G4int i) { fStepperType = i ; }
|
||||
|
||||
void SetStepper();
|
||||
|
||||
void SetMinStep(G4double s) { fMinStep = s ; }
|
||||
|
||||
void UpdateField();
|
||||
|
||||
void SetFieldValue(G4ThreeVector fieldVector) ;
|
||||
void SetFieldValue(G4double fieldValue) ;
|
||||
G4ThreeVector GetConstantFieldValue();
|
||||
G4FieldManager* GetLocalFieldManager() { return fLocalFieldManager ;}
|
||||
|
||||
protected:
|
||||
|
||||
G4FieldManager* GetGlobalFieldManager() ;
|
||||
// Returns the global Field Manager
|
||||
|
||||
G4FieldManager* fFieldManager ;
|
||||
G4FieldManager* fLocalFieldManager ;
|
||||
|
||||
G4ChordFinder* fChordFinder ;
|
||||
G4ChordFinder* fLocalChordFinder ;
|
||||
|
||||
G4Mag_UsualEqRhs* fEquation ;
|
||||
G4Mag_UsualEqRhs* fLocalEquation ;
|
||||
|
||||
G4MagneticField* fMagneticField ;
|
||||
G4MagneticField* fLocalMagneticField ;
|
||||
|
||||
G4MagIntegratorStepper* fStepper ;
|
||||
G4MagIntegratorStepper* fLocalStepper ;
|
||||
G4int fStepperType ;
|
||||
|
||||
G4double fMinStep ;
|
||||
|
||||
F03FieldMessenger* fFieldMessenger;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: F03EventAction.hh,v 1.3 2001/11/07 16:36:33 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifndef F03EventAction_h
|
||||
#define F03EventAction_h 1
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class F03RunAction;
|
||||
class F03EventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class F03EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
F03EventAction(F03RunAction* F03RA);
|
||||
~F03EventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
G4int GetEventno();
|
||||
void setEventVerbose(G4int level);
|
||||
|
||||
void SetDrawFlag(G4String val) {drawFlag = val;};
|
||||
void SetPrintModulo(G4int val) {printModulo = val;};
|
||||
|
||||
private:
|
||||
G4int calorimeterCollID;
|
||||
F03EventActionMessenger* eventMessenger;
|
||||
F03RunAction* runaction;
|
||||
G4int verboselevel;
|
||||
|
||||
G4String drawFlag;
|
||||
G4int printModulo;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user