Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 08:28:24

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 //---------------------------------------------------------------------------
0030 //
0031 // ClassName:   PhysicsListMessenger
0032 //
0033 // Description: EM physics with a possibility to add PAI model
0034 //
0035 // Author:      V.Ivanchenko 01.09.2010
0036 //
0037 //----------------------------------------------------------------------------
0038 //
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 #include "PhysicsListMessenger.hh"
0044 
0045 #include "PhysicsList.hh"
0046 #include "TestParameters.hh"
0047 
0048 #include "G4UIcmdWithADouble.hh"
0049 #include "G4UIcmdWithADoubleAndUnit.hh"
0050 #include "G4UIcmdWithAString.hh"
0051 #include "G4UIcmdWithAnInteger.hh"
0052 #include "G4UIdirectory.hh"
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0055 
0056 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
0057   : G4UImessenger(), fPhysicsList(pPhys)
0058 {
0059   fPhysDir = new G4UIdirectory("/testex/phys/");
0060   fPhysDir->SetGuidance("physics list commands");
0061 
0062   fECmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setMaxE", this);
0063   fECmd->SetGuidance("Set max energy deposit");
0064   fECmd->SetParameterName("Emax", false);
0065   fECmd->SetUnitCategory("Energy");
0066   fECmd->SetRange("Emax>0.0");
0067   fECmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0068 
0069   fEBCmd = new G4UIcmdWithAnInteger("/testex/phys/setNbinsE", this);
0070   fEBCmd->SetGuidance("Set number of bins in energy.");
0071   fEBCmd->SetParameterName("Ebins", false);
0072   fEBCmd->SetRange("Ebins>0");
0073   fEBCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0074 
0075   fListCmd = new G4UIcmdWithAString("/testex/phys/addPhysics", this);
0076   fListCmd->SetGuidance("Add modula physics list.");
0077   fListCmd->SetParameterName("PList", false);
0078   fListCmd->AvailableForStates(G4State_PreInit);
0079 
0080   fPHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMPhotonMass", this);
0081   fPHCmd->SetGuidance("Set LDMPhotonMass");
0082   fPHCmd->SetParameterName("LDMPmass", false);
0083   fPHCmd->SetUnitCategory("Energy");
0084   fPHCmd->SetRange("LDMPmass>0.0");
0085   fPHCmd->AvailableForStates(G4State_PreInit);
0086 
0087   fHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMHiMass", this);
0088   fHCmd->SetGuidance("Set LDMHiMass");
0089   fHCmd->SetParameterName("LDMHmass", false);
0090   fHCmd->SetUnitCategory("Energy");
0091   fHCmd->SetRange("LDMHmass>0.0");
0092   fHCmd->AvailableForStates(G4State_PreInit);
0093 }
0094 
0095 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0096 
0097 PhysicsListMessenger::~PhysicsListMessenger()
0098 {
0099   delete fECmd;
0100   delete fPHCmd;
0101   delete fHCmd;
0102   delete fEBCmd;
0103   delete fListCmd;
0104   delete fPhysDir;
0105 }
0106 
0107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0108 
0109 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0110 {
0111   TestParameters* man = TestParameters::GetPointer();
0112 
0113   if (command == fECmd) {
0114     man->SetMaxEnergy(fECmd->GetNewDoubleValue(newValue));
0115   }
0116   if (command == fEBCmd) {
0117     man->SetNumberBins(fEBCmd->GetNewIntValue(newValue));
0118   }
0119   if (command == fListCmd) {
0120     fPhysicsList->AddPhysicsList(newValue);
0121   }
0122   if (command == fPHCmd) {
0123     fPhysicsList->SetLDMPhotonMass(fPHCmd->GetNewDoubleValue(newValue));
0124   }
0125   if (command == fHCmd) {
0126     fPhysicsList->SetLDMHiMass(fHCmd->GetNewDoubleValue(newValue));
0127   }
0128 }
0129 
0130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......