Geant4  10.01
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 
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 {
140  mainDir->SetGuidance( "Cexmc settings." );
142  geometryDir->SetGuidance( "Geometry settings (gdml file etc.)" );
144  physicsDir->SetGuidance( "Physics related settings "
145  "(production model etc.)" );
147  gunDir->SetGuidance( "Gun settings (different FWHMs etc.)" );
149  detectorDir->SetGuidance( "Sensitive detectors settings" );
151  eventDir->SetGuidance( "Event settings (verbose level etc.)" );
153  runDir->SetGuidance( "Run settings (geometry file etc.)" );
155  monitorDir->SetGuidance( "Various settings for the monitor." );
157  targetDir->SetGuidance( "Various settings for the target." );
159  vetoCounterDir->SetGuidance( "Various settings for the veto counters." );
162  "\n Various settings for the left veto counter." );
165  "\n Various settings for the right veto counter." );
167  calorimeterDir->SetGuidance( "Various settings for the calorimeters." );
170  "\n Various settings for the left calorimeter." );
173  "\n Various settings for the right calorimeter." );
176  "\n Energy deposit settings in the monitor (thresholds etc.)" );
179  "\n Energy deposit settings in both veto counters "
180  "(thresholds etc.)" );
183  "\n Energy deposit settings in the left veto counter "
184  "(thresholds etc.)" );
187  "\n Energy deposit settings in the right veto counter "
188  "(thresholds etc.)" );
191  "\n Energy deposit settings in both calorimeters "
192  "(thresholds etc.)" );
195  "\n Energy deposit settings in the left calorimeter "
196  "(thresholds etc.)" );
199  "\n Energy deposit settings in the right calorimeter "
200  "(thresholds etc.)" );
202  reconstructorDir->SetGuidance( "Reconstructor settings" );
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 
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
G4UIdirectory * vetoCounterLeftDir
static G4String targetDirName
G4UIdirectory * calorimeterDir
static G4String vetoCounterEDDirName
static G4String vetoCounterRightDirName
G4UIdirectory * vetoCounterRightEDDir
static void Destroy(void)
const G4String CexmcDetectorTypeName[CexmcNumberOfDetectorTypes]
static G4String monitorEDDirName
static G4String detectorDirName
G4UIdirectory * eventDir
G4UIdirectory * vetoCounterDir
G4UIdirectory * visDir
static G4String vetoCounterDirName
static G4String calorimeterEDDirName
static G4String calorimeterRightEDDirName
G4UIdirectory * calorimeterRightDir
G4UIdirectory * geometryDir
G4UIdirectory * vetoCounterRightDir
static G4String mainDirName
G4UIdirectory * detectorDir
static G4String physicsDirName
static G4String runDirName
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
static G4String reconstructorDirName
G4UIdirectory * physicsDir
const G4String CexmcDetectorRoleName[CexmcNumberOfDetectorRoles]
G4UIdirectory * targetDir
static G4String calorimeterLeftEDDirName
G4UIdirectory * mainDir
G4UIdirectory * monitorDir
G4UIdirectory * calorimeterLeftEDDir
G4UIdirectory * calorimeterEDDir
static CexmcMessenger * instance
static G4String gunDirName
static G4String calorimeterLeftDirName
G4UIdirectory * reconstructorDir
G4UIdirectory * runDir
static G4String calorimeterRightDirName
G4UIdirectory * vetoCounterLeftEDDir
G4UIdirectory * calorimeterLeftDir
static G4String visDirName
static G4String monitorDirName
G4UIdirectory * gunDir
static CexmcMessenger * Instance(void)
static G4String vetoCounterRightEDDirName
G4UIdirectory * monitorEDDir
static G4String geometryDirName
G4UIdirectory * vetoCounterEDDir
static G4String eventDirName
static G4String vetoCounterLeftEDDirName
G4UIdirectory * calorimeterRightEDDir