Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** >> 22 // $Id: HadrontherapyPhisicsListMessenger.cc; May 2005 >> 23 // ---------------------------------------------------------------------------- >> 24 // GEANT 4 - Hadrontherapy example >> 25 // ---------------------------------------------------------------------------- >> 26 // Code developed by: 25 // 27 // 26 // Hadrontherapy advanced example for Geant4 << 28 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 27 // See more at: https://twiki.cern.ch/twiki/bi << 29 // 28 << 30 // (a) Laboratori Nazionali del Sud >> 31 // of the National Institute for Nuclear Physics, Catania, Italy >> 32 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy >> 33 // >> 34 // * cirrone@lns.infn.it >> 35 // ---------------------------------------------------------------------------- 29 #include "HadrontherapyPhysicsListMessenger.hh 36 #include "HadrontherapyPhysicsListMessenger.hh" 30 #include "HadrontherapyPhysicsList.hh" 37 #include "HadrontherapyPhysicsList.hh" 31 #include "G4UIdirectory.hh" 38 #include "G4UIdirectory.hh" >> 39 #include "G4UIcmdWithoutParameter.hh" >> 40 #include "G4UIcmdWithADouble.hh" 32 #include "G4UIcmdWithADoubleAndUnit.hh" 41 #include "G4UIcmdWithADoubleAndUnit.hh" >> 42 #include "G4UIcmdWithABool.hh" 33 #include "G4UIcmdWithAString.hh" 43 #include "G4UIcmdWithAString.hh" 34 44 35 ////////////////////////////////////////////// << 45 HadrontherapyPhysicsListMessenger::HadrontherapyPhysicsListMessenger(HadrontherapyPhysicsList * physList) 36 HadrontherapyPhysicsListMessenger::Hadronthera << 46 :physicsList(physList) 37 :pPhysicsList(pPhys) << 47 { 38 { << 48 listDir = new G4UIdirectory("/physics/"); 39 physDir = new G4UIdirectory("/Physics/"); << 49 // Building modular PhysicsList 40 physDir->SetGuidance("Commands to activate p << 50 41 << 51 physicsListCmd = new G4UIcmdWithAString("/physics/addPhysics",this); 42 pListCmd = new G4UIcmdWithAString("/Physics/ << 52 physicsListCmd->SetGuidance("Add chunks of PhysicsList."); 43 pListCmd->SetGuidance("Add physics list."); << 53 physicsListCmd->SetParameterName("physList",false); 44 pListCmd->SetParameterName("PList",false); << 54 physicsListCmd->AvailableForStates(G4State_PreInit); 45 pListCmd->AvailableForStates(G4State_PreInit << 46 } 55 } 47 56 48 ////////////////////////////////////////////// << 49 HadrontherapyPhysicsListMessenger::~Hadronther 57 HadrontherapyPhysicsListMessenger::~HadrontherapyPhysicsListMessenger() 50 { 58 { 51 delete physDir; << 59 delete physicsListCmd; >> 60 delete listDir; 52 } 61 } 53 62 54 ////////////////////////////////////////////// << 63 void HadrontherapyPhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 55 void HadrontherapyPhysicsListMessenger::SetNew << 56 G4St << 57 { 64 { 58 if( command == pListCmd ) << 65 if (command == physicsListCmd) 59 { pPhysicsList->AddPhysicsList(newValue);} << 66 { physicsList->AddPhysicsList(newValue);} 60 } 67 } >> 68 >> 69 >> 70 >> 71 >> 72 61 73 62 74