Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
ML2MainMessenger.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 //
26 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 //*******************************************************//
42 
43 #include "ML2MainMessenger.hh"
44 #include "G4SystemOfUnits.hh"
45 
47 {
48 
49  CInputData=InData;
50  phaseSpaceCentre=new G4UIcmdWith3VectorAndUnit("/general/centrePhaseSpace", this);
53  phaseSpaceCentre->SetGuidance("position of the centre of the plane phase space");
55 
56  phaseSpaceHalfSize=new G4UIcmdWith3VectorAndUnit("/general/halfSizePhaseSpace", this);
59  phaseSpaceHalfSize->SetGuidance("half size of the plane phase space");
61 
62  bSavePhaseSpace=new G4UIcmdWithABool("/general/bSavePhaseSpace",this);
64  bSavePhaseSpace->SetGuidance("true if to save the phase space");
66 
67  bForcePhaseSpaceBeforeJaws=new G4UIcmdWithABool("/general/bForcePhaseSpaceBeforeJaws",this);
69  bForcePhaseSpaceBeforeJaws->SetGuidance("to automatically put the phase plane before the jaws");
71 
72  bStopAtPhaseSpace=new G4UIcmdWithABool("/general/bStopAtPhaseSpace",this);
74  bStopAtPhaseSpace->SetGuidance("true if to kill the particle at the phase space");
76 
77  bSaveROG=new G4UIcmdWithABool("/general/bSaveROG",this);
79  bSaveROG->SetGuidance("true if save the ROG volume");
80  CInputData->setbSaveROG(true);
81 
82  bOnlyVisio=new G4UIcmdWithABool("/OnlyVisio",this);
84  bOnlyVisio->SetGuidance("switch the visualization mode");
85  CInputData->setbOnlyVisio(false);
86 
87  ROGOutFile=new G4UIcmdWithAString("/general/ROGOutFile",this);
89  ROGOutFile->SetGuidance("full path of the ROG file name");
90  CInputData->setROGOutFile("defaultROGFile.txt");
91 
92  phaseSPaceOutFile=new G4UIcmdWithAString("/general/PhaseSpaceOutFile",this);
94  phaseSPaceOutFile->SetGuidance("full file name of the phase space");
96 
97  maxNumberOfEvents=new G4UIcmdWithAnInteger("/convergence/maxNumberOfEvents", this);
99  maxNumberOfEvents->SetGuidance(" maximum number of events at least in one experimental voxel");
101 
102  nMaxLoop=new G4UIcmdWithAnInteger("/convergence/nMaxLoop", this);
104  nMaxLoop->SetGuidance("it is used if /convergence/bCompareExp is false");
106 
107  bCompareExp=new G4UIcmdWithABool("/convergence/bCompareExp",this);
109  bCompareExp->SetGuidance("to compare the data with an experimental file data");
110  CInputData->setBCompareExp(false);
111 
112  fileExperimentalData=new G4UIcmdWithAString("/convergence/fileExperimentalData",this);
114  fileExperimentalData->SetGuidance("full path and name of the experimental file results");
116 
117  fileExperimentalDataOut=new G4UIcmdWithAString("/convergence/fileExperimentalDataOut",this);
119  fileExperimentalDataOut->SetGuidance("full path and name of the experimental file results");
121 
122  nBeam=new G4UIcmdWithAnInteger("/general/nBeam",this);
123  nBeam->SetDefaultValue(100);
124  nBeam->SetGuidance("number of events to run");
125  CInputData->setNBeams(100);
126 
127  nMaxParticlesInRamPlanePhaseSpace=new G4UIcmdWithAnInteger("/general/nMaxParticlesInRamPlanePhaseSpace",this);
129  nMaxParticlesInRamPlanePhaseSpace->SetGuidance("maximum particle number stored in RAM before saving - for phase space");
131 
132  saving_in_Selected_Voxels_every_events=new G4UIcmdWithAnInteger("/general/saving_in_Selected_Voxels_every_events",this);
134  saving_in_Selected_Voxels_every_events->SetGuidance("maximum particle number stored before saving - for experiemntal data comparison");
136 
137  saving_in_ROG_Voxels_every_events=new G4UIcmdWithAnInteger("/general/saving_in_ROG_Voxels_every_events",this);
139  saving_in_ROG_Voxels_every_events->SetGuidance("maximum particle number stored before saving - for ROG");
141 
142  max_N_particles_in_PhSp_File=new G4UIcmdWithAnInteger("/general/max_N_particles_in_PhSp_File",this);
144  max_N_particles_in_PhSp_File->SetGuidance("maximum particle number stored in the phase space file");
146 }
147 
149 {
153  delete phaseSpaceCentre;
154  delete phaseSpaceHalfSize;
155  delete phaseSPaceOutFile;
156  delete ROGOutFile;
157  delete bSavePhaseSpace;
159  delete bStopAtPhaseSpace;
160  delete bSaveROG;
161 
162  delete nBeam;
164 
165  delete maxNumberOfEvents;
166  delete bCompareExp;
167  delete bOnlyVisio;
168  delete fileExperimentalData;
170  delete nMaxLoop;
171 }
172 
174 {
175  if (cmd==nBeam)
176  {CInputData->setNBeams(nBeam->GetNewIntValue(newValue));}
177 
180 
183 
186 
189 
190  if (cmd==phaseSpaceCentre)
192 
193  if (cmd==phaseSpaceHalfSize)
194  {
196  }
197 
198  if (cmd==bOnlyVisio)
200 
203 
204  if (cmd==bSavePhaseSpace)
206 
207  if (cmd==bSaveROG)
209 
210  if (cmd==bStopAtPhaseSpace)
212 
213  if (cmd==phaseSPaceOutFile)
214  {CInputData->setPhaseSpaceOutFile(newValue);}
215 
216  if (cmd==ROGOutFile)
217  {CInputData->setROGOutFile(newValue);}
218 
219  if (cmd==maxNumberOfEvents)
221 
222  if (cmd==nMaxLoop)
224 
225  if (cmd==bCompareExp)
227 
228  if (cmd==fileExperimentalData)
229  {CInputData->setFileExperimentalData(newValue);}
230 
231  if (cmd==fileExperimentalDataOut)
233 }
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithABool * bSavePhaseSpace
void SetDefaultValue(G4ThreeVector defVal)
G4UIcmdWithAString * ROGOutFile
void setMaxNumberOfEvents(G4int val)
CLHEP::Hep3Vector G4ThreeVector
CML2MainMessenger(CML2CInputData *CInputData)
void setROGOutFile(G4String val)
G4UIcmdWithABool * bForcePhaseSpaceBeforeJaws
G4UIcmdWithAnInteger * saving_in_Selected_Voxels_every_events
static constexpr double mm
Definition: G4SIunits.hh:115
static G4ThreeVector GetNew3VectorRawValue(const char *paramString)
void setbSaveROG(G4bool val)
void SetDefaultValue(G4bool defVal)
void SetDefaultValue(G4int defVal)
void setNMaxParticlesInRamPlanePhaseSpace(G4int val)
G4UIcmdWithABool * bOnlyVisio
G4UIcmdWithAnInteger * nMaxLoop
G4UIcmdWithAString * fileExperimentalDataOut
void setPhaseSpaceHalfSize(G4ThreeVector val)
G4UIcmdWithABool * bCompareExp
void setNmaxLoop(G4int val)
void setSaving_in_ROG_Voxels_every_events(G4int val)
void setBCompareExp(G4bool val)
void SetDefaultValue(const char *defVal)
void setNBeams(G4int val)
G4UIcmdWithAnInteger * nBeam
static G4bool GetNewBoolValue(const char *paramString)
void setbStopAtPhaseSpace(G4bool val)
void setFileExperimentalData(G4String val)
G4UIcmdWith3VectorAndUnit * phaseSpaceHalfSize
G4UIcmdWithABool * bStopAtPhaseSpace
G4UIcmdWithAString * fileExperimentalData
void setMax_N_particles_in_PhSp_File(G4int val)
G4UIcmdWithAnInteger * max_N_particles_in_PhSp_File
void setbOnlyVisio(G4bool val)
void setPhaseSpaceOutFile(G4String val)
void setFileExperimentalDataOut(G4String val)
G4UIcmdWithABool * bSaveROG
static G4int GetNewIntValue(const char *paramString)
void setPhaseSpaceCentre(G4ThreeVector val)
G4UIcmdWithAnInteger * maxNumberOfEvents
G4UIcmdWith3VectorAndUnit * phaseSpaceCentre
void setbForcePhaseSpaceBeforeJaws(G4bool val)
G4UIcmdWithAnInteger * saving_in_ROG_Voxels_every_events
void SetDefaultUnit(const char *defUnit)
void setSaving_in_Selected_Voxels_every_events(G4int val)
CML2CInputData * CInputData
void setbSavePhaseSPace(G4bool val)
G4UIcmdWithAnInteger * nMaxParticlesInRamPlanePhaseSpace
void SetNewValue(G4UIcommand *cmd, G4String newValue)
G4UIcmdWithAString * phaseSPaceOutFile