Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
@@ -48,5 +48,3 @@ class B2ActionInitialization : public G4VUserActionInitialization
};
#endif
@@ -31,7 +31,6 @@
#define B2EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
/// Event action class
@@ -42,8 +41,8 @@ class B2EventAction : public G4UserEventAction
B2EventAction();
virtual ~B2EventAction();
virtual void BeginOfEventAction(const G4Event* );
virtual void EndOfEventAction(const G4Event* );
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,26 +38,26 @@ class G4Event;
/// The primary generator action class with particle gum.
///
/// It defines a single particle which hits the Tracker
/// It defines a single particle which hits the Tracker
/// perpendicular to the input face. The type of the particle
/// can be changed via the G4 build-in commands of G4ParticleGun class
/// can be changed via the G4 build-in commands of G4ParticleGun class
/// (see the macros provided with this example).
class B2PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
B2PrimaryGeneratorAction();
B2PrimaryGeneratorAction();
virtual ~B2PrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event* );
virtual void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() { return fParticleGun; }
G4ParticleGun* GetParticleGun() {return fParticleGun;}
// Set methods
void SetRandomFlag(G4bool );
void SetRandomFlag(G4bool);
private:
G4ParticleGun* fParticleGun; // G4 particle gun
G4ParticleGun* fParticleGun; // G4 particle gun
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,7 +46,7 @@ class B2RunAction : public G4UserRunAction
virtual ~B2RunAction();
virtual void BeginOfRunAction(const G4Run* run);
virtual void EndOfRunAction(const G4Run* run);
virtual void EndOfRunAction(const G4Run* run);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -30,12 +30,13 @@
#ifndef B2TrackerHit_h
#define B2TrackerHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "tls.hh"
#include "G4Allocator.hh"
#include "G4THitsCollection.hh"
#include "G4ThreeVector.hh"
#include "G4VHit.hh"
/// Tracker hit class
///
/// It defines data members to store the trackID, chamberNb, energy deposit,
@@ -54,30 +55,29 @@ class B2TrackerHit : public G4VHit
G4bool operator==(const B2TrackerHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
inline void operator delete(void*);
// methods from base class
virtual void Draw();
virtual void Print();
// Set methods
void SetTrackID (G4int track) { fTrackID = track; };
void SetChamberNb(G4int chamb) { fChamberNb = chamb; };
void SetEdep (G4double de) { fEdep = de; };
void SetPos (G4ThreeVector xyz){ fPos = xyz; };
void SetTrackID(G4int track) { fTrackID = track; };
void SetChamberNb(G4int chamb) { fChamberNb = chamb; };
void SetEdep(G4double de) { fEdep = de; };
void SetPos(G4ThreeVector xyz) { fPos = xyz; };
// Get methods
G4int GetTrackID() const { return fTrackID; };
G4int GetChamberNb() const { return fChamberNb; };
G4double GetEdep() const { return fEdep; };
G4int GetTrackID() const { return fTrackID; };
G4int GetChamberNb() const { return fChamberNb; };
G4double GetEdep() const { return fEdep; };
G4ThreeVector GetPos() const { return fPos; };
private:
G4int fTrackID;
G4int fChamberNb;
G4double fEdep;
G4ThreeVector fPos;
G4int fTrackID;
G4int fChamberNb;
G4double fEdep;
G4ThreeVector fPos;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -90,16 +90,15 @@ extern G4ThreadLocal G4Allocator<B2TrackerHit>* B2TrackerHitAllocator;
inline void* B2TrackerHit::operator new(size_t)
{
if(!B2TrackerHitAllocator)
B2TrackerHitAllocator = new G4Allocator<B2TrackerHit>;
return (void *) B2TrackerHitAllocator->MallocSingle();
if (!B2TrackerHitAllocator) B2TrackerHitAllocator = new G4Allocator<B2TrackerHit>;
return (void*)B2TrackerHitAllocator->MallocSingle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void B2TrackerHit::operator delete(void *hit)
inline void B2TrackerHit::operator delete(void* hit)
{
B2TrackerHitAllocator->FreeSingle((B2TrackerHit*) hit);
B2TrackerHitAllocator->FreeSingle((B2TrackerHit*)hit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -30,10 +30,10 @@
#ifndef B2TrackerSD_h
#define B2TrackerSD_h 1
#include "G4VSensitiveDetector.hh"
#include "B2TrackerHit.hh"
#include "G4VSensitiveDetector.hh"
#include <vector>
class G4Step;
@@ -50,14 +50,13 @@ class G4HCofThisEvent;
class B2TrackerSD : public G4VSensitiveDetector
{
public:
B2TrackerSD(const G4String& name,
const G4String& hitsCollectionName);
B2TrackerSD(const G4String& name, const G4String& hitsCollectionName);
virtual ~B2TrackerSD();
// methods from base class
virtual void Initialize(G4HCofThisEvent* hitCollection);
virtual void Initialize(G4HCofThisEvent* hitCollection);
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history);
virtual void EndOfEvent(G4HCofThisEvent* hitCollection);
virtual void EndOfEvent(G4HCofThisEvent* hitCollection);
private:
B2TrackerHitsCollection* fHitsCollection;
@@ -30,8 +30,8 @@
#ifndef B2bChamberParameterisation_h
#define B2bChamberParameterisation_h 1
#include "globals.hh"
#include "G4VPVParameterisation.hh"
#include "globals.hh"
class G4VPhysicalVolume;
class G4Box;
@@ -56,59 +56,39 @@ class G4Polyhedra;
/// They are spaced an equal distance apart, starting from given location.
class B2bChamberParameterisation : public G4VPVParameterisation
{
{
public:
B2bChamberParameterisation(G4int noChambers,
G4double startZ,
G4double spacing,
G4double widthChamber,
G4double lengthInitial,
G4double lengthFinal );
B2bChamberParameterisation(G4int noChambers, G4double startZ, G4double spacing,
G4double widthChamber, G4double lengthInitial, G4double lengthFinal);
virtual ~B2bChamberParameterisation();
void ComputeTransformation (const G4int copyNo,
G4VPhysicalVolume* physVol) const;
void ComputeDimensions (G4Tubs & trackerLayer, const G4int copyNo,
const G4VPhysicalVolume* physVol) const;
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume* physVol) const;
void ComputeDimensions(G4Tubs& trackerLayer, const G4int copyNo,
const G4VPhysicalVolume* physVol) const;
private: // Dummy declarations to get rid of warnings ...
void ComputeDimensions (G4Box&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trd&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trap&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Cons&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Sphere&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Orb&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Ellipsoid&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Torus&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Para&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Hype&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polycone&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polyhedra&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Box&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const {}
void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const {}
private:
G4int fNoChambers;
G4int fNoChambers;
G4double fStartZ;
G4double fHalfWidth; // The half-width of each tracker chamber
G4double fSpacing; // The distance between the chambers' center
G4double fRmaxFirst; // The first half-length
G4double fRmaxIncr; // The Increment for the half-length
G4double fHalfWidth; // The half-width of each tracker chamber
G4double fSpacing; // The distance between the chambers' center
G4double fRmaxFirst; // The first half-length
G4double fRmaxIncr; // The Increment for the half-length
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -30,10 +30,11 @@
#ifndef B2bDetectorConstruction_h
#define B2bDetectorConstruction_h 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
#include "tls.hh"
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4VPhysicalVolume;
class G4LogicalVolume;
class G4Material;
@@ -56,31 +57,31 @@ class B2bDetectorConstruction : public G4VUserDetectorConstruction
virtual void ConstructSDandField();
// Set methods
void SetTargetMaterial (G4String );
void SetChamberMaterial(G4String );
void SetMaxStep (G4double );
void SetCheckOverlaps(G4bool );
void SetTargetMaterial(G4String);
void SetChamberMaterial(G4String);
void SetMaxStep(G4double);
void SetCheckOverlaps(G4bool);
private:
// methods
void DefineMaterials();
G4VPhysicalVolume* DefineVolumes();
// data members
G4LogicalVolume* fLogicTarget; // pointer to the logical Target
G4LogicalVolume* fLogicChamber; // pointer to the logical Chamber
G4LogicalVolume* fLogicTarget; // pointer to the logical Target
G4LogicalVolume* fLogicChamber; // pointer to the logical Chamber
G4Material* fTargetMaterial; // pointer to the target material
G4Material* fChamberMaterial; // pointer to the chamber material
G4Material* fTargetMaterial; // pointer to the target material
G4Material* fChamberMaterial; // pointer to the chamber material
G4UserLimits* fStepLimit; // pointer to user step limits
G4UserLimits* fStepLimit; // pointer to user step limits
B2bDetectorMessenger* fMessenger; // detector messenger
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
// magnetic field messenger
G4bool fCheckOverlaps; // option to activate checking of volumes overlaps
B2bDetectorMessenger* fMessenger; // detector messenger
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
// magnetic field messenger
G4bool fCheckOverlaps; // option to activate checking of volumes overlaps
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -30,8 +30,8 @@
#ifndef B2bDetectorMessenger_h
#define B2bDetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
#include "globals.hh"
class B2bDetectorConstruction;
class G4UIdirectory;
@@ -47,22 +47,22 @@ class G4UIcmdWithADoubleAndUnit;
/// - /B2/det/setChamberMaterial name
/// - /B2/det/stepMax value unit
class B2bDetectorMessenger: public G4UImessenger
class B2bDetectorMessenger : public G4UImessenger
{
public:
B2bDetectorMessenger(B2bDetectorConstruction* );
B2bDetectorMessenger(B2bDetectorConstruction*);
virtual ~B2bDetectorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
B2bDetectorConstruction* fDetectorConstruction;
B2bDetectorConstruction* fDetectorConstruction;
G4UIdirectory* fB2Directory;
G4UIdirectory* fDetDirectory;
G4UIdirectory* fB2Directory;
G4UIdirectory* fDetDirectory;
G4UIcmdWithAString* fTargMatCmd;
G4UIcmdWithAString* fChamMatCmd;
G4UIcmdWithAString* fTargMatCmd;
G4UIcmdWithAString* fChamMatCmd;
G4UIcmdWithADoubleAndUnit* fStepMaxCmd;
};