Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:01

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 /// \file electromagnetic/TestEm6/src/PhysicsListMessenger.cc
0027 /// \brief Implementation of the PhysicsListMessenger class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "PhysicsListMessenger.hh"
0034 
0035 #include "PhysicsList.hh"
0036 
0037 #include "G4UIcmdWithADouble.hh"
0038 #include "G4UIcmdWithAString.hh"
0039 #include "G4UIdirectory.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* physL)
0044   : G4UImessenger(),
0045     fPhysList(physL),
0046     fPhysDir(0),
0047     fGammaToMuPairFacCmd(0),
0048     fAnnihiToMuPairFacCmd(0),
0049     fAnnihiToHadronFacCmd(0),
0050     fListCmd(0)
0051 {
0052   fPhysDir = new G4UIdirectory("/testem/phys/");
0053   fPhysDir->SetGuidance("physics list commands");
0054 
0055   fGammaToMuPairFacCmd = new G4UIcmdWithADouble("/testem/phys/SetGammaToMuPairFac", this);
0056   fGammaToMuPairFacCmd->SetGuidance(
0057     "Set factor to artificially increase the GammaToMuPair cross section");
0058   fGammaToMuPairFacCmd->SetParameterName("GammaToMuPairFac", false);
0059   fGammaToMuPairFacCmd->SetRange("GammaToMuPairFac>0.0");
0060   fGammaToMuPairFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0061 
0062   fAnnihiToMuPairFacCmd = new G4UIcmdWithADouble("/testem/phys/SetAnnihiToMuPairFac", this);
0063   fAnnihiToMuPairFacCmd->SetGuidance(
0064     "Set factor to artificially increase the AnnihiToMuPair cross section");
0065   fAnnihiToMuPairFacCmd->SetParameterName("AnnihiToMuPairFac", false);
0066   fAnnihiToMuPairFacCmd->SetRange("AnnihiToMuPairFac>0.0");
0067   fAnnihiToMuPairFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0068 
0069   fAnnihiToHadronFacCmd = new G4UIcmdWithADouble("/testem/phys/SetAnnihiToHadronFac", this);
0070   fAnnihiToHadronFacCmd->SetGuidance(
0071     "Set factor to artificially increase the AnnihiToHadrons cross section");
0072   fAnnihiToHadronFacCmd->SetParameterName("AnnihiToHadFac", false);
0073   fAnnihiToHadronFacCmd->SetRange("AnnihiToHadFac>0.0");
0074   fAnnihiToHadronFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0075 
0076   fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics", this);
0077   fListCmd->SetGuidance("Add modula physics list.");
0078   fListCmd->SetParameterName("PList", false);
0079   fListCmd->AvailableForStates(G4State_PreInit);
0080 }
0081 
0082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0083 
0084 PhysicsListMessenger::~PhysicsListMessenger()
0085 {
0086   delete fGammaToMuPairFacCmd;
0087   delete fAnnihiToMuPairFacCmd;
0088   delete fAnnihiToHadronFacCmd;
0089   delete fPhysDir;
0090   delete fListCmd;
0091 }
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0096 {
0097   if (command == fGammaToMuPairFacCmd) {
0098     fPhysList->SetGammaToMuPairFac(fGammaToMuPairFacCmd->GetNewDoubleValue(newValue));
0099   }
0100 
0101   if (command == fAnnihiToMuPairFacCmd) {
0102     fPhysList->SetAnnihiToMuPairFac(fAnnihiToMuPairFacCmd->GetNewDoubleValue(newValue));
0103   }
0104 
0105   if (command == fAnnihiToHadronFacCmd) {
0106     fPhysList->SetAnnihiToHadronFac(fAnnihiToHadronFacCmd->GetNewDoubleValue(newValue));
0107   }
0108 
0109   if (command == fListCmd) {
0110     fPhysList->AddPhysicsList(newValue);
0111   }
0112 }
0113 
0114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......