Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -14,6 +14,9 @@ track of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
10/11/20 I. Hrivnacova (physicslistsShared-V10-06-00)
|
||||
- Removed trailing whitespaces
|
||||
|
||||
24/3/19 J.Allison (physicslistsShared-V10-05-00)
|
||||
- Part of Merge Request exampleB4-V10-05-00.
|
||||
- Corrected name of include file: csv.hh
|
||||
|
||||
@@ -51,4 +51,4 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file DetectorConstruction.hh
|
||||
/// \brief Definition of the DetectorConstruction class
|
||||
|
||||
@@ -49,7 +49,7 @@ class G4GlobalMagFieldMessenger;
|
||||
///
|
||||
/// In ConstructSDandField() sensitive detectors of CalorimeterSD type
|
||||
/// are created and associated with the Absorber and Gap volumes.
|
||||
/// In addition a transverse uniform magnetic field is defined
|
||||
/// In addition a transverse uniform magnetic field is defined
|
||||
/// via G4GlobalMagFieldMessenger class.
|
||||
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
@@ -61,11 +61,11 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
public:
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
virtual void ConstructSDandField();
|
||||
|
||||
|
||||
private:
|
||||
// data members
|
||||
//
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the PrimaryGeneratorAction class
|
||||
|
||||
@@ -38,19 +38,19 @@ class G4Event;
|
||||
|
||||
/// The primary generator action class with particle gum.
|
||||
///
|
||||
/// It defines a single particle which hits the calorimeter
|
||||
/// It defines a single particle which hits the calorimeter
|
||||
/// 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 PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction();
|
||||
PrimaryGeneratorAction();
|
||||
virtual ~PrimaryGeneratorAction();
|
||||
|
||||
virtual void GeneratePrimaries(G4Event* event);
|
||||
|
||||
|
||||
// set methods
|
||||
void SetRandomFlag(G4bool value);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file RunAction.hh
|
||||
/// \brief Definition of the RunAction class
|
||||
|
||||
@@ -37,9 +37,9 @@ class G4Run;
|
||||
|
||||
/// Run action class
|
||||
///
|
||||
/// It accumulates statistic and computes dispersion of the energy deposit
|
||||
/// It accumulates statistic and computes dispersion of the energy deposit
|
||||
/// and track lengths of charged particles with use of analysis tools:
|
||||
/// H1D histograms are created in BeginOfRunAction() for the following
|
||||
/// H1D histograms are created in BeginOfRunAction() for the following
|
||||
/// physics quantities:
|
||||
/// - Edep in absorber
|
||||
/// - Edep in gap
|
||||
@@ -49,7 +49,7 @@ class G4Run;
|
||||
/// The histograms and ntuple are saved in the output file in a format
|
||||
/// accoring to a selected technology in Analysis.hh.
|
||||
///
|
||||
/// In EndOfRunAction(), the accumulated statistic and computed
|
||||
/// In EndOfRunAction(), the accumulated statistic and computed
|
||||
/// dispersion is printed.
|
||||
///
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ DIRNAME=$1
|
||||
|
||||
for FILE in `ls $DIRNAME/include`; do
|
||||
rm -f include/$FILE
|
||||
done
|
||||
done
|
||||
for FILE in `ls $DIRNAME/src`; do
|
||||
rm -f src/$FILE
|
||||
done
|
||||
done
|
||||
|
||||
echo "... clean_files.sh from $1 finished"
|
||||
|
||||
|
||||
@@ -56,6 +56,6 @@ void ActionInitialization::Build() const
|
||||
{
|
||||
SetUserAction(new PrimaryGeneratorAction);
|
||||
SetUserAction(new RunAction(fFileName));
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file DetectorConstruction
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreadLocal
|
||||
G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = 0;
|
||||
G4ThreadLocal
|
||||
G4GlobalMagFieldMessenger* DetectorConstruction::fMagFieldMessenger = 0;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -57,7 +57,7 @@ DetectorConstruction::DetectorConstruction()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::~DetectorConstruction()
|
||||
{}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -71,11 +71,11 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
G4Material* csi = nistManager->FindOrBuildMaterial("G4_CESIUM_IODIDE");
|
||||
// There is no need to test if materials were built/found
|
||||
// as G4NistManager would issue an error otherwise
|
||||
// Try the code with "XYZ".
|
||||
// Try the code with "XYZ".
|
||||
|
||||
// Print all materials
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
|
||||
// Option to switch on/off checking of volumes overlaps
|
||||
G4bool checkOverlaps = true;
|
||||
|
||||
@@ -85,12 +85,12 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
|
||||
// The world dimensions
|
||||
G4double worldHxyz = 2.*m;
|
||||
|
||||
|
||||
// world volume
|
||||
G4Box* worldS = new G4Box("World", worldHxyz, worldHxyz, worldHxyz);
|
||||
G4Box* worldS = new G4Box("World", worldHxyz, worldHxyz, worldHxyz);
|
||||
|
||||
G4LogicalVolume* worldLV = new G4LogicalVolume(worldS, air, "World");
|
||||
|
||||
|
||||
G4VPhysicalVolume* worldPV
|
||||
= new G4PVPlacement(
|
||||
0, G4ThreeVector(), worldLV, "World", 0, false, 0, checkOverlaps);
|
||||
@@ -102,12 +102,12 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
// The box dimensions
|
||||
G4double boxHxy = 1.*m;
|
||||
G4double boxHz = 10.*cm;
|
||||
|
||||
|
||||
// box volume
|
||||
G4Box* boxS = new G4Box("World", boxHxy, boxHxy, boxHz);
|
||||
G4Box* boxS = new G4Box("World", boxHxy, boxHxy, boxHz);
|
||||
|
||||
G4LogicalVolume* boxLV = new G4LogicalVolume(boxS, csi, "Box");
|
||||
|
||||
|
||||
// The box position
|
||||
G4double posz = 0.*m;
|
||||
|
||||
@@ -121,12 +121,12 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
// The screen dimensions
|
||||
G4double screenHxy = 1.999*m;
|
||||
G4double screenHz = 1.*mm;
|
||||
|
||||
|
||||
// Screen volume
|
||||
G4Box* screenS = new G4Box("World", screenHxy, screenHxy, screenHz);
|
||||
|
||||
G4Box* screenS = new G4Box("World", screenHxy, screenHxy, screenHz);
|
||||
|
||||
G4LogicalVolume* screenLV = new G4LogicalVolume(screenS, air, "Screen");
|
||||
|
||||
|
||||
// The screen position
|
||||
posz += boxHz + screenHz;
|
||||
|
||||
@@ -134,7 +134,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
0, G4ThreeVector(0, 0, posz),
|
||||
screenLV, "Screen", worldLV, false, 0, checkOverlaps);
|
||||
|
||||
//
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
worldLV->SetVisAttributes(G4VisAttributes::GetInvisible());
|
||||
@@ -156,14 +156,14 @@ void DetectorConstruction::ConstructSDandField()
|
||||
{
|
||||
// G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
|
||||
|
||||
//
|
||||
//
|
||||
// Sensitive detectors
|
||||
//
|
||||
auto screenSD = new ScreenSD("ScreenSD");
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(screenSD);
|
||||
SetSensitiveDetector("Screen", screenSD);
|
||||
|
||||
//
|
||||
//
|
||||
// Magnetic field
|
||||
//
|
||||
// Create global magnetic field messenger.
|
||||
@@ -172,7 +172,7 @@ void DetectorConstruction::ConstructSDandField()
|
||||
G4ThreeVector fieldValue;
|
||||
fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
|
||||
fMagFieldMessenger->SetVerboseLevel(1);
|
||||
|
||||
|
||||
// Register the field messenger for deleting
|
||||
G4AutoDelete::Register(fMagFieldMessenger);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file PrimaryGeneratorAction
|
||||
/// \brief Implementation of the PrimaryGeneratorAction class
|
||||
|
||||
@@ -69,7 +69,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
// This function is called at the begining of event
|
||||
|
||||
// In order to avoid dependence of PrimaryGeneratorAction
|
||||
// on DetectorConstruction class we get world volume
|
||||
// on DetectorConstruction class we get world volume
|
||||
// from G4LogicalVolumeStore
|
||||
//
|
||||
G4double worldZHalfLength = 0.;
|
||||
@@ -82,7 +82,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
}
|
||||
|
||||
if ( worldBox ) {
|
||||
worldZHalfLength = worldBox->GetZHalfLength();
|
||||
worldZHalfLength = worldBox->GetZHalfLength();
|
||||
}
|
||||
else {
|
||||
G4ExceptionDescription msg;
|
||||
@@ -91,8 +91,8 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
msg << "The gun will be place in the center.";
|
||||
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
"MyCode0002", JustWarning, msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Set gun position
|
||||
fParticleGun
|
||||
->SetParticlePosition(G4ThreeVector(0., 0., -worldZHalfLength));
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
RunAction::RunAction(const G4String& fileName)
|
||||
: G4UserRunAction(),
|
||||
fFileName(fileName)
|
||||
{
|
||||
{
|
||||
// Create analysis manager
|
||||
// The choice of analysis technology is done via selectin of a namespace
|
||||
// in Analysis.hh
|
||||
@@ -59,7 +59,7 @@ RunAction::RunAction(const G4String& fileName)
|
||||
analysisManager->CreateNtupleIColumn("ID"); // column id = 0
|
||||
analysisManager->CreateNtupleIColumn("PDG"); // column id = 1
|
||||
analysisManager->CreateNtupleDColumn("Ekin"); // column id = 2
|
||||
analysisManager->CreateNtupleDColumn("Xpos"); // column id = 3
|
||||
analysisManager->CreateNtupleDColumn("Xpos"); // column id = 3
|
||||
analysisManager->CreateNtupleDColumn("Ypos"); // column id = 4
|
||||
analysisManager->CreateNtupleDColumn("time"); // column id = 5
|
||||
analysisManager->FinishNtuple();
|
||||
@@ -69,13 +69,13 @@ RunAction::RunAction(const G4String& fileName)
|
||||
|
||||
RunAction::~RunAction()
|
||||
{
|
||||
delete G4AnalysisManager::Instance();
|
||||
delete G4AnalysisManager::Instance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::BeginOfRunAction(const G4Run* /*run*/)
|
||||
{
|
||||
{
|
||||
// Get analysis manager
|
||||
auto analysisManager = G4AnalysisManager::Instance();
|
||||
|
||||
|
||||
@@ -76,16 +76,16 @@ G4bool ScreenSD::ProcessHits(G4Step* step, G4TouchableHistory* /*history*/)
|
||||
// Obtain local coordinates:
|
||||
const G4VTouchable* touchable = preStepPoint->GetTouchable();
|
||||
G4ThreeVector globalPosition = preStepPoint->GetPosition();
|
||||
G4ThreeVector localPosition
|
||||
G4ThreeVector localPosition
|
||||
= touchable->GetHistory()->GetTopTransform().TransformPoint(globalPosition);
|
||||
// // Example for obtaining the local direction:
|
||||
// G4ThreeVector globalDirection = preStepPoint->GetMomentumDirection();
|
||||
// G4ThreeVector localDirection
|
||||
// G4ThreeVector localDirection
|
||||
// = touchable->GetHistory()->GetTopTransform().TransformAxis(localDirection);
|
||||
|
||||
// Time
|
||||
G4double time = preStepPoint->GetGlobalTime();
|
||||
|
||||
|
||||
// Store hit in the ntuple
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->FillNtupleIColumn(0, ID);
|
||||
@@ -94,7 +94,7 @@ G4bool ScreenSD::ProcessHits(G4Step* step, G4TouchableHistory* /*history*/)
|
||||
analysisManager->FillNtupleDColumn(3, localPosition.x()/cm);
|
||||
analysisManager->FillNtupleDColumn(4, localPosition.y()/cm);
|
||||
analysisManager->FillNtupleDColumn(5, time/ns);
|
||||
analysisManager->AddNtupleRow();
|
||||
analysisManager->AddNtupleRow();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user