Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SDmessenger.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//
27//
28// ---------------------------------------------------------------------
29
30#include "G4SDmessenger.hh"
31#include "G4SDManager.hh"
32#include "G4UIdirectory.hh"
34#include "G4UIcmdWithAString.hh"
36
37G4SDmessenger::G4SDmessenger(G4SDManager* SDManager):fSDMan(SDManager)
38{
39 hitsDir = new G4UIdirectory("/hits/");
40 hitsDir->SetGuidance("Sensitive detectors and Hits");
41
42 listCmd = new G4UIcmdWithoutParameter("/hits/list",this);
43 listCmd->SetGuidance("List sensitive detector tree.");
44
45 activeCmd = new G4UIcmdWithAString("/hits/activate",this);
46 activeCmd->SetGuidance("Activate sensitive detector(s).");
47 activeCmd->SetParameterName("detector",true);
48 activeCmd->SetDefaultValue("/");
49
50 inactiveCmd = new G4UIcmdWithAString("/hits/inactivate",this);
51 inactiveCmd->SetGuidance("Inactivate sensitive detector(s).");
52 inactiveCmd->SetParameterName("detector",true);
53 inactiveCmd->SetDefaultValue("/");
54
55 verboseCmd = new G4UIcmdWithAnInteger("/hits/verbose",this);
56 verboseCmd->SetGuidance("Set the Verbose level.");
57 verboseCmd->SetParameterName("level",false);
58}
59
61{
62 delete listCmd;
63 delete activeCmd;
64 delete inactiveCmd;
65 delete verboseCmd;
66 delete hitsDir;
67}
68
70{
71 if( command==listCmd )
72 { fSDMan->ListTree(); }
73 if( command==activeCmd )
74 { fSDMan->Activate(newVal,1); }
75 if( command==inactiveCmd )
76 { fSDMan->Activate(newVal,0); }
77 if( command==verboseCmd )
78 { fSDMan->SetVerboseLevel(verboseCmd->GetNewIntValue(newVal)); }
79 return;
80}
81
82
void SetVerboseLevel(G4int vl)
Definition: G4SDManager.hh:92
void Activate(G4String dName, G4bool activeFlag)
Definition: G4SDManager.cc:121
void ListTree() const
Definition: G4SDManager.hh:99
void SetNewValue(G4UIcommand *command, G4String newValues)
G4SDmessenger(G4SDManager *SDManager)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156