Changeset 1342 for trunk/examples/extended/electromagnetic/TestEm8/src
- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm8/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysicsList.cc,v 1.19 2010/06/04 17:08:15 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 26 // $Id: PhysicsList.cc,v 1.21 2010/10/27 14:52:07 vnivanch Exp $ 27 // GEANT4 tag $Name: examples-V09-03-09 $ 28 // 29 //--------------------------------------------------------------------------- 30 // 31 // ClassName: PhysicsList 32 // 33 // Description: EM physics with a possibility to add PAI model 34 // 35 // Author: V.Ivanchenko 01.09.2010 36 // 37 //---------------------------------------------------------------------------- 29 38 // 30 39 … … 39 48 #include "G4EmStandardPhysics_option2.hh" 40 49 #include "G4EmStandardPhysics_option3.hh" 50 #include "G4EmLivermorePhysics.hh" 51 #include "G4EmPenelopePhysics.hh" 41 52 #include "G4DecayPhysics.hh" 42 53 … … 47 58 #include "G4Electron.hh" 48 59 #include "G4Positron.hh" 60 #include "G4Proton.hh" 49 61 50 62 #include "G4UnitsTable.hh" … … 67 79 cutForElectron = defaultCutValue; 68 80 cutForPositron = defaultCutValue; 69 70 stepMaxProcess = 0; 81 cutForProton = defaultCutValue; 71 82 72 83 pMessenger = new PhysicsListMessenger(this); 84 85 stepMaxProcess = new StepMax(); 73 86 74 87 // Decay Physics is always defined … … 140 153 emPhysicsList = new G4EmStandardPhysics_option3(); 141 154 155 } else if (name == "emlivermore") { 156 157 emName = name; 158 delete emPhysicsList; 159 emPhysicsList = new G4EmLivermorePhysics(); 160 161 } else if (name == "empenelope") { 162 163 emName = name; 164 delete emPhysicsList; 165 emPhysicsList = new G4EmPenelopePhysics(); 166 142 167 } else if (name == "pai") { 143 168 … … 163 188 { 164 189 // Step limitation seen as a process 165 stepMaxProcess = new StepMax();166 190 167 191 theParticleIterator->reset(); … … 195 219 SetCutValue(cutForElectron, "e-"); 196 220 SetCutValue(cutForPositron, "e+"); 221 SetCutValue(cutForProton, "proton"); 197 222 198 223 if ( verboseLevel > 0 ) { DumpCutValuesTable(); } … … 221 246 cutForPositron = cut; 222 247 SetParticleCuts(cutForPositron, G4Positron::Positron()); 248 } 249 250 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 251 252 void PhysicsList::SetCutForProton(G4double cut) 253 { 254 cutForPositron = cut; 255 SetParticleCuts(cutForProton, G4Proton::Proton()); 223 256 } 224 257 -
trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.cc,v 1.3 2010/09/08 09:12:10 vnivanch Exp $ 27 // GEANT4 tag $Name: examples-V09-03-09 $ 26 28 // 27 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 17:00:47 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 //--------------------------------------------------------------------------- 29 30 // 31 // ClassName: PhysicsListMessenger 32 // 33 // Description: EM physics with a possibility to add PAI model 34 // 35 // Author: V.Ivanchenko 01.09.2010 36 // 37 //---------------------------------------------------------------------------- 30 38 // 31 39 … … 38 46 #include "G4UIcmdWithADoubleAndUnit.hh" 39 47 #include "G4UIcmdWithAString.hh" 48 #include "G4UIcmdWithAnInteger.hh" 49 #include "HistoManager.hh" 40 50 41 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 44 54 :pPhysicsList(pPhys) 45 55 { 46 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this);47 gammaCutCmd->SetGuidance("Set gamma cut.");48 gammaCutCmd->SetParameterName("Gcut",false);49 gammaCutCmd->SetUnitCategory("Length");50 gammaCutCmd->SetRange("Gcut>0.0");51 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);56 eCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this); 57 eCmd->SetGuidance("Set max energy deposit"); 58 eCmd->SetParameterName("Emax",false); 59 eCmd->SetUnitCategory("Energy"); 60 eCmd->SetRange("Emax>0.0"); 61 eCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 52 62 53 electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this); 54 electCutCmd->SetGuidance("Set electron cut."); 55 electCutCmd->SetParameterName("Ecut",false); 56 electCutCmd->SetUnitCategory("Length"); 57 electCutCmd->SetRange("Ecut>0.0"); 58 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 63 ebCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsE",this); 64 ebCmd->SetGuidance("Set number of bins in energy."); 65 ebCmd->SetParameterName("Ebins",false); 66 ebCmd->SetRange("Ebins>0"); 67 ebCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 59 68 60 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this); 61 protoCutCmd->SetGuidance("Set positron cut."); 62 protoCutCmd->SetParameterName("Pcut",false); 63 protoCutCmd->SetUnitCategory("Length"); 64 protoCutCmd->SetRange("Pcut>0.0"); 65 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 66 67 allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this); 68 allCutCmd->SetGuidance("Set cut for all."); 69 allCutCmd->SetParameterName("cut",false); 70 allCutCmd->SetUnitCategory("Length"); 71 allCutCmd->SetRange("cut>0.0"); 72 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 69 cbCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsCl",this); 70 cbCmd->SetGuidance("Set max number of clusters."); 71 cbCmd->SetParameterName("Cbins",false); 72 cbCmd->SetRange("Cbins>0"); 73 cbCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 73 74 74 75 pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); … … 82 83 PhysicsListMessenger::~PhysicsListMessenger() 83 84 { 84 delete gammaCutCmd; 85 delete electCutCmd; 86 delete protoCutCmd; 87 delete allCutCmd; 85 delete eCmd; 86 delete ebCmd; 87 delete cbCmd; 88 88 delete pListCmd; 89 89 } … … 94 94 G4String newValue) 95 95 { 96 if( command == gammaCutCmd ) 97 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));} 96 HistoManager* man = HistoManager::GetPointer(); 97 if( command == eCmd ) 98 { man->SetMaxEnergy(eCmd->GetNewDoubleValue(newValue));} 98 99 99 if( command == e lectCutCmd )100 { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}100 if( command == ebCmd ) 101 { man->SetNumberBins(ebCmd->GetNewIntValue(newValue));} 101 102 102 if( command == protoCutCmd ) 103 { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));} 104 105 if( command == allCutCmd ) 106 { 107 G4double cut = allCutCmd->GetNewDoubleValue(newValue); 108 pPhysicsList->SetCutForGamma(cut); 109 pPhysicsList->SetCutForElectron(cut); 110 pPhysicsList->SetCutForPositron(cut); 111 } 103 if( command == cbCmd ) 104 { man->SetNumberBinsCluster(cbCmd->GetNewIntValue(newValue));} 112 105 113 106 if( command == pListCmd )
Note: See TracChangeset
for help on using the changeset viewer.