Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcMessenger.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  * ============================================================================
28  *
29  * Filename: CexmcMessenger.cc
30  *
31  * Description: common messenger stuff (directories etc.)
32  *
33  * Version: 1.0
34  * Created: 15.11.2009 12:59:56
35  * Revision: none
36  * Compiler: gcc
37  *
38  * Author: Alexey Radkov (),
39  * Company: PNPI
40  *
41  * ============================================================================
42  */
43 
44 #include <G4UIdirectory.hh>
45 #include "CexmcMessenger.hh"
47 
48 
49 namespace
50 {
51  const G4String ed( CexmcDetectorTypeName[ CexmcEDDetector ] + "/" );
52 }
53 
54 
55 CexmcMessenger * CexmcMessenger::instance( NULL );
56 
59  "geometry/" );
61  "physics/" );
63  "gun/" );
65  "detector/" );
67  "event/" );
69  "run/" );
101  CexmcMessenger::mainDirName + "reconstructor/" );
103 #ifdef CEXMC_USE_ROOT
104 G4String CexmcMessenger::histoDirName(
105  CexmcMessenger::mainDirName + "histo/" );
106 #endif
107 
108 
110 {
111  if ( instance == NULL )
112  instance = new CexmcMessenger;
113 
114  return instance;
115 }
116 
117 
119 {
120  delete instance;
121  instance = NULL;
122 }
123 
124 
125 CexmcMessenger::CexmcMessenger() : mainDir( NULL ), geometryDir( NULL ),
126  physicsDir( NULL ), gunDir( NULL ), detectorDir( NULL ), eventDir( NULL ),
127  runDir( NULL ), monitorDir( NULL ), targetDir( NULL ),
128  vetoCounterDir( NULL ), vetoCounterLeftDir( NULL ),
129  vetoCounterRightDir( NULL ), calorimeterDir( NULL ),
130  calorimeterLeftDir( NULL ), calorimeterRightDir( NULL ),
131  monitorEDDir( NULL ), vetoCounterEDDir( NULL ),
132  vetoCounterLeftEDDir( NULL ), vetoCounterRightEDDir( NULL ),
133  calorimeterEDDir( NULL ), calorimeterLeftEDDir( NULL ),
134  calorimeterRightEDDir( NULL ), reconstructorDir( NULL ), visDir( NULL )
135 #ifdef CEXMC_USE_ROOT
136  ,histoDir( NULL )
137 #endif
138 {
139  mainDir = new G4UIdirectory( mainDirName );
140  mainDir->SetGuidance( "Cexmc settings." );
141  geometryDir = new G4UIdirectory( geometryDirName );
142  geometryDir->SetGuidance( "Geometry settings (gdml file etc.)" );
143  physicsDir = new G4UIdirectory( physicsDirName );
144  physicsDir->SetGuidance( "Physics related settings "
145  "(production model etc.)" );
146  gunDir = new G4UIdirectory( gunDirName );
147  gunDir->SetGuidance( "Gun settings (different FWHMs etc.)" );
148  detectorDir = new G4UIdirectory( detectorDirName );
149  detectorDir->SetGuidance( "Sensitive detectors settings" );
150  eventDir = new G4UIdirectory( eventDirName );
151  eventDir->SetGuidance( "Event settings (verbose level etc.)" );
152  runDir = new G4UIdirectory( runDirName );
153  runDir->SetGuidance( "Run settings (geometry file etc.)" );
154  monitorDir = new G4UIdirectory( monitorDirName );
155  monitorDir->SetGuidance( "Various settings for the monitor." );
156  targetDir = new G4UIdirectory( targetDirName );
157  targetDir->SetGuidance( "Various settings for the target." );
158  vetoCounterDir = new G4UIdirectory( vetoCounterDirName );
159  vetoCounterDir->SetGuidance( "Various settings for the veto counters." );
160  vetoCounterLeftDir = new G4UIdirectory( vetoCounterLeftDirName );
161  vetoCounterLeftDir->SetGuidance(
162  "\n Various settings for the left veto counter." );
163  vetoCounterRightDir = new G4UIdirectory( vetoCounterRightDirName );
164  vetoCounterRightDir->SetGuidance(
165  "\n Various settings for the right veto counter." );
166  calorimeterDir = new G4UIdirectory( calorimeterDirName );
167  calorimeterDir->SetGuidance( "Various settings for the calorimeters." );
168  calorimeterLeftDir = new G4UIdirectory( calorimeterLeftDirName );
169  calorimeterLeftDir->SetGuidance(
170  "\n Various settings for the left calorimeter." );
171  calorimeterRightDir = new G4UIdirectory( calorimeterRightDirName );
172  calorimeterRightDir->SetGuidance(
173  "\n Various settings for the right calorimeter." );
174  monitorEDDir = new G4UIdirectory( monitorEDDirName );
175  monitorEDDir->SetGuidance(
176  "\n Energy deposit settings in the monitor (thresholds etc.)" );
177  vetoCounterEDDir = new G4UIdirectory( vetoCounterEDDirName );
178  vetoCounterEDDir->SetGuidance(
179  "\n Energy deposit settings in both veto counters "
180  "(thresholds etc.)" );
181  vetoCounterLeftEDDir = new G4UIdirectory( vetoCounterLeftEDDirName );
182  vetoCounterLeftEDDir->SetGuidance(
183  "\n Energy deposit settings in the left veto counter "
184  "(thresholds etc.)" );
185  vetoCounterRightEDDir = new G4UIdirectory( vetoCounterRightEDDirName );
186  vetoCounterRightEDDir->SetGuidance(
187  "\n Energy deposit settings in the right veto counter "
188  "(thresholds etc.)" );
189  calorimeterEDDir = new G4UIdirectory( calorimeterEDDirName );
190  calorimeterEDDir->SetGuidance(
191  "\n Energy deposit settings in both calorimeters "
192  "(thresholds etc.)" );
193  calorimeterLeftEDDir = new G4UIdirectory( calorimeterLeftEDDirName );
194  calorimeterLeftEDDir->SetGuidance(
195  "\n Energy deposit settings in the left calorimeter "
196  "(thresholds etc.)" );
197  calorimeterRightEDDir = new G4UIdirectory( calorimeterRightEDDirName );
198  calorimeterRightEDDir->SetGuidance(
199  "\n Energy deposit settings in the right calorimeter "
200  "(thresholds etc.)" );
201  reconstructorDir = new G4UIdirectory( reconstructorDirName );
202  reconstructorDir->SetGuidance( "Reconstructor settings" );
203  visDir = new G4UIdirectory( visDirName );
204  visDir->SetGuidance( "Visualization settings" );
205 #ifdef CEXMC_USE_ROOT
206  histoDir = new G4UIdirectory( histoDirName );
207  histoDir->SetGuidance( "Commands to list and show histograms" );
208 #endif
209 }
210 
211 
212 CexmcMessenger::~CexmcMessenger()
213 {
214  delete mainDir;
215  delete geometryDir;
216  delete physicsDir;
217  delete gunDir;
218  delete detectorDir;
219  delete eventDir;
220  delete runDir;
221  delete monitorDir;
222  delete targetDir;
223  delete vetoCounterDir;
224  delete vetoCounterLeftDir;
225  delete vetoCounterRightDir;
226  delete calorimeterDir;
227  delete calorimeterLeftDir;
228  delete calorimeterRightDir;
229  delete monitorEDDir;
230  delete vetoCounterEDDir;
231  delete vetoCounterLeftEDDir;
232  delete vetoCounterRightEDDir;
233  delete calorimeterEDDir;
234  delete calorimeterLeftEDDir;
235  delete calorimeterRightEDDir;
236  delete reconstructorDir;
237  delete visDir;
238 #ifdef CEXMC_USE_ROOT
239  delete histoDir;
240 #endif
241 }
242 
static G4String vetoCounterLeftDirName
static G4String calorimeterDirName
static G4String targetDirName
static G4String vetoCounterEDDirName
static G4String vetoCounterRightDirName
static void Destroy(void)
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
static G4String monitorEDDirName
static G4String detectorDirName
static G4String vetoCounterDirName
static G4String calorimeterEDDirName
static G4String calorimeterRightEDDirName
static G4String mainDirName
static G4String physicsDirName
static G4String runDirName
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
static G4String reconstructorDirName
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
static G4String calorimeterLeftEDDirName
static G4String gunDirName
static G4String calorimeterLeftDirName
static G4String calorimeterRightDirName
static G4String visDirName
static G4String monitorDirName
static CexmcMessenger * Instance(void)
static G4String vetoCounterRightEDDirName
static G4String geometryDirName
static G4String eventDirName
static G4String vetoCounterLeftEDDirName