[825] | 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,v 1.1 2006/10/31 11:35:02 gunter Exp $ |
---|
[1203] | 27 | // GEANT4 tag $Name: geant4-09-03-cand-03 $ |
---|
[825] | 28 | // |
---|
| 29 | //--------------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // ClassName: G4EmMessenger |
---|
| 32 | // |
---|
| 33 | // Author: 2002 J.P. Wellisch |
---|
| 34 | // |
---|
| 35 | // Modified: |
---|
| 36 | // 09.11.2005 V.Ivanchenko edit to provide a standard |
---|
| 37 | // 19.06.2006 V.Ivanchenko add mu-nuclear process |
---|
| 38 | // |
---|
| 39 | //---------------------------------------------------------------------------- |
---|
| 40 | // |
---|
| 41 | |
---|
| 42 | #include "G4EmMessenger.hh" |
---|
| 43 | #include "G4EmExtraPhysics.hh" |
---|
| 44 | |
---|
| 45 | G4EmMessenger::G4EmMessenger(G4EmExtraPhysics* ab) |
---|
| 46 | { |
---|
| 47 | theB = ab; |
---|
| 48 | aDir1 = new G4UIdirectory("/physics_engine/"); |
---|
| 49 | aDir1->SetGuidance("commands related to the physics simulation engine."); |
---|
| 50 | |
---|
| 51 | // general stuff. |
---|
| 52 | aDir2 = new G4UIdirectory("/physics_engine/tailor/"); |
---|
| 53 | aDir2->SetGuidance("tailoring the processes"); |
---|
| 54 | |
---|
| 55 | // command for synchrotron radiation. |
---|
| 56 | theSynch = new G4UIcmdWithAString("/physics_engine/tailor/SyncRadiation",this); |
---|
| 57 | theSynch->SetGuidance("Switching on/off synchrotron radiation."); |
---|
| 58 | theSynch->SetParameterName("status","off"); |
---|
| 59 | theSynch->SetCandidates("on off"); |
---|
| 60 | theSynch->SetDefaultValue("off"); |
---|
| 61 | theSynch->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
| 62 | |
---|
| 63 | // command for gamma nuclear physics. |
---|
| 64 | theGN = new G4UIcmdWithAString("/physics_engine/tailor/GammaNuclear",this); |
---|
| 65 | theGN->SetGuidance("Switching on gamma nuclear physics."); |
---|
| 66 | theGN->SetParameterName("status","off"); |
---|
| 67 | theGN->SetCandidates("on off"); |
---|
| 68 | theGN->SetDefaultValue("on"); |
---|
| 69 | theGN->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
| 70 | |
---|
| 71 | // command for muon nuclear physics. |
---|
| 72 | theMUN = new G4UIcmdWithAString("/physics_engine/tailor/MuonNuclear",this); |
---|
| 73 | theMUN->SetGuidance("Switching on muon nuclear physics."); |
---|
| 74 | theMUN->SetParameterName("status","off"); |
---|
| 75 | theMUN->SetCandidates("on off"); |
---|
| 76 | theMUN->SetDefaultValue("off"); |
---|
| 77 | theMUN->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | G4EmMessenger::~G4EmMessenger() |
---|
| 81 | { |
---|
| 82 | delete theSynch; |
---|
| 83 | delete theGN; |
---|
| 84 | delete theMUN; |
---|
| 85 | delete aDir1; |
---|
| 86 | delete aDir2; |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | void G4EmMessenger::SetNewValue(G4UIcommand* aComm, G4String aS) |
---|
| 90 | { |
---|
| 91 | if(aComm==theSynch) theB->Synch(aS); |
---|
| 92 | if(aComm==theGN) theB->GammaNuclear(aS); |
---|
| 93 | if(aComm==theMUN) theB->MuonNuclear(aS); |
---|
| 94 | } |
---|