Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -0,0 +1,81 @@
// 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: Em3CalorHit.hh,v 1.1.4.1 1999/12/07 20:46:59 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3CalorHit_h
#define Em3CalorHit_h 1
#include "Em3DetectorConstruction.hh"
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3CalorHit : public G4VHit
{
public:
Em3CalorHit();
~Em3CalorHit();
Em3CalorHit(const Em3CalorHit&);
const Em3CalorHit& operator=(const Em3CalorHit&);
int operator==(const Em3CalorHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
void Print();
public:
void AddAbs(G4int i, G4double de, G4double dl)
{EdepAbs[i] += de; TrackLengthAbs[i] += dl;};
G4double GetEdepAbs(G4int i) {return EdepAbs[i];};
G4double GetTrakAbs(G4int i) {return TrackLengthAbs[i];};
private:
G4double EdepAbs[MaxAbsor];
G4double TrackLengthAbs[MaxAbsor];
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
typedef G4THitsCollection<Em3CalorHit> Em3CalorHitsCollection;
extern G4Allocator<Em3CalorHit> Em3CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void* Em3CalorHit::operator new(size_t)
{
void* aHit;
aHit = (void*) Em3CalorHitAllocator.MallocSingle();
return aHit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void Em3CalorHit::operator delete(void* aHit)
{
Em3CalorHitAllocator.FreeSingle((Em3CalorHit*) 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: Em3CalorimeterSD.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3CalorimeterSD_h
#define Em3CalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "globals.hh"
class Em3DetectorConstruction;
class G4HCofThisEvent;
class G4Step;
#include "Em3CalorHit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3CalorimeterSD : public G4VSensitiveDetector
{
public:
Em3CalorimeterSD(G4String, Em3DetectorConstruction* );
~Em3CalorimeterSD();
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
void clear();
void DrawAll();
void PrintAll();
private:
Em3CalorHitsCollection* CalCollection;
Em3DetectorConstruction* Detector;
G4int* HitID;
};
#endif
@@ -0,0 +1,133 @@
// 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: Em3DetectorConstruction.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3DetectorConstruction_h
#define Em3DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class Em3DetectorMessenger;
class Em3CalorimeterSD;
const G4int MaxAbsor = 10;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3DetectorConstruction : public G4VUserDetectorConstruction
{
public:
Em3DetectorConstruction();
~Em3DetectorConstruction();
public:
void SetNbOfAbsor (G4int);
void SetAbsorMaterial (G4int,G4String);
void SetAbsorThickness(G4int,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;};
G4int GetNbOfAbsor() {return NbOfAbsor;};
G4Material* GetAbsorMaterial(G4int i) {return AbsorMaterial[i];};
G4double GetAbsorThickness(G4int i) {return AbsorThickness[i];};
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
const G4VPhysicalVolume* GetAbsorber(G4int i) {return physiAbsor[i];};
private:
G4int NbOfAbsor;
G4Material* AbsorMaterial [MaxAbsor];
G4double AbsorThickness[MaxAbsor];
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* solidAbsor[MaxAbsor]; //pointer to the solid Absorbers
G4LogicalVolume* logicAbsor[MaxAbsor]; //pointer to the logical Absorbers
G4VPhysicalVolume* physiAbsor[MaxAbsor]; //pointer to the physical Absorbers
G4UniformMagField* magField; //pointer to the magnetic field
Em3DetectorMessenger* detectorMessenger; //pointer to the Messenger
Em3CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
private:
void DefineMaterials();
void ComputeCalorParameters();
G4VPhysicalVolume* ConstructCalorimeter();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void Em3DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
LayerThickness = 0.;
for (G4int iAbs=0; iAbs<NbOfAbsor; iAbs++)
LayerThickness += AbsorThickness[iAbs];
CalorThickness = NbOfLayers*LayerThickness;
WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
}
#endif
@@ -0,0 +1,53 @@
// 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: Em3DetectorMessenger.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3DetectorMessenger_h
#define Em3DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class Em3DetectorConstruction;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3DetectorMessenger: public G4UImessenger
{
public:
Em3DetectorMessenger(Em3DetectorConstruction* );
~Em3DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
Em3DetectorConstruction* Em3Detector;
G4UIdirectory* Em3detDir;
G4UIcmdWithADoubleAndUnit* SizeYZCmd;
G4UIcmdWithAnInteger* NbLayersCmd;
G4UIcmdWithAnInteger* NbAbsorCmd;
G4UIcommand* AbsorCmd;
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
#endif
@@ -0,0 +1,53 @@
// 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: Em3EventAction.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3EventAction_h
#define Em3EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class Em3RunAction;
class Em3DetectorConstruction;
class Em3EventActionMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3EventAction : public G4UserEventAction
{
public:
Em3EventAction(Em3RunAction*,Em3DetectorConstruction*);
~Em3EventAction();
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void SetDrawFlag (G4String val) {drawFlag = val;};
void SetPrintModulo(G4int val) {printModulo = val;};
private:
Em3RunAction* Em3Run;
Em3DetectorConstruction* Detector;
G4int calorimeterCollID; // Hits collection ID
G4String drawFlag; // draw/print the event
G4int printModulo;
Em3EventActionMessenger* eventMessenger;
};
#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: Em3EventActionMessenger.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3EventActionMessenger_h
#define Em3EventActionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class Em3EventAction;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3EventActionMessenger: public G4UImessenger
{
public:
Em3EventActionMessenger(Em3EventAction*);
~Em3EventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
Em3EventAction* eventAction;
G4UIcmdWithAString* DrawCmd;
G4UIcmdWithAnInteger* PrintCmd;
};
#endif
@@ -0,0 +1,53 @@
// 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: Em3PhysicsList.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3PhysicsList_h
#define Em3PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3PhysicsList: public G4VUserPhysicsList
{
public:
Em3PhysicsList();
~Em3PhysicsList();
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 ConstructGeneral();
void ConstructEM();
};
#endif
@@ -0,0 +1,48 @@
// 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: Em3PrimaryGeneratorAction.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3PrimaryGeneratorAction_h
#define Em3PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class Em3DetectorConstruction;
class Em3PrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
Em3PrimaryGeneratorAction(Em3DetectorConstruction*);
~Em3PrimaryGeneratorAction();
public:
void SetDefaultKinematic();
void GeneratePrimaries(G4Event*);
private:
G4ParticleGun* particleGun;
Em3DetectorConstruction* Em3Detector;
Em3PrimaryGeneratorMessenger* gunMessenger;
};
#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: Em3PrimaryGeneratorMessenger.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3PrimaryGeneratorMessenger_h
#define Em3PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class Em3PrimaryGeneratorAction;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3PrimaryGeneratorMessenger: public G4UImessenger
{
public:
Em3PrimaryGeneratorMessenger(Em3PrimaryGeneratorAction*);
~Em3PrimaryGeneratorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
Em3PrimaryGeneratorAction* Em3Action;
G4UIcmdWithoutParameter* DefaultCmd;
};
#endif
@@ -0,0 +1,81 @@
// 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: Em3RunAction.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3RunAction_h
#define Em3RunAction_h 1
#include "Em3DetectorConstruction.hh"
#include "G4UserRunAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4Run;
class Em3RunActionMessenger;
class HepTupleManager;
class HepTuple;
class Em3RunAction : public G4UserRunAction
{
public:
Em3RunAction(Em3DetectorConstruction*);
~Em3RunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void fillPerEvent(G4int,G4double,G4double);
HepTuple* GetnTuple() {return ntuple;}
void SetSaveFlag(G4String val) {saveFlag = val;}
void SetRndmFreq(G4int val) {saveRndm = val;}
G4int GetRndmFreq() {return saveRndm;}
private:
void bookHisto();
private:
G4double sumEAbs[MaxAbsor], sum2EAbs[MaxAbsor];
G4double sumLAbs[MaxAbsor], sum2LAbs[MaxAbsor];
HepTupleManager* hbookManager;
HepTuple* ntuple;
Em3DetectorConstruction* Detector;
Em3RunActionMessenger* runMessenger;
G4String saveFlag;
G4int saveRndm;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline
void Em3RunAction::fillPerEvent(G4int kAbs, G4double EAbs, G4double LAbs)
{
//accumulate statistic
//
sumEAbs[kAbs] += EAbs; sum2EAbs[kAbs] += EAbs*EAbs;
sumLAbs[kAbs] += LAbs; sum2LAbs[kAbs] += LAbs*LAbs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,47 @@
// 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: Em3RunActionMessenger.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3RunActionMessenger_h
#define Em3RunActionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class Em3RunAction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3RunActionMessenger: public G4UImessenger
{
public:
Em3RunActionMessenger(Em3RunAction*);
~Em3RunActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
Em3RunAction* Em3Run;
G4UIcmdWithAString* SaveCmd;
G4UIdirectory* RndmDir;
G4UIcmdWithAnInteger* RndmSaveCmd;
G4UIcmdWithAString* RndmReadCmd;
};
#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: Em3SteppingAction.hh,v 1.1.4.1 1999/12/07 20:47:00 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef Em3SteppingAction_h
#define Em3SteppingAction_h 1
#include "G4UserSteppingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3SteppingAction : public G4UserSteppingAction
{
public:
Em3SteppingAction();
~Em3SteppingAction();
void UserSteppingAction(const G4Step*);
};
#endif
@@ -0,0 +1,50 @@
// 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: Em3VisManager.hh,v 1.1.4.1 1999/12/07 20:47:01 gunter Exp $
// GEANT4 tag $Name: geant4-01-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 Em3VisManager_h
#define Em3VisManager_h 1
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class Em3VisManager: public G4VisManager {
public:
Em3VisManager ();
private:
void RegisterGraphicsSystems ();
};
#endif