Changeset 1337 for trunk/examples/extended/electromagnetic/TestEm6/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm6/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm6/src/DetectorConstruction.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.10 2006/06/29 16:57:00 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/DetectorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.5 2006/06/29 16:57:02 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/EventAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 6 2006/06/29 16:57:04 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: EventAction.cc,v 1.8 2010/06/07 05:40:46 perl Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 67 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 68 68 69 void EventAction::EndOfEventAction(const G4Event* evt)69 void EventAction::EndOfEventAction(const G4Event*) 70 70 { 71 if (G4VVisManager::GetConcreteInstance())72 {73 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();74 G4int n_trajectories = 0;75 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();76 for(G4int i=0; i<n_trajectories; i++)77 { G4Trajectory* trj = (G4Trajectory*)78 ((*(evt->GetTrajectoryContainer()))[i]);79 if (drawFlag == "all") trj->DrawTrajectory(100);80 else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))81 trj->DrawTrajectory(100);82 }83 }84 71 } 85 72 -
trunk/examples/extended/electromagnetic/TestEm6/src/EventActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.6 2006/06/29 16:57:07 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1.1 3 2009/05/13 17:25:33vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: PhysicsList.cc,v 1.15 2010/03/31 09:26:09 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 42 #include "G4Neutron.hh" 43 43 #include "G4AntiNeutron.hh" 44 //#include "G4GenericIon.hh"45 44 46 45 #include "G4GammaConversionToMuons.hh" 47 46 48 #include "G4MultipleScattering.hh" 47 #include "G4eMultipleScattering.hh" 48 #include "G4MuMultipleScattering.hh" 49 #include "G4hMultipleScattering.hh" 49 50 50 51 #include "G4eIonisation.hh" … … 67 68 #include "G4StepLimiter.hh" 68 69 70 #include "G4ProcessTable.hh" 71 72 #include "G4ComptonScattering.hh" 73 #include "G4GammaConversion.hh" 74 #include "G4PhotoElectricEffect.hh" 75 76 69 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 78 … … 74 82 defaultCutValue = 1.*km; 75 83 pMes = new PhysicsListMessenger(this); 76 theGammaToMuPairProcess = 0;77 theAnnihiToMuPairProcess = 0;78 eehadProcess = 0;79 84 SetVerboseLevel(1); 80 85 } … … 85 90 { 86 91 delete pMes; 87 delete theAnnihiToMuPairProcess;88 delete theGammaToMuPairProcess;89 delete eehadProcess;90 92 } 91 93 … … 176 178 if (particleName == "gamma") { 177 179 // gamma allow only gamma -> mu+mu- 178 theGammaToMuPairProcess=new G4GammaConversionToMuons(); 179 pmanager->AddDiscreteProcess(theGammaToMuPairProcess); 180 180 pmanager->AddDiscreteProcess(new G4GammaConversionToMuons); 181 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); 182 pmanager->AddDiscreteProcess(new G4ComptonScattering); 183 pmanager->AddDiscreteProcess(new G4GammaConversion); 184 181 185 } else if (particleName == "e-") { 182 186 //electron 183 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);187 pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1); 184 188 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 185 189 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); … … 190 194 // to make the process of e+e- annihilation more visible, 191 195 // do not enable the other standard processes: 192 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 193 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 194 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 195 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 196 197 theAnnihiToMuPairProcess = new G4AnnihiToMuPair(); 198 eehadProcess = new G4eeToHadrons(); 199 pmanager->AddDiscreteProcess(theAnnihiToMuPairProcess); 200 pmanager->AddDiscreteProcess(eehadProcess); 196 //pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1); 197 //pmanager->AddProcess(new G4eIonisation, -1, 2,2); 198 //pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 199 //pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 200 201 pmanager->AddDiscreteProcess(new G4AnnihiToMuPair); 202 pmanager->AddDiscreteProcess(new G4eeToHadrons); 201 203 pmanager->AddDiscreteProcess(new G4StepLimiter); 202 204 … … 204 206 particleName == "mu-" ) { 205 207 //muon 206 pmanager->AddProcess(new G4Mu ltipleScattering,-1, 1,1);208 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1); 207 209 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 208 210 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); … … 211 213 212 214 } else if( particleName == "anti_proton") { 213 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);215 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 214 216 pmanager->AddProcess(new G4hhIonisation, -1, 2,2); 215 217 pmanager->AddProcess(new G4StepLimiter, -1,-1,3); 216 218 217 219 } else if( particleName == "GenericIon") { 218 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);220 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 219 221 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 220 222 pmanager->AddProcess(new G4StepLimiter, -1,-1,3); … … 222 224 } else if( particle->GetPDGCharge() != 0.0 && !particle->IsShortLived() 223 225 && particleName != "chargedgeantino") { 224 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);226 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 225 227 pmanager->AddProcess(new G4hIonisation, -1, 2,2); 226 228 pmanager->AddProcess(new G4StepLimiter, -1,-1,3); … … 277 279 void PhysicsList::SetGammaToMuPairFac(G4double fac) 278 280 { 281 G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); 282 G4GammaConversionToMuons* theGammaToMuPairProcess = (G4GammaConversionToMuons*) theProcessTable->FindProcess("GammaToMuPair","gamma"); 279 283 if(theGammaToMuPairProcess) theGammaToMuPairProcess->SetCrossSecFactor(fac); 284 else G4cout << "Warning. No process GammaToMuPair found, SetGammaToMuPairFac was ignored" << G4endl; 280 285 } 281 286 … … 284 289 void PhysicsList::SetAnnihiToMuPairFac(G4double fac) 285 290 { 291 G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); 292 G4AnnihiToMuPair* theAnnihiToMuPairProcess = (G4AnnihiToMuPair*) theProcessTable->FindProcess("AnnihiToMuPair","e+"); 286 293 if(theAnnihiToMuPairProcess) theAnnihiToMuPairProcess->SetCrossSecFactor(fac); 294 else G4cout << "Warning. No process AnnihiToMuPair found, SetAnnihiToMuPairFac was ignored" << G4endl; 287 295 } 288 296 … … 291 299 void PhysicsList::SetAnnihiToHadronFac(G4double fac) 292 300 { 301 G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); 302 G4eeToHadrons* eehadProcess = (G4eeToHadrons*) theProcessTable->FindProcess("ee2hadr","e+"); 293 303 if(eehadProcess) eehadProcess->SetCrossSecFactor(fac); 294 } 295 296 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 304 else G4cout << "Warning. No process ee2hadr found, SetAnnihiToHadronFac was ignored" << G4endl; 305 } 306 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsListMessenger.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.cc,v 1. 8 2006/06/29 16:57:11 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: PhysicsListMessenger.cc,v 1.9 2009/11/27 14:54:58 hbu Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 44 44 physDir->SetGuidance("physics list commands"); 45 45 46 GammaToMuPairFac =new G4UIcmdWithADouble46 GammaToMuPairFacCmd=new G4UIcmdWithADouble 47 47 ("/testem/phys/SetGammaToMuPairFac",this); 48 GammaToMuPairFac ->SetGuidance(48 GammaToMuPairFacCmd->SetGuidance( 49 49 "Set factor to artificially increase the GammaToMuPair cross section"); 50 GammaToMuPairFac ->SetParameterName("GammaToMuPairFac",false);51 GammaToMuPairFac ->SetRange("GammaToMuPairFac>0.0");52 GammaToMuPairFac ->AvailableForStates(G4State_PreInit,G4State_Idle);50 GammaToMuPairFacCmd->SetParameterName("GammaToMuPairFac",false); 51 GammaToMuPairFacCmd->SetRange("GammaToMuPairFac>0.0"); 52 GammaToMuPairFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 53 53 54 AnnihiToMuPairFac =new G4UIcmdWithADouble54 AnnihiToMuPairFacCmd=new G4UIcmdWithADouble 55 55 ("/testem/phys/SetAnnihiToMuPairFac",this); 56 AnnihiToMuPairFac ->SetGuidance(56 AnnihiToMuPairFacCmd->SetGuidance( 57 57 "Set factor to artificially increase the AnnihiToMuPair cross section"); 58 AnnihiToMuPairFac ->SetParameterName("AnnihiToMuPairFac",false);59 AnnihiToMuPairFac ->SetRange("AnnihiToMuPairFac>0.0");60 AnnihiToMuPairFac ->AvailableForStates(G4State_PreInit,G4State_Idle);58 AnnihiToMuPairFacCmd->SetParameterName("AnnihiToMuPairFac",false); 59 AnnihiToMuPairFacCmd->SetRange("AnnihiToMuPairFac>0.0"); 60 AnnihiToMuPairFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 61 61 62 AnnihiToHadronFac =new G4UIcmdWithADouble62 AnnihiToHadronFacCmd=new G4UIcmdWithADouble 63 63 ("/testem/phys/SetAnnihiToHadronFac",this); 64 AnnihiToHadronFac ->SetGuidance(64 AnnihiToHadronFacCmd->SetGuidance( 65 65 "Set factor to artificially increase the AnnihiToHadrons cross section"); 66 AnnihiToHadronFac ->SetParameterName("AnnihiToHadFac",false);67 AnnihiToHadronFac ->SetRange("AnnihiToHadFac>0.0");68 AnnihiToHadronFac ->AvailableForStates(G4State_PreInit,G4State_Idle);66 AnnihiToHadronFacCmd->SetParameterName("AnnihiToHadFac",false); 67 AnnihiToHadronFacCmd->SetRange("AnnihiToHadFac>0.0"); 68 AnnihiToHadronFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 69 69 } 70 70 … … 73 73 PhysicsListMessenger::~PhysicsListMessenger() 74 74 { 75 delete GammaToMuPairFac ;76 delete AnnihiToMuPairFac ;77 delete AnnihiToHadronFac ;75 delete GammaToMuPairFacCmd; 76 delete AnnihiToMuPairFacCmd; 77 delete AnnihiToHadronFacCmd; 78 78 delete physDir; 79 79 } … … 84 84 G4String newValue) 85 85 { 86 if(command == GammaToMuPairFac )86 if(command == GammaToMuPairFacCmd) 87 87 { physList->SetGammaToMuPairFac( 88 GammaToMuPairFac ->GetNewDoubleValue(newValue));}88 GammaToMuPairFacCmd->GetNewDoubleValue(newValue));} 89 89 90 if( command == AnnihiToMuPairFac )90 if( command == AnnihiToMuPairFacCmd) 91 91 { physList->SetAnnihiToMuPairFac( 92 AnnihiToMuPairFac ->GetNewDoubleValue(newValue));}92 AnnihiToMuPairFacCmd->GetNewDoubleValue(newValue));} 93 93 94 if( command == AnnihiToHadronFac )94 if( command == AnnihiToHadronFacCmd) 95 95 { physList->SetAnnihiToHadronFac( 96 AnnihiToHadronFac ->GetNewDoubleValue(newValue));}96 AnnihiToHadronFacCmd->GetNewDoubleValue(newValue));} 97 97 } 98 98 -
trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:57:14 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:57:17 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/RunAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.1 3 2008/09/18 16:42:07 maireExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: RunAction.cc,v 1.14 2009/11/27 14:54:58 hbu Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 108 108 G4RunManager::GetRunManager()->SetRandomNumberStore(true); 109 109 CLHEP::HepRandom::showEngineStatus(); 110 ProcCounter = new ProcessesCount; 111 } 112 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 114 115 void RunAction::CountProcesses(G4String procName) 116 { 117 //does the process already encounted ? 118 size_t nbProc = ProcCounter->size(); 119 size_t i = 0; 120 while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++; 121 if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName)); 122 123 (*ProcCounter)[i]->Count(); 110 124 } 111 125 … … 116 130 // show Rndm status 117 131 CLHEP::HepRandom::showEngineStatus(); 132 //total number of process calls 133 G4double countTot = 0.; 134 G4cout << "\n Number of process calls --->"; 135 for (size_t i=0; i< ProcCounter->size();i++) { 136 G4String procName = (*ProcCounter)[i]->GetName(); 137 if (procName != "Transportation") { 138 G4int count = (*ProcCounter)[i]->GetCounter(); 139 G4cout << "\t" << procName << " : " << count; 140 countTot += count; 141 } 142 } 143 G4cout << G4endl; 144 118 145 } 119 146 -
trunk/examples/extended/electromagnetic/TestEm6/src/SteppingAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 9 2006/06/29 16:57:23 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: SteppingAction.cc,v 1.10 2009/11/27 14:54:58 hbu Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 60 60 if (process == 0) return; 61 61 G4String processName = process->GetProcessName(); 62 runAction->CountProcesses(processName); //count processes 63 62 64 if (processName != "GammaToMuPair") return; 63 65 -
trunk/examples/extended/electromagnetic/TestEm6/src/SteppingVerbose.cc
r1230 r1337 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.5 2006/06/29 16:57:25 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset
for help on using the changeset viewer.