CMS 3D CMS Logo

GflashEMShowerModelMessenger.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  https://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: GflashEMShowerModelMessenger.cc,v 1.3 2008/02/29 23:40:56 syjun Exp $
00027 // GEANT4 tag $Name: V02-01-04 $
00028 //
00029 //
00030 // ------------------------------------------------------------
00031 // GEANT 4 class implementation
00032 //
00033 //      ------------- GFlashShowerModelMessenger -------------
00034 //
00035 // Author: Joanna Weng - 9.11.2004
00036 // ------------------------------------------------------------
00037 
00038 #include "SimG4Core/GFlash/interface/GflashEMShowerModelMessenger.h"
00039 #include "SimG4Core/GFlash/interface/GflashEMShowerModel.h"
00040 
00041 #include "GFlashParticleBounds.hh"
00042 #include "G4UIdirectory.hh"
00043 #include "G4UIcmdWithAString.hh"
00044 #include "G4UIcmdWithADoubleAndUnit.hh" 
00045 #include "G4UIcmdWithADouble.hh"
00046 #include "G4UIcmdWithAnInteger.hh"
00047 #include "G4Electron.hh"
00048 #include "G4Positron.hh"
00049 #include "globals.hh"
00050 
00051 #include <iomanip>                
00052 #include <sstream>
00053 
00054 GflashEMShowerModelMessenger::
00055 GflashEMShowerModelMessenger(GflashEMShowerModel * aModel)
00056 { 
00057   myParaDir = new G4UIdirectory("/GFlash/");
00058   myParaDir->SetGuidance("Parametrisation control.");
00059   myModel= aModel;
00060   
00061   FlagCmd = new G4UIcmdWithAnInteger("/GFlash/flag",this);
00062   FlagCmd->SetGuidance("Defines if GFlash is activated");
00063   FlagCmd->SetParameterName("flag",false,false);
00064   
00065   ContCmd = new G4UIcmdWithAnInteger("/GFlash/containment ",this);
00066   ContCmd->SetGuidance("Defines if Containment is checked");
00067   ContCmd->SetParameterName("flag",false,false);
00068   
00069   StepInX0Cmd = new G4UIcmdWithADouble("/GFlash/stepXo",this);
00070   StepInX0Cmd->SetGuidance("Defines step lenghts");
00071   StepInX0Cmd->SetParameterName("flag",false,false);
00072   
00073   EminCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emin",this);
00074   EminCmd->SetGuidance("Set minimum kinetic energy to trigger parametrisation");
00075   EminCmd->SetParameterName("Emin",false,false);
00076   EminCmd->SetDefaultUnit("GeV");
00077   EminCmd->SetUnitCategory("Energy");
00078   EminCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00079   
00080   EmaxCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emax",this);
00081   EmaxCmd->SetGuidance("Set maximum kinetic energy to trigger parametrisation");
00082   EmaxCmd->SetParameterName("Emax",false,false);
00083   EmaxCmd->SetDefaultUnit("GeV");
00084   EmaxCmd->SetUnitCategory("Energy");
00085   EmaxCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00086   
00087   EkillCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Ekill",this);
00088   EkillCmd->SetGuidance("Set maximum kinetic energy for electrons to be killed");
00089   EkillCmd->SetParameterName("Ekill",false,false);
00090   EkillCmd->SetDefaultUnit("GeV");
00091   EkillCmd->SetUnitCategory("Energy");
00092   EkillCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00093 }
00094 
00095 
00096 GflashEMShowerModelMessenger::~GflashEMShowerModelMessenger()
00097 {
00098   delete ContCmd;
00099   delete FlagCmd;
00100   delete StepInX0Cmd;  
00101   delete EminCmd;
00102   delete EmaxCmd;
00103   delete EkillCmd;
00104 }
00105 
00106 
00107 void GflashEMShowerModelMessenger::
00108 SetNewValue(G4UIcommand * command,G4String newValues)
00109 { 
00110   /*  
00111   if( command == FlagCmd ) { 
00112     myModel->SetFlagParamType(FlagCmd->GetNewIntValue(newValues));      
00113     this->GetCurrentValue(command);    
00114   }
00115   if( command == ContCmd ) { 
00116     myModel->SetFlagParticleContainment(ContCmd->GetNewIntValue(newValues));      
00117     this->GetCurrentValue(command);    
00118   }
00119   if( command == StepInX0Cmd ) { 
00120     myModel->SetStepInX0(StepInX0Cmd->GetNewDoubleValue(newValues));      
00121     this->GetCurrentValue(command);    
00122   }
00123   
00124   else if( command == EminCmd ) {
00125     myModel->PBound->SetMinEneToParametrise(*G4Electron::ElectronDefinition(),
00126                                        EminCmd->GetNewDoubleValue(newValues));
00127     this->GetCurrentValue(command);  
00128   }
00129   
00130   else if( command == EmaxCmd ) {
00131     myModel->PBound->SetMaxEneToParametrise(*G4Electron::ElectronDefinition(),
00132                                        EmaxCmd->GetNewDoubleValue(newValues));
00133     this->GetCurrentValue(command);      
00134   }
00135   
00136   else if( command == EkillCmd ) {
00137     myModel->PBound->SetEneToKill(*G4Electron::ElectronDefinition(),
00138                                        EkillCmd->GetNewDoubleValue(newValues));
00139     this->GetCurrentValue(command);  
00140   }
00141   */
00142 }
00143 
00144 
00145 G4String GflashEMShowerModelMessenger::GetCurrentValue(G4UIcommand * command)
00146 {
00147   G4String returnValue('\0');
00148   std::ostringstream os;
00149   /*  
00150   if( command == FlagCmd ) { 
00151     os << "/GFlash/flag " << myModel->GetFlagParamType()  << '\0';
00152     returnValue = G4String(os.str());
00153   }
00154   
00155   else if( command == EkillCmd ) {    
00156     os << "/GFlash/Ekill "
00157        << myModel->PBound->GetEneToKill(*G4Electron::ElectronDefinition())/GeV
00158        << " GeV" << '\0';
00159     returnValue = G4String(os.str());
00160   }
00161   
00162   else if( command == EminCmd ) {    
00163     os << "/GFlash/Emin "
00164        << myModel->PBound->GetMinEneToParametrise(*G4Electron::ElectronDefinition())/GeV
00165        << " GeV" << '\0';
00166     returnValue = G4String(os.str());  
00167   }
00168   
00169   else if( command == EmaxCmd ) {
00170     os << "/GFlash/Emax "
00171        << myModel->PBound->GetMaxEneToParametrise(*G4Electron::ElectronDefinition())/GeV
00172        << " GeV" << '\0';
00173     returnValue = G4String(os.str());
00174   }
00175   */
00176   return returnValue;
00177 }

Generated on Tue Jun 9 17:47:04 2009 for CMSSW by  doxygen 1.5.4