Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpNoviceDetectorMessenger Class Reference

#include <OpNoviceDetectorMessenger.hh>

Inheritance diagram for OpNoviceDetectorMessenger:
G4UImessenger

Public Member Functions

 OpNoviceDetectorMessenger (G4VUserDetectorConstruction *)
 
 ~OpNoviceDetectorMessenger () override
 
void SetNewValue (G4UIcommand *, G4String) override
 

Private Attributes

G4VUserDetectorConstructionfOpNoviceDetCon = nullptr
 
G4UIdirectoryfDetConDir = nullptr
 
G4UIcmdWithABoolfVerboseCmd = nullptr
 
G4UIcmdWithABoolfDumpGdmlCmd = nullptr
 
G4UIcmdWithAStringfDumpGdmlFileNameCmd = nullptr
 

Detailed Description

Definition at line 45 of file OpNoviceDetectorMessenger.hh.

Constructor & Destructor Documentation

◆ OpNoviceDetectorMessenger()

OpNoviceDetectorMessenger::OpNoviceDetectorMessenger ( G4VUserDetectorConstruction detcon)

Definition at line 36 of file OpNoviceDetectorMessenger.cc.

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}
G4VUserDetectorConstruction * fOpNoviceDetCon
G4UIcmdWithAString * fDumpGdmlFileNameCmd

◆ ~OpNoviceDetectorMessenger()

OpNoviceDetectorMessenger::~OpNoviceDetectorMessenger ( )
override

Definition at line 66 of file OpNoviceDetectorMessenger.cc.

67{
68 delete fDetConDir;
69 delete fVerboseCmd;
70 delete fDumpGdmlCmd;
72}

Member Function Documentation

◆ SetNewValue()

void OpNoviceDetectorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
override

Definition at line 76 of file OpNoviceDetectorMessenger.cc.

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}

Member Data Documentation

◆ fOpNoviceDetCon

G4VUserDetectorConstruction* OpNoviceDetectorMessenger::fOpNoviceDetCon = nullptr
private

Definition at line 53 of file OpNoviceDetectorMessenger.hh.

◆ fDetConDir

G4UIdirectory* OpNoviceDetectorMessenger::fDetConDir = nullptr
private

Definition at line 54 of file OpNoviceDetectorMessenger.hh.

◆ fVerboseCmd

G4UIcmdWithABool* OpNoviceDetectorMessenger::fVerboseCmd = nullptr
private

Definition at line 55 of file OpNoviceDetectorMessenger.hh.

◆ fDumpGdmlCmd

G4UIcmdWithABool* OpNoviceDetectorMessenger::fDumpGdmlCmd = nullptr
private

Definition at line 56 of file OpNoviceDetectorMessenger.hh.

◆ fDumpGdmlFileNameCmd

G4UIcmdWithAString* OpNoviceDetectorMessenger::fDumpGdmlFileNameCmd = nullptr
private

Definition at line 57 of file OpNoviceDetectorMessenger.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration