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] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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"
 46 #include "CexmcSensitiveDetectorsAttributes.hh"
 47 
 48 
 49 namespace
 50 {
 51     const G4String  ed( CexmcDetectorTypeName[ CexmcEDDetector ] + "/" );
 52 }
 53 
 54 
 55 CexmcMessenger *  CexmcMessenger::instance( NULL );
 56 
 57 G4String  CexmcMessenger::mainDirName( "/cexmc/" );
 58 G4String  CexmcMessenger::geometryDirName( CexmcMessenger::mainDirName +
 59                                            "geometry/" );
 60 G4String  CexmcMessenger::physicsDirName( CexmcMessenger::mainDirName +
 61                                            "physics/" );
 62 G4String  CexmcMessenger::gunDirName( CexmcMessenger::mainDirName +
 63                                            "gun/" );
 64 G4String  CexmcMessenger::detectorDirName( CexmcMessenger::mainDirName +
 65                                            "detector/" );
 66 G4String  CexmcMessenger::eventDirName( CexmcMessenger::mainDirName +
 67                                            "event/" );
 68 G4String  CexmcMessenger::runDirName( CexmcMessenger::mainDirName +
 69                                            "run/" );
 70 G4String  CexmcMessenger::monitorDirName( CexmcMessenger::detectorDirName +
 71                CexmcDetectorRoleName[ CexmcMonitorDetectorRole ] + "/" );
 72 G4String  CexmcMessenger::targetDirName( CexmcMessenger::detectorDirName +
 73                CexmcDetectorRoleName[ CexmcTargetDetectorRole ] + "/" );
 74 G4String  CexmcMessenger::vetoCounterDirName( CexmcMessenger::detectorDirName +
 75                CexmcDetectorRoleName[ CexmcVetoCounterDetectorRole ] + "/" );
 76 G4String  CexmcMessenger::vetoCounterLeftDirName(
 77                             CexmcMessenger::vetoCounterDirName + "left/" );
 78 G4String  CexmcMessenger::vetoCounterRightDirName(
 79                             CexmcMessenger::vetoCounterDirName + "right/" );
 80 G4String  CexmcMessenger::calorimeterDirName( CexmcMessenger::detectorDirName +
 81                CexmcDetectorRoleName[ CexmcCalorimeterDetectorRole ] + "/" );
 82 G4String  CexmcMessenger::calorimeterLeftDirName(
 83                             CexmcMessenger::calorimeterDirName + "left/" );
 84 G4String  CexmcMessenger::calorimeterRightDirName(
 85                             CexmcMessenger::calorimeterDirName + "right/" );
 86 G4String  CexmcMessenger::monitorEDDirName(
 87                             CexmcMessenger::monitorDirName + ed );
 88 G4String  CexmcMessenger::vetoCounterEDDirName(
 89                             CexmcMessenger::vetoCounterDirName + ed );
 90 G4String  CexmcMessenger::vetoCounterLeftEDDirName(
 91                             CexmcMessenger::vetoCounterLeftDirName + ed );
 92 G4String  CexmcMessenger::vetoCounterRightEDDirName(
 93                             CexmcMessenger::vetoCounterRightDirName + ed );
 94 G4String  CexmcMessenger::calorimeterEDDirName(
 95                             CexmcMessenger::calorimeterDirName + ed );
 96 G4String  CexmcMessenger::calorimeterLeftEDDirName(
 97                             CexmcMessenger::calorimeterLeftDirName + ed );
 98 G4String  CexmcMessenger::calorimeterRightEDDirName(
 99                             CexmcMessenger::calorimeterRightDirName + ed );
100 G4String  CexmcMessenger::reconstructorDirName(
101                             CexmcMessenger::mainDirName + "reconstructor/" );
102 G4String  CexmcMessenger::visDirName( CexmcMessenger::mainDirName + "vis/" );
103 #ifdef CEXMC_USE_ROOT
104 G4String  CexmcMessenger::histoDirName(
105                             CexmcMessenger::mainDirName + "histo/" );
106 #endif
107 
108 
109 CexmcMessenger *  CexmcMessenger::Instance( void )
110 {
111     if ( instance == NULL )
112         instance = new CexmcMessenger;
113 
114     return instance;
115 }
116 
117 
118 void  CexmcMessenger::Destroy( void )
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 
243