G4NistMessenger.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id: G4NistMessenger.cc 67044 2013-01-30 08:50:06Z gcosmo $
00027 //
00028 //
00029 // File name:     G4NistMessenger
00030 //
00031 // Author:        Vladimir Ivanchenko
00032 //
00033 // Creation date: 23.12.2004
00034 //
00035 // Modifications:
00036 //
00037 //
00038 // -------------------------------------------------------------------
00039 //
00040 
00041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00043 
00044 #include "G4NistMessenger.hh"
00045 
00046 #include "G4NistManager.hh"
00047 
00048 #include "G4UIdirectory.hh"
00049 #include "G4UIcmdWithAnInteger.hh"
00050 #include "G4UIcmdWithAString.hh"
00051 #include "G4IonisParamMat.hh"
00052 #include "G4DensityEffectData.hh"
00053 
00054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00055 
00056 G4NistMessenger::G4NistMessenger(G4NistManager* man)
00057 :manager(man)
00058 {
00059   matDir = new G4UIdirectory("/material/");
00060   matDir->SetGuidance("Commands for materials");
00061 
00062   verCmd = new G4UIcmdWithAnInteger("/material/verbose",this);
00063   verCmd->SetGuidance("Set verbose level.");
00064   
00065   nistDir = new G4UIdirectory("/material/nist/");
00066   nistDir->SetGuidance("Commands for the nist dataBase");
00067     
00068   prtElmCmd = new G4UIcmdWithAString("/material/nist/printElement",this);
00069   prtElmCmd->SetGuidance("print element(s) in dataBase.");
00070   prtElmCmd->SetGuidance("symbol = element.");
00071   prtElmCmd->SetGuidance("all    = all elements.");
00072   prtElmCmd->SetParameterName("symbol", true);
00073   prtElmCmd->SetDefaultValue("all");
00074   
00075   przElmCmd = new G4UIcmdWithAnInteger("/material/nist/printElementZ",this);
00076   przElmCmd->SetGuidance("print element Z in dataBase.");
00077   przElmCmd->SetGuidance("0 = all elements.");
00078   przElmCmd->SetParameterName("Z", true);
00079   przElmCmd->SetDefaultValue(0);
00080   przElmCmd->SetRange("0<=Z && Z<108");
00081    
00082   lisMatCmd = new G4UIcmdWithAString("/material/nist/listMaterials",this);
00083   lisMatCmd->SetGuidance("list materials in Geant4 dataBase.");
00084   lisMatCmd->SetGuidance("simple - simple NIST materials.");
00085   lisMatCmd->SetGuidance("compound - compound NIST materials.");
00086   lisMatCmd->SetGuidance("hep - HEP materials.");
00087   lisMatCmd->SetGuidance("biomedical - biomedical materials.");
00088   lisMatCmd->SetGuidance("all - list of all Geant4 materials.");
00089   lisMatCmd->SetParameterName("list", true);
00090   lisMatCmd->SetCandidates("simple compound hep all");
00091   lisMatCmd->SetDefaultValue("all");
00092   
00093   g4Dir = new G4UIdirectory("/material/g4/");
00094   g4Dir->SetGuidance("Commands for G4MaterialTable");
00095   
00096   g4ElmCmd = new G4UIcmdWithAString("/material/g4/printElement",this);
00097   g4ElmCmd->SetGuidance("print Element from G4ElementTable.");
00098   g4ElmCmd->SetGuidance("all - all elements.");
00099   g4ElmCmd->SetParameterName("elm", true);
00100   g4ElmCmd->SetDefaultValue("all");
00101     
00102   g4MatCmd = new G4UIcmdWithAString("/material/g4/printMaterial",this);
00103   g4MatCmd->SetGuidance("print Material from G4MaterialTable.");
00104   g4MatCmd->SetGuidance("all - all materials");
00105   g4MatCmd->SetParameterName("mat", true);
00106   g4MatCmd->SetDefaultValue("all");
00107 
00108   g4DensCmd = new G4UIcmdWithAString("/material/g4/printDensityEffParam",this);
00109   g4DensCmd->SetGuidance("print Material from G4DensityEffectData.");
00110   g4DensCmd->SetGuidance("all - all materials");
00111   g4DensCmd->SetParameterName("mat", true);
00112   g4DensCmd->SetDefaultValue("all");
00113 }
00114 
00115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00116 
00117 G4NistMessenger::~G4NistMessenger()
00118 {
00119   delete verCmd;  
00120   delete prtElmCmd;
00121   delete przElmCmd;
00122   delete lisMatCmd;
00123   delete nistDir;
00124   
00125   delete g4ElmCmd;   
00126   delete g4MatCmd;
00127   delete g4DensCmd;
00128   delete g4Dir;
00129   delete matDir;  
00130 }
00131 
00132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00133 
00134 void G4NistMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
00135 {
00136   if (command == verCmd) 
00137    { manager->SetVerbose(verCmd->GetNewIntValue(newValue));}
00138     
00139   else if (command == prtElmCmd)
00140    { manager->PrintElement(newValue);}
00141     
00142   else if (command == przElmCmd) {
00143     G4int Z = przElmCmd->GetNewIntValue(newValue);
00144     if(Z >= 0 && Z < 108) { manager->PrintElement(Z); }
00145   }
00146    
00147   else if (command == lisMatCmd) 
00148    { manager->ListMaterials(newValue);}
00149 
00150   else if (command == g4ElmCmd)
00151    { manager->PrintG4Element(newValue);}
00152    
00153   else if (command == g4MatCmd)
00154    { manager->PrintG4Material(newValue);}
00155 
00156   else if (command == g4DensCmd)
00157     { G4IonisParamMat::GetDensityEffectData()->PrintData(newValue); }
00158 }
00159 
00160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

Generated on Mon May 27 17:49:05 2013 for Geant4 by  doxygen 1.4.7