Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4SDMessenger.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2015 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
15#include "TG4SDMessenger.h"
16#include "TG4SDConstruction.h"
17#include "TG4SDServices.h"
18
19#include <G4UIcmdWithABool.hh>
20#include <G4UIcmdWithAString.hh>
21#include <G4UIcmdWithoutParameter.hh>
22#include <G4UIdirectory.hh>
23
24//______________________________________________________________________________
26 : G4UImessenger(),
27 fSDConstruction(sdConstruction),
28 fAddSDSelectionCmd(0),
29 fSetSDSelectionFromTGeoCmd(0),
30 fSetSVLabelCmd(0),
31 fSetGflashCmd(0),
32 fSetExclusiveSDScoringCmd(0),
33 fPrintUserSDsCmd(0)
34{
36
37 fAddSDSelectionCmd = new G4UIcmdWithAString("/mcDet/addSDSelection", this);
38 G4String guidance = "Selects volumes which will be make sensitive \n";
39 guidance +=
40 "(When any selection is applied MCApllication::Stepping() is called only ";
41 guidance += "from the selected volumes.)";
42 fAddSDSelectionCmd->SetGuidance(guidance);
43 fAddSDSelectionCmd->SetParameterName("SDSelection", false);
44 fAddSDSelectionCmd->AvailableForStates(G4State_PreInit);
45
47 new G4UIcmdWithABool("/mcDet/setSDSelectionFromTGeo", this);
48 guidance = "Get sensitive volumes selection from TGeo geometry. \n";
49 guidance +=
50 "(When any selection is applied MCApllication::Stepping() is called only ";
51 guidance += "from the selected volumes.)";
52 fSetSDSelectionFromTGeoCmd->SetGuidance(guidance);
53 fSetSDSelectionFromTGeoCmd->SetParameterName("SDSelectionFromTGeo", false);
54 fSetSDSelectionFromTGeoCmd->AvailableForStates(G4State_PreInit);
55
56 fSetSVLabelCmd = new G4UIcmdWithAString("/mcDet/setSVLabel", this);
57 guidance = "Set the string which is used in TGeoVolume::SetOption \n";
58 guidance += "(to label sensitive volumes (default is \"";
60 guidance += "\".)";
61 fSetSVLabelCmd->SetGuidance(guidance);
62 fSetSVLabelCmd->SetParameterName("SVLabel", false);
63 fSetSVLabelCmd->AvailableForStates(G4State_PreInit);
64
65 fSetGflashCmd = new G4UIcmdWithABool("/mcDet/setGflash", this);
66 guidance = "Activate creating sensitive detectors adapted for GFlash.";
67 fSetGflashCmd->SetGuidance(guidance);
68 fSetGflashCmd->SetParameterName("Gflash", false);
69 fSetGflashCmd->AvailableForStates(G4State_PreInit);
70
72 new G4UIcmdWithABool("/mcDet/setExclusiveSDScoring", this);
73 guidance = "Activate scoring by user sensitive detectors only.\n";
74 guidance += "The MC Application::Stepping() will be not called.";
75 fSetExclusiveSDScoringCmd->SetGuidance(guidance);
76 fSetExclusiveSDScoringCmd->SetParameterName("ExclusiveSDScoring", false);
77 fSetExclusiveSDScoringCmd->AvailableForStates(G4State_PreInit);
78
79 fPrintUserSDsCmd = new G4UIcmdWithoutParameter("/mcDet/printUserSDs", this);
80 fPrintUserSDsCmd->SetGuidance("Prints user sensitive detectors.");
81 fPrintUserSDsCmd->AvailableForStates(G4State_Init, G4State_Idle);
82}
83
84//______________________________________________________________________________
96
97//
98// public methods
99//
100
101//______________________________________________________________________________
102void TG4SDMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
103{
105
106 if (command == fAddSDSelectionCmd) {
107 fSDConstruction->AddSelection(newValue);
108 }
109 else if (command == fSetSDSelectionFromTGeoCmd) {
111 fSetSDSelectionFromTGeoCmd->GetNewBoolValue(newValue));
112 }
113 else if (command == fSetSVLabelCmd) {
115 }
116 else if (command == fSetGflashCmd) {
117 fSDConstruction->SetIsGflash(fSetGflashCmd->GetNewBoolValue(newValue));
118 }
119 else if (command == fSetExclusiveSDScoringCmd) {
121 fSetExclusiveSDScoringCmd->GetNewBoolValue(newValue));
122 }
123 else if (command == fPrintUserSDsCmd) {
125 }
126}
Definition of the TG4SDConstruction class.
Definition of the TG4SDMessenger class.
Definition of the TG4SDServices class.
Sensitive detector construction.
static const G4String & GetDefaultSVLabel()
void SetIsGflash(G4bool isGflash)
void SetSelectionFromTGeo(G4bool value)
void SetExclusiveSDScoring(G4bool value)
void SetSensitiveVolumeLabel(const G4String &label)
void AddSelection(const G4String &selection)
G4UIcmdWithABool * fSetGflashCmd
setGflash command
G4UIcmdWithAString * fSetSVLabelCmd
setSVLabel command
TG4SDConstruction * fSDConstruction
associated class
G4UIcmdWithABool * fSetExclusiveSDScoringCmd
setExclusiveSDScoring command
G4UIcmdWithABool * fSetSDSelectionFromTGeoCmd
getSDSelectionFromTGeo command
G4UIcmdWithAString * fAddSDSelectionCmd
addSDSelection command
virtual void SetNewValue(G4UIcommand *command, G4String string)
G4UIcmdWithoutParameter * fPrintUserSDsCmd
command: printVolumes
TG4SDMessenger()
Not implemented.
virtual ~TG4SDMessenger()
void PrintUserSensitiveDetectors() const
static TG4SDServices * Instance()