Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:10

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 // History:
0027 // 18 Jan 2011 Alf Adapted from TestEm18
0028 //
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 
0032 #include "XrayFluoPhysicsListMessenger.hh"
0033 
0034 #include "XrayFluoPhysicsList.hh"
0035 #include "G4RunManager.hh"
0036 #include "G4UIdirectory.hh"
0037 #include "G4UIcmdWithAString.hh"
0038 #include "G4UIcmdWithADoubleAndUnit.hh"
0039 #include "G4UIcmdWithABool.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 XrayFluoPhysicsListMessenger::XrayFluoPhysicsListMessenger(XrayFluoPhysicsList* pPhys)
0044 :pPhysicsList(pPhys)
0045 {
0046   physDir = new G4UIdirectory("/phys/");
0047   physDir->SetGuidance("physics list commands");
0048   
0049   pListCmd = new G4UIcmdWithAString("/phys/addPhysics",this);  
0050   pListCmd->SetGuidance("Add modules physics list.");
0051   pListCmd->SetParameterName("PList",false);
0052   pListCmd->AvailableForStates(G4State_PreInit);
0053   
0054   gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setGCut",this);  
0055   gammaCutCmd->SetGuidance("Set gamma cut.");
0056   gammaCutCmd->SetParameterName("Gcut",false);
0057   gammaCutCmd->SetUnitCategory("Length");
0058   gammaCutCmd->SetRange("Gcut>0.0");
0059   gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0060 
0061   electCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setECut",this);  
0062   electCutCmd->SetGuidance("Set electron and positron cuts.");
0063   electCutCmd->SetParameterName("Ecut",false);
0064   electCutCmd->SetUnitCategory("Length");
0065   electCutCmd->SetRange("Ecut>0.0");
0066   electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0067   
0068   protoCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setPCut",this);  
0069   protoCutCmd->SetGuidance("Set proton cut.");
0070   protoCutCmd->SetParameterName("Pcut",false);
0071   protoCutCmd->SetUnitCategory("Length");
0072   protoCutCmd->SetRange("Pcut>0.0");
0073   protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0074 
0075   allCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setCuts",this);  
0076   allCutCmd->SetGuidance("Set cut for all.");
0077   allCutCmd->SetParameterName("cut",false);
0078   allCutCmd->SetUnitCategory("Length");
0079   allCutCmd->SetRange("cut>0.0");
0080   allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0081 
0082   /*fluoCmd = new G4UIcmdWithABool("/phys/fluo",this);  
0083   fluoCmd->SetGuidance("Set fluorescence on/off.");
0084   fluoCmd->SetParameterName("fluo",false);
0085   fluoCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0086 
0087   pixeCmd = new G4UIcmdWithABool("/phys/pixe",this);  
0088   pixeCmd->SetGuidance("Set PIXE on/off.");
0089   pixeCmd->SetParameterName("pixe",false);
0090   pixeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);  
0091   */
0092 }
0093 
0094 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0095 
0096 XrayFluoPhysicsListMessenger::~XrayFluoPhysicsListMessenger()
0097 {
0098   delete pListCmd;
0099   delete gammaCutCmd;
0100   delete electCutCmd;
0101   delete protoCutCmd;
0102   delete allCutCmd;
0103   delete physDir;
0104   //  delete fluoCmd;
0105   //  delete pixeCmd;
0106 }
0107 
0108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0109 
0110 void XrayFluoPhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0111 { 
0112   if( command == pListCmd )
0113    { pPhysicsList->AddPhysicsList(newValue);}
0114          
0115   if( command == gammaCutCmd )
0116    { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0117      
0118   if( command == electCutCmd )
0119    { 
0120      G4double cut = electCutCmd->GetNewDoubleValue(newValue);
0121      pPhysicsList->SetCutForElectron(cut);
0122      pPhysicsList->SetCutForPositron(cut);
0123    }
0124      
0125   if( command == protoCutCmd )
0126    { pPhysicsList->SetCutForProton(protoCutCmd->GetNewDoubleValue(newValue));}
0127 
0128   if( command == allCutCmd )
0129     {
0130       G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0131       pPhysicsList->SetCutForGamma(cut);
0132       pPhysicsList->SetCutForElectron(cut);
0133       pPhysicsList->SetCutForPositron(cut);
0134       pPhysicsList->SetCutForProton(cut);
0135     } 
0136 
0137   //Notify the run manager that the physics has been modified
0138   G4RunManager::GetRunManager()->PhysicsHasBeenModified();
0139 
0140 //  if( command == fluoCmd )
0141 //   { pPhysicsList->SetFluorescence(fluoCmd->GetNewBoolValue(newValue));}
0142 //
0143 //  if( command == pixeCmd )
0144 //   { pPhysicsList->SetPIXE(fluoCmd->GetNewBoolValue(newValue));}
0145 }
0146 
0147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......