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4.p3 ] [ 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 ]

Diff markup

Differences between /examples/advanced/ChargeExchangeMC/src/CexmcRunManagerMessenger.cc (Version 11.3.0) and /examples/advanced/ChargeExchangeMC/src/CexmcRunManagerMessenger.cc (Version 4.0.p2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 /*                                                
 27  * ===========================================    
 28  *                                                
 29  *       Filename:  CexmcRunManagerMessenger.c    
 30  *                                                
 31  *    Description:  init parameters (productio    
 32  *                                                
 33  *        Version:  1.0                           
 34  *        Created:  03.11.2009 20:45:11           
 35  *       Revision:  none                          
 36  *       Compiler:  gcc                           
 37  *                                                
 38  *         Author:  Alexey Radkov (),             
 39  *        Company:  PNPI                          
 40  *                                                
 41  * ===========================================    
 42  */                                               
 43                                                   
 44 #include <G4UIcmdWithAString.hh>                  
 45 #include <G4UIcmdWithAnInteger.hh>                
 46 #include <G4UIcmdWithABool.hh>                    
 47 #include <G4UIcmdWithoutParameter.hh>             
 48 #include "CexmcRunManager.hh"                     
 49 #include "CexmcRunManagerMessenger.hh"            
 50 #include "CexmcMessenger.hh"                      
 51                                                   
 52                                                   
 53 CexmcRunManagerMessenger::CexmcRunManagerMesse    
 54                                 CexmcRunManage    
 55     runManager( runManager_ ), setProductionMo    
 56     setGuiMacro( NULL ), setEventCountPolicy(     
 57     setEventDataVerboseLevel( NULL ),             
 58 #ifdef CEXMC_USE_PERSISTENCY                      
 59     replayEvents( NULL ), seekTo( NULL ), skip    
 60 #endif                                            
 61     registerScenePrimitives( NULL ), validateG    
 62 {                                                 
 63     setProductionModel = new G4UIcmdWithAStrin    
 64         ( CexmcMessenger::physicsDirName + "pr    
 65     setProductionModel->SetGuidance( "Set prod    
 66     setProductionModel->SetParameterName( "Pro    
 67     setProductionModel->SetCandidates( "pi0 et    
 68     setProductionModel->AvailableForStates( G4    
 69                                                   
 70     setGdmlFile = new G4UIcmdWithAString(         
 71         ( CexmcMessenger::geometryDirName + "g    
 72     setGdmlFile->SetGuidance( "GDML file to re    
 73     setGdmlFile->SetParameterName( "GdmlFile",    
 74     setGdmlFile->AvailableForStates( G4State_P    
 75                                                   
 76     setGuiMacro = new G4UIcmdWithAString(         
 77         ( CexmcMessenger::runDirName + "guiMac    
 78     setGuiMacro->SetGuidance( "Set Gui macro f    
 79     setGuiMacro->SetParameterName( "GuiMacro",    
 80     setGuiMacro->AvailableForStates( G4State_P    
 81                                                   
 82     setEventCountPolicy = new G4UIcmdWithAStri    
 83         ( CexmcMessenger::runDirName + "eventC    
 84     setEventCountPolicy->SetGuidance( "How num    
 85             "    all - all events are accounte    
 86             "    interaction - events with stu    
 87             "    trigger - only events with tr    
 88     setEventCountPolicy->SetParameterName( "Ev    
 89     setEventCountPolicy->SetCandidates( "all i    
 90     setEventCountPolicy->SetDefaultValue( "all    
 91     setEventCountPolicy->AvailableForStates( G    
 92                                                   
 93     setEventDataVerboseLevel = new G4UIcmdWith    
 94         ( CexmcMessenger::runDirName + "eventD    
 95         this );                                   
 96     setEventDataVerboseLevel->SetGuidance( "Wh    
 97             "    nosave - never,\n"               
 98             "    trigger - when energy deposit    
 99             "    interaction - when studied in    
100     setEventDataVerboseLevel->SetParameterName    
101                                                   
102     setEventDataVerboseLevel->SetCandidates( "    
103     setEventDataVerboseLevel->SetDefaultValue(    
104     setEventDataVerboseLevel->AvailableForStat    
105                                                   
106                                                   
107 #ifdef CEXMC_USE_PERSISTENCY                      
108     replayEvents = new G4UIcmdWithAnInteger(      
109         ( CexmcMessenger::runDirName + "replay    
110     replayEvents->SetGuidance( "Replay specifi    
111            "\n    (available only if a project    
112            "\n    If number of events is 0 (or    
113            "\n    run will be replayed" );        
114     replayEvents->SetParameterName( "ReplayEve    
115     replayEvents->SetRange( "ReplayEvents >= 0    
116     replayEvents->SetDefaultValue( 0 );           
117     replayEvents->AvailableForStates( G4State_    
118                                                   
119     seekTo = new G4UIcmdWithAnInteger(            
120         ( CexmcMessenger::runDirName + "seekto    
121     seekTo->SetGuidance( "Seek to specified ev    
122            "(available only if a project is re    
123            "\n    'seekto 0' brings to the sta    
124            "\n    first recorded event with in    
125            "\n    event with trigger" );          
126     seekTo->SetParameterName( "SeekTo", false     
127     seekTo->SetRange( "SeekTo >= 0" );            
128     seekTo->SetDefaultValue( 0 );                 
129     seekTo->AvailableForStates( G4State_PreIni    
130                                                   
131     skipInteractionsWithoutEDT = new G4UIcmdWi    
132         ( CexmcMessenger::runDirName + "skipIn    
133         this );                                   
134     skipInteractionsWithoutEDT->SetGuidance( "    
135         ".fdb file\n    if event was not trigg    
136         "project is read and then\n    written    
137         "event data verbose level is\n    'tri    
138     skipInteractionsWithoutEDT->SetParameterNa    
139                                                   
140     skipInteractionsWithoutEDT->SetDefaultValu    
141     skipInteractionsWithoutEDT->AvailableForSt    
142                                                   
143 #endif                                            
144                                                   
145     registerScenePrimitives = new G4UIcmdWitho    
146         ( CexmcMessenger::visDirName + "regist    
147         this );                                   
148     registerScenePrimitives->SetGuidance( "Reg    
149         "(radial lines,\n    inner crystals hi    
150     registerScenePrimitives->AvailableForState    
151                                                   
152                                                   
153     validateGdmlFile = new G4UIcmdWithABool(      
154         ( CexmcMessenger::geometryDirName + "v    
155         this );                                   
156     validateGdmlFile->SetGuidance( "If GDML fi    
157     validateGdmlFile->SetParameterName( "Valid    
158     validateGdmlFile->SetDefaultValue( false )    
159     validateGdmlFile->AvailableForStates( G4St    
160 }                                                 
161                                                   
162                                                   
163 CexmcRunManagerMessenger::~CexmcRunManagerMess    
164 {                                                 
165     delete setProductionModel;                    
166     delete setGdmlFile;                           
167     delete setGuiMacro;                           
168     delete setEventCountPolicy;                   
169     delete setEventDataVerboseLevel;              
170 #ifdef CEXMC_USE_PERSISTENCY                      
171     delete replayEvents;                          
172     delete seekTo;                                
173     delete skipInteractionsWithoutEDT;            
174 #endif                                            
175     delete registerScenePrimitives;               
176     delete validateGdmlFile;                      
177 }                                                 
178                                                   
179                                                   
180 void  CexmcRunManagerMessenger::SetNewValue( G    
181                                              G    
182 {                                                 
183     do                                            
184     {                                             
185         if ( cmd == setProductionModel )          
186         {                                         
187             CexmcProductionModelType  producti    
188                                                   
189             do                                    
190             {                                     
191                 if ( value == "pi0" )             
192                 {                                 
193                     productionModelType = Cexm    
194                     break;                        
195                 }                                 
196                 if ( value == "eta" )             
197                 {                                 
198                     productionModelType = Cexm    
199                     break;                        
200                 }                                 
201             } while ( false );                    
202             runManager->SetProductionModelType    
203             break;                                
204         }                                         
205         if ( cmd == setGdmlFile )                 
206         {                                         
207             runManager->SetGdmlFileName( value    
208             break;                                
209         }                                         
210         if ( cmd == setGuiMacro )                 
211         {                                         
212             runManager->SetGuiMacroName( value    
213             break;                                
214         }                                         
215         if ( cmd == setEventCountPolicy )         
216         {                                         
217             CexmcEventCountPolicy  eventCountP    
218             do                                    
219             {                                     
220                 if ( value == "interaction" )     
221                 {                                 
222                     eventCountPolicy = CexmcCo    
223                     break;                        
224                 }                                 
225                 if ( value == "trigger" )         
226                 {                                 
227                     eventCountPolicy = CexmcCo    
228                     break;                        
229                 }                                 
230             } while ( false );                    
231             runManager->SetEventCountPolicy( e    
232             break;                                
233         }                                         
234         if ( cmd == setEventDataVerboseLevel )    
235         {                                         
236             CexmcEventDataVerboseLevel  eventD    
237                                                   
238             do                                    
239             {                                     
240                 if ( value == "nosave" )          
241                 {                                 
242                     eventDataVerboseLevel = Ce    
243                     break;                        
244                 }                                 
245                 if ( value == "trigger" )         
246                 {                                 
247                     eventDataVerboseLevel = Ce    
248                     break;                        
249                 }                                 
250                 if ( value == "interaction" )     
251                 {                                 
252                     eventDataVerboseLevel = Ce    
253                     break;                        
254                 }                                 
255             } while ( false );                    
256             runManager->SetEventDataVerboseLev    
257             break;                                
258         }                                         
259 #ifdef CEXMC_USE_PERSISTENCY                      
260         if ( cmd == replayEvents )                
261         {                                         
262             runManager->ReplayEvents(             
263                                 G4UIcmdWithAnI    
264             break;                                
265         }                                         
266         if ( cmd == seekTo )                      
267         {                                         
268             runManager->SeekTo( G4UIcmdWithAnI    
269             break;                                
270         }                                         
271         if ( cmd == skipInteractionsWithoutEDT    
272         {                                         
273             runManager->SkipInteractionsWithou    
274                                 G4UIcmdWithABo    
275             break;                                
276         }                                         
277 #endif                                            
278         if ( cmd == registerScenePrimitives )     
279         {                                         
280             runManager->RegisterScenePrimitive    
281             break;                                
282         }                                         
283         if ( cmd == validateGdmlFile )            
284         {                                         
285             runManager->SetGdmlFileValidation(    
286                                 G4UIcmdWithABo    
287             break;                                
288         }                                         
289     } while ( false );                            
290 }                                                 
291                                                   
292