Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0027 #include "GammaKnifePhysicsListMessenger.hh"
0028 #include "GammaKnifePhysicsList.hh"
0029 #include "G4UIdirectory.hh"
0030 #include "G4UIcmdWithoutParameter.hh"
0031 #include "G4UIcmdWithADouble.hh"
0032 #include "G4UIcmdWithADoubleAndUnit.hh"
0033 #include "G4UIcmdWithABool.hh"
0034 #include "G4UIcmdWithAString.hh"
0035 #include "G4SystemOfUnits.hh"
0036 
0037 GammaKnifePhysicsListMessenger::GammaKnifePhysicsListMessenger(GammaKnifePhysicsList * physList)
0038 :physicsList(physList)
0039 {  
0040  listDir = new G4UIdirectory("/Physics/");
0041   // Building modular PhysicsList
0042 
0043  physicsListCmd = new G4UIcmdWithAString("/Physics/addPhysics",this);  
0044  physicsListCmd->SetGuidance("Add chunks of PhysicsList.");
0045  physicsListCmd->SetParameterName("physList",false);
0046  physicsListCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0047     
0048  gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setGCut",this);  
0049  gammaCutCmd->SetGuidance("Set gamma cut.");
0050   gammaCutCmd->SetParameterName("Gcut",false);
0051   gammaCutCmd->SetUnitCategory("Length");
0052   gammaCutCmd->SetRange("Gcut>0.0");
0053   gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0054 
0055   electCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setECut",this);  
0056   electCutCmd->SetGuidance("Set electron cut.");
0057   electCutCmd->SetParameterName("Ecut",false);
0058   electCutCmd->SetUnitCategory("Length");
0059   electCutCmd->SetRange("Ecut>0.0");
0060   electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0061   
0062   protoCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setPCut",this);  
0063   protoCutCmd->SetGuidance("Set positron cut.");
0064   protoCutCmd->SetParameterName("Pcut",false);
0065   protoCutCmd->SetUnitCategory("Length");
0066   protoCutCmd->SetRange("Pcut>0.0");
0067   protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0068 
0069   allCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setCuts",this);  
0070   allCutCmd->SetGuidance("Set cut for all.");
0071   allCutCmd->SetParameterName("cut",false);
0072   allCutCmd->SetUnitCategory("Length");
0073   allCutCmd->SetRange("cut>0.0");
0074   allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0075 
0076 
0077 }
0078 
0079 GammaKnifePhysicsListMessenger::~GammaKnifePhysicsListMessenger()
0080 {
0081   delete physicsListCmd;
0082   delete gammaCutCmd;
0083   delete electCutCmd;
0084   delete protoCutCmd;
0085   delete allCutCmd;
0086   delete listDir;
0087 }
0088 
0089 void GammaKnifePhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0090 {
0091  if (command == physicsListCmd)
0092     { 
0093         physicsList->AddPhysicsList(newValue);
0094     }
0095 
0096  else if( command == gammaCutCmd )
0097    { physicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0098      
0099   else if( command == electCutCmd )
0100    { physicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
0101      
0102   else if( command == protoCutCmd )
0103    { physicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
0104 
0105   else if( command == allCutCmd )
0106     {
0107       G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0108       physicsList->SetCutForGamma(cut);
0109       physicsList->SetCutForElectron(cut);
0110       physicsList->SetCutForPositron(cut);
0111     } 
0112 
0113 }
0114 
0115 
0116 
0117 
0118 
0119