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

MaGeGeometryGermaniumCrystalMessenger.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: MaGeGeometryGermaniumCrystalMessenger.cc,v 1.2 2004/11/18 18:09:25 gast Exp $ 
00024 //      
00025 // CLASS IMPLEMENTATION:  @CLASS_NAME@.cc
00026 //
00027 //---------------------------------------------------------------------------//
00033 // 
00034 //---------------------------------------------------------------------------//
00045 //---------------------------------------------------------------------------//
00046 //
00047 
00048 #include "G4UIcmdWithAString.hh"
00049 #include "G4UIcmdWithADouble.hh"
00050 #include "G4UIdirectory.hh"
00051 
00052 //---------------------------------------------------------------------------//
00053 
00054 #include "gerdageometry/MaGeGeometryGermaniumCrystalMessenger.hh" 
00055 #include "gerdageometry/MaGeGeometryGermaniumCrystal.hh" 
00056 
00057 //---------------------------------------------------------------------------//
00058 MaGeGeometryGermaniumCrystalMessenger::
00059   MaGeGeometryGermaniumCrystalMessenger(
00060   MaGeGeometryGermaniumCrystal *Crystal) : fCrystal(Crystal)
00061 {
00062   //  /MaGe/geometry/crystal
00063   fGeCrystalDir = new G4UIdirectory("/MaGe/geometry/crystal/");
00064   fGeCrystalDir->SetGuidance("tune the crystal parameters");
00065 
00066   //  /MaGe/geometry/crystal/innerradius
00067   fCrystalInnerRadiusCmd = new G4UIcmdWithADouble(
00068    "/MaGe/geometry/crystal/innerradius", this);
00069   fCrystalInnerRadiusCmd->SetGuidance("Set crystal inner radius");
00070 
00071   //  /MaGe/geometry/crystal/outerradius
00072   fCrystalOuterRadiusCmd = new G4UIcmdWithADouble(
00073    "/MaGe/geometry/crystal/outerradius", this);
00074   fCrystalOuterRadiusCmd->SetGuidance("Set crystal outer radius");
00075  
00076   //  /MaGe/geometry/crystal/height
00077   fCrystalHeightCmd = new G4UIcmdWithADouble(
00078    "/MaGe/geometry/crystal/height", this);
00079   fCrystalHeightCmd->SetGuidance("Set crystal height");
00080 
00081   //  /MaGe/geometry/crystal/deadlayer
00082   fCrystalDeadLayerCmd = new G4UIcmdWithADouble(
00083    "/MaGe/geometry/crystal/deadlayer", this);
00084   fCrystalDeadLayerCmd->SetGuidance("Set crystal deadlayer");
00085 
00086 }
00087 
00088 
00089 MaGeGeometryGermaniumCrystalMessenger::
00090    ~MaGeGeometryGermaniumCrystalMessenger()
00091 {
00092   delete fGeCrystalDir;
00093   delete fCrystalInnerRadiusCmd;
00094   delete fCrystalOuterRadiusCmd;
00095   delete fCrystalHeightCmd;
00096   delete fCrystalDeadLayerCmd;
00097 }
00098 
00099 void MaGeGeometryGermaniumCrystalMessenger::SetNewValue(
00100   G4UIcommand *cmd, G4String newValue)
00101 {
00102   if (cmd == fCrystalInnerRadiusCmd)
00103    { G4double ir=fCrystalInnerRadiusCmd->GetNewDoubleValue(newValue);
00104      fCrystal->SetInnerRadius(ir*cm); }
00105   else if (cmd == fCrystalOuterRadiusCmd)
00106    { G4double our=fCrystalOuterRadiusCmd->GetNewDoubleValue(newValue);
00107      fCrystal->SetOuterRadius(our*cm); }
00108   else if (cmd == fCrystalHeightCmd)
00109    { G4double h=fCrystalHeightCmd->GetNewDoubleValue(newValue);
00110      fCrystal->SetHeight(h*cm); }
00111   else if (cmd == fCrystalDeadLayerCmd)
00112    { G4double dl=fCrystalDeadLayerCmd->GetNewDoubleValue(newValue);
00113      fCrystal->SetDeadLayer(dl*cm); }
00114 }
00115 
00116 

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