Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GammaRayTelAnalysisMessenger.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$
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class implementation file
31 // CERN Geneva Switzerland
32 //
33 //
34 // ------------ GammaRayTelAnalysisMessenger ------
35 // by R.Giannitrapani, F.Longo & G.Santin (03 dic 2000)
36 // 20.11.01 G.Santin: modified according to the new GammaRayTelAnalysis.cc
37 // ************************************************************
38 #ifdef G4ANALYSIS_USE
39 
40 #include "G4UIdirectory.hh"
41 #include "G4UIcmdWithAString.hh"
42 
44 #include "GammaRayTelAnalysis.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47 
48 GammaRayTelAnalysisMessenger::GammaRayTelAnalysisMessenger(GammaRayTelAnalysis* analysis)
49  :gammaRayTelAnalysis(analysis)
50 
51 {
52  gammaRayTelAnalysisDir = new G4UIdirectory("/analysis/");
53  gammaRayTelAnalysisDir->SetGuidance("GammaRayTel analysis control.");
54 
55  /*
56  Commands for the 1D histograms (energy deposition in the last
57  TKR layer and hits distribution along the TKR)
58 
59  The Draw command gives the possibility to draw the 1d histograms
60  at every event.
61 
62  The Save command gives the possibility to save the 1d histograms in
63  two separate PostScript files at the end of the run.
64  */
65 
66  Histo1DDrawCmd = new G4UIcmdWithAString("/analysis/histo1dDraw",this);
67  Histo1DDrawCmd->SetGuidance("Enable the drawing of the 1d histograms every event.");
68  Histo1DDrawCmd->SetGuidance("Choice: disable, enable(default)");
69  Histo1DDrawCmd->SetParameterName("choice",true);
70  Histo1DDrawCmd->SetDefaultValue("ebable");
71  Histo1DDrawCmd->SetCandidates("disable enable");
72  Histo1DDrawCmd->AvailableForStates(G4State_Idle);
73 
74  Histo1DSaveCmd = new G4UIcmdWithAString("/analysis/histo1dSave",this);
75  Histo1DSaveCmd->SetGuidance("Enable the saving of the 1d histograms every run.");
76  Histo1DSaveCmd->SetGuidance("Choice: disable, enable(default)");
77  Histo1DSaveCmd->SetParameterName("choice",true);
78  Histo1DSaveCmd->SetDefaultValue("enable");
79  Histo1DSaveCmd->SetCandidates("disable enable");
80  Histo1DSaveCmd->AvailableForStates(G4State_Idle);
81 
82  /*
83  Commands for the 2D histograms (hits positions along the TKR)
84 
85  The Draw command gives the possibility to draw the 1d histograms
86  at every event.
87 
88  The Save command gives the possibility to save the 1d histograms in
89  two separate PostScript files at the end of the run.
90 
91  Moreover there is the possibility to set the 2d histograms so
92  that the info stored are true position ((x,z) or (y,z)
93  coordinates with respect to the payload reference frame in mm) or
94  the number of the Strip and the number of the Plane in which the
95  hit occur. To note that this feature is just for visualization
96  purpouse since both the information are saved in the external ASCII
97  file.
98  */
99  Histo2DDrawCmd = new G4UIcmdWithAString("/analysis/histo2dDraw",this);
100  Histo2DDrawCmd->SetGuidance("Enable the drawing of the 2d histograms every events.");
101  Histo2DDrawCmd->SetGuidance("Choice: disable, enable(default)");
102  Histo2DDrawCmd->SetParameterName("choice",true);
103  Histo2DDrawCmd->SetDefaultValue("enable");
104  Histo2DDrawCmd->SetCandidates("disable enable");
105  Histo2DDrawCmd->AvailableForStates(G4State_Idle);
106 
107  Histo2DSaveCmd = new G4UIcmdWithAString("/analysis/histo2dSave",this);
108  Histo2DSaveCmd->SetGuidance("Enable the saving of the 2d histograms every run.");
109  Histo2DSaveCmd->SetGuidance("Choice: disable, enable(default)");
110  Histo2DSaveCmd->SetParameterName("choice",true);
111  Histo2DSaveCmd->SetDefaultValue("enable");
112  Histo2DSaveCmd->SetCandidates("disable enable");
113  Histo2DSaveCmd->AvailableForStates(G4State_Idle);
114 
115  Histo2DModeCmd = new G4UIcmdWithAString("/analysis/histo2dMode",this);
116  Histo2DModeCmd->SetGuidance("Select the mode for the 2d histograms.");
117  Histo2DModeCmd->SetGuidance("Choice: position, strip(default)");
118  Histo2DModeCmd->SetGuidance("position -> the histo is filled with true positions in mm");
119  Histo2DModeCmd->SetGuidance("strip -> the histo is filled with the number of the strip and the plane");
120  Histo2DModeCmd->SetParameterName("choice",true);
121  Histo2DModeCmd->SetDefaultValue("strip");
122  Histo2DModeCmd->SetCandidates("position strip");
123  Histo2DModeCmd->AvailableForStates(G4State_Idle);
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
127 
128 GammaRayTelAnalysisMessenger::~GammaRayTelAnalysisMessenger()
129 {
130  delete Histo1DDrawCmd;
131  delete Histo1DSaveCmd;
132  delete Histo2DDrawCmd;
133  delete Histo2DSaveCmd;
134  delete Histo2DModeCmd;
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
138 
139 void GammaRayTelAnalysisMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
140 {
141 
142  // 1D Histograms
143 
144  if( command == Histo1DDrawCmd )
145  { gammaRayTelAnalysis->SetHisto1DDraw(newValue);}
146 
147  if( command == Histo1DSaveCmd )
148  { gammaRayTelAnalysis->SetHisto1DSave(newValue);}
149 
150  // 2D Histograms
151 
152  if( command == Histo2DDrawCmd )
153  { gammaRayTelAnalysis->SetHisto2DDraw(newValue);}
154 
155  if( command == Histo2DSaveCmd )
156  { gammaRayTelAnalysis->SetHisto2DSave(newValue);}
157 
158  if( command == Histo2DModeCmd )
159  { gammaRayTelAnalysis->SetHisto2DMode(newValue);}
160 
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
164 #endif
165 
166 
167 
168 
169