Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-01 07:50:17

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