Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:10

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
0029 //
0030 // History:
0031 // -----------
0032 // 28 Nov 2001 Elena Guardincerri     Created
0033 //
0034 // -------------------------------------------------------------------
0035 
0036 #include "XrayFluoPrimaryGeneratorMessenger.hh"
0037 #include "XrayFluoPrimaryGeneratorAction.hh"
0038 #include "G4UIcmdWithAString.hh"
0039 #include "G4UIcmdWithABool.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0042 
0043 XrayFluoPrimaryGeneratorMessenger::XrayFluoPrimaryGeneratorMessenger(XrayFluoPrimaryGeneratorAction* XrayFluoGun)
0044   :XrayFluoAction(XrayFluoGun)
0045 { 
0046   RndmCmd = new G4UIcmdWithAString("/gun/random",this);
0047   RndmCmd->SetGuidance("Shoot randomly the incident particle.");
0048   RndmCmd->SetGuidance("  Choice : on(default), off");
0049   RndmCmd->SetParameterName("choice",true);
0050   RndmCmd->SetDefaultValue("on");
0051   RndmCmd->SetCandidates("on off");
0052   RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0053 
0054   RndmVert = new G4UIcmdWithAString("/gun/randomVert",this);
0055   RndmVert->SetGuidance("Shoot randomly the incident particle.");
0056   RndmVert->SetGuidance("  Choice : on(default), off");
0057   RndmVert->SetParameterName("choice",true);
0058   RndmVert->SetDefaultValue("on");
0059   RndmVert->SetCandidates("on off");
0060   RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0061 
0062   spectrum = new G4UIcmdWithAString("/gun/spectrum",this);
0063   spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum.");
0064   spectrum->SetGuidance("  Choice : on(default), off");
0065   spectrum->SetParameterName("choice",true);
0066   spectrum->SetDefaultValue("on");
0067   spectrum->SetCandidates("on off");
0068   spectrum->AvailableForStates(G4State_PreInit,G4State_Idle);
0069 
0070   isoVert = new G4UIcmdWithAString("/gun/isoVert",this);
0071   isoVert->SetGuidance("Shoot the incident particle from an isotrofic direction.");
0072   isoVert->SetGuidance("  Choice : on(default), off");
0073   isoVert->SetParameterName("choice",true);
0074   isoVert->SetDefaultValue("on");
0075   isoVert->SetCandidates("on off");
0076   isoVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0077 
0078   loadPahseSpace=new G4UIcmdWithAString("/gun/loadGunData",this);
0079   loadPahseSpace->SetGuidance("Load emission from samples form previous runs");
0080   loadPahseSpace->SetGuidance("Please enter the filename");
0081   loadPahseSpace->SetParameterName("choice",true);
0082   loadPahseSpace->AvailableForStates(G4State_Idle);
0083 
0084   loadRayleighData=new G4UIcmdWithABool("/gun/loadRayleighFlag",this);
0085   loadRayleighData->SetGuidance("Select if data form rayleigh scattering must be loaded");
0086   loadRayleighData->SetGuidance("To be used before and togheter with /gun/loadGunData");
0087   loadRayleighData->SetParameterName("Rayleigh Flag",true);
0088   loadRayleighData->SetDefaultValue(true);
0089   loadRayleighData->AvailableForStates(G4State_Idle);
0090 
0091   G4cout << "XrayFluoPrimaryGeneratorMessenger created" << G4endl;
0092 
0093 }
0094 
0095 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0096 
0097 XrayFluoPrimaryGeneratorMessenger::~XrayFluoPrimaryGeneratorMessenger()
0098 {
0099   delete RndmCmd;
0100   delete  RndmVert;
0101   delete spectrum;
0102   delete isoVert;
0103   delete loadPahseSpace;
0104   delete loadRayleighData;
0105   G4cout << "XrayFluoPrimaryGeneratorMessenger deleted" << G4endl;
0106 
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0110 
0111 void XrayFluoPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
0112 { 
0113   if( command == RndmCmd )
0114    { XrayFluoAction->SetRndmFlag(newValue);}
0115  if( command == RndmVert )
0116    { XrayFluoAction->SetRndmVert(newValue);}
0117  if( command == spectrum )
0118    { XrayFluoAction->SetSpectrum(newValue);} 
0119  if( command == isoVert )
0120    { XrayFluoAction->SetIsoVert(newValue);}
0121  if( command == loadPahseSpace )
0122    { XrayFluoAction->ActivatePhaseSpace(newValue);}
0123  if( command == loadRayleighData )
0124    { 
0125      G4cout << "newValue: " << newValue << G4endl;
0126 
0127      G4bool newRayFlag = loadRayleighData->GetNewBoolValue(newValue);
0128      XrayFluoAction->SetRayleighFlag(newRayFlag);
0129    }
0130 }
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0133