Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
TrackingMessenger.cc
이 파일의 문서화 페이지로 가기
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 //
28 //
29 // $Id: TrackingMessenger.cc 98257 2016-07-04 17:39:46Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "TrackingMessenger.hh"
35 #include "TrackingAction.hh"
36 
37 #include "G4UIcmdWithABool.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UIparameter.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44 :G4UImessenger(),
45  fTrackingAction(trackA),fTrackingCmd(0),fTimeWindowCmd(0)
46 {
47  fTrackingCmd = new G4UIcmdWithABool("/rdecay01/fullChain",this);
48  fTrackingCmd->SetGuidance("allow full decay chain");
49  fTrackingCmd->SetParameterName("flag",true);
51 
52  fTimeWindowCmd = new G4UIcommand("/rdecay01/timeWindow",this);
53  fTimeWindowCmd->SetGuidance("set time window to survey activity per nuclide");
54  fTimeWindowCmd->SetGuidance(" t1, delta_t");
55  //
56  G4UIparameter* t1Prm = new G4UIparameter("t1",'d',false);
57  t1Prm->SetGuidance("time_1");
58  t1Prm->SetParameterRange("t1>0.");
60  //
61  G4UIparameter* unit1Prm = new G4UIparameter("unit1",'s',false);
62  unit1Prm->SetGuidance("unit of t1");
64  unit1Prm->SetParameterCandidates(unitList);
65  fTimeWindowCmd->SetParameter(unit1Prm);
66  //
67  G4UIparameter* dtPrm = new G4UIparameter("dt",'d',false);
68  dtPrm->SetGuidance("delta_t");
69  dtPrm->SetParameterRange("dt>0.");
71  //
72  G4UIparameter* unit2Prm = new G4UIparameter("unit2",'s',false);
73  unit2Prm->SetGuidance("unit of dt");
74  unit2Prm->SetParameterCandidates(unitList);
75  fTimeWindowCmd->SetParameter(unit2Prm);
76  //
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  delete fTrackingCmd;
85  delete fTimeWindowCmd;
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
92  if (command == fTrackingCmd)
94 
95  if (command == fTimeWindowCmd)
96  {
97  G4double t1; G4double dt;
98  G4String unt1, unt2;
99  std::istringstream is(newValue);
100  is >> t1 >> unt1 >> dt >> unt2;
101  t1 *= G4UIcommand::ValueOf(unt1);
102  dt *= G4UIcommand::ValueOf(unt2);
103  fTrackingAction->SetTimeWindow (t1, dt);
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:311
static G4String CategoryOf(const char *unitName)
Definition: G4UIcommand.cc:318
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
TTree * t1
Definition: plottest35.C:26
void SetDefaultValue(G4bool defVal)
G4UIcmdWithABool * fTrackingCmd
virtual void SetNewValue(G4UIcommand *, G4String)
void SetGuidance(const char *theGuidance)
G4UIcommand * fTimeWindowCmd
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterRange(const char *theRange)
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
TrackingMessenger(TrackingAction *)
double G4double
Definition: G4Types.hh:76
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4String UnitsList(const char *unitCategory)
Definition: G4UIcommand.cc:323
TrackingAction * fTrackingAction
void SetParameterCandidates(const char *theString)
Definition of the TrackingMessenger class.
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242