Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -37,13 +37,7 @@
|
||||
|
||||
F03ActionInitialization::F03ActionInitialization
|
||||
(F03DetectorConstruction* detConstruction)
|
||||
: G4VUserActionInitialization(),
|
||||
fDetConstruction(detConstruction)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03ActionInitialization::~F03ActionInitialization()
|
||||
: fDetConstruction(detConstruction)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -34,22 +34,7 @@
|
||||
|
||||
#include "F03CalorHit.hh"
|
||||
|
||||
G4ThreadLocal G4Allocator<F03CalorHit>* F03CalorHitAllocator=0;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03CalorHit::F03CalorHit()
|
||||
: G4VHit(),
|
||||
fEdepAbs(0.),
|
||||
fTrackLengthAbs(0.),
|
||||
fEdepGap(0.),
|
||||
fTrackLengthGap(0.)
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03CalorHit::~F03CalorHit()
|
||||
{;}
|
||||
G4ThreadLocal G4Allocator<F03CalorHit>* F03CalorHitAllocator=nullptr;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -80,6 +65,6 @@ G4bool F03CalorHit::operator==(const F03CalorHit& right) const
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03CalorHit::Print()
|
||||
{;}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
F03CalorimeterSD::F03CalorimeterSD(G4String name,
|
||||
F03DetectorConstruction* det)
|
||||
: G4VSensitiveDetector(name),
|
||||
fCalCollection(0),
|
||||
fCalCollection(nullptr),
|
||||
fDetector(det),
|
||||
fHitID(new G4int[500])
|
||||
{
|
||||
@@ -82,7 +82,7 @@ G4bool F03CalorimeterSD::ProcessHits(G4Step* step, G4TouchableHistory*)
|
||||
|
||||
if ((edep == 0.) && (stepl == 0.) ) return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
auto theTouchable
|
||||
= (G4TouchableHistory*)(step->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
@@ -90,7 +90,7 @@ G4bool F03CalorimeterSD::ProcessHits(G4Step* step, G4TouchableHistory*)
|
||||
G4int number = 0;
|
||||
if (fHitID[number]==-1)
|
||||
{
|
||||
F03CalorHit* calHit = new F03CalorHit();
|
||||
auto calHit = new F03CalorHit();
|
||||
if (physVol == fDetector->GetAbsorber()) calHit->AddAbs(edep,stepl);
|
||||
fHitID[number] = fCalCollection->insert(calHit) - 1;
|
||||
if (verboseLevel>0)
|
||||
@@ -101,7 +101,7 @@ G4bool F03CalorimeterSD::ProcessHits(G4Step* step, G4TouchableHistory*)
|
||||
if (physVol == fDetector->GetAbsorber())
|
||||
(*fCalCollection)[fHitID[number]]->AddAbs(edep,stepl);
|
||||
if (verboseLevel>0)
|
||||
G4cout << " Energy added to F03: " << number << G4endl;
|
||||
G4cout << " Energy added to F03: " << number << G4endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -57,32 +57,12 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03DetectorConstruction::F03DetectorConstruction()
|
||||
: G4VUserDetectorConstruction(),
|
||||
fDetectorMessenger(0),
|
||||
fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0),
|
||||
fSolidAbsorber(0), fLogicAbsorber(0), fPhysiAbsorber(0),
|
||||
fSolidRadSlice(0), fLogicRadSlice(0), fPhysiRadSlice(0),
|
||||
fSolidRadiator(0), fLogicRadiator(0), fPhysiRadiator(0),
|
||||
fWorldMaterial(0), fAbsorberMaterial(0), fRadiatorMat(0),
|
||||
// default parameter values of the calorimeter
|
||||
fWorldSizeR( 22000.*mm),
|
||||
fWorldSizeZ( 44000.*mm),
|
||||
fAbsorberThickness( 1.*mm),
|
||||
fAbsorberRadius( 20000.*mm),
|
||||
fZAbsorber( 21990.*mm),
|
||||
fZStartAbs( 0.),
|
||||
fZEndAbs( 0.),
|
||||
fRadThickness( 100.*mm),
|
||||
fGasGap( 100.*mm),
|
||||
fDetGap( 1.*mm),
|
||||
fFoilNumber(2)
|
||||
{
|
||||
fDetectorMessenger = new F03DetectorMessenger(this);
|
||||
|
||||
// create materials
|
||||
|
||||
DefineMaterials();
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -104,7 +84,7 @@ G4VPhysicalVolume* F03DetectorConstruction::Construct()
|
||||
void F03DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
//This function illustrates the possible ways to define materials
|
||||
|
||||
|
||||
G4String name, symbol; // a=mass of a mole;
|
||||
G4double a, z, density; // z=mean number of protons;
|
||||
G4int nel;
|
||||
@@ -116,19 +96,19 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
//
|
||||
|
||||
a = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
||||
auto elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
||||
|
||||
a = 12.01*g/mole;
|
||||
G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
|
||||
auto elC = new G4Element(name="Carbon", symbol="C", z=6., a);
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
||||
auto elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
||||
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
||||
auto elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
||||
|
||||
a = 39.948*g/mole;
|
||||
G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
|
||||
auto elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
|
||||
|
||||
//
|
||||
// define simple materials
|
||||
@@ -137,14 +117,14 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
// Mylar
|
||||
|
||||
density = 1.39*g/cm3;
|
||||
G4Material* mylar = new G4Material(name="Mylar", density, nel=3);
|
||||
auto mylar = new G4Material(name="Mylar", density, nel=3);
|
||||
mylar->AddElement(elO,2);
|
||||
mylar->AddElement(elC,5);
|
||||
mylar->AddElement(elH,4);
|
||||
|
||||
// Polypropelene
|
||||
|
||||
G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
|
||||
auto CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
|
||||
CH2->AddElement(elH,2);
|
||||
CH2->AddElement(elC,1);
|
||||
|
||||
@@ -152,20 +132,20 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
|
||||
density = 3.700*mg/cm3;
|
||||
a = 83.80*g/mole;
|
||||
G4Material* Kr = new G4Material(name="Kr",z=36., a, density );
|
||||
auto Kr = new G4Material(name="Kr",z=36., a, density );
|
||||
|
||||
// Dry air (average composition)
|
||||
|
||||
density = 1.7836*mg/cm3; // STP
|
||||
G4Material* argon = new G4Material(name="Argon" , density, ncomponents=1);
|
||||
auto argon = new G4Material(name="Argon" , density, ncomponents=1);
|
||||
argon->AddElement(elAr, 1);
|
||||
|
||||
density = 1.25053*mg/cm3; // STP
|
||||
G4Material* nitrogen = new G4Material(name="N2" , density, ncomponents=1);
|
||||
auto nitrogen = new G4Material(name="N2" , density, ncomponents=1);
|
||||
nitrogen->AddElement(elN, 2);
|
||||
|
||||
density = 1.4289*mg/cm3; // STP
|
||||
G4Material* oxygen = new G4Material(name="O2" , density, ncomponents=1);
|
||||
auto oxygen = new G4Material(name="O2" , density, ncomponents=1);
|
||||
oxygen->AddElement(elO, 2);
|
||||
|
||||
density = 1.2928*mg/cm3; // STP
|
||||
@@ -173,7 +153,7 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
temperature = STP_Temperature;
|
||||
pressure = 1.0e-8*STP_Pressure;
|
||||
|
||||
G4Material* air = new G4Material(name="Air" , density, ncomponents=3,
|
||||
auto air = new G4Material(name="Air" , density, ncomponents=3,
|
||||
kStateGas,temperature,pressure);
|
||||
air->AddMaterial( nitrogen, fractionmass = 0.7557 );
|
||||
air->AddMaterial( oxygen, fractionmass = 0.2315 );
|
||||
@@ -183,26 +163,26 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
|
||||
density = 5.858*mg/cm3;
|
||||
a = 131.29*g/mole;
|
||||
G4Material* Xe = new G4Material(name="Xenon",z=54., a, density );
|
||||
auto Xe = new G4Material(name="Xenon",z=54., a, density );
|
||||
|
||||
// Carbon dioxide, STP
|
||||
|
||||
density = 1.842*mg/cm3;
|
||||
G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
|
||||
auto CarbonDioxide = new G4Material(name="CO2", density, nel=2);
|
||||
CarbonDioxide->AddElement(elC,1);
|
||||
CarbonDioxide->AddElement(elO,2);
|
||||
|
||||
// 80% Xe + 20% CO2, STP
|
||||
|
||||
density = 5.0818*mg/cm3;
|
||||
G4Material* Xe20CO2 = new G4Material(name="Xe20CO2", density, ncomponents=2);
|
||||
auto Xe20CO2 = new G4Material(name="Xe20CO2", density, ncomponents=2);
|
||||
Xe20CO2->AddMaterial( Xe, fractionmass = 0.922 );
|
||||
Xe20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.078 );
|
||||
|
||||
// 80% Kr + 20% CO2, STP
|
||||
|
||||
density = 3.601*mg/cm3;
|
||||
G4Material* Kr20CO2 = new G4Material(name="Kr20CO2", density, ncomponents=2);
|
||||
auto Kr20CO2 = new G4Material(name="Kr20CO2", density, ncomponents=2);
|
||||
Kr20CO2->AddMaterial( Kr, fractionmass = 0.89 );
|
||||
Kr20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.11 );
|
||||
|
||||
@@ -211,14 +191,14 @@ void F03DetectorConstruction::DefineMaterials()
|
||||
//default materials of the calorimeter and TR radiator
|
||||
|
||||
fRadiatorMat = air; // CH2 ; // mylar;
|
||||
|
||||
|
||||
fAbsorberMaterial = air; // Kr20CO2; // XeCO2CF4;
|
||||
|
||||
fWorldMaterial = air;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
{
|
||||
// Cleanup old geometry
|
||||
@@ -245,11 +225,11 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
fWorldMaterial, // its material
|
||||
"World"); // its name
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(0, // no rotation
|
||||
fPhysiWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
"World", // its name
|
||||
fLogicWorld, // its logical volume
|
||||
0, // its mother volume
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean op.
|
||||
0, // copy number
|
||||
checkOverlaps); // checkOverlaps
|
||||
@@ -263,15 +243,15 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
G4cout << "fFoilNumber = " << fFoilNumber << G4endl;
|
||||
G4cout << "fRadiatorMat = " << fRadiatorMat->GetName() << G4endl;
|
||||
G4cout << "WorldMaterial = " << fWorldMaterial->GetName() << G4endl;
|
||||
|
||||
|
||||
fSolidRadiator = new G4Tubs("Radiator", 0.0, fAbsorberRadius, 0.5*radThick,
|
||||
0.0, twopi);
|
||||
|
||||
fLogicRadiator = new G4LogicalVolume(fSolidRadiator, fWorldMaterial,
|
||||
fLogicRadiator = new G4LogicalVolume(fSolidRadiator, fWorldMaterial,
|
||||
"Radiator");
|
||||
|
||||
fPhysiRadiator = new G4PVPlacement(0, G4ThreeVector(0,0,zRad),
|
||||
"Radiator", fLogicRadiator, fPhysiWorld, false, 0,
|
||||
fPhysiRadiator = new G4PVPlacement(nullptr, G4ThreeVector(0,0,zRad),
|
||||
"Radiator", fLogicRadiator, fPhysiWorld, false, 0,
|
||||
checkOverlaps);
|
||||
|
||||
|
||||
@@ -290,7 +270,7 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
G4double zSlice = zStart + j*radSliceThick;
|
||||
G4cout << zSlice/mm << " mm" << "\t";
|
||||
|
||||
fPhysiRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0., zSlice),
|
||||
fPhysiRadSlice = new G4PVPlacement(nullptr,G4ThreeVector(0.,0., zSlice),
|
||||
"RadSlice",fLogicRadSlice,
|
||||
fPhysiRadiator,false,j, checkOverlaps);
|
||||
}
|
||||
@@ -306,8 +286,8 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber,
|
||||
fAbsorberMaterial,
|
||||
"Absorber");
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(0,
|
||||
|
||||
fPhysiAbsorber = new G4PVPlacement(nullptr,
|
||||
G4ThreeVector(0.,0.,fZAbsorber),
|
||||
"Absorber",
|
||||
fLogicAbsorber,
|
||||
@@ -426,24 +406,24 @@ void F03DetectorConstruction::SetAbsorberZpos(G4double val)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03DetectorConstruction::ConstructSDandField()
|
||||
{
|
||||
{
|
||||
// Sensitive Detectors: Absorber
|
||||
|
||||
if (!fCalorimeterSD.Get()) {
|
||||
F03CalorimeterSD* calorimeterSD = new F03CalorimeterSD("CalorSD",this);
|
||||
auto calorimeterSD = new F03CalorimeterSD("CalorSD",this);
|
||||
fCalorimeterSD.Put(calorimeterSD);
|
||||
}
|
||||
}
|
||||
G4SDManager::GetSDMpointer()->AddNewDetector(fCalorimeterSD.Get());
|
||||
SetSensitiveDetector(fLogicAbsorber, fCalorimeterSD.Get());
|
||||
|
||||
// Construct the field creator - this will register the field it creates
|
||||
|
||||
if (!fEmFieldSetup.Get()) {
|
||||
F03FieldSetup* emFieldSetup = new F03FieldSetup();
|
||||
if (!fEmFieldSetup.Get()) {
|
||||
auto emFieldSetup = new F03FieldSetup();
|
||||
|
||||
fEmFieldSetup.Put(emFieldSetup);
|
||||
G4AutoDelete::Register(emFieldSetup); //Kernel will delete the messenger
|
||||
}
|
||||
}
|
||||
// Set local field manager and local field in radiator and its daughters:
|
||||
G4bool allLocal = true;
|
||||
fLogicRadiator->SetFieldManager(fEmFieldSetup.Get()->GetLocalFieldManager(),
|
||||
|
||||
@@ -42,20 +42,11 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03DetectorMessenger::F03DetectorMessenger(F03DetectorConstruction* det)
|
||||
: G4UImessenger(),
|
||||
fDetector(det),
|
||||
fDetDir(0),
|
||||
fAbsMaterCmd(0),
|
||||
fAbsThickCmd(0),
|
||||
fAbsRadCmd(0),
|
||||
fAbsZposCmd(0),
|
||||
fWorldMaterCmd(0),
|
||||
fWorldZCmd(0),
|
||||
fWorldRCmd(0)
|
||||
: fDetector(det)
|
||||
{
|
||||
fDetDir = new G4UIdirectory("/calor/");
|
||||
fDetDir->SetGuidance("F03 detector control.");
|
||||
|
||||
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
fAbsMaterCmd->SetParameterName("choice",true);
|
||||
@@ -133,19 +124,19 @@ void F03DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
|
||||
if( command == fWorldMaterCmd )
|
||||
{ fDetector->SetWorldMaterial(newValue);}
|
||||
|
||||
|
||||
if( command == fAbsThickCmd )
|
||||
{fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == fAbsRadCmd )
|
||||
{ fDetector->SetAbsorberRadius(fAbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
|
||||
if( command == fAbsZposCmd )
|
||||
{ fDetector->SetAbsorberZpos(fAbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
|
||||
if( command == fWorldZCmd )
|
||||
{ fDetector->SetWorldSizeZ(fWorldZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
|
||||
if( command == fWorldRCmd )
|
||||
{ fDetector->SetWorldSizeR(fWorldRCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
@@ -45,15 +45,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03FieldMessenger::F03FieldMessenger(F03FieldSetup* fieldSetup)
|
||||
: G4UImessenger(),
|
||||
fEMfieldSetup(fieldSetup),
|
||||
fFieldDir(0),
|
||||
fStepperCmd(0),
|
||||
fMagFieldZCmd(0),
|
||||
fMagFieldCmd(0),
|
||||
fLocalMagFieldCmd(0),
|
||||
fMinStepCmd(0),
|
||||
fUpdateCmd(0)
|
||||
: fEMfieldSetup(fieldSetup)
|
||||
{
|
||||
fFieldDir = new G4UIdirectory("/field/");
|
||||
fFieldDir->SetGuidance("F03 field tracking control.");
|
||||
@@ -69,26 +61,26 @@ F03FieldMessenger::F03FieldMessenger(F03FieldSetup* fieldSetup)
|
||||
fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
fUpdateCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
|
||||
fMagFieldZCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
|
||||
fMagFieldZCmd->SetGuidance("Define global magnetic field.");
|
||||
fMagFieldZCmd->SetGuidance("Global magnetic field will be in Z direction.");
|
||||
fMagFieldZCmd->SetParameterName("Bz",false,false);
|
||||
fMagFieldZCmd->SetDefaultUnit("tesla");
|
||||
fMagFieldZCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
|
||||
fMagFieldCmd = new G4UIcmdWith3VectorAndUnit("/field/setField",this);
|
||||
fMagFieldCmd->SetGuidance("Define global magnetic field.");
|
||||
fMagFieldCmd->SetParameterName("Bx","By","Bz",false,false);
|
||||
fMagFieldCmd->SetDefaultUnit("tesla");
|
||||
fMagFieldCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
|
||||
fLocalMagFieldCmd = new G4UIcmdWith3VectorAndUnit("/field/setLocalField",this);
|
||||
fLocalMagFieldCmd->SetGuidance("Define local magnetic field.");
|
||||
fLocalMagFieldCmd->SetParameterName("Blx","Bly","Blz",false,false);
|
||||
fLocalMagFieldCmd->SetDefaultUnit("tesla");
|
||||
fLocalMagFieldCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
|
||||
fMinStepCmd = new G4UIcmdWithADoubleAndUnit("/field/setMinStep",this);
|
||||
fMinStepCmd->SetGuidance("Define minimal step");
|
||||
fMinStepCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
|
||||
@@ -63,17 +63,6 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03FieldSetup::F03FieldSetup()
|
||||
: fFieldManager(0),
|
||||
fLocalFieldManager(0),
|
||||
fChordFinder(0),
|
||||
fLocalChordFinder(0),
|
||||
fEquation(0),
|
||||
fLocalEquation(0),
|
||||
fMagneticField(0),
|
||||
fLocalMagneticField(0),
|
||||
fStepper(0),
|
||||
fLocalStepper(0),
|
||||
fFieldMessenger(0)
|
||||
{
|
||||
fMagneticField = new G4UniformMagField(G4ThreeVector(3.3*tesla,
|
||||
0.0, // 0.5*tesla,
|
||||
@@ -83,12 +72,9 @@ F03FieldSetup::F03FieldSetup()
|
||||
0.0));
|
||||
|
||||
fFieldMessenger = new F03FieldMessenger(this);
|
||||
|
||||
|
||||
fEquation = new G4Mag_UsualEqRhs(fMagneticField);
|
||||
fLocalEquation = new G4Mag_UsualEqRhs(fLocalMagneticField);
|
||||
|
||||
fMinStep = 0.25*mm ; // minimal step of 1 mm is default
|
||||
fStepperType = 4 ; // ClassicalRK4 is default stepper
|
||||
|
||||
fFieldManager = GetGlobalFieldManager();
|
||||
fLocalFieldManager = new G4FieldManager();
|
||||
@@ -148,7 +134,7 @@ void F03FieldSetup::CreateSteppers()
|
||||
delete fStepper;
|
||||
fStepper= nullptr;
|
||||
|
||||
delete fLocalStepper;
|
||||
delete fLocalStepper;
|
||||
fLocalStepper= nullptr;
|
||||
|
||||
switch ( fStepperType )
|
||||
@@ -203,7 +189,7 @@ void F03FieldSetup::CreateSteppers()
|
||||
fLocalStepper = new G4RKG3_Stepper( fLocalEquation );
|
||||
G4cout<<"G4RKG3_Stepper is called"<<G4endl;
|
||||
break;
|
||||
default: fStepper = 0;
|
||||
default: fStepper = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +205,7 @@ void F03FieldSetup::SetFieldZValue(G4double fieldStrength)
|
||||
|
||||
void F03FieldSetup::SetFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
if(fMagneticField) delete fMagneticField;
|
||||
delete fMagneticField;
|
||||
|
||||
if(fieldVector != G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
@@ -230,7 +216,7 @@ void F03FieldSetup::SetFieldValue(G4ThreeVector fieldVector)
|
||||
// If the new field's value is Zero, then
|
||||
// setting the pointer to zero ensures
|
||||
// that it is not used for propagation.
|
||||
fMagneticField = 0;
|
||||
fMagneticField = nullptr;
|
||||
}
|
||||
|
||||
// Either
|
||||
@@ -247,7 +233,7 @@ void F03FieldSetup::SetFieldValue(G4ThreeVector fieldVector)
|
||||
|
||||
void F03FieldSetup::SetLocalFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
if(fLocalMagneticField) delete fLocalMagneticField;
|
||||
delete fLocalMagneticField;
|
||||
|
||||
if(fieldVector != G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
@@ -258,7 +244,7 @@ void F03FieldSetup::SetLocalFieldValue(G4ThreeVector fieldVector)
|
||||
// If the new field's value is Zero, then
|
||||
// setting the pointer to zero ensures
|
||||
// that it is not used for propagation.
|
||||
fLocalMagneticField = 0;
|
||||
fLocalMagneticField = nullptr;
|
||||
}
|
||||
|
||||
// Either
|
||||
|
||||
@@ -47,22 +47,14 @@
|
||||
#include "G4PhysicalConstants.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleDefinition* F03PrimaryGeneratorAction::fgPrimaryParticle = 0;
|
||||
|
||||
G4ParticleDefinition* F03PrimaryGeneratorAction::fgPrimaryParticle = nullptr;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03PrimaryGeneratorAction::F03PrimaryGeneratorAction(
|
||||
F03DetectorConstruction* det)
|
||||
: G4VUserPrimaryGeneratorAction(),
|
||||
fParticleGun(0),
|
||||
fDetector(det),
|
||||
fGunMessenger(0),
|
||||
fRndmFlag("off"),
|
||||
fXVertex(0.),
|
||||
fYVertex(0.),
|
||||
fZVertex(0.),
|
||||
fVertexDefined(false)
|
||||
: fDetector(det)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
@@ -43,12 +43,7 @@
|
||||
|
||||
F03PrimaryGeneratorMessenger::F03PrimaryGeneratorMessenger(
|
||||
F03PrimaryGeneratorAction* action)
|
||||
: G4UImessenger(),
|
||||
fAction(action),
|
||||
fRndmCmd(0),
|
||||
fSetXVertexCmd(0),
|
||||
fSetYVertexCmd(0),
|
||||
fSetZVertexCmd(0)
|
||||
: fAction(action)
|
||||
{
|
||||
fRndmCmd = new G4UIcmdWithAString("/gun/random",this);
|
||||
fRndmCmd->SetGuidance("Shoot randomly the incident particle.");
|
||||
@@ -57,7 +52,7 @@ F03PrimaryGeneratorMessenger::F03PrimaryGeneratorMessenger(
|
||||
fRndmCmd->SetDefaultValue("off");
|
||||
fRndmCmd->SetCandidates("on off");
|
||||
fRndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
|
||||
fSetXVertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
|
||||
fSetXVertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
|
||||
fSetXVertexCmd->SetParameterName("xv",true);
|
||||
|
||||
@@ -39,17 +39,6 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03SteppingVerbose::F03SteppingVerbose()
|
||||
: G4SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03SteppingVerbose::~F03SteppingVerbose()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
@@ -86,13 +75,13 @@ void F03SteppingVerbose::StepInfo()
|
||||
<< std::setw(10) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(10) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
if( fTrack->GetNextVolume() != nullptr ) {
|
||||
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
|
||||
} else {
|
||||
G4cout << std::setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr){
|
||||
G4cout << " "
|
||||
<< std::setw(10)
|
||||
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
|
||||
Reference in New Issue
Block a user