G4HadronicEPTestMessenger.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 //
00027 #include "G4HadronicEPTestMessenger.hh"
00028 #include "G4UIdirectory.hh"
00029 #include "G4UIcmdWithAnInteger.hh"
00030 #include "G4UIcmdWithADouble.hh"
00031 #include "G4UIcmdWithADoubleAndUnit.hh"
00032 
00033 
00034 G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(G4HadronicProcessStore* theStore)
00035  :theProcessStore(theStore)
00036 {
00037   // Main directory for control of the e/p test
00038   heptstDirectory = new G4UIdirectory("/heptst/");
00039   heptstDirectory->SetGuidance("Controls for the hadronic energy/momentum test");
00040 
00041   // Command to set level of detail reported upon e/p non-conservation
00042   reportLvlCmd = new G4UIcmdWithAnInteger("/heptst/reportLevel",this);
00043   reportLvlCmd->SetGuidance("Set level of detail reported upon E/p non-conservation");
00044   reportLvlCmd->SetGuidance(" 0 - (default) no reporting "); 
00045   reportLvlCmd->SetGuidance(" 1 - report only when E/p not conserved "); 
00046   reportLvlCmd->SetGuidance(" 2 - report regardless of E/p conservation "); 
00047   reportLvlCmd->SetGuidance(" 3 - report only when E/p not conserved, with names, limits "); 
00048   reportLvlCmd->SetGuidance(" 4 - report regardless of E/p conservation, with names, limits "); 
00049   reportLvlCmd->SetParameterName("ReportLevel",true);
00050   reportLvlCmd->SetDefaultValue(0);
00051   reportLvlCmd->SetRange("ReportLevel >= 0 && ReportLevel < 5");
00052 
00053   // Set the absolute energy non-conservation level for the process
00054   procAbsLvlCmd = new G4UIcmdWithADoubleAndUnit("/heptst/processAbsLevel",this);
00055   procAbsLvlCmd->SetGuidance("Set absolute energy level (with unit) of allowed energy non-conservation");
00056   procAbsLvlCmd->SetParameterName("ProcessAbsLevel",true);
00057   procAbsLvlCmd->SetDefaultValue(-1.0);
00058   procAbsLvlCmd->SetUnitCategory("Energy");
00059 
00060   // Set the relative energy non-conservation level for the process
00061   procRelLvlCmd = new G4UIcmdWithADouble("/heptst/processRelLevel",this);
00062   procRelLvlCmd->SetGuidance("Set relative level of allowed energy non-conservation");
00063   procRelLvlCmd->SetParameterName("ProcessRelLevel",true);
00064   procRelLvlCmd->SetDefaultValue(-1.0);
00065 }
00066 
00067 
00068 G4HadronicEPTestMessenger::~G4HadronicEPTestMessenger()
00069 {
00070   delete heptstDirectory;
00071   delete reportLvlCmd;
00072   delete procAbsLvlCmd;
00073   delete procRelLvlCmd;
00074 }
00075 
00076 
00077 void G4HadronicEPTestMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
00078 {
00079   if (command==reportLvlCmd) {
00080     theProcessStore->SetEpReportLevel(reportLvlCmd->GetNewIntValue(newValue) );
00081 
00082   } else if(command==procRelLvlCmd) {
00083     //    G4double absval = theHadronicProcess->GetEnergyMomentumCheckLevels().second;
00084     theProcessStore->SetProcessRelLevel(procRelLvlCmd->GetNewDoubleValue(newValue) );
00085   } else if(command==procAbsLvlCmd) {
00086     //    G4double relval = theHadronicProcess->GetEnergyMomentumCheckLevels().first;
00087     theProcessStore->SetProcessAbsLevel(procAbsLvlCmd->GetNewDoubleValue(newValue) );
00088   }
00089 }

Generated on Mon May 27 17:48:26 2013 for Geant4 by  doxygen 1.4.7