Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:30

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 // This is the *BASIC* version of IORT, a Geant4-based application
0027 //
0028 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
0029 // Contributor Authors: S.Guatelli(e)
0030 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
0031 //    
0032 //   (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
0033 //   (b) IBFM-CNR , Segrate (Milano), Italy
0034 //   (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
0035 //   (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
0036 //   (e) University of Wollongong, Australia
0037 //
0038 //   *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
0039 //////////////////////////////////////////////////////////////////////////////////////////////
0040 
0041 #include "IORTPhysicsListMessenger.hh"
0042 
0043 #include "IORTPhysicsList.hh"
0044 #include "G4UIdirectory.hh"
0045 #include "G4UIcmdWithADoubleAndUnit.hh"
0046 #include "G4UIcmdWithAString.hh"
0047 
0048 /////////////////////////////////////////////////////////////////////////////
0049 IORTPhysicsListMessenger::IORTPhysicsListMessenger(IORTPhysicsList* pPhys)
0050 :pPhysicsList(pPhys)
0051 {
0052   physDir = new G4UIdirectory("/Physics/");
0053   physDir->SetGuidance("Commands to activate physics models and set cuts");
0054    
0055   gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setGCut",this);  
0056   gammaCutCmd->SetGuidance("Set gamma cut.");
0057   gammaCutCmd->SetParameterName("Gcut",false);
0058   gammaCutCmd->SetUnitCategory("Length");
0059   gammaCutCmd->SetRange("Gcut>0.0");
0060   gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0061 
0062   electCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setECut",this);  
0063   electCutCmd->SetGuidance("Set electron cut.");
0064   electCutCmd->SetParameterName("Ecut",false);
0065   electCutCmd->SetUnitCategory("Length");
0066   electCutCmd->SetRange("Ecut>0.0");
0067   electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0068   
0069   protoCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setPCut",this);  
0070   protoCutCmd->SetGuidance("Set positron cut.");
0071   protoCutCmd->SetParameterName("Pcut",false);
0072   protoCutCmd->SetUnitCategory("Length");
0073   protoCutCmd->SetRange("Pcut>0.0");
0074   protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0075 
0076   allCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setCuts",this);  
0077   allCutCmd->SetGuidance("Set cut for all.");
0078   allCutCmd->SetParameterName("cut",false);
0079   allCutCmd->SetUnitCategory("Length");
0080   allCutCmd->SetRange("cut>0.0");
0081   allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0082 
0083   allDetectorCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setDetectorCuts",this);  
0084   allDetectorCmd->SetGuidance("Set cut for all. into Detector");
0085   allDetectorCmd->SetParameterName("cut",false);
0086   allDetectorCmd->SetUnitCategory("Length");
0087   allDetectorCmd->SetRange("cut>0.0");
0088   allDetectorCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0089 
0090   pListCmd = new G4UIcmdWithAString("/Physics/addPhysics",this);  
0091   pListCmd->SetGuidance("Add physics list.");
0092   pListCmd->SetParameterName("PList",false);
0093   pListCmd->AvailableForStates(G4State_PreInit, G4State_Idle);  
0094 }
0095 
0096 /////////////////////////////////////////////////////////////////////////////
0097 IORTPhysicsListMessenger::~IORTPhysicsListMessenger()
0098 {
0099   delete gammaCutCmd;
0100   delete electCutCmd;
0101   delete protoCutCmd;
0102   delete allCutCmd;
0103   delete allDetectorCmd;
0104   delete pListCmd;
0105   delete physDir;    
0106 }
0107 
0108 /////////////////////////////////////////////////////////////////////////////
0109 void IORTPhysicsListMessenger::SetNewValue(G4UIcommand* command,
0110                                           G4String newValue)
0111 {       
0112   if( command == gammaCutCmd )
0113    { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0114      
0115   else if( command == electCutCmd )
0116    { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
0117      
0118   else if( command == protoCutCmd )
0119    { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
0120 
0121   else if( command == allCutCmd )
0122     {
0123       G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0124       pPhysicsList->SetCutForGamma(cut);
0125       pPhysicsList->SetCutForElectron(cut);
0126       pPhysicsList->SetCutForPositron(cut);
0127     } 
0128   else if( command == allDetectorCmd)
0129   {
0130       G4double cut = allDetectorCmd -> GetNewDoubleValue(newValue);
0131       pPhysicsList -> SetDetectorCut(cut);
0132   }
0133   else if( command == pListCmd )
0134    { pPhysicsList->AddPhysicsList(newValue);}
0135 }