Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -29,8 +29,6 @@
|
||||
|
||||
#include "F03ActionInitialization.hh"
|
||||
#include "F03PrimaryGeneratorAction.hh"
|
||||
#include "F03RunAction.hh"
|
||||
#include "F03EventAction.hh"
|
||||
#include "F03SteppingVerbose.hh"
|
||||
|
||||
#include "F03DetectorConstruction.hh"
|
||||
@@ -52,7 +50,6 @@ F03ActionInitialization::~F03ActionInitialization()
|
||||
|
||||
void F03ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
SetUserAction(new F03RunAction());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -60,11 +57,6 @@ void F03ActionInitialization::BuildForMaster() const
|
||||
void F03ActionInitialization::Build() const
|
||||
{
|
||||
SetUserAction(new F03PrimaryGeneratorAction(fDetConstruction));
|
||||
|
||||
F03RunAction* runAction = new F03RunAction();
|
||||
SetUserAction(runAction);
|
||||
F03EventAction* eventAction = new F03EventAction(runAction);
|
||||
SetUserAction(eventAction);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03CalorHit class
|
||||
//
|
||||
//
|
||||
// $Id: F03CalorHit.cc 76602 2013-11-13 08:33:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03CalorimeterSD class
|
||||
//
|
||||
//
|
||||
// $Id: F03CalorimeterSD.cc 76602 2013-11-13 08:33:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03DetectorConstruction class
|
||||
//
|
||||
//
|
||||
// $Id: F03DetectorConstruction.cc 101666 2016-11-21 09:12:08Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -76,7 +75,7 @@ F03DetectorConstruction::F03DetectorConstruction()
|
||||
fRadThickness( 100.*mm),
|
||||
fGasGap( 100.*mm),
|
||||
fDetGap( 1.*mm),
|
||||
fFoilNumber(1)
|
||||
fFoilNumber(2)
|
||||
{
|
||||
fDetectorMessenger = new F03DetectorMessenger(this);
|
||||
|
||||
@@ -237,6 +236,8 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
ComputeCalorParameters();
|
||||
PrintCalorParameters();
|
||||
|
||||
G4bool checkOverlaps = true;
|
||||
|
||||
fSolidWorld = new G4Tubs("World", // its name
|
||||
0.,fWorldSizeR,fWorldSizeZ/2.,0.,twopi);// its size
|
||||
|
||||
@@ -250,53 +251,48 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
fLogicWorld, // its logical volume
|
||||
0, // its mother volume
|
||||
false, // no boolean op.
|
||||
0); // copy number
|
||||
0, // copy number
|
||||
checkOverlaps); // checkOverlaps
|
||||
|
||||
// TR radiator envelope
|
||||
|
||||
G4double radThick = fFoilNumber*(fRadThickness + fGasGap) + fDetGap;
|
||||
G4double zRad = fZAbsorber - 0.5*(radThick + fAbsorberThickness);
|
||||
|
||||
G4double zRad = fZAbsorber - 20*cm - 0.5*radThick;
|
||||
G4cout << "zRad = " << zRad/mm << " mm" << G4endl;
|
||||
|
||||
radThick *= 1.02;
|
||||
G4cout << "radThick = " << radThick/mm << " mm" << G4endl;
|
||||
G4cout << "fFoilNumber = " << fFoilNumber << G4endl;
|
||||
G4cout << "fRadiatorMat = " << fRadiatorMat->GetName() << G4endl;
|
||||
G4cout << "WorldMaterial = " << fWorldMaterial->GetName() << G4endl;
|
||||
|
||||
fSolidRadiator = new G4Tubs("Radiator",0.0,
|
||||
1.01*fAbsorberRadius,
|
||||
0.5*radThick,0.0, twopi);
|
||||
fSolidRadiator = new G4Tubs("Radiator", 0.0, fAbsorberRadius, 0.5*radThick,
|
||||
0.0, twopi);
|
||||
|
||||
fLogicRadiator = new G4LogicalVolume(fSolidRadiator,
|
||||
fWorldMaterial,
|
||||
"Radiator");
|
||||
fLogicRadiator = new G4LogicalVolume(fSolidRadiator, fWorldMaterial,
|
||||
"Radiator");
|
||||
|
||||
fPhysiRadiator = new G4PVPlacement(0,
|
||||
G4ThreeVector(0,0,zRad),
|
||||
"Radiator", fLogicRadiator,
|
||||
fPhysiWorld, false, 0);
|
||||
fPhysiRadiator = new G4PVPlacement(0, G4ThreeVector(0,0,zRad),
|
||||
"Radiator", fLogicRadiator, fPhysiWorld, false, 0,
|
||||
checkOverlaps);
|
||||
|
||||
fSolidRadSlice = new G4Tubs("RadSlice",0.0,
|
||||
fAbsorberRadius,0.5*fRadThickness,0.0,twopi);
|
||||
|
||||
fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat,
|
||||
"RadSlice",0,0,0);
|
||||
fSolidRadSlice = new G4Tubs("RadSlice",0.0, fAbsorberRadius, 0.5*fRadThickness,
|
||||
0.0, twopi);
|
||||
|
||||
G4double zModule, zRadiator;
|
||||
zModule = zRad + 0.5*radThick/1.02;
|
||||
G4cout << "zModule = " << zModule/mm << " mm" << G4endl;
|
||||
fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat, "RadSlice");
|
||||
|
||||
// Radiator slice
|
||||
G4double radSliceThick = fRadThickness +fGasGap;
|
||||
G4double zStart = 0.5*(-radThick + radSliceThick) + fDetGap;
|
||||
// start on the board of radiator enevelope + det gap
|
||||
|
||||
for (G4int j=0;j<fFoilNumber;j++)
|
||||
{
|
||||
zRadiator = zModule - j*(fRadThickness + fGasGap);
|
||||
G4cout << zRadiator/mm << " mm" << "\t";
|
||||
// G4cout << "j = " << j << "\t";
|
||||
G4double zSlice = zStart + j*radSliceThick;
|
||||
G4cout << zSlice/mm << " mm" << "\t";
|
||||
|
||||
fPhysiRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0.,zRadiator-zRad),
|
||||
fPhysiRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0., zSlice),
|
||||
"RadSlice",fLogicRadSlice,
|
||||
fPhysiRadiator,false,j);
|
||||
fPhysiRadiator,false,j, checkOverlaps);
|
||||
}
|
||||
G4cout << G4endl;
|
||||
|
||||
@@ -317,7 +313,8 @@ G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
|
||||
fLogicAbsorber,
|
||||
fPhysiWorld,
|
||||
false,
|
||||
0);
|
||||
0,
|
||||
checkOverlaps);
|
||||
|
||||
return fPhysiWorld;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03DetectorMessenger class
|
||||
//
|
||||
//
|
||||
// $Id: F03DetectorMessenger.cc 77294 2013-11-22 11:01:00Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field03/src/F03EventAction.cc
|
||||
/// \brief Implementation of the F03EventAction class
|
||||
//
|
||||
//
|
||||
// $Id: F03EventAction.cc 92498 2015-09-02 07:24:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "F03EventAction.hh"
|
||||
#include "F03RunAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03EventAction::F03EventAction(F03RunAction* action)
|
||||
: G4UserEventAction(),
|
||||
fRunAction(action)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03EventAction::~F03EventAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03EventAction::BeginOfEventAction(const G4Event*)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
// save rndm status
|
||||
if (fRunAction->GetRndmFreq() == 2)
|
||||
{
|
||||
G4Random::saveEngineStatus("endOfEvent.rndm");
|
||||
|
||||
G4int evtNb = evt->GetEventID();
|
||||
G4int printProgress = G4RunManager::GetRunManager()->GetPrintProgress();
|
||||
if (evtNb%printProgress == 0)
|
||||
{
|
||||
G4cout << "\n---> End of Event: " << evtNb << G4endl;
|
||||
G4Random::showEngineStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03FieldMessenger class
|
||||
//
|
||||
//
|
||||
// $Id: F03FieldMessenger.cc 96980 2016-05-19 09:41:22Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -38,6 +37,7 @@
|
||||
#include "F03FieldSetup.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWith3VectorAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
@@ -49,7 +49,9 @@ F03FieldMessenger::F03FieldMessenger(F03FieldSetup* fieldSetup)
|
||||
fEMfieldSetup(fieldSetup),
|
||||
fFieldDir(0),
|
||||
fStepperCmd(0),
|
||||
fMagFieldZCmd(0),
|
||||
fMagFieldCmd(0),
|
||||
fLocalMagFieldCmd(0),
|
||||
fMinStepCmd(0),
|
||||
fUpdateCmd(0)
|
||||
{
|
||||
@@ -68,13 +70,25 @@ F03FieldMessenger::F03FieldMessenger(F03FieldSetup* fieldSetup)
|
||||
fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
fUpdateCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/field/setFieldZ",this);
|
||||
fMagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
fMagFieldCmd->SetParameterName("Bz",false,false);
|
||||
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.");
|
||||
@@ -88,7 +102,9 @@ F03FieldMessenger::F03FieldMessenger(F03FieldSetup* fieldSetup)
|
||||
F03FieldMessenger::~F03FieldMessenger()
|
||||
{
|
||||
delete fStepperCmd;
|
||||
delete fMagFieldZCmd;
|
||||
delete fMagFieldCmd;
|
||||
delete fLocalMagFieldCmd;
|
||||
delete fMinStepCmd;
|
||||
delete fFieldDir;
|
||||
delete fUpdateCmd;
|
||||
@@ -102,12 +118,27 @@ void F03FieldMessenger::SetNewValue( G4UIcommand* command, G4String newValue)
|
||||
fEMfieldSetup->SetStepperType(fStepperCmd->GetNewIntValue(newValue));
|
||||
if( command == fUpdateCmd )
|
||||
fEMfieldSetup->UpdateField();
|
||||
if( command == fMagFieldZCmd )
|
||||
{
|
||||
fEMfieldSetup->SetFieldZValue(fMagFieldZCmd->GetNewDoubleValue(newValue));
|
||||
// Check the value
|
||||
G4cout << "Set global field value to " <<
|
||||
fEMfieldSetup->GetGlobalFieldValue() / gauss << " Gauss " << G4endl;
|
||||
}
|
||||
if( command == fMagFieldCmd )
|
||||
{
|
||||
fEMfieldSetup->SetFieldValue(fMagFieldCmd->GetNewDoubleValue(newValue));
|
||||
fEMfieldSetup->SetFieldValue(fMagFieldCmd->GetNew3VectorValue(newValue));
|
||||
// Check the value
|
||||
G4cout << "Set field value to " <<
|
||||
fEMfieldSetup->GetConstantFieldValue() / gauss << " Gauss " << G4endl;
|
||||
G4cout << "Set global field value to " <<
|
||||
fEMfieldSetup->GetGlobalFieldValue() / gauss << " Gauss " << G4endl;
|
||||
}
|
||||
if( command == fLocalMagFieldCmd )
|
||||
{
|
||||
fEMfieldSetup->SetLocalFieldValue(fLocalMagFieldCmd->GetNew3VectorValue(newValue));
|
||||
fEMfieldSetup->UpdateField();
|
||||
// Check the value
|
||||
G4cout << "Set local field value to " <<
|
||||
fEMfieldSetup->GetLocalFieldValue() / gauss << " Gauss " << G4endl;
|
||||
}
|
||||
if( command == fMinStepCmd )
|
||||
fEMfieldSetup->SetMinStep(fMinStepCmd->GetNewDoubleValue(newValue));
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03FieldSetup class
|
||||
//
|
||||
//
|
||||
// $Id: F03FieldSetup.cc 109870 2018-05-09 12:39:45Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Field Setup class implementation.
|
||||
@@ -210,7 +209,7 @@ void F03FieldSetup::CreateSteppers()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03FieldSetup::SetFieldValue(G4double fieldStrength)
|
||||
void F03FieldSetup::SetFieldZValue(G4double fieldStrength)
|
||||
{
|
||||
G4ThreeVector fieldSetVec(0.0, 0.0, fieldStrength);
|
||||
SetFieldValue( fieldSetVec );
|
||||
@@ -246,6 +245,33 @@ void F03FieldSetup::SetFieldValue(G4ThreeVector fieldVector)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03FieldSetup::SetLocalFieldValue(G4ThreeVector fieldVector)
|
||||
{
|
||||
if(fLocalMagneticField) delete fLocalMagneticField;
|
||||
|
||||
if(fieldVector != G4ThreeVector(0.,0.,0.))
|
||||
{
|
||||
fLocalMagneticField = new G4UniformMagField(fieldVector);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the new field's value is Zero, then
|
||||
// setting the pointer to zero ensures
|
||||
// that it is not used for propagation.
|
||||
fLocalMagneticField = 0;
|
||||
}
|
||||
|
||||
// Either
|
||||
// - UpdateField() to reset all (ChordFinder, Equation);
|
||||
// UpdateField();
|
||||
// or simply update the field manager & equation of motion
|
||||
// with pointer to new field
|
||||
GetLocalFieldManager()->SetDetectorField(fLocalMagneticField);
|
||||
fEquation->SetFieldObj( fLocalMagneticField );
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4FieldManager* F03FieldSetup::GetGlobalFieldManager()
|
||||
{
|
||||
return G4TransportationManager::GetTransportationManager()
|
||||
@@ -254,12 +280,14 @@ G4FieldManager* F03FieldSetup::GetGlobalFieldManager()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreeVector F03FieldSetup::GetConstantFieldValue()
|
||||
G4ThreeVector F03FieldSetup::GetConstantFieldValue(G4MagneticField* magneticField) const
|
||||
{
|
||||
if ( ! magneticField ) return G4ThreeVector();
|
||||
|
||||
static G4double fieldValue[6], position[4];
|
||||
position[0] = position[1] = position[2] = position[3] = 0.0;
|
||||
|
||||
fMagneticField->GetFieldValue( position, fieldValue);
|
||||
magneticField->GetFieldValue( position, fieldValue);
|
||||
G4ThreeVector fieldVec(fieldValue[0], fieldValue[1], fieldValue[2]);
|
||||
|
||||
return fieldVec;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03PrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
// $Id: F03PrimaryGeneratorAction.cc 77892 2013-11-29 08:56:08Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03PrimaryGeneratorMessenger class
|
||||
//
|
||||
//
|
||||
// $Id: F03PrimaryGeneratorMessenger.cc 77892 2013-11-29 08:56:08Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field03/src/F03RunAction.cc
|
||||
/// \brief Implementation of the F03RunAction class
|
||||
//
|
||||
//
|
||||
// $Id: F03RunAction.cc 110100 2018-05-15 11:30:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "F03RunAction.hh"
|
||||
#include "F03RunMessenger.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03RunAction::F03RunAction()
|
||||
: G4UserRunAction(),
|
||||
fMessenger(0),
|
||||
fSaveRndm(0)
|
||||
{
|
||||
fMessenger = new F03RunMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03RunAction::~F03RunAction()
|
||||
{
|
||||
delete fMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03RunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
// save Rndm status
|
||||
if (fSaveRndm > 0)
|
||||
{
|
||||
G4Random::showEngineStatus();
|
||||
G4Random::saveEngineStatus("beginOfRun.rndm");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03RunAction::EndOfRunAction(const G4Run*)
|
||||
{
|
||||
// save Rndm status
|
||||
|
||||
if (fSaveRndm == 1)
|
||||
{
|
||||
G4Random::showEngineStatus();
|
||||
G4Random::saveEngineStatus("endOfRun.rndm");
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -1,96 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field03/src/F03RunMessenger.cc
|
||||
/// \brief Implementation of the F03RunMessenger class
|
||||
//
|
||||
//
|
||||
// $Id: F03RunMessenger.cc 76602 2013-11-13 08:33:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "F03RunMessenger.hh"
|
||||
|
||||
#include "F03RunAction.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03RunMessenger::F03RunMessenger(F03RunAction* action)
|
||||
: G4UImessenger(),
|
||||
fRunAction(action),
|
||||
fRndmDir(0),
|
||||
fRndmSaveCmd(0),
|
||||
fRndmReadCmd(0)
|
||||
{
|
||||
fRndmDir = new G4UIdirectory("/rndm/");
|
||||
fRndmDir->SetGuidance("Rndm status control.");
|
||||
|
||||
fRndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
|
||||
fRndmSaveCmd->
|
||||
SetGuidance("set frequency to save rndm status on external files.");
|
||||
fRndmSaveCmd->SetGuidance("freq = 0 not saved");
|
||||
fRndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
|
||||
fRndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
|
||||
fRndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
|
||||
fRndmSaveCmd->SetParameterName("frequency",false);
|
||||
fRndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
|
||||
fRndmSaveCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fRndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
|
||||
fRndmReadCmd->SetGuidance("get rndm status from an external file.");
|
||||
fRndmReadCmd->SetParameterName("fileName",true);
|
||||
fRndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
|
||||
fRndmReadCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F03RunMessenger::~F03RunMessenger()
|
||||
{
|
||||
delete fRndmSaveCmd;
|
||||
delete fRndmReadCmd;
|
||||
delete fRndmDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F03RunMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{
|
||||
if (command == fRndmSaveCmd)
|
||||
fRunAction->SetRndmFreq(fRndmSaveCmd->GetNewIntValue(newValues));
|
||||
|
||||
if (command == fRndmReadCmd)
|
||||
{G4cout << "\n---> rndm status restored from file: " << newValues << G4endl;
|
||||
G4Random::restoreEngineStatus(newValues);
|
||||
G4Random::showEngineStatus();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the F03SteppingVerbose class
|
||||
//
|
||||
//
|
||||
// $Id: F03SteppingVerbose.cc 76602 2013-11-13 08:33:35Z gcosmo $
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user