Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -47,8 +47,6 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
void Build() const override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4c
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -30,11 +30,12 @@
|
||||
#ifndef B4cCalorHit_h
|
||||
#define B4cCalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VHit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
namespace B4c
|
||||
{
|
||||
@@ -57,10 +58,10 @@ class CalorHit : public G4VHit
|
||||
G4bool operator==(const CalorHit&) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
inline void operator delete(void*);
|
||||
|
||||
// methods from base class
|
||||
void Draw() override{}
|
||||
void Draw() override {}
|
||||
void Print() override;
|
||||
|
||||
// methods to handle data
|
||||
@@ -71,8 +72,8 @@ class CalorHit : public G4VHit
|
||||
G4double GetTrackLength() const;
|
||||
|
||||
private:
|
||||
G4double fEdep = 0.; ///< Energy deposit in the sensitive volume
|
||||
G4double fTrackLength = 0.; ///< Track length in the sensitive volume
|
||||
G4double fEdep = 0.; ///< Energy deposit in the sensitive volume
|
||||
G4double fTrackLength = 0.; ///< Track length in the sensitive volume
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -88,33 +89,36 @@ inline void* CalorHit::operator new(size_t)
|
||||
if (!CalorHitAllocator) {
|
||||
CalorHitAllocator = new G4Allocator<CalorHit>;
|
||||
}
|
||||
void *hit;
|
||||
hit = (void *) CalorHitAllocator->MallocSingle();
|
||||
void* hit;
|
||||
hit = (void*)CalorHitAllocator->MallocSingle();
|
||||
return hit;
|
||||
}
|
||||
|
||||
inline void CalorHit::operator delete(void *hit)
|
||||
inline void CalorHit::operator delete(void* hit)
|
||||
{
|
||||
if (!CalorHitAllocator) {
|
||||
CalorHitAllocator = new G4Allocator<CalorHit>;
|
||||
}
|
||||
CalorHitAllocator->FreeSingle((CalorHit*) hit);
|
||||
CalorHitAllocator->FreeSingle((CalorHit*)hit);
|
||||
}
|
||||
|
||||
inline void CalorHit::Add(G4double de, G4double dl) {
|
||||
inline void CalorHit::Add(G4double de, G4double dl)
|
||||
{
|
||||
fEdep += de;
|
||||
fTrackLength += dl;
|
||||
}
|
||||
|
||||
inline G4double CalorHit::GetEdep() const {
|
||||
inline G4double CalorHit::GetEdep() const
|
||||
{
|
||||
return fEdep;
|
||||
}
|
||||
|
||||
inline G4double CalorHit::GetTrackLength() const {
|
||||
inline G4double CalorHit::GetTrackLength() const
|
||||
{
|
||||
return fTrackLength;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace B4c
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
#ifndef B4cCalorimeterSD_h
|
||||
#define B4cCalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
|
||||
#include "CalorHit.hh"
|
||||
|
||||
#include <vector>
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B4c
|
||||
{
|
||||
@@ -53,24 +53,21 @@ namespace B4c
|
||||
class CalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
CalorimeterSD(const G4String& name,
|
||||
const G4String& hitsCollectionName,
|
||||
G4int nofCells);
|
||||
CalorimeterSD(const G4String& name, const G4String& hitsCollectionName, G4int nofCells);
|
||||
~CalorimeterSD() override = default;
|
||||
|
||||
// methods from base class
|
||||
void Initialize(G4HCofThisEvent* hitCollection) override;
|
||||
void Initialize(G4HCofThisEvent* hitCollection) override;
|
||||
G4bool ProcessHits(G4Step* step, G4TouchableHistory* history) override;
|
||||
void EndOfEvent(G4HCofThisEvent* hitCollection) override;
|
||||
void EndOfEvent(G4HCofThisEvent* hitCollection) override;
|
||||
|
||||
private:
|
||||
CalorHitsCollection* fHitsCollection = nullptr;
|
||||
G4int fNofCells = 0;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4c
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#define B4cDetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
#include "G4Threading.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
@@ -73,16 +75,15 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
|
||||
// data members
|
||||
//
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
// magnetic field messenger
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
// magnetic field messenger
|
||||
|
||||
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
|
||||
G4int fNofLayers = -1; // number of layers
|
||||
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
|
||||
G4int fNofLayers = -1; // number of layers
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4c
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Event;
|
||||
|
||||
namespace B4c
|
||||
{
|
||||
|
||||
@@ -47,29 +49,26 @@ namespace B4c
|
||||
|
||||
class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
EventAction() = default;
|
||||
~EventAction() override = default;
|
||||
public:
|
||||
EventAction() = default;
|
||||
~EventAction() override = default;
|
||||
|
||||
void BeginOfEventAction(const G4Event* event) override;
|
||||
void EndOfEventAction(const G4Event* event) override;
|
||||
void BeginOfEventAction(const G4Event* event) override;
|
||||
void EndOfEventAction(const G4Event* event) override;
|
||||
|
||||
private:
|
||||
// methods
|
||||
CalorHitsCollection* GetHitsCollection(G4int hcID,
|
||||
const G4Event* event) const;
|
||||
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength,
|
||||
G4double gapEdep, G4double gapTrackLength) const;
|
||||
private:
|
||||
// methods
|
||||
CalorHitsCollection* GetHitsCollection(G4int hcID, const G4Event* event) const;
|
||||
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength, G4double gapEdep,
|
||||
G4double gapTrackLength) const;
|
||||
|
||||
// data members
|
||||
G4int fAbsHCID = -1;
|
||||
G4int fGapHCID = -1;
|
||||
// data members
|
||||
G4int fAbsHCID = -1;
|
||||
G4int fGapHCID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4c
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -25,13 +25,12 @@
|
||||
//
|
||||
//
|
||||
/// \file B4/B4c/include/PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the PrimaryGeneratorAction class
|
||||
/// \brief Definition of the B4::PrimaryGeneratorAction class
|
||||
|
||||
#ifndef B4PrimaryGeneratorAction_h
|
||||
#define B4PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
@@ -48,17 +47,17 @@ namespace B4
|
||||
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction();
|
||||
~PrimaryGeneratorAction() override;
|
||||
public:
|
||||
PrimaryGeneratorAction();
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event* event) override;
|
||||
void GeneratePrimaries(G4Event* event) override;
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#define B4RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Run;
|
||||
|
||||
@@ -63,12 +62,11 @@ class RunAction : public G4UserRunAction
|
||||
~RunAction() override = default;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace B4
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user