Warning, file /geant4/examples/advanced/hadrontherapy/src/HadrontherapyGeometryController.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "HadrontherapyGeometryController.hh"
0030 #include "HadrontherapyDetectorConstruction.hh"
0031 #include "HadrontherapyInteractionParameters.hh"
0032 #include "HadrontherapyDetectorROGeometry.hh"
0033 #include "HadrontherapyTIFPAPassiveProtonBeamLine.hh"
0034 #include "PassiveProtonBeamLine.hh"
0035 #include "BESTPassiveProtonBeamLine.hh"
0036 #include "PassiveCarbonBeamLine.hh"
0037 #include "LaserDrivenBeamLine.hh"
0038 #include "G4RunManager.hh"
0039 #include "G4VUserParallelWorld.hh"
0040 #include "G4ThreeVector.hh"
0041
0042
0043 HadrontherapyGeometryController::HadrontherapyGeometryController()
0044 {}
0045
0046
0047 HadrontherapyGeometryController::~HadrontherapyGeometryController()
0048 {}
0049
0050
0051 void HadrontherapyGeometryController::SetGeometry(G4String name)
0052 {
0053 G4cout <<"Activating geometry " << name << G4endl;
0054 if(name == "default")
0055 {
0056 registerGeometry(new PassiveProtonBeamLine());
0057 }
0058 else if(name == "Carbon")
0059 {
0060 registerGeometry(new PassiveCarbonBeamLine());
0061 }
0062 else if(name == "LaserDriven")
0063 {
0064 registerGeometry(new LaserDrivenBeamLine());
0065 }
0066
0067 else if(name == "TrentoLine")
0068 {
0069 registerGeometry(new TrentoPassiveProtonBeamLine());
0070 }
0071 else if(name == "BESTBeamLine")
0072 {
0073 registerGeometry(new BESTPassiveProtonBeamLine());
0074 }
0075
0076 else
0077 {
0078 G4cout <<"Unknown geometry: " << name << ". Geometry not changed." << G4endl;
0079 }
0080 }
0081
0082
0083 void HadrontherapyGeometryController::registerGeometry(G4VUserDetectorConstruction *detector)
0084 {
0085 G4RunManager *runManager = G4RunManager::GetRunManager();
0086 runManager -> SetUserInitialization(detector);
0087 runManager -> GeometryHasBeenModified();
0088 }
0089