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: Alfonso Mantero (Alfonso.mantero@ge.infn.it)
0029 //
0030 // History:
0031 // -----------
0032 // 02 Sep 2003  Alfonso Mantero created
0033 //
0034 // -------------------------------------------------------------------
0035 
0036 #include "XrayFluoPlanePrimaryGeneratorMessenger.hh"
0037 #include "XrayFluoPlanePrimaryGeneratorAction.hh"
0038 #include "G4UIcmdWithAString.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0041 
0042 XrayFluoPlanePrimaryGeneratorMessenger::XrayFluoPlanePrimaryGeneratorMessenger(XrayFluoPlanePrimaryGeneratorAction* XrayFluoGun)
0043 :XrayFluoAction(XrayFluoGun)
0044 { 
0045   RndmCmd = new G4UIcmdWithAString("/gun/random",this);
0046   RndmCmd->SetGuidance("Shoot particles from a point-like source at infinity, witth an incidence angle with the plane of 45 deg");
0047   RndmCmd->SetGuidance("  Choice : on(default), off");
0048   RndmCmd->SetParameterName("choice",true);
0049   RndmCmd->SetDefaultValue("on");
0050   RndmCmd->SetCandidates("on off");
0051   RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0052 
0053   RndmVert = new G4UIcmdWithAString("/gun/beam",this);
0054   RndmVert->SetGuidance("Creates a round beam of particles of 0.5mm in diameter.");
0055   RndmVert->SetGuidance("  Choice : on(default), off");
0056   RndmVert->SetParameterName("choice",true);
0057   RndmVert->SetDefaultValue("on");
0058   RndmVert->SetCandidates("on off");
0059   RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0060 
0061   spectrum = new G4UIcmdWithAString("/gun/spectrum",this);
0062   spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum.");
0063   spectrum->SetGuidance("  Choice : on(default), off");
0064   spectrum->SetParameterName("choice",true);
0065   spectrum->SetDefaultValue("on");
0066   spectrum->SetCandidates("on off");
0067   spectrum->AvailableForStates(G4State_PreInit,G4State_Idle);
0068 
0069   isoVert = new G4UIcmdWithAString("/gun/isoVert",this);
0070   isoVert->SetGuidance("Shoot the incident particle from an isotropic direction.");
0071   isoVert->SetGuidance("  Choice : on(default), off");
0072   isoVert->SetParameterName("choice",true);
0073   isoVert->SetDefaultValue("on");
0074   isoVert->SetCandidates("on off");
0075   isoVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0076 
0077   G4cout << "XrayFluoPlanePrimaryGeneratorMessenger created" << G4endl;
0078 
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0082 
0083 XrayFluoPlanePrimaryGeneratorMessenger::~XrayFluoPlanePrimaryGeneratorMessenger()
0084 {
0085   delete RndmCmd;
0086   delete  RndmVert;
0087   delete spectrum;
0088   delete isoVert;
0089 
0090   G4cout << "XrayFluoPlanePrimaryGeneratorMessenger deleted" << G4endl;
0091 
0092 }
0093 
0094 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0095 
0096 void XrayFluoPlanePrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
0097 { 
0098   if( command == RndmCmd )
0099     { 
0100       XrayFluoAction->SetRndmFlag(newValue);
0101       XrayFluoAction->SetRndmVert("off");
0102       XrayFluoAction->SetIsoVert("off");
0103     }
0104   
0105   if( command == RndmVert )
0106     { 
0107       XrayFluoAction->SetRndmVert(newValue);
0108       XrayFluoAction->SetIsoVert("off");
0109       XrayFluoAction->SetRndmFlag("off");
0110     }
0111   if( command == spectrum )
0112     { XrayFluoAction->SetSpectrum(newValue);} 
0113   
0114   if( command == isoVert )
0115     { 
0116       XrayFluoAction->SetIsoVert(newValue);
0117       XrayFluoAction->SetRndmFlag("off");
0118       XrayFluoAction->SetRndmVert("off");
0119     }
0120 }
0121 
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0123