Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
+12
-10
@@ -24,29 +24,31 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5ActionInitialization.hh
|
||||
/// \brief Definition of the B5ActionInitialization class
|
||||
/// \file ActionInitialization.hh
|
||||
/// \brief Definition of the B5::ActionInitialization class
|
||||
|
||||
#ifndef B5ActionInitialization_h
|
||||
#define B5ActionInitialization_h 1
|
||||
|
||||
#include "G4VUserActionInitialization.hh"
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Action initialization class.
|
||||
|
||||
class B5ActionInitialization : public G4VUserActionInitialization
|
||||
class ActionInitialization : public G4VUserActionInitialization
|
||||
{
|
||||
public:
|
||||
B5ActionInitialization();
|
||||
virtual ~B5ActionInitialization();
|
||||
|
||||
virtual void BuildForMaster() const;
|
||||
virtual void Build() const;
|
||||
ActionInitialization();
|
||||
~ActionInitialization() override;
|
||||
|
||||
void BuildForMaster() const override;
|
||||
void Build() const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+13
-8
@@ -24,13 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5CellParameterisation.hh
|
||||
/// \brief Definition of the B5CellParameterisation class
|
||||
/// \file CellParameterisation.hh
|
||||
/// \brief Definition of the B5::CellParameterisation class
|
||||
|
||||
#ifndef B5CellParameterisation_H
|
||||
#define B5CellParameterisation_H 1
|
||||
|
||||
#include "B5Constants.hh"
|
||||
#include "Constants.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VPVParameterisation.hh"
|
||||
@@ -39,22 +39,27 @@
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// EM Calorimeter cell parameterisation
|
||||
|
||||
class B5CellParameterisation : public G4VPVParameterisation
|
||||
class CellParameterisation : public G4VPVParameterisation
|
||||
{
|
||||
public:
|
||||
B5CellParameterisation();
|
||||
virtual ~B5CellParameterisation();
|
||||
CellParameterisation();
|
||||
~CellParameterisation() override;
|
||||
|
||||
virtual void ComputeTransformation(
|
||||
const G4int copyNo,G4VPhysicalVolume *physVol) const;
|
||||
void ComputeTransformation(
|
||||
const G4int copyNo,G4VPhysicalVolume *physVol) const override;
|
||||
|
||||
private:
|
||||
std::array<G4double, kNofEmCells> fXCell;
|
||||
std::array<G4double, kNofEmCells> fYCell;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -24,14 +24,17 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5Constants.hh
|
||||
/// \brief Definition of constants.
|
||||
/// \file Constants.hh
|
||||
/// \brief Definition of B5 example constants.
|
||||
|
||||
#ifndef B5Constants_h
|
||||
#define B5Constants_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
constexpr G4int kNofHodoscopes1 = 15;
|
||||
constexpr G4int kNofHodoscopes2 = 25;
|
||||
constexpr G4int kNofChambers = 5;
|
||||
@@ -42,4 +45,6 @@ constexpr G4int kNofHadColumns = 10;
|
||||
constexpr G4int kNofHadRows = 2;
|
||||
constexpr G4int kNofHadCells = kNofHadColumns * kNofHadRows;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
+25
-20
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5DetectorConstruction.hh
|
||||
/// \brief Definition of the B5DetectorConstruction class
|
||||
/// \file DetectorConstruction.hh
|
||||
/// \brief Definition of the B5::DetectorConstruction class
|
||||
|
||||
#ifndef B5DetectorConstruction_h
|
||||
#define B5DetectorConstruction_h 1
|
||||
@@ -37,24 +37,27 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
class B5MagneticField;
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4VSensitiveDetector;
|
||||
class G4VisAttributes;
|
||||
class G4GenericMessenger;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
class MagneticField;
|
||||
|
||||
/// Detector construction
|
||||
|
||||
class B5DetectorConstruction : public G4VUserDetectorConstruction
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
B5DetectorConstruction();
|
||||
virtual ~B5DetectorConstruction();
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
virtual void ConstructSDandField();
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
void ConstructSDandField() override;
|
||||
|
||||
void SetArmAngle(G4double val);
|
||||
G4double GetArmAngle() { return fArmAngle; }
|
||||
@@ -66,24 +69,26 @@ class B5DetectorConstruction : public G4VUserDetectorConstruction
|
||||
|
||||
G4GenericMessenger* fMessenger;
|
||||
|
||||
static G4ThreadLocal B5MagneticField* fMagneticField;
|
||||
static G4ThreadLocal MagneticField* fMagneticField;
|
||||
static G4ThreadLocal G4FieldManager* fFieldMgr;
|
||||
|
||||
G4LogicalVolume* fHodoscope1Logical;
|
||||
G4LogicalVolume* fHodoscope2Logical;
|
||||
G4LogicalVolume* fWirePlane1Logical;
|
||||
G4LogicalVolume* fWirePlane2Logical;
|
||||
G4LogicalVolume* fCellLogical;
|
||||
G4LogicalVolume* fHadCalScintiLogical;
|
||||
G4LogicalVolume* fMagneticLogical;
|
||||
G4LogicalVolume* fHodoscope1Logical = nullptr;
|
||||
G4LogicalVolume* fHodoscope2Logical = nullptr;
|
||||
G4LogicalVolume* fWirePlane1Logical = nullptr;
|
||||
G4LogicalVolume* fWirePlane2Logical = nullptr;
|
||||
G4LogicalVolume* fCellLogical = nullptr;
|
||||
G4LogicalVolume* fHadCalScintiLogical = nullptr;
|
||||
G4LogicalVolume* fMagneticLogical = nullptr;
|
||||
|
||||
std::vector<G4VisAttributes*> fVisAttributes;
|
||||
|
||||
G4double fArmAngle;
|
||||
G4RotationMatrix* fArmRotation;
|
||||
G4VPhysicalVolume* fSecondArmPhys;
|
||||
G4double fArmAngle = 30.*CLHEP::deg;
|
||||
G4RotationMatrix* fArmRotation = nullptr;
|
||||
G4VPhysicalVolume* fSecondArmPhys = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+28
-23
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5DriftChamberHit.hh
|
||||
/// \brief Definition of the B5DriftChamberHit class
|
||||
/// \file DriftChamberHit.hh
|
||||
/// \brief Definition of the B5::DriftChamberHit class
|
||||
|
||||
#ifndef B5DriftChamberHit_h
|
||||
#define B5DriftChamberHit_h 1
|
||||
@@ -41,6 +41,9 @@
|
||||
class G4AttDef;
|
||||
class G4AttValue;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Drift chamber hit
|
||||
///
|
||||
/// It records:
|
||||
@@ -48,24 +51,24 @@ class G4AttValue;
|
||||
/// - the particle time
|
||||
/// - the particle local and global positions
|
||||
|
||||
class B5DriftChamberHit : public G4VHit
|
||||
class DriftChamberHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
B5DriftChamberHit();
|
||||
B5DriftChamberHit(G4int layerID);
|
||||
B5DriftChamberHit(const B5DriftChamberHit &right);
|
||||
virtual ~B5DriftChamberHit();
|
||||
DriftChamberHit();
|
||||
DriftChamberHit(G4int layerID);
|
||||
DriftChamberHit(const DriftChamberHit &right) = default;
|
||||
~DriftChamberHit() override;
|
||||
|
||||
const B5DriftChamberHit& operator=(const B5DriftChamberHit &right);
|
||||
G4bool operator==(const B5DriftChamberHit &right) const;
|
||||
DriftChamberHit& operator=(const DriftChamberHit &right) = default;
|
||||
G4bool operator==(const DriftChamberHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
virtual void Draw();
|
||||
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
|
||||
virtual std::vector<G4AttValue>* CreateAttValues() const;
|
||||
virtual void Print();
|
||||
void Draw() override;
|
||||
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
void Print() override;
|
||||
|
||||
void SetLayerID(G4int z) { fLayerID = z; }
|
||||
G4int GetLayerID() const { return fLayerID; }
|
||||
@@ -80,27 +83,29 @@ class B5DriftChamberHit : public G4VHit
|
||||
G4ThreeVector GetWorldPos() const { return fWorldPos; }
|
||||
|
||||
private:
|
||||
G4int fLayerID;
|
||||
G4double fTime;
|
||||
G4int fLayerID = -1;
|
||||
G4double fTime = 0.;
|
||||
G4ThreeVector fLocalPos;
|
||||
G4ThreeVector fWorldPos;
|
||||
};
|
||||
|
||||
using B5DriftChamberHitsCollection = G4THitsCollection<B5DriftChamberHit>;
|
||||
using DriftChamberHitsCollection = G4THitsCollection<DriftChamberHit>;
|
||||
|
||||
extern G4ThreadLocal G4Allocator<B5DriftChamberHit>* B5DriftChamberHitAllocator;
|
||||
extern G4ThreadLocal G4Allocator<DriftChamberHit>* DriftChamberHitAllocator;
|
||||
|
||||
inline void* B5DriftChamberHit::operator new(size_t)
|
||||
inline void* DriftChamberHit::operator new(size_t)
|
||||
{
|
||||
if (!B5DriftChamberHitAllocator) {
|
||||
B5DriftChamberHitAllocator = new G4Allocator<B5DriftChamberHit>;
|
||||
if (!DriftChamberHitAllocator) {
|
||||
DriftChamberHitAllocator = new G4Allocator<DriftChamberHit>;
|
||||
}
|
||||
return (void*)B5DriftChamberHitAllocator->MallocSingle();
|
||||
return (void*)DriftChamberHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void B5DriftChamberHit::operator delete(void* aHit)
|
||||
inline void DriftChamberHit::operator delete(void* aHit)
|
||||
{
|
||||
B5DriftChamberHitAllocator->FreeSingle((B5DriftChamberHit*) aHit);
|
||||
DriftChamberHitAllocator->FreeSingle((DriftChamberHit*) aHit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
+15
-10
@@ -24,36 +24,41 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5DriftChamberSD.hh
|
||||
/// \brief Definition of the B5DriftChamberSD class
|
||||
/// \file DriftChamberSD.hh
|
||||
/// \brief Definition of the B5::DriftChamberSD class
|
||||
|
||||
#ifndef B5DriftChamberSD_h
|
||||
#define B5DriftChamberSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
|
||||
#include "B5DriftChamberHit.hh"
|
||||
#include "DriftChamberHit.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Drift chamber sensitive detector
|
||||
|
||||
class B5DriftChamberSD : public G4VSensitiveDetector
|
||||
class DriftChamberSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
B5DriftChamberSD(G4String name);
|
||||
virtual ~B5DriftChamberSD();
|
||||
DriftChamberSD(G4String name);
|
||||
~DriftChamberSD() override;
|
||||
|
||||
virtual void Initialize(G4HCofThisEvent*HCE);
|
||||
virtual G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist);
|
||||
void Initialize(G4HCofThisEvent*HCE) override;
|
||||
G4bool ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist) override;
|
||||
|
||||
private:
|
||||
B5DriftChamberHitsCollection* fHitsCollection;
|
||||
G4int fHCID;
|
||||
DriftChamberHitsCollection* fHitsCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+29
-24
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5EmCalorimeterHit.hh
|
||||
/// \brief Definition of the B5EmCalorimeterHit class
|
||||
/// \file EmCalorimeterHit.hh
|
||||
/// \brief Definition of the B5::EmCalorimeterHit class
|
||||
|
||||
#ifndef B5EmCalorimeterHit_h
|
||||
#define B5EmCalorimeterHit_h 1
|
||||
@@ -41,6 +41,9 @@
|
||||
class G4AttDef;
|
||||
class G4AttValue;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// EM Calorimeter hit
|
||||
///
|
||||
/// It records:
|
||||
@@ -48,24 +51,24 @@ class G4AttValue;
|
||||
/// - the energy deposit
|
||||
/// - the cell logical volume, its position and rotation
|
||||
|
||||
class B5EmCalorimeterHit : public G4VHit
|
||||
class EmCalorimeterHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
B5EmCalorimeterHit();
|
||||
B5EmCalorimeterHit(G4int cellID);
|
||||
B5EmCalorimeterHit(const B5EmCalorimeterHit &right);
|
||||
virtual ~B5EmCalorimeterHit();
|
||||
EmCalorimeterHit();
|
||||
EmCalorimeterHit(G4int cellID);
|
||||
EmCalorimeterHit(const EmCalorimeterHit &right) = default;
|
||||
~EmCalorimeterHit() override;
|
||||
|
||||
const B5EmCalorimeterHit& operator=(const B5EmCalorimeterHit &right);
|
||||
G4bool operator==(const B5EmCalorimeterHit &right) const;
|
||||
EmCalorimeterHit& operator=(const EmCalorimeterHit &right) = default;
|
||||
G4bool operator==(const EmCalorimeterHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
virtual void Draw();
|
||||
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
|
||||
virtual std::vector<G4AttValue>* CreateAttValues() const;
|
||||
virtual void Print();
|
||||
void Draw() override;
|
||||
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
void Print() override;
|
||||
|
||||
void SetCellID(G4int z) { fCellID = z; }
|
||||
G4int GetCellID() const { return fCellID; }
|
||||
@@ -84,28 +87,30 @@ class B5EmCalorimeterHit : public G4VHit
|
||||
const G4LogicalVolume* GetLogV() const { return fPLogV; }
|
||||
|
||||
private:
|
||||
G4int fCellID;
|
||||
G4double fEdep;
|
||||
G4int fCellID = -1;
|
||||
G4double fEdep = 0.;
|
||||
G4ThreeVector fPos;
|
||||
G4RotationMatrix fRot;
|
||||
const G4LogicalVolume* fPLogV;
|
||||
const G4LogicalVolume* fPLogV = nullptr;
|
||||
};
|
||||
|
||||
using B5EmCalorimeterHitsCollection = G4THitsCollection<B5EmCalorimeterHit>;
|
||||
using EmCalorimeterHitsCollection = G4THitsCollection<EmCalorimeterHit>;
|
||||
|
||||
extern G4ThreadLocal G4Allocator<B5EmCalorimeterHit>* B5EmCalorimeterHitAllocator;
|
||||
extern G4ThreadLocal G4Allocator<EmCalorimeterHit>* EmCalorimeterHitAllocator;
|
||||
|
||||
inline void* B5EmCalorimeterHit::operator new(size_t)
|
||||
inline void* EmCalorimeterHit::operator new(size_t)
|
||||
{
|
||||
if (!B5EmCalorimeterHitAllocator) {
|
||||
B5EmCalorimeterHitAllocator = new G4Allocator<B5EmCalorimeterHit>;
|
||||
if (!EmCalorimeterHitAllocator) {
|
||||
EmCalorimeterHitAllocator = new G4Allocator<EmCalorimeterHit>;
|
||||
}
|
||||
return (void*)B5EmCalorimeterHitAllocator->MallocSingle();
|
||||
return (void*)EmCalorimeterHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void B5EmCalorimeterHit::operator delete(void* aHit)
|
||||
inline void EmCalorimeterHit::operator delete(void* aHit)
|
||||
{
|
||||
B5EmCalorimeterHitAllocator->FreeSingle((B5EmCalorimeterHit*) aHit);
|
||||
EmCalorimeterHitAllocator->FreeSingle((EmCalorimeterHit*) aHit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
+15
-10
@@ -24,36 +24,41 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5EmCalorimeterSD.hh
|
||||
/// \brief Definition of the B5EmCalorimeterSD class
|
||||
/// \file EmCalorimeterSD.hh
|
||||
/// \brief Definition of the B5::EmCalorimeterSD class
|
||||
|
||||
#ifndef B5EmCalorimeterSD_h
|
||||
#define B5EmCalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
|
||||
#include "B5EmCalorimeterHit.hh"
|
||||
#include "EmCalorimeterHit.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// EM calorimeter sensitive detector
|
||||
|
||||
class B5EmCalorimeterSD : public G4VSensitiveDetector
|
||||
class EmCalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
B5EmCalorimeterSD(G4String name);
|
||||
virtual ~B5EmCalorimeterSD();
|
||||
EmCalorimeterSD(G4String name);
|
||||
~EmCalorimeterSD() override;
|
||||
|
||||
virtual void Initialize(G4HCofThisEvent*HCE);
|
||||
virtual G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void Initialize(G4HCofThisEvent*HCE) override;
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) override;
|
||||
|
||||
private:
|
||||
B5EmCalorimeterHitsCollection* fHitsCollection;
|
||||
G4int fHCID;
|
||||
EmCalorimeterHitsCollection* fHitsCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+23
-12
@@ -24,12 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5EventAction.hh
|
||||
/// \brief Definition of the B5EventAction class
|
||||
/// \file EventAction.hh
|
||||
/// \brief Definition of the B5::EventAction class
|
||||
|
||||
#ifndef B5EventAction_h
|
||||
#define B5EventAction_h 1
|
||||
|
||||
#include "Constants.hh"
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
@@ -44,31 +45,41 @@ const G4int kH1 = 0;
|
||||
const G4int kH2 = 1;
|
||||
const G4int kDim = 2;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Event action
|
||||
|
||||
class B5EventAction : public G4UserEventAction
|
||||
class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
B5EventAction();
|
||||
virtual ~B5EventAction();
|
||||
EventAction();
|
||||
~EventAction() override;
|
||||
|
||||
virtual void BeginOfEventAction(const G4Event*);
|
||||
virtual void EndOfEventAction(const G4Event*);
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
std::vector<G4double>& GetEmCalEdep() { return fCalEdep[kEm]; }
|
||||
std::vector<G4double>& GetHadCalEdep() { return fCalEdep[kHad]; }
|
||||
|
||||
private:
|
||||
// hit collections Ids
|
||||
std::array<G4int, kDim> fHodHCID;
|
||||
std::array<G4int, kDim> fDriftHCID;
|
||||
std::array<G4int, kDim> fCalHCID;
|
||||
std::array<G4int, kDim> fHodHCID = { -1, -1 };
|
||||
std::array<G4int, kDim> fDriftHCID = { -1, -1 };
|
||||
std::array<G4int, kDim> fCalHCID = { -1, -1 };
|
||||
// histograms Ids
|
||||
std::array<std::array<G4int, kDim>, kDim> fDriftHistoID;
|
||||
std::array<std::array<G4int, kDim>, kDim> fDriftHistoID
|
||||
{{ {{ -1, -1 }}, {{ -1, -1 }} }};
|
||||
// std::array<T, N> is an aggregate that contains a C array.
|
||||
// To initialize it, we need outer braces for the class itself
|
||||
// and inner braces for the C array
|
||||
// energy deposit in calorimeters cells
|
||||
std::array<std::vector<G4double>, kDim> fCalEdep;
|
||||
std::array<std::vector<G4double>, kDim> fCalEdep
|
||||
{{ std::vector<G4double>(kNofEmCells, 0.), std::vector<G4double>(kNofHadCells, 0.) }};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+29
-24
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5HadCalorimeterHit.hh
|
||||
/// \brief Definition of the B5HadCalorimeterHit class
|
||||
/// \file HadCalorimeterHit.hh
|
||||
/// \brief Definition of the B5::HadCalorimeterHit class
|
||||
|
||||
#ifndef B5HadCalorimeterHit_h
|
||||
#define B5HadCalorimeterHit_h 1
|
||||
@@ -41,6 +41,9 @@
|
||||
class G4AttDef;
|
||||
class G4AttValue;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Hadron Calorimeter hit
|
||||
///
|
||||
/// It records:
|
||||
@@ -48,24 +51,24 @@ class G4AttValue;
|
||||
/// - the energy deposit
|
||||
/// - the cell position and rotation
|
||||
|
||||
class B5HadCalorimeterHit : public G4VHit
|
||||
class HadCalorimeterHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
B5HadCalorimeterHit();
|
||||
B5HadCalorimeterHit(G4int iCol,G4int iRow);
|
||||
B5HadCalorimeterHit(const B5HadCalorimeterHit &right);
|
||||
virtual ~B5HadCalorimeterHit();
|
||||
HadCalorimeterHit();
|
||||
HadCalorimeterHit(G4int iCol,G4int iRow);
|
||||
HadCalorimeterHit(const HadCalorimeterHit &right) = default;
|
||||
~HadCalorimeterHit() override;
|
||||
|
||||
const B5HadCalorimeterHit& operator=(const B5HadCalorimeterHit &right);
|
||||
G4bool operator==(const B5HadCalorimeterHit &right) const;
|
||||
HadCalorimeterHit& operator=(const HadCalorimeterHit &right) = default;
|
||||
G4bool operator==(const HadCalorimeterHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
virtual void Draw();
|
||||
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
|
||||
virtual std::vector<G4AttValue>* CreateAttValues() const;
|
||||
virtual void Print();
|
||||
void Draw() override;
|
||||
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
void Print() override;
|
||||
|
||||
void SetColumnID(G4int z) { fColumnID = z; }
|
||||
G4int GetColumnID() const { return fColumnID; }
|
||||
@@ -84,28 +87,30 @@ class B5HadCalorimeterHit : public G4VHit
|
||||
G4RotationMatrix GetRot() const { return fRot; }
|
||||
|
||||
private:
|
||||
G4int fColumnID;
|
||||
G4int fRowID;
|
||||
G4double fEdep;
|
||||
G4int fColumnID = -1;
|
||||
G4int fRowID = -1;
|
||||
G4double fEdep = 0.;
|
||||
G4ThreeVector fPos;
|
||||
G4RotationMatrix fRot;
|
||||
};
|
||||
|
||||
using B5HadCalorimeterHitsCollection = G4THitsCollection<B5HadCalorimeterHit>;
|
||||
using HadCalorimeterHitsCollection = G4THitsCollection<HadCalorimeterHit>;
|
||||
|
||||
extern G4ThreadLocal G4Allocator<B5HadCalorimeterHit>* B5HadCalorimeterHitAllocator;
|
||||
extern G4ThreadLocal G4Allocator<HadCalorimeterHit>* HadCalorimeterHitAllocator;
|
||||
|
||||
inline void* B5HadCalorimeterHit::operator new(size_t)
|
||||
inline void* HadCalorimeterHit::operator new(size_t)
|
||||
{
|
||||
if (!B5HadCalorimeterHitAllocator) {
|
||||
B5HadCalorimeterHitAllocator = new G4Allocator<B5HadCalorimeterHit>;
|
||||
if (!HadCalorimeterHitAllocator) {
|
||||
HadCalorimeterHitAllocator = new G4Allocator<HadCalorimeterHit>;
|
||||
}
|
||||
return (void*)B5HadCalorimeterHitAllocator->MallocSingle();
|
||||
return (void*)HadCalorimeterHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void B5HadCalorimeterHit::operator delete(void* aHit)
|
||||
inline void HadCalorimeterHit::operator delete(void* aHit)
|
||||
{
|
||||
B5HadCalorimeterHitAllocator->FreeSingle((B5HadCalorimeterHit*) aHit);
|
||||
HadCalorimeterHitAllocator->FreeSingle((HadCalorimeterHit*) aHit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
+15
-10
@@ -24,36 +24,41 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5HadCalorimeterSD.hh
|
||||
/// \brief Definition of the B5HadCalorimeterSD class
|
||||
/// \file HadCalorimeterSD.hh
|
||||
/// \brief Definition of the B5::HadCalorimeterSD class
|
||||
|
||||
#ifndef B5HadCalorimeterSD_h
|
||||
#define B5HadCalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
|
||||
#include "B5HadCalorimeterHit.hh"
|
||||
#include "HadCalorimeterHit.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Hadron calorimeter sensitive detector
|
||||
|
||||
class B5HadCalorimeterSD : public G4VSensitiveDetector
|
||||
class HadCalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
B5HadCalorimeterSD(G4String name);
|
||||
virtual ~B5HadCalorimeterSD();
|
||||
HadCalorimeterSD(G4String name);
|
||||
~HadCalorimeterSD() override;
|
||||
|
||||
virtual void Initialize(G4HCofThisEvent*HCE);
|
||||
virtual G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void Initialize(G4HCofThisEvent*HCE) override;
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) override;
|
||||
|
||||
private:
|
||||
B5HadCalorimeterHitsCollection* fHitsCollection;
|
||||
G4int fHCID;
|
||||
HadCalorimeterHitsCollection* fHitsCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+28
-23
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5HodoscopeHit.hh
|
||||
/// \brief Definition of the B5HodoscopeHit class
|
||||
/// \file HodoscopeHit.hh
|
||||
/// \brief Definition of the B5::HodoscopeHit class
|
||||
|
||||
#ifndef B5HodoscopeHit_h
|
||||
#define B5HodoscopeHit_h 1
|
||||
@@ -41,6 +41,9 @@
|
||||
class G4AttDef;
|
||||
class G4AttValue;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Hodoscope hit
|
||||
///
|
||||
/// It records:
|
||||
@@ -48,23 +51,23 @@ class G4AttValue;
|
||||
/// - the particle time
|
||||
/// - the strip logical volume, its position and rotation
|
||||
|
||||
class B5HodoscopeHit : public G4VHit
|
||||
class HodoscopeHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
B5HodoscopeHit(G4int i,G4double t);
|
||||
B5HodoscopeHit(const B5HodoscopeHit &right);
|
||||
virtual ~B5HodoscopeHit();
|
||||
HodoscopeHit(G4int i,G4double t);
|
||||
HodoscopeHit(const HodoscopeHit &right) = default;
|
||||
~HodoscopeHit() override;
|
||||
|
||||
const B5HodoscopeHit& operator=(const B5HodoscopeHit &right);
|
||||
G4bool operator==(const B5HodoscopeHit &right) const;
|
||||
HodoscopeHit& operator=(const HodoscopeHit &right) = default;
|
||||
G4bool operator==(const HodoscopeHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void*aHit);
|
||||
|
||||
void Draw();
|
||||
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
|
||||
virtual std::vector<G4AttValue>* CreateAttValues() const;
|
||||
void Print();
|
||||
void Draw() override;
|
||||
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
void Print() override;
|
||||
|
||||
G4int GetID() const { return fId; }
|
||||
|
||||
@@ -81,28 +84,30 @@ class B5HodoscopeHit : public G4VHit
|
||||
const G4LogicalVolume* GetLogV() const { return fPLogV; }
|
||||
|
||||
private:
|
||||
G4int fId;
|
||||
G4double fTime;
|
||||
G4int fId = -1;
|
||||
G4double fTime = 0.;
|
||||
G4ThreeVector fPos;
|
||||
G4RotationMatrix fRot;
|
||||
const G4LogicalVolume* fPLogV;
|
||||
const G4LogicalVolume* fPLogV = nullptr;
|
||||
};
|
||||
|
||||
using B5HodoscopeHitsCollection = G4THitsCollection<B5HodoscopeHit>;
|
||||
using HodoscopeHitsCollection = G4THitsCollection<HodoscopeHit>;
|
||||
|
||||
extern G4ThreadLocal G4Allocator<B5HodoscopeHit>* B5HodoscopeHitAllocator;
|
||||
extern G4ThreadLocal G4Allocator<HodoscopeHit>* HodoscopeHitAllocator;
|
||||
|
||||
inline void* B5HodoscopeHit::operator new(size_t)
|
||||
inline void* HodoscopeHit::operator new(size_t)
|
||||
{
|
||||
if (!B5HodoscopeHitAllocator) {
|
||||
B5HodoscopeHitAllocator = new G4Allocator<B5HodoscopeHit>;
|
||||
if (!HodoscopeHitAllocator) {
|
||||
HodoscopeHitAllocator = new G4Allocator<HodoscopeHit>;
|
||||
}
|
||||
return (void*)B5HodoscopeHitAllocator->MallocSingle();
|
||||
return (void*)HodoscopeHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void B5HodoscopeHit::operator delete(void*aHit)
|
||||
inline void HodoscopeHit::operator delete(void*aHit)
|
||||
{
|
||||
B5HodoscopeHitAllocator->FreeSingle((B5HodoscopeHit*) aHit);
|
||||
HodoscopeHitAllocator->FreeSingle((HodoscopeHit*) aHit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
+15
-10
@@ -24,35 +24,40 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5HodoscopeSD.hh
|
||||
/// \brief Definition of the B5HodoscopeSD class
|
||||
/// \file HodoscopeSD.hh
|
||||
/// \brief Definition of the B5::HodoscopeSD class
|
||||
|
||||
#ifndef B5HodoscopeSD_h
|
||||
#define B5HodoscopeSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "B5HodoscopeHit.hh"
|
||||
#include "HodoscopeHit.hh"
|
||||
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
class G4TouchableHistory;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Hodoscope sensitive detector
|
||||
|
||||
class B5HodoscopeSD : public G4VSensitiveDetector
|
||||
class HodoscopeSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
B5HodoscopeSD(G4String name);
|
||||
virtual ~B5HodoscopeSD();
|
||||
HodoscopeSD(G4String name);
|
||||
~HodoscopeSD() override;
|
||||
|
||||
virtual void Initialize(G4HCofThisEvent*HCE);
|
||||
virtual G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
|
||||
void Initialize(G4HCofThisEvent*HCE) override;
|
||||
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) override;
|
||||
|
||||
private:
|
||||
B5HodoscopeHitsCollection* fHitsCollection;
|
||||
G4int fHCID;
|
||||
HodoscopeHitsCollection* fHitsCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+15
-8
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5MagneticField.hh
|
||||
/// \brief Definition of the B5MagneticField class
|
||||
/// \file MagneticField.hh
|
||||
/// \brief Definition of the B5::MagneticField class
|
||||
|
||||
#ifndef B5MagneticField_H
|
||||
#define B5MagneticField_H 1
|
||||
@@ -33,17 +33,22 @@
|
||||
#include "globals.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
class G4GenericMessenger;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Magnetic field
|
||||
|
||||
class B5MagneticField : public G4MagneticField
|
||||
class MagneticField : public G4MagneticField
|
||||
{
|
||||
public:
|
||||
B5MagneticField();
|
||||
virtual ~B5MagneticField();
|
||||
MagneticField();
|
||||
~MagneticField() override;
|
||||
|
||||
virtual void GetFieldValue(const G4double point[4],double* bField ) const;
|
||||
void GetFieldValue(const G4double point[4],double* bField ) const override;
|
||||
|
||||
void SetField(G4double val) { fBy = val; }
|
||||
G4double GetField() const { return fBy; }
|
||||
@@ -51,10 +56,12 @@ class B5MagneticField : public G4MagneticField
|
||||
private:
|
||||
void DefineCommands();
|
||||
|
||||
G4GenericMessenger* fMessenger;
|
||||
G4double fBy;
|
||||
G4GenericMessenger* fMessenger = nullptr;
|
||||
G4double fBy = 1.0*CLHEP::tesla;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
+24
-17
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the B5PrimaryGeneratorAction class
|
||||
/// \file PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the B5::PrimaryGeneratorAction class
|
||||
|
||||
#ifndef B5PrimaryGeneratorAction_h
|
||||
#define B5PrimaryGeneratorAction_h 1
|
||||
@@ -33,11 +33,16 @@
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4GenericMessenger;
|
||||
class G4Event;
|
||||
class G4ParticleDefinition;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
/// Primary generator
|
||||
///
|
||||
/// A single particle is generated.
|
||||
@@ -47,13 +52,13 @@ class G4ParticleDefinition;
|
||||
/// - random selection of a particle type from proton, kaon+, pi+, muon+, e+
|
||||
|
||||
|
||||
class B5PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
B5PrimaryGeneratorAction();
|
||||
virtual ~B5PrimaryGeneratorAction();
|
||||
PrimaryGeneratorAction();
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
virtual void GeneratePrimaries(G4Event*);
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
void SetMomentum(G4double val) { fMomentum = val; }
|
||||
G4double GetMomentum() const { return fMomentum; }
|
||||
@@ -70,19 +75,21 @@ class B5PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
private:
|
||||
void DefineCommands();
|
||||
|
||||
G4ParticleGun* fParticleGun;
|
||||
G4GenericMessenger* fMessenger;
|
||||
G4ParticleDefinition* fPositron;
|
||||
G4ParticleDefinition* fMuon;
|
||||
G4ParticleDefinition* fPion;
|
||||
G4ParticleDefinition* fKaon;
|
||||
G4ParticleDefinition* fProton;
|
||||
G4double fMomentum;
|
||||
G4double fSigmaMomentum;
|
||||
G4double fSigmaAngle;
|
||||
G4bool fRandomizePrimary;
|
||||
G4ParticleGun* fParticleGun = nullptr;
|
||||
G4GenericMessenger* fMessenger = nullptr;
|
||||
G4ParticleDefinition* fPositron = nullptr;
|
||||
G4ParticleDefinition* fMuon = nullptr;
|
||||
G4ParticleDefinition* fPion = nullptr;
|
||||
G4ParticleDefinition* fKaon = nullptr;
|
||||
G4ParticleDefinition* fProton = nullptr;
|
||||
G4double fMomentum = 1000. * CLHEP::MeV;
|
||||
G4double fSigmaMomentum = 50. * CLHEP::MeV;
|
||||
G4double fSigmaAngle = 2. * CLHEP::deg;
|
||||
G4bool fRandomizePrimary = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B5RunAction.hh
|
||||
/// \brief Definition of the B5RunAction class
|
||||
/// \file RunAction.hh
|
||||
/// \brief Definition of the B5::RunAction class
|
||||
|
||||
#ifndef B5RunAction_h
|
||||
#define B5RunAction_h 1
|
||||
@@ -33,25 +33,30 @@
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class B5EventAction;
|
||||
|
||||
class G4Run;
|
||||
|
||||
namespace B5
|
||||
{
|
||||
|
||||
class EventAction;
|
||||
|
||||
/// Run action class
|
||||
|
||||
class B5RunAction : public G4UserRunAction
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
B5RunAction(B5EventAction* eventAction);
|
||||
virtual ~B5RunAction();
|
||||
RunAction(EventAction* eventAction);
|
||||
~RunAction() override;
|
||||
|
||||
virtual void BeginOfRunAction(const G4Run*);
|
||||
virtual void EndOfRunAction(const G4Run*);
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
private:
|
||||
B5EventAction* fEventAction;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user