Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:47

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 biasing/ReverseMC01/src/G4AdjointPhysicsMessenger.cc
0027 /// \brief Implementation of the G4AdjointPhysicsMessenger class
0028 //
0029 //
0030 //////////////////////////////////////////////////////////////
0031 //      Class Name:        G4AdjointPhysicsMessenger
0032 //        Author:               L. Desorgher
0033 //         Organisation:         SpaceIT GmbH
0034 //        Contract:        ESA contract 21435/08/NL/AT
0035 //         Customer:             ESA/ESTEC
0036 //////////////////////////////////////////////////////////////
0037 
0038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 #include "G4AdjointPhysicsMessenger.hh"
0042 
0043 #include "G4AdjointPhysicsList.hh"
0044 #include "G4UIcmdWith3VectorAndUnit.hh"
0045 #include "G4UIcmdWithABool.hh"
0046 #include "G4UIcmdWithADouble.hh"
0047 #include "G4UIcmdWithADoubleAndUnit.hh"
0048 #include "G4UIcmdWithAString.hh"
0049 #include "G4UIcmdWithAnInteger.hh"
0050 #include "G4UIcmdWithoutParameter.hh"
0051 #include "G4UIdirectory.hh"
0052 #include "G4UnitsTable.hh"
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0055 
0056 G4AdjointPhysicsMessenger::G4AdjointPhysicsMessenger(G4AdjointPhysicsList* pPhysicsList)
0057   : G4UImessenger(),
0058     fPhysicsList(pPhysicsList),
0059     fPhysicsDir(0),
0060     fUsepIonisationCmd(0),
0061     fUseBremCmd(0),
0062     fUseComptonCmd(0),
0063     fUseMSCmd(0),
0064     fUsePEEffectCmd(0),
0065     fUseGammaConversionCmd(0),
0066     fUseEgainFluctuationCmd(0),
0067     fSetEminAdjModelsCmd(0),
0068     fSetEmaxAdjModelsCmd(0)
0069 {
0070   fPhysicsDir = new G4UIdirectory("/adjoint_physics/");
0071 
0072   fPhysicsDir->SetGuidance("Definition of adjoint and forward physics processes");
0073   //-------
0074   fUsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation", this);
0075   fUsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered");
0076   fUsepIonisationCmd->AvailableForStates(G4State_PreInit);
0077 
0078   fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung", this);
0079   fUseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered");
0080   fUseBremCmd->AvailableForStates(G4State_PreInit);
0081 
0082   fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton", this);
0083   fUseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered");
0084   fUseComptonCmd->AvailableForStates(G4State_PreInit);
0085 
0086   fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS", this);
0087   fUseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered");
0088   fUseMSCmd->AvailableForStates(G4State_PreInit);
0089 
0090   fUseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation", this);
0091   fUseEgainFluctuationCmd->SetGuidance(
0092     "Switch on/off the fluctation for continuous energy gain/loss");
0093   fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit);
0094 
0095   fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect", this);
0096   fUsePEEffectCmd->AvailableForStates(G4State_PreInit);
0097   fUsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered");
0098 
0099   fUseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion", this);
0100   fUseGammaConversionCmd->AvailableForStates(G4State_PreInit);
0101   fUseGammaConversionCmd->SetGuidance("If true the fwd gamma pair conversion is considered");
0102 
0103   fSetEminAdjModelsCmd =
0104     new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels", this);
0105   fSetEminAdjModelsCmd->SetGuidance("Set the minimum energy  of the adjoint models");
0106   fSetEminAdjModelsCmd->SetParameterName("Emin", false);
0107   fSetEminAdjModelsCmd->SetUnitCategory("Energy");
0108   fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit);
0109 
0110   fSetEmaxAdjModelsCmd =
0111     new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels", this);
0112   fSetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models.");
0113   fSetEmaxAdjModelsCmd->SetParameterName("Emax", false);
0114   fSetEmaxAdjModelsCmd->SetUnitCategory("Energy");
0115   fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit);
0116 }
0117 
0118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0119 
0120 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMessenger()
0121 {
0122   delete fUsepIonisationCmd;
0123   delete fUseBremCmd;
0124   delete fUseComptonCmd;
0125   delete fUseMSCmd;
0126   delete fUsePEEffectCmd;
0127   delete fUseGammaConversionCmd;
0128   delete fUseEgainFluctuationCmd;
0129   delete fSetEminAdjModelsCmd;
0130   delete fSetEmaxAdjModelsCmd;
0131 }
0132 
0133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0134 
0135 void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0136 {
0137   if (command == fUsepIonisationCmd) {
0138     fPhysicsList->SetUseProtonIonisation(fUsepIonisationCmd->GetNewBoolValue(newValue));
0139   }
0140   else if (command == fUseBremCmd) {
0141     fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue));
0142   }
0143   else if (command == fUseComptonCmd) {
0144     fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue));
0145   }
0146   else if (command == fUseMSCmd) {
0147     fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue));
0148   }
0149   else if (command == fUsePEEffectCmd) {
0150     fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue));
0151   }
0152   else if (command == fUseGammaConversionCmd) {
0153     fPhysicsList->SetUseGammaConversion(fUseGammaConversionCmd->GetNewBoolValue(newValue));
0154   }
0155   else if (command == fUseEgainFluctuationCmd) {
0156     fPhysicsList->SetUseEgainFluctuation(fUseEgainFluctuationCmd->GetNewBoolValue(newValue));
0157   }
0158 
0159   else if (command == fSetEminAdjModelsCmd) {
0160     fPhysicsList->SetEminAdjModels(fSetEminAdjModelsCmd->GetNewDoubleValue(newValue));
0161   }
0162   else if (command == fSetEmaxAdjModelsCmd) {
0163     fPhysicsList->SetEmaxAdjModels(fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue));
0164   }
0165 }
0166 
0167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......