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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 ]

Diff markup

Differences between /examples/advanced/stim_pixe_tomography/src/DetectorMessenger.cc (Version 11.3.0) and /examples/advanced/stim_pixe_tomography/src/DetectorMessenger.cc (Version ReleaseNotes)


** Warning: Cannot open xref database.

  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 //....oooOO0OOooo........oooOO0OOooo........oo    
 29 //....oooOO0OOooo........oooOO0OOooo........oo    
 30                                                   
 31 #include "DetectorMessenger.hh"                   
 32                                                   
 33 #include "G4UIcmdWithADoubleAndUnit.hh"           
 34 #include "G4UIcmdWithAString.hh"                  
 35 #include "G4UIcmdWithAnInteger.hh"                
 36 #include "G4UIdirectory.hh"                       
 37                                                   
 38 #include "DetectorConstruction.hh"                
 39                                                   
 40 //....oooOO0OOooo........oooOO0OOooo........oo    
 41                                                   
 42 DetectorMessenger::DetectorMessenger(DetectorC    
 43   : G4UImessenger(),                              
 44     fDetector(Det),                               
 45     fTomoDir(nullptr),                            
 46     fDetDir(nullptr),                             
 47     fAbsMaterCmd(nullptr),                        
 48     fAbsThickCmd(nullptr),                        
 49     fAbsSizYZCmd(nullptr),                        
 50     fAbsXposCmd(nullptr),                         
 51     fWorldMaterCmd(nullptr),                      
 52     fWorldXCmd(nullptr),                          
 53     fWorldYZCmd(nullptr),                         
 54     fPhantomType(nullptr)                         
 55 {                                                 
 56   fTomoDir = new G4UIdirectory("/tomography/")    
 57   fTomoDir->SetGuidance("UI commands specific     
 58                                                   
 59   fDetDir = new G4UIdirectory("/tomography/det    
 60   fDetDir->SetGuidance("detector construction     
 61                                                   
 62   fAbsMaterCmd = new G4UIcmdWithAString("/tomo    
 63   fAbsMaterCmd->SetGuidance("Select Material o    
 64   fAbsMaterCmd->SetParameterName("choice", fal    
 65   fAbsMaterCmd->AvailableForStates(G4State_Pre    
 66   fAbsMaterCmd->SetToBeBroadcasted(false);        
 67                                                   
 68   fWorldMaterCmd = new G4UIcmdWithAString("/to    
 69   fWorldMaterCmd->SetGuidance("Select Material    
 70   fWorldMaterCmd->SetParameterName("wchoice",     
 71   fWorldMaterCmd->AvailableForStates(G4State_P    
 72   fWorldMaterCmd->SetToBeBroadcasted(false);      
 73                                                   
 74   fAbsThickCmd = new G4UIcmdWithADoubleAndUnit    
 75   fAbsThickCmd->SetGuidance("Set Thickness of     
 76   fAbsThickCmd->SetParameterName("SizeZ", fals    
 77   fAbsThickCmd->SetRange("SizeZ>0.");             
 78   fAbsThickCmd->SetUnitCategory("Length");        
 79   fAbsThickCmd->AvailableForStates(G4State_Pre    
 80   fAbsThickCmd->SetToBeBroadcasted(false);        
 81                                                   
 82   fAbsSizYZCmd = new G4UIcmdWithADoubleAndUnit    
 83   fAbsSizYZCmd->SetGuidance("Set sizeYZ of the    
 84   fAbsSizYZCmd->SetParameterName("SizeYZ", fal    
 85   fAbsSizYZCmd->SetRange("SizeYZ>0.");            
 86   fAbsSizYZCmd->SetUnitCategory("Length");        
 87   fAbsSizYZCmd->AvailableForStates(G4State_Pre    
 88   fAbsSizYZCmd->SetToBeBroadcasted(false);        
 89                                                   
 90   fAbsXposCmd = new G4UIcmdWithADoubleAndUnit(    
 91   fAbsXposCmd->SetGuidance("Set X pos. of the     
 92   fAbsXposCmd->SetParameterName("Xpos", false)    
 93   fAbsXposCmd->SetUnitCategory("Length");         
 94   fAbsXposCmd->AvailableForStates(G4State_PreI    
 95   fAbsXposCmd->SetToBeBroadcasted(false);         
 96                                                   
 97   fWorldXCmd = new G4UIcmdWithADoubleAndUnit("    
 98   fWorldXCmd->SetGuidance("Set X size of the W    
 99   fWorldXCmd->SetParameterName("WSizeX", false    
100   fWorldXCmd->SetRange("WSizeX>0.");              
101   fWorldXCmd->SetUnitCategory("Length");          
102   fWorldXCmd->AvailableForStates(G4State_PreIn    
103   fWorldXCmd->SetToBeBroadcasted(false);          
104                                                   
105   fWorldYZCmd = new G4UIcmdWithADoubleAndUnit(    
106   fWorldYZCmd->SetGuidance("Set sizeYZ of the     
107   fWorldYZCmd->SetParameterName("WSizeYZ", fal    
108   fWorldYZCmd->SetRange("WSizeYZ>0.");            
109   fWorldYZCmd->SetUnitCategory("Length");         
110   fWorldYZCmd->AvailableForStates(G4State_PreI    
111   fWorldYZCmd->SetToBeBroadcasted(false);         
112                                                   
113   fPhantomType = new G4UIcmdWithAnInteger("/to    
114   fPhantomType->SetGuidance("Select the type o    
115   fPhantomType->SetParameterName("choice", fal    
116   fPhantomType->AvailableForStates(G4State_Pre    
117   fPhantomType->SetToBeBroadcasted(false);        
118 }                                                 
119                                                   
120 //....oooOO0OOooo........oooOO0OOooo........oo    
121                                                   
122 DetectorMessenger::~DetectorMessenger()           
123 {                                                 
124   delete fAbsMaterCmd;                            
125   delete fAbsThickCmd;                            
126   delete fAbsSizYZCmd;                            
127   delete fAbsXposCmd;                             
128   delete fWorldMaterCmd;                          
129   delete fWorldXCmd;                              
130   delete fWorldYZCmd;                             
131   delete fDetDir;                                 
132   delete fTomoDir;                                
133   delete fPhantomType;                            
134 }                                                 
135                                                   
136 //....oooOO0OOooo........oooOO0OOooo........oo    
137                                                   
138 void DetectorMessenger::SetNewValue(G4UIcomman    
139 {                                                 
140   if (command == fAbsMaterCmd) {                  
141     fDetector->SetAbsorberMaterial(newValue);     
142   }                                               
143                                                   
144   if (command == fWorldMaterCmd) {                
145     fDetector->SetWorldMaterial(newValue);        
146   }                                               
147                                                   
148   if (command == fAbsThickCmd) {                  
149     fDetector->SetAbsorberThickness(fAbsThickC    
150   }                                               
151                                                   
152   if (command == fAbsSizYZCmd) {                  
153     fDetector->SetAbsorberSizeYZ(fAbsSizYZCmd-    
154   }                                               
155                                                   
156   if (command == fAbsXposCmd) {                   
157     fDetector->SetAbsorberXpos(fAbsXposCmd->Ge    
158   }                                               
159                                                   
160   if (command == fWorldXCmd) {                    
161     fDetector->SetWorldSizeX(fWorldXCmd->GetNe    
162   }                                               
163                                                   
164   if (command == fWorldYZCmd) {                   
165     fDetector->SetWorldSizeYZ(fWorldYZCmd->Get    
166   }                                               
167                                                   
168   if (command == fPhantomType) {                  
169     fDetector->SetPhantomType(fPhantomType->Ge    
170   }                                               
171 }                                                 
172                                                   
173 //....oooOO0OOooo........oooOO0OOooo........oo    
174