Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -0,0 +1,55 @@
// 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: AnaEx01AnalysisManager.hh,v 1.3 2000/10/31 13:10:00 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// Example Analysis Manager implementing virtual function
// RegisterAnalysisSystems. Exploits C-pre-processor variables
// G4ANALYSIS_USE_JAS, 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().
#ifndef AnaEx01AnalysisManager_h
#define AnaEx01AnalysisManager_h 1
#ifdef G4ANALYSIS_USE
#include "G4AnalysisManager.hh"
class G4Run;
class G4Event;
class G4Step;
class IHistogram1D;
//class ITuple;
class AnaEx01AnalysisManager: public G4AnalysisManager {
public:
AnaEx01AnalysisManager(const G4String&);
public:
virtual void BeginOfRun(const G4Run*);
virtual void EndOfRun(const G4Run*);
virtual void BeginOfEvent(const G4Event*);
virtual void EndOfEvent(const G4Event*);
virtual void Step(const G4Step*);
private:
G4int fCalorimeterCollID;
IHistogram1D* fEAbs;
IHistogram1D* fLAbs;
IHistogram1D* fEGap;
IHistogram1D* fLGap;
//ITuple* fTuple;
};
#endif
#endif
@@ -0,0 +1,82 @@
// 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: AnaEx01CalorHit.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorHit_h
#define AnaEx01CalorHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorHit : public G4VHit
{
public:
AnaEx01CalorHit();
~AnaEx01CalorHit();
AnaEx01CalorHit(const AnaEx01CalorHit&);
const AnaEx01CalorHit& operator=(const AnaEx01CalorHit&);
int operator==(const AnaEx01CalorHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
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<AnaEx01CalorHit> AnaEx01CalorHitsCollection;
extern G4Allocator<AnaEx01CalorHit> AnaEx01CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void* AnaEx01CalorHit::operator new(size_t)
{
void* aHit;
aHit = (void*) AnaEx01CalorHitAllocator.MallocSingle();
return aHit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void AnaEx01CalorHit::operator delete(void* aHit)
{
AnaEx01CalorHitAllocator.FreeSingle((AnaEx01CalorHit*) aHit);
}
#endif
@@ -0,0 +1,51 @@
// 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: AnaEx01CalorimeterSD.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorimeterSD_h
#define AnaEx01CalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "globals.hh"
class AnaEx01DetectorConstruction;
class G4HCofThisEvent;
class G4Step;
#include "AnaEx01CalorHit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorimeterSD : public G4VSensitiveDetector
{
public:
AnaEx01CalorimeterSD(G4String, AnaEx01DetectorConstruction* );
~AnaEx01CalorimeterSD();
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
void clear();
void DrawAll();
void PrintAll();
private:
AnaEx01CalorHitsCollection* CalCollection;
AnaEx01DetectorConstruction* Detector;
G4int* HitID;
};
#endif
@@ -0,0 +1,140 @@
// 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: AnaEx01DetectorConstruction.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01DetectorConstruction_h
#define AnaEx01DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class AnaEx01DetectorMessenger;
class AnaEx01CalorimeterSD;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
{
public:
AnaEx01DetectorConstruction();
~AnaEx01DetectorConstruction();
public:
void SetAbsorberMaterial (G4String);
void SetAbsorberThickness(G4double);
void SetGapMaterial (G4String);
void SetGapThickness(G4double);
void SetCalorSizeYZ(G4double);
void SetNbOfLayers (G4int);
void SetMagField(G4double);
G4VPhysicalVolume* Construct();
void UpdateGeometry();
public:
void PrintCalorParameters();
G4double GetWorldSizeX() {return WorldSizeX;};
G4double GetWorldSizeYZ() {return WorldSizeYZ;};
G4double GetCalorThickness() {return CalorThickness;};
G4double GetCalorSizeYZ() {return CalorSizeYZ;};
G4int GetNbOfLayers() {return NbOfLayers;};
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
G4double GetAbsorberThickness() {return AbsorberThickness;};
G4Material* GetGapMaterial() {return GapMaterial;};
G4double GetGapThickness() {return GapThickness;};
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
const G4VPhysicalVolume* GetGap() {return physiGap;};
private:
G4Material* AbsorberMaterial;
G4double AbsorberThickness;
G4Material* GapMaterial;
G4double GapThickness;
G4int NbOfLayers;
G4double LayerThickness;
G4double CalorSizeYZ;
G4double CalorThickness;
G4Material* defaultMaterial;
G4double WorldSizeYZ;
G4double WorldSizeX;
G4Box* solidWorld; //pointer to the solid World
G4LogicalVolume* logicWorld; //pointer to the logical World
G4VPhysicalVolume* physiWorld; //pointer to the physical World
G4Box* solidCalor; //pointer to the solid Calor
G4LogicalVolume* logicCalor; //pointer to the logical Calor
G4VPhysicalVolume* physiCalor; //pointer to the physical Calor
G4Box* solidLayer; //pointer to the solid Layer
G4LogicalVolume* logicLayer; //pointer to the logical Layer
G4VPhysicalVolume* physiLayer; //pointer to the physical Layer
G4Box* solidAbsorber; //pointer to the solid Absorber
G4LogicalVolume* logicAbsorber; //pointer to the logical Absorber
G4VPhysicalVolume* physiAbsorber; //pointer to the physical Absorber
G4Box* solidGap; //pointer to the solid Gap
G4LogicalVolume* logicGap; //pointer to the logical Gap
G4VPhysicalVolume* physiGap; //pointer to the physical Gap
G4UniformMagField* magField; //pointer to the magnetic field
AnaEx01DetectorMessenger* detectorMessenger; //pointer to the Messenger
AnaEx01CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
private:
void DefineMaterials();
void ComputeCalorParameters();
G4VPhysicalVolume* ConstructCalorimeter();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void AnaEx01DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
LayerThickness = AbsorberThickness + GapThickness;
CalorThickness = NbOfLayers*LayerThickness;
WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
}
#endif
@@ -0,0 +1,54 @@
// 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: AnaEx01DetectorMessenger.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01DetectorMessenger_h
#define AnaEx01DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class AnaEx01DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01DetectorMessenger: public G4UImessenger
{
public:
AnaEx01DetectorMessenger(AnaEx01DetectorConstruction* );
~AnaEx01DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
AnaEx01DetectorConstruction* AnaEx01Detector;
G4UIdirectory* AnaEx01detDir;
G4UIcmdWithAString* AbsMaterCmd;
G4UIcmdWithAString* GapMaterCmd;
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
G4UIcmdWithADoubleAndUnit* GapThickCmd;
G4UIcmdWithADoubleAndUnit* SizeYZCmd;
G4UIcmdWithAnInteger* NbLayersCmd;
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
#endif
@@ -0,0 +1,33 @@
// 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: AnaEx01EventAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01EventAction_h
#define AnaEx01EventAction_h
#include "G4UserEventAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01EventAction : public G4UserEventAction {
public:
AnaEx01EventAction(AnaEx01AnalysisManager* = 0);
virtual ~AnaEx01EventAction();
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,68 @@
// 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: AnaEx01PhysicsList.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PhysicsList_h
#define AnaEx01PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PhysicsList: public G4VUserPhysicsList
{
public:
AnaEx01PhysicsList();
~AnaEx01PhysicsList();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
public:
// Set/Get cut values
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForProton(G4double);
G4double GetCutForGamma() const;
G4double GetCutForElectron() const;
G4double GetCutForProton() const;
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructMesons();
void ConstructBaryons();
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForProton;
G4double currentDefaultCut;
};
#endif
@@ -0,0 +1,49 @@
// 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: AnaEx01PrimaryGeneratorAction.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PrimaryGeneratorAction_h
#define AnaEx01PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class AnaEx01DetectorConstruction;
class AnaEx01PrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
AnaEx01PrimaryGeneratorAction(AnaEx01DetectorConstruction*);
~AnaEx01PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event*);
void SetRndmFlag(G4String val) { rndmFlag = val;}
private:
G4ParticleGun* particleGun; //pointer a to G4 service class
AnaEx01DetectorConstruction* AnaEx01Detector; //pointer to the geometry
AnaEx01PrimaryGeneratorMessenger* gunMessenger; //messenger of this class
G4String rndmFlag; //flag for a random impact point
};
#endif
@@ -0,0 +1,41 @@
// 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: AnaEx01PrimaryGeneratorMessenger.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PrimaryGeneratorMessenger_h
#define AnaEx01PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class AnaEx01PrimaryGeneratorAction;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PrimaryGeneratorMessenger: public G4UImessenger
{
public:
AnaEx01PrimaryGeneratorMessenger(AnaEx01PrimaryGeneratorAction*);
~AnaEx01PrimaryGeneratorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
AnaEx01PrimaryGeneratorAction* AnaEx01Action;
G4UIcmdWithAString* RndmCmd;
};
#endif
@@ -0,0 +1,32 @@
// 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: AnaEx01RunAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01RunAction_h
#define AnaEx01RunAction_h
#include "G4UserRunAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01RunAction : public G4UserRunAction {
public:
AnaEx01RunAction(AnaEx01AnalysisManager* = 0);
~AnaEx01RunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,29 @@
// 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: AnaEx01SteppingAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01SteppingAction_h
#define AnaEx01SteppingAction_h
#include "G4UserSteppingAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01SteppingAction : public G4UserSteppingAction {
public:
AnaEx01SteppingAction(AnaEx01AnalysisManager* = 0);
virtual ~AnaEx01SteppingAction();
virtual void UserSteppingAction(const G4Step*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,42 @@
// 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: AnaEx01SteppingVerbose.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// AnaEx01SteppingVerbose.hh
//
// Description:
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose
//
//---------------------------------------------------------------
class AnaEx01SteppingVerbose;
#ifndef AnaEx01SteppingVerbose_h
#define AnaEx01SteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
class AnaEx01SteppingVerbose : public G4SteppingVerbose {
public:
// Constructor/Destructor
AnaEx01SteppingVerbose();
~AnaEx01SteppingVerbose();
//
void StepInfo();
void TrackingStarted();
//
};
#endif
@@ -0,0 +1,54 @@
// 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: AnaEx01VisManager.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-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 AnaEx01VisManager_h
#define AnaEx01VisManager_h 1
#ifdef G4VIS_USE
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01VisManager: public G4VisManager {
public:
AnaEx01VisManager ();
private:
void RegisterGraphicsSystems ();
};
#endif
#endif