Back to home page

EIC code displayed by LXR

 
 

    


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

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