Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/hadronic/FlukaCern/ProcessLevel/CrossSection/src/XSHistoManagerMessenger.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 XSHistoManagerMessenger.cc
0027 ///  \brief UI commands for XS study.
0028 //
0029 //  Author: G.Hugo, 06 January 2023
0030 //
0031 // ***************************************************************************
0032 //
0033 //      XSHistoManagerMessenger
0034 //
0035 ///  UI commands for XS study.
0036 //
0037 // ***************************************************************************
0038 
0039 #include "XSHistoManagerMessenger.hh"
0040 
0041 #include "XSHistoManager.hh"
0042 
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 XSHistoManagerMessenger::XSHistoManagerMessenger(XSHistoManager* const histoManager)
0046   : fHisto(histoManager),
0047     fOutputFileNameCmd(G4UIcmdWithAString("/allXS/outputFileName", this)),
0048     fParticleNameCmd(G4UIcmdWithAString("/allXS/particleName", this)),
0049     fElementNameCmd(G4UIcmdWithAString("/allXS/elementName", this)),
0050     fNonElementaryMaterialNameCmd(G4UIcmdWithAString("/allXS/nonElementaryMaterialName", this)),
0051     fNumBinsCmd(G4UIcmdWithAnInteger("/allXS/numBins", this)),
0052     fMinKineticEnergyCmd(G4UIcmdWithADoubleAndUnit("/allXS/minKineticEnergy", this)),
0053     fMaxKineticEnergyCmd(G4UIcmdWithADoubleAndUnit("/allXS/maxKineticEnergy", this))
0054 {
0055   fOutputFileNameCmd.SetGuidance("Set output file name (histograms).");
0056 
0057   fParticleNameCmd.SetGuidance("Set particle name.");
0058   fParticleNameCmd.SetParameterName("particleName", false);
0059   fParticleNameCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0060 
0061   fElementNameCmd.SetGuidance("Set target element name.");
0062   fElementNameCmd.SetParameterName("elementName", false);
0063   fElementNameCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0064 
0065   fNonElementaryMaterialNameCmd.SetGuidance("Set target material name (in case not elementary).");
0066   fNonElementaryMaterialNameCmd.SetParameterName("nonElementaryMaterialName", false);
0067   fNonElementaryMaterialNameCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0068 
0069   fNumBinsCmd.SetGuidance("Set number of bins in kinetic energy.");
0070   fNumBinsCmd.SetParameterName("numBins", false);
0071   fNumBinsCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0072 
0073   fMinKineticEnergyCmd.SetGuidance("Set min kinetic energy");
0074   fMinKineticEnergyCmd.SetParameterName("MinKineticEnergy", false);
0075   fMinKineticEnergyCmd.SetUnitCategory("Energy");
0076   fMinKineticEnergyCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0077 
0078   fMaxKineticEnergyCmd.SetGuidance("Set max kinetic energy");
0079   fMaxKineticEnergyCmd.SetParameterName("MaxKineticEnergy", false);
0080   fMaxKineticEnergyCmd.SetUnitCategory("Energy");
0081   fMaxKineticEnergyCmd.AvailableForStates(G4State_PreInit, G4State_Idle);
0082 }
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 void XSHistoManagerMessenger::SetNewValue(G4UIcommand* command, G4String value)
0087 {
0088   if (command == &fOutputFileNameCmd) {
0089     fHisto->SetOutputFileName(value);
0090   }
0091   else if (command == &fParticleNameCmd) {
0092     fHisto->SetParticle(value);
0093   }
0094   else if (command == &fElementNameCmd) {
0095     fHisto->SetElement(value);
0096   }
0097   else if (command == &fNonElementaryMaterialNameCmd) {
0098     fHisto->SetMaterial(value);
0099   }
0100   else if (command == &fNumBinsCmd) {
0101     fHisto->SetNumberOfBins(fNumBinsCmd.GetNewIntValue(value));
0102   }
0103   else if (command == &fMinKineticEnergyCmd) {
0104     fHisto->SetMinKinEnergy(fMinKineticEnergyCmd.GetNewDoubleValue(value));
0105   }
0106   else if (command == &fMaxKineticEnergyCmd) {
0107     fHisto->SetMaxKinEnergy(fMaxKineticEnergyCmd.GetNewDoubleValue(value));
0108   }
0109 }
0110 
0111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......