Geant4  10.02.p02
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_lists/");
56  aDir1->SetGuidance("commands related to the physics simulation engine.");
57 
58  // general stuff.
59  aDir2 = new G4UIdirectory("/physics_lists/em/");
60  aDir2->SetGuidance("tailoring the processes");
61 
62  // command for synchrotron radiation.
63  theSynch = new G4UIcmdWithABool("/physics_lists/em/SyncRadiation",this);
64  theSynch->SetGuidance("Switching on/off synchrotron radiation.");
66 
67  // command for synchrotron radiation.
68  theSynchAll = new G4UIcmdWithABool("/physics_lists/em/SyncRadiationAll",this);
69  theSynchAll->SetGuidance("Switching on/off synchrotron radiation for all charged.");
71 
72  // command for gamma nuclear physics.
73  theGN = new G4UIcmdWithABool("/physics_lists/em/GammaNuclear",this);
74  theGN->SetGuidance("Switching on gamma nuclear physics.");
76 
77  // command for muon nuclear physics.
78  theMUN = new G4UIcmdWithABool("/physics_lists/em/MuonNuclear",this);
79  theMUN->SetGuidance("Switching on muon nuclear physics.");
81 }
82 
84 {
85  delete theSynch;
86  delete theSynchAll;
87  delete theGN;
88  delete theMUN;
89  delete aDir1;
90  delete aDir2;
91 }
92 
94 {
95  if(aComm==theSynch) theB->Synch(theSynch->GetNewBoolValue(aS));
97  if(aComm==theGN) theB->GammaNuclear(theGN->GetNewBoolValue(aS));
98  if(aComm==theMUN) theB->MuonNuclear(theMUN->GetNewBoolValue(aS));
99 }
void SetNewValue(G4UIcommand *aComm, G4String aS)
void MuonNuclear(G4bool val)
G4UIcmdWithABool * theMUN
G4UIdirectory * aDir2
G4UIcmdWithABool * theSynch
static G4bool GetNewBoolValue(const char *paramString)
virtual ~G4EmMessenger()
G4UIdirectory * aDir1
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4EmMessenger(G4EmExtraPhysics *af)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
static const G4double ab
void SynchAll(G4bool val)
G4UIcmdWithABool * theGN
void GammaNuclear(G4bool val)
void Synch(G4bool val)
G4EmExtraPhysics * theB
G4UIcmdWithABool * theSynchAll