Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayFluoAnalysisMessenger.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 //
27 // $Id: XrayFluoAnalysisMessenger.cc
28 // GEANT4 tag $Name: xray_fluo-V03-02-00
29 //
30 // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
31 //
32 // History:
33 // -----------
34 // 28 Nov 2001 Elena Guardincerri Created
35 //
36 // -------------------------------------------------------------------
37 
38 #ifdef G4ANALYSIS_USE
40 
41 
42 
43 
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
46 
47 XrayFluoAnalysisMessenger::XrayFluoAnalysisMessenger(XrayFluoAnalysisManager* analysisManager)
48  :xrayFluoAnalysis(analysisManager)
49 
50 {
51  XrayFluoAnalysisDir = new G4UIdirectory("/analysis/");
52  XrayFluoAnalysisDir->SetGuidance("analysis control.");
53 
54  outputFileCommand = new G4UIcmdWithAString("/analysis/outputFile",this);
55  outputFileCommand->SetGuidance("specify the name of the output file (lowercase if paw will be used)");
56  outputFileCommand->SetGuidance("command /analysis/update MUST be used after this command");
57  outputFileCommand->SetParameterName("choice",true);
58  outputFileCommand->SetDefaultValue("xrayfluo.hbk");
59  outputFileCommand->AvailableForStates(G4State_Idle);
60 
61  outputFileType = new G4UIcmdWithAString("/analysis/fileType",this);
62  outputFileType->SetGuidance("specify the type of the output file");
63  outputFileType->SetGuidance("command /analysis/update MUST be used after this command");
64  outputFileType->SetParameterName("choice",true);
65  outputFileType->SetDefaultValue("hbook");
66  outputFileType->SetCandidates("hbook xml");
67  outputFileType->AvailableForStates(G4State_Idle);
68 
69  persistencyUpdateCommand = new G4UIcmdWithoutParameter("/analysis/update",this);
70  outputFileCommand->SetGuidance("Update persistency file");
71  outputFileCommand->SetGuidance("This command MUST be used after outputFile or outputFileType commands");
72  outputFileCommand->AvailableForStates(G4State_Idle);
73 
74  physicFlagCmd = new G4UIcmdWithABool("/analysis/setPhysicProduction",this);
75  physicFlagCmd->SetGuidance("Select if data stored in the Pahse-Space must contain physical data or particles exiting the sample");
76  physicFlagCmd->SetGuidance("To be used before and togheter with /gun/loadGunData");
77  physicFlagCmd->SetParameterName("Physyc Flag",true);
78  physicFlagCmd->SetDefaultValue(false);
79  physicFlagCmd->AvailableForStates(G4State_Idle);
80 
81 }
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83 
84 XrayFluoAnalysisMessenger::~XrayFluoAnalysisMessenger()
85 {
86 
87  delete XrayFluoAnalysisDir;
88 
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
93 void XrayFluoAnalysisMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
94 {
95 
96  if(command == outputFileCommand)
97  {
98  if ((xrayFluoAnalysis->GetDeletePersistencyFileFlag())) remove("xrayfluo.hbk");
99  xrayFluoAnalysis->SetOutputFileName(newValue);
100  }
101 
102  else if (command == persistencyUpdateCommand)
103  {xrayFluoAnalysis->CreatePersistency();}
104 
105  else if(command == outputFileType)
106  {
107  if (xrayFluoAnalysis->GetDeletePersistencyFileFlag()) remove("xrayfluo.hbk");
108  xrayFluoAnalysis->SetOutputFileType(newValue);
109  }
110  if( command == physicFlagCmd )
111  {
112  G4bool newPhysFlag = physicFlagCmd->GetNewBoolValue(newValue);
113  xrayFluoAnalysis->SetPhysicFlag(newPhysFlag);
114  }
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
118 
119 #endif
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132