[1199] | 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 | // $Id: NTSTDetectorMessenger.cc,v 1.3 2006/06/29 18:26:08 gunter Exp $ |
---|
| 27 | // GEANT4 tag $Name: HEAD $ |
---|
| 28 | // |
---|
| 29 | // |
---|
| 30 | |
---|
| 31 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 32 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 33 | |
---|
| 34 | #include "NTSTDetectorMessenger.hh" |
---|
| 35 | |
---|
| 36 | #include "NTSTDetectorConstruction.hh" |
---|
| 37 | #include "G4UIdirectory.hh" |
---|
| 38 | #include "G4UIcmdWithAString.hh" |
---|
| 39 | #include "G4UIcmdWithAnInteger.hh" |
---|
| 40 | #include "G4UIcmdWithADoubleAndUnit.hh" |
---|
| 41 | #include "G4UIcmdWithoutParameter.hh" |
---|
| 42 | |
---|
| 43 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 44 | |
---|
| 45 | NTSTDetectorMessenger::NTSTDetectorMessenger(NTSTDetectorConstruction * NTSTDet) |
---|
| 46 | :NTSTDetector(NTSTDet) |
---|
| 47 | { |
---|
| 48 | NTSTdetDir = new G4UIdirectory("/NTST/"); |
---|
| 49 | NTSTdetDir->SetGuidance("NTST detector control."); |
---|
| 50 | |
---|
| 51 | InputFileNameCmd = new G4UIcmdWithAString("/NTST/setInputFile", this); |
---|
| 52 | InputFileNameCmd->SetGuidance("Set input file name"); |
---|
| 53 | InputFileNameCmd->SetParameterName("File",true); |
---|
| 54 | InputFileNameCmd->SetDefaultValue("SVT.dat"); |
---|
| 55 | |
---|
| 56 | DisableDet = new G4UIcmdWithAString("/NTST/disable", this); |
---|
| 57 | DisableDet->SetGuidance("disable detetector"); |
---|
| 58 | DisableDet->SetCandidates("none SVT DCH all"); |
---|
| 59 | DisableDet->SetDefaultValue("none"); |
---|
| 60 | |
---|
| 61 | DebugCmd = new G4UIcmdWithAnInteger("/NTST/setDebug",this); |
---|
| 62 | DebugCmd->SetGuidance("Set debug flag."); |
---|
| 63 | DebugCmd->SetParameterName("Debug",true); |
---|
| 64 | |
---|
| 65 | NSubLayer = new G4UIcmdWithAnInteger("/NTST/setNSubLayer",this); |
---|
| 66 | NSubLayer->SetGuidance("Set the number of SVT sublayers."); |
---|
| 67 | NSubLayer->SetParameterName("NSubLay",true); |
---|
| 68 | NSubLayer->SetDefaultValue(7); |
---|
| 69 | NSubLayer->SetRange("NSubLay<8"); |
---|
| 70 | |
---|
| 71 | #if 0 |
---|
| 72 | MinimumDriverStep |
---|
| 73 | = new G4UIcmdWithADoubleAndUnit("/NTST/setOuterRadius",this); |
---|
| 74 | MinimumDriverStep->SetGuidance("Set Minimum Step for "); |
---|
| 75 | MinimumDriverStep->SetParameterName("MinimumStep",false,false); |
---|
| 76 | MinimumDriverStep->SetDefaultValue(0.1); |
---|
| 77 | MinimumDriverStep->SetDefaultUnit("mm"); |
---|
| 78 | MinimumDriverStep->SetRange("Radius>0."); |
---|
| 79 | #endif |
---|
| 80 | |
---|
| 81 | MotherOuterRadius |
---|
| 82 | = new G4UIcmdWithADoubleAndUnit("/NTST/setOuterRadius",this); |
---|
| 83 | MotherOuterRadius->SetGuidance("Set outer radius of the SVT mother volume"); |
---|
| 84 | MotherOuterRadius->SetParameterName("Radius",false,false); |
---|
| 85 | MotherOuterRadius->SetDefaultValue(19.); |
---|
| 86 | MotherOuterRadius->SetDefaultUnit("cm"); |
---|
| 87 | MotherOuterRadius->SetRange("Radius>0."); |
---|
| 88 | |
---|
| 89 | fieldStat = new G4UIcmdWithoutParameter("/NTST/getFieldStats",this); |
---|
| 90 | fieldStat->SetGuidance( "Return number calls to field routine" ); |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 94 | |
---|
| 95 | NTSTDetectorMessenger::~NTSTDetectorMessenger() |
---|
| 96 | { |
---|
| 97 | delete DebugCmd; delete MotherOuterRadius; |
---|
| 98 | delete NTSTdetDir; |
---|
| 99 | } |
---|
| 100 | |
---|
| 101 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 102 | |
---|
| 103 | void NTSTDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) |
---|
| 104 | { |
---|
| 105 | if( command == DebugCmd ) |
---|
| 106 | { NTSTDetector->SetDebugCmd(DebugCmd->GetNewIntValue(newValue));} |
---|
| 107 | |
---|
| 108 | if( command == MotherOuterRadius ) |
---|
| 109 | { NTSTDetector-> |
---|
| 110 | SetOuterRadius(MotherOuterRadius->GetNewDoubleValue(newValue));} |
---|
| 111 | |
---|
| 112 | if( command == NSubLayer ) |
---|
| 113 | { NTSTDetector-> |
---|
| 114 | SetNSubLayer(NSubLayer->GetNewIntValue(newValue));} |
---|
| 115 | |
---|
| 116 | if (command == fieldStat) NTSTDetector->GetFieldCallStats(); |
---|
| 117 | } |
---|
| 118 | |
---|
| 119 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|