Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MJGeneratorTUNLFELMessenger.cc

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------//
00002 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00003 //                                                                           //
00004 //                         MAJORANA Simulation                               //
00005 //                                                                           //
00006 //      This code implementation is the intellectual property of the         //
00007 //      MAJORANA Collaboration. It is based on Geant4, an intellectual       //
00008 //      property of the RD44 GEANT4 collaboration.                           //
00009 //                                                                           //
00010 //                        *********************                              //
00011 //                                                                           //
00012 //    Neither the authors of this software system, nor their employing       //
00013 //    institutes, nor the agencies providing financial support for this      //
00014 //    work  make  any representation or  warranty, express or implied,       //
00015 //    regarding this software system or assume any liability for its use.    //
00016 //    By copying, distributing or modifying the Program (or any work based   //
00017 //    on on the Program) you indicate your acceptance of this statement,     //
00018 //    and all its terms.                                                     //
00019 //                                                                           //
00020 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00021 //---------------------------------------------------------------------------//
00022 //                                                          
00023 // $Id: MJGeneratorTUNLFELMessenger.cc,v 1.2 2004/11/09 13:42:39 xliu Exp $ 
00024 //      
00025 // CLASS IMPLEMENTATION:  MJGeneratorTUNLFELMessenger.cc
00026 //
00027 //---------------------------------------------------------------------------//
00033 // 
00034 //---------------------------------------------------------------------------//
00044 //---------------------------------------------------------------------------//
00045 //
00046 
00047 #include "globals.hh"
00048 #include "G4UIcmdWith3VectorAndUnit.hh"
00049 #include "G4UIcmdWithADouble.hh"
00050 #include "G4UIcmdWithADoubleAndUnit.hh"
00051 #include "G4UIcmdWithoutParameter.hh"
00052 #include "G4UIcommand.hh"
00053 #include "G4UIdirectory.hh"
00054 
00055 #include "generators/MJGeneratorTUNLFEL.hh"
00056 
00057 //---------------------------------------------------------------------------//
00058 
00059 #include "generators/MJGeneratorTUNLFELMessenger.hh"
00060 
00061 //---------------------------------------------------------------------------//
00062 
00063 MJGeneratorTUNLFELMessenger::MJGeneratorTUNLFELMessenger(MJGeneratorTUNLFEL *generator) : fTUNLFELGenerator(generator)
00064 {
00065   // /MJ/generator/TUNLFEL
00066   fTUNLFELDirectory = new G4UIdirectory("/MJ/generator/TUNLFEL/");
00067   fTUNLFELDirectory->SetGuidance("TUNL FEL beam generator control.");
00068 
00069   // MJ/generator/TUNLFEL/dump
00070   fDumpCmd = new G4UIcmdWithoutParameter("/MJ/generator/TUNLFEL/dump", this);
00071   fDumpCmd->SetGuidance("Dump parameters of generator to screen");
00072 
00073   // /MJ/generator/TUNLFEL/energysigma
00074   fEnergySigmaCmd = new G4UIcmdWithADoubleAndUnit(
00075                     "/MJ/generator/TUNLFEL/energysigma", this);
00076   fEnergySigmaCmd->SetGuidance("Mean energy for FEL beam");
00077   fEnergySigmaCmd->SetDefaultUnit("MeV");
00078   fEnergySigmaCmd->SetUnitCandidates("ev keV Mev GeV TeV");
00079 
00080   // /MJ/generator/TUNLFEL/majorsigma
00081   fMajorSigmaCmd = new G4UIcmdWithADoubleAndUnit(
00082                    "/MJ/generator/TUNLFEL/majorsigma", this);
00083   fMajorSigmaCmd->SetGuidance("Sigma of beam width along major axis.");
00084   fMajorSigmaCmd->SetDefaultUnit("cm");
00085   fMajorSigmaCmd->SetUnitCandidates("mm cm m");
00086 
00087   // /MJ/generator/TUNLFEL/meanenergy
00088   fMeanEnergyCmd = new G4UIcmdWithADoubleAndUnit(
00089                    "/MJ/generator/TUNLFEL/meanenergy", this);
00090   fMeanEnergyCmd->SetGuidance("Mean energy of beam.");
00091   fMeanEnergyCmd->SetDefaultUnit("MeV");
00092   fMeanEnergyCmd->SetUnitCandidates("ev keV MeV GeV TeV");
00093 
00094   // /MJ/generator/TUNLFEL/minorsigma
00095   fMinorSigmaCmd = new G4UIcmdWithADoubleAndUnit(
00096                    "/MJ/generator/TUNLFEL/minorsigma", this);
00097   fMinorSigmaCmd->SetGuidance("Sigma of beam width along minor axis.");
00098   fMinorSigmaCmd->SetDefaultUnit("cm");
00099   fMinorSigmaCmd->SetUnitCandidates("mm cm m");
00100 
00101   // /MJ/generator/TUNLFEL/origin
00102   fOriginCmd = new  G4UIcmdWith3VectorAndUnit(
00103                    "/MJ/generator/TUNLFEL/origin", this);
00104   fOriginCmd->SetGuidance("Origin in mother coordinate system of beam.");
00105   fOriginCmd->SetDefaultUnit("cm");
00106   fOriginCmd->SetUnitCandidates("mm cm m");
00107 
00108   // /MJ/generator/TUNLFEL/rho
00109   fRhoCmd = new G4UIcmdWithADouble("/MJ/generator/TUNLFEL/rho", this);
00110   fRhoCmd->SetGuidance(
00111       "Major axis angle of beam profile relative to x-axis in degrees");
00112 }
00113 
00114 //---------------------------------------------------------------------------//
00115 
00116 MJGeneratorTUNLFELMessenger::MJGeneratorTUNLFELMessenger(const MJGeneratorTUNLFELMessenger & other)
00117 {;}
00118 
00119 //---------------------------------------------------------------------------//
00120 
00121 MJGeneratorTUNLFELMessenger::~MJGeneratorTUNLFELMessenger()
00122 {
00123   delete fRhoCmd;
00124   delete fOriginCmd;
00125   delete fMinorSigmaCmd;
00126   delete fMeanEnergyCmd;
00127   delete fMajorSigmaCmd;
00128   delete fEnergySigmaCmd;
00129   delete fDumpCmd;
00130   delete fTUNLFELDirectory;
00131 }
00132 
00133 //---------------------------------------------------------------------------//
00134 
00135 G4String MJGeneratorTUNLFELMessenger::GetCurrentValue(G4UIcommand *cmd)
00136 {
00137   G4String cv = " ";
00138   if(cmd == fDumpCmd)
00139     fTUNLFELGenerator->Dump();
00140 
00141   return cv;
00142 }
00143 
00144 //---------------------------------------------------------------------------//
00145 
00146 void MJGeneratorTUNLFELMessenger::SetNewValue(G4UIcommand *cmd, G4String newValues)
00147 {
00148   if(cmd == fEnergySigmaCmd)
00149     fTUNLFELGenerator->SetEnergySigma(
00150                        fEnergySigmaCmd->GetNewDoubleValue(newValues));
00151   else if(cmd == fMajorSigmaCmd) 
00152     fTUNLFELGenerator->SetMajorSigma(
00153                        fMajorSigmaCmd->GetNewDoubleValue(newValues));
00154   else if(cmd == fMeanEnergyCmd) 
00155     fTUNLFELGenerator->SetMeanEnergy(
00156                        fMeanEnergyCmd->GetNewDoubleValue(newValues));
00157   else if(cmd == fMinorSigmaCmd)
00158     fTUNLFELGenerator->SetMinorSigma(
00159                        fMinorSigmaCmd->GetNewDoubleValue(newValues));
00160   else if(cmd == fOriginCmd)
00161     fTUNLFELGenerator->SetOrigin(fOriginCmd->GetNew3VectorValue(newValues));
00162   else if(cmd == fRhoCmd)
00163     fTUNLFELGenerator->SetRho(fRhoCmd->GetNewDoubleValue(newValues) * deg);
00164 }
00165 
00166 //---------------------------------------------------------------------------//
00167 //---------------------------------------------------------------------------//

Generated on Mon Nov 29 16:58:51 2004 for Majorana Simulation by  doxygen 1.3.9.1