Loading...
Searching...
No Matches
OpNoviceDetectorMessenger.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
30#include "G4UIdirectory.hh"
31#include "G4UIcmdWithABool.hh"
32#include "G4UIcmdWithAString.hh"
33
34//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35
39 , fOpNoviceDetCon(detcon)
40{
41 fDetConDir = new G4UIdirectory("/OpNovice/DetectorConstruction/");
42 fDetConDir->SetGuidance("Configuring Detector Construction");
43
45 new G4UIcmdWithABool("/OpNovice/DetectorConstruction/enableVerbose", this);
46 fVerboseCmd->SetGuidance("Set flag for enabling verbose diagnostic printout");
47 fVerboseCmd->SetDefaultValue(false);
48 fVerboseCmd->AvailableForStates(G4State_PreInit);
49
51 new G4UIcmdWithABool("/OpNovice/DetectorConstruction/dumpGdml", this);
52 fDumpGdmlCmd->SetGuidance(
53 "Set flag for enabling dumping the detector to a gdml file");
54 fDumpGdmlCmd->SetDefaultValue(false);
55 fDumpGdmlCmd->AvailableForStates(G4State_PreInit);
56
58 "/OpNovice/DetectorConstruction/dumpGdmlFileName", this);
59 fDumpGdmlFileNameCmd->SetGuidance("Enter file name to dump gdml file ");
60 fDumpGdmlFileNameCmd->SetDefaultValue("OpNovice_dump.gdml");
61 fDumpGdmlFileNameCmd->AvailableForStates(G4State_PreInit);
62}
63
64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
73
74//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75
77 G4String newValue)
78{
79 auto dc1 = dynamic_cast<OpNoviceDetectorConstruction*>(fOpNoviceDetCon);
80 if(dc1 != nullptr)
81 {
82 if(command == fVerboseCmd)
83 dc1->SetVerbose(fVerboseCmd->GetNewBoolValue(newValue));
84 if(command == fDumpGdmlCmd)
85 dc1->SetDumpGdml(fDumpGdmlCmd->GetNewBoolValue(newValue));
86 if(command == fDumpGdmlFileNameCmd)
87 dc1->SetDumpGdmlFile(newValue);
88 }
89 else
90 {
91 auto dc2 = dynamic_cast<OpNoviceGDMLDetectorConstruction*>(fOpNoviceDetCon);
92 if(command == fVerboseCmd)
93 dc2->SetVerbose(fVerboseCmd->GetNewBoolValue(newValue));
94 if(command == fDumpGdmlCmd)
95 dc2->SetDumpGdml(fDumpGdmlCmd->GetNewBoolValue(newValue));
96 if(command == fDumpGdmlFileNameCmd)
97 dc2->SetDumpGdmlFile(newValue);
98 }
99}
100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the OpNoviceDetectorConstruction class.
Definition of the OpNoviceDetectorMessenger class.
G4VUserDetectorConstruction * fOpNoviceDetCon
void SetNewValue(G4UIcommand *, G4String) override
OpNoviceDetectorMessenger(G4VUserDetectorConstruction *)
G4UIcmdWithAString * fDumpGdmlFileNameCmd

Applications | User Support | Publications | Collaboration