Geant4  10.01.p01
G4EmMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4EmMessenger.cc 66704 2013-01-10 18:20:17Z gunter $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4EmMessenger
31 //
32 // Author: 2002 J.P. Wellisch
33 //
34 // Modified:
35 // 09.11.2005 V.Ivanchenko edit to provide a standard
36 // 19.06.2006 V.Ivanchenko add mu-nuclear process
37 //
38 //----------------------------------------------------------------------------
39 //
40 
41 #include "G4EmMessenger.hh"
42 #include "G4EmExtraPhysics.hh"
43 
44 
45 //A. Dotti (8Jun2013): This class does not need changes for MT
46 // Note that in general "physics" realated commands should not
47 // be executed by threads, but this is a special case. Actually the command
48 // executes a building of processes if it was not build before, thus we need
49 // all threads to process commands.
50 // The logic of thread-private objects is in G4EmExtraPhysics class
51 
53 {
54  theB = ab;
55  aDir1 = new G4UIdirectory("/physics_engine/");
56  aDir1->SetGuidance("commands related to the physics simulation engine.");
57 
58  // general stuff.
59  aDir2 = new G4UIdirectory("/physics_engine/tailor/");
60  aDir2->SetGuidance("tailoring the processes");
61 
62  // command for synchrotron radiation.
63  theSynch = new G4UIcmdWithAString("/physics_engine/tailor/SyncRadiation",this);
64  theSynch->SetGuidance("Switching on/off synchrotron radiation.");
65  theSynch->SetParameterName("status",false);
66  theSynch->SetCandidates("on off");
67  theSynch->SetDefaultValue("off");
69 
70  // command for gamma nuclear physics.
71  theGN = new G4UIcmdWithAString("/physics_engine/tailor/GammaNuclear",this);
72  theGN->SetGuidance("Switching on gamma nuclear physics.");
73  theGN->SetParameterName("status",false);
74  theGN->SetCandidates("on off");
75  theGN->SetDefaultValue("on");
77 
78  // command for muon nuclear physics.
79  theMUN = new G4UIcmdWithAString("/physics_engine/tailor/MuonNuclear",this);
80  theMUN->SetGuidance("Switching on muon nuclear physics.");
81  theMUN->SetParameterName("status",false);
82  theMUN->SetCandidates("on off");
83  theMUN->SetDefaultValue("off");
85 }
86 
88 {
89  delete theSynch;
90  delete theGN;
91  delete theMUN;
92  delete aDir1;
93  delete aDir2;
94 }
95 
97 {
98  if(aComm==theSynch) theB->Synch(aS);
99  if(aComm==theGN) theB->GammaNuclear(aS);
100  if(aComm==theMUN) theB->MuonNuclear(aS);
101 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetNewValue(G4UIcommand *aComm, G4String aS)
G4UIdirectory * aDir2
G4UIcmdWithAString * theGN
virtual ~G4EmMessenger()
G4UIcmdWithAString * theMUN
G4UIdirectory * aDir1
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4EmMessenger(G4EmExtraPhysics *af)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void GammaNuclear(G4String &aState)
static const G4double ab
void SetDefaultValue(const char *defVal)
void Synch(G4String &aState)
G4UIcmdWithAString * theSynch
void MuonNuclear(G4String &aState)
void SetCandidates(const char *candidateList)
G4EmExtraPhysics * theB