Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:16:52

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Code developed by:
0027 // S.Guatelli, M. Large and A. Malaroda, University of Wollongong
0028 //
0029 #include "ICRP110PhantomMessenger.hh"
0030 #include "ICRP110PhantomConstruction.hh"
0031 #include "G4UIdirectory.hh"
0032 #include "G4UIcmdWithAString.hh"
0033 
0034 ICRP110PhantomMessenger::ICRP110PhantomMessenger(ICRP110PhantomConstruction* myUsrPhtm)
0035   :fUserPhantom(myUsrPhtm)
0036 { 
0037   fPhantomDir = new G4UIdirectory("/phantom/");
0038   fPhantomDir -> SetGuidance("Set Your Phantom.");
0039   
0040   fSexCmd = new G4UIcmdWithAString("/phantom/setPhantomSex",this);
0041   fSexCmd -> SetGuidance("Set sex of Phantom: Male or Female.");
0042   fSexCmd -> SetParameterName("phantomSex",true);
0043   fSexCmd -> SetDefaultValue("female");
0044   fSexCmd -> SetCandidates("male female");
0045   fSexCmd -> AvailableForStates(G4State_PreInit,G4State_Idle); 
0046   
0047   fSectionCmd = new G4UIcmdWithAString("/phantom/setPhantomSection",this);
0048   fSectionCmd -> SetGuidance("Set section of Phantom: head, trunk or full");
0049   fSectionCmd -> SetParameterName("phantomSection",true);
0050   fSectionCmd -> SetDefaultValue("head");
0051   fSectionCmd -> SetCandidates("head trunk full");
0052   fSectionCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);  
0053 }
0054 
0055 ICRP110PhantomMessenger::~ICRP110PhantomMessenger()
0056 {
0057   delete  fSexCmd;
0058   delete  fSectionCmd;
0059   delete  fPhantomDir;
0060 }
0061 
0062 void ICRP110PhantomMessenger::SetNewValue(G4UIcommand* command,G4String newValue){ 
0063      
0064   if( command == fSexCmd )
0065     { 
0066       fUserPhantom -> SetPhantomSex(newValue);
0067       //G4cout << "Phantom Messenger calls upon SetPhantomSex in Detector Construction. " << G4endl; 
0068     }
0069   if( command == fSectionCmd )
0070     {
0071       fUserPhantom -> SetPhantomSection(newValue);
0072       //G4cout << "Phantom Messenger calls upon SetPhantomSection in Detector Construction. " << G4endl;
0073     }
0074 }
0075 
0076 
0077