Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-29 07:38:56

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