39#include "G4LogicalVolume.hh"
40#include "G4PVPlacement.hh"
42#include "G4Material.hh"
43#include "G4NistManager.hh"
47#include "G4GeometryManager.hh"
48#include "G4SolidStore.hh"
49#include "G4LogicalVolumeStore.hh"
50#include "G4PhysicalVolumeStore.hh"
52#include "G4RunManager.hh"
53#include "G4StateManager.hh"
55#include "G4PhysicalConstants.hh"
56#include "G4SystemOfUnits.hh"
60#include "G4RotationMatrix.hh"
65#include "G4AutoDelete.hh"
94 G4GeometryManager::GetInstance()->OpenGeometry();
95 G4PhysicalVolumeStore::GetInstance()->Clean();
96 G4LogicalVolumeStore::GetInstance()->Clean();
97 G4SolidStore::GetInstance()->Clean();
175 auto g4rot =
new G4RotationMatrix();
177 *g4rot = g4rot->inverse();
178 if (*g4rot == G4RotationMatrix()) g4rot =
nullptr;
190 auto solidTestPlane =
new G4Tubs(
"TestPlane",
200 G4ThreeVector testPlaneCenter = G4ThreeVector(0.,0.,z);
228 g4rot =
new G4RotationMatrix();
230 *g4rot = g4rot->inverse();
231 if (*g4rot == G4RotationMatrix()) g4rot =
nullptr;
256 G4ThreeVector degraderCenter = G4ThreeVector(0.,0.,
GetDegraderPos());
275 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
278 if ( pttoMaterial ) {
280 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
282 G4cout <<
"\n--> WARNING from SetWorldMaterial : "
283 << materialChoice <<
" not found" << G4endl;
293 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
296 if ( pttoMaterial ) {
298 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
300 G4cout <<
"\n--> WARNING from SetTargetMaterial : "
301 << materialChoice <<
" not found" << G4endl;
312 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
315 if ( pttoMaterial ) {
317 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
319 G4cout <<
"\n--> WARNING from SetDegraderMaterial : "
320 << materialChoice <<
" not found" << G4endl;
331 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
332 G4RunManager::GetRunManager()->ReinitializeGeometry();
341 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
342 G4RunManager::GetRunManager()->ReinitializeGeometry();
351 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
352 G4RunManager::GetRunManager()->ReinitializeGeometry();
361 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
362 G4RunManager::GetRunManager()->ReinitializeGeometry();
371 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
372 G4RunManager::GetRunManager()->ReinitializeGeometry();
381 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
382 G4RunManager::GetRunManager()->ReinitializeGeometry();
391 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
392 G4RunManager::GetRunManager()->ReinitializeGeometry();
401 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
402 G4RunManager::GetRunManager()->ReinitializeGeometry();
411 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
412 G4RunManager::GetRunManager()->ReinitializeGeometry();
421 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
422 G4RunManager::GetRunManager()->ReinitializeGeometry();
431 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
432 G4RunManager::GetRunManager()->ReinitializeGeometry();
441 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
442 G4RunManager::GetRunManager()->ReinitializeGeometry();
451 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
452 G4RunManager::GetRunManager()->ReinitializeGeometry();
461 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
462 G4RunManager::GetRunManager()->ReinitializeGeometry();
471 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
472 G4RunManager::GetRunManager()->ReinitializeGeometry();
481 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
482 G4RunManager::GetRunManager()->ReinitializeGeometry();
491 if ( G4StateManager::GetStateManager()->GetCurrentState() != G4State_PreInit ) {
492 G4RunManager::GetRunManager()->ReinitializeGeometry();
502 G4AutoDelete::Register(field);
516 G4RotationMatrix rot;
518 unsigned int place = 0;
520 while (place < rotation.size()) {
524 G4String current=rotation.substr(place+1);
525 angle = strtod(current.c_str(),&p) * deg;
527 if (!p || (*p !=
',' && *p !=
'\0')) {
528 G4cerr <<
"Invalid rotation specification: " <<
529 rotation.c_str() << G4endl;
534 G4RotationMatrix thisRotation;
536 switch(rotation.substr(place,1).c_str()[0]) {
547 G4cerr <<
" Invalid rotation specification: "
548 << rotation << G4endl;
552 rot = thisRotation * rot;
553 place = rotation.find(
',',place);
554 if (place > rotation.size())
break;
Definition of the F04DetectorConstruction class.
Definition of the F04DetectorMessenger class.
Definition of the F04FocusSolenoid class.
Definition of the F04GlobalField class.
Definition of the F04Materials class.
Definition of the F04SimpleSolenoid class.
void SetDegraderThickness(G4double)
G4VPhysicalVolume * fPhysiWorld
void SetTransferMgntPos(G4double)
G4double GetDegraderRadius()
G4Tubs * fSolidTransferMgnt
void SetDegraderMaterial(G4String)
G4double fDegraderThickness
G4VPhysicalVolume * Construct() override
void SetTargetPos(G4double)
void SetTransferMgntB(G4double)
void SetWorldMaterial(G4String)
G4double GetCaptureMgntRadius()
G4LogicalVolume * fLogicTransferMgnt
G4VPhysicalVolume * ConstructDetector()
G4Material * GetWorldMaterial()
G4LogicalVolume * fLogicCaptureMgnt
G4Material * GetTargetMaterial()
G4double fCaptureMgntLength
~F04DetectorConstruction() override
void SetTransferMgntRadius(G4double)
G4Material * GetDegraderMaterial()
G4double GetCaptureMgntLength()
void SetWorldSizeR(G4double)
G4double GetTransferMgntRadius()
G4Material * fTargetMaterial
void SetDegraderPos(G4double)
G4Tubs * fSolidCaptureMgnt
G4VPhysicalVolume * fPhysiTransferMgnt
G4double GetTransferMgntLength()
G4double fTargetThickness
G4VPhysicalVolume * fPhysiTarget
G4double GetTransferMgntPos()
G4double GetTargetThickness()
G4double fTransferMgntLength
void SetTargetAngle(G4int)
G4ThreeVector fCaptureMgntCenter
F04DetectorMessenger * fDetectorMessenger
G4Cache< F04GlobalField * > fFieldSetUp
void SetCaptureMgntRadius(G4double)
G4double fTransferMgntRadius
void ConstructSDandField() override
G4ThreeVector fTransferMgntCenter
G4double fTransferMgntPos
void SetTargetMaterial(G4String)
static G4RotationMatrix StringToRotationMatrix(G4String rotation)
void SetTargetThickness(G4double)
G4double fCaptureMgntRadius
G4LogicalVolume * fLogicDegrader
void SetCaptureMgntLength(G4double)
void SetWorldSizeZ(G4double)
F04Materials * fMaterials
G4LogicalVolume * fLogicTarget
G4Material * fDegraderMaterial
void SetDegraderRadius(G4double)
void SetTransferMgntLength(G4double)
F04DetectorConstruction()
void SetCaptureMgntB1(G4double)
void SetCaptureMgntB2(G4double)
G4VPhysicalVolume * fPhysiCaptureMgnt
G4double GetDegraderPos()
G4VPhysicalVolume * fPhysiDegrader
G4double GetDegraderThickness()
G4double GetTargetRadius()
void SetTargetRadius(G4double)
G4LogicalVolume * fLogicWorld
G4Material * fWorldMaterial
static F04GlobalField * GetObject()
G4Material * GetMaterial(G4String)
static F04Materials * GetInstance()
void strip(G4String &str, char ch=' ')