Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FieldBuilderMessenger.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// Implementation of the G4FieldBuilderMessenger class
27//
28// Author: Ivana Hrivnacova (IJCLab, Orsay), 2024
29// -------------------------------------------------------------------
30
32#include "G4FieldBuilder.hh"
33
36#include "G4UIdirectory.hh"
37
38//_____________________________________________________________________________
40 : fFieldBuilder(fieldBuilder)
41{
42 // Standard constructor
43
44 G4String directoryName = "/field/";
45 fDirectory = new G4UIdirectory(directoryName);
46 fDirectory->SetGuidance("Magnetic (or other type) field control commands.");
47
48 G4String commandName = std::move(directoryName);
49 commandName.append("verboseLevel");
50 fVerboseLevelCmd = new G4UIcmdWithAnInteger(commandName, this);
51 fVerboseLevelCmd->SetGuidance("Set verbose level");
52 fVerboseLevelCmd->SetParameterName("VerboseLevel", false);
53 // add possible values
54 fVerboseLevelCmd->AvailableForStates(
56}
57
58//_____________________________________________________________________________
60{
61 // Destructor
62
63 delete fDirectory;
64 delete fVerboseLevelCmd;
65}
66
67//
68// public methods
69//
70
71//_____________________________________________________________________________
73 G4UIcommand* command, G4String newValues)
74{
75 // Apply command to the associated object.
76
77 if (command == fVerboseLevelCmd)
78 {
79 fFieldBuilder->SetVerboseLevel(fVerboseLevelCmd->GetNewIntValue(newValues));
80 return;
81 }
82}
@ G4State_Init
@ G4State_Idle
@ G4State_PreInit
void SetNewValue(G4UIcommand *command, G4String newValues) override
G4FieldBuilderMessenger()=delete
G4FieldBuilder is a singleton manager class for building magnetic or other fields,...