Changeset 1337 for trunk/examples/extended/electromagnetic/TestEm13/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm13/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm13/src/DetectorConstruction.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.5 2006/06/29 16:44:24 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/TestEm13/src/DetectorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:44:27 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/TestEm13/src/EventAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 2 2006/06/29 16:44:30 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: EventAction.cc,v 1.5 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...... … … 35 35 36 36 #include "G4Event.hh" 37 #include "G4TrajectoryContainer.hh"38 #include "G4Trajectory.hh"39 #include "G4VVisManager.hh"40 37 #include "G4UnitsTable.hh" 41 38 … … 43 40 44 41 EventAction::EventAction() 45 :printModulo(10000 ),eventMessenger(0)42 :printModulo(100000),eventMessenger(0) 46 43 { 47 44 eventMessenger = new EventActionMessenger(this); … … 68 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 69 66 70 void EventAction::EndOfEventAction(const G4Event* evt)67 void EventAction::EndOfEventAction(const G4Event*) 71 68 { 72 if (G4VVisManager::GetConcreteInstance())73 {74 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();75 G4int n_trajectories = 0;76 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();77 for (G4int i=0; i<n_trajectories; i++) {78 G4Trajectory* trj = (G4Trajectory*)79 ((*(evt->GetTrajectoryContainer()))[i]);80 trj->DrawTrajectory(1000);81 }82 }83 69 } 84 70 -
trunk/examples/extended/electromagnetic/TestEm13/src/EventActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:44:32 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/TestEm13/src/PhysListEmLivermore.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.cc,v 1. 5 2009/11/19 17:30:25maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmLivermore.cc,v 1.6 2010/04/02 15:46:31 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 140 140 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 141 141 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 142 pmanager->AddProcess(eIoni, -1, 142 pmanager->AddProcess(eIoni, -1,-1, 1); 143 143 144 144 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); … … 147 147 eBremModel->SetHighEnergyLimit(highEnergyLimit); 148 148 eBrem->AddEmModel(0, eBremModel); 149 pmanager->AddProcess(eBrem, -1, 2, 2);149 pmanager->AddProcess(eBrem, -1,-1, 2); 150 150 151 151 } else if (particleName == "e+") { 152 152 //positron 153 pmanager->AddProcess(new G4eIonisation, -1, 154 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);153 pmanager->AddProcess(new G4eIonisation, -1,-1, 1); 154 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1, 2); 155 155 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 156 156 … … 158 158 particleName == "mu-" ) { 159 159 //muon 160 pmanager->AddProcess(new G4MuIonisation, -1, 161 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);162 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);160 pmanager->AddProcess(new G4MuIonisation, -1,-1, 1); 161 pmanager->AddProcess(new G4MuBremsstrahlung, -1,-1, 2); 162 pmanager->AddProcess(new G4MuPairProduction, -1,-1, 3); 163 163 164 164 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 165 pmanager->AddProcess(new G4ionIonisation, -1, 165 pmanager->AddProcess(new G4ionIonisation, -1,-1, 1); 166 166 167 167 } else if ((!particle->IsShortLived()) && … … 169 169 (particle->GetParticleName() != "chargedgeantino")) { 170 170 //all others charged particles except geantino 171 pmanager->AddProcess(new G4hIonisation, -1, 171 pmanager->AddProcess(new G4hIonisation, -1,-1, 1); 172 172 } 173 173 } -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmPenelope.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmPenelope.cc,v 1. 6 2009/11/19 17:30:25maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmPenelope.cc,v 1.7 2010/04/02 15:46:31 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 141 141 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 142 142 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 143 pmanager->AddProcess(eIoni, -1, 143 pmanager->AddProcess(eIoni, -1,-1, 1); 144 144 145 145 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); … … 148 148 eBremModel->SetHighEnergyLimit(highEnergyLimit); 149 149 eBrem->AddEmModel(0, eBremModel); 150 pmanager->AddProcess(eBrem, -1, 2, 2);150 pmanager->AddProcess(eBrem, -1,-1, 2); 151 151 152 152 } else if (particleName == "e+") { … … 157 157 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 158 158 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 159 pmanager->AddProcess(eIoni, -1, 159 pmanager->AddProcess(eIoni, -1,-1, 1); 160 160 161 161 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); … … 164 164 eBremModel->SetHighEnergyLimit(highEnergyLimit); 165 165 eBrem->AddEmModel(0, eBremModel); 166 pmanager->AddProcess(eBrem, -1, 2, 2);166 pmanager->AddProcess(eBrem, -1,-1, 2); 167 167 168 168 G4eplusAnnihilation* eAnni = new G4eplusAnnihilation(); … … 176 176 particleName == "mu-" ) { 177 177 //muon 178 pmanager->AddProcess(new G4MuIonisation, -1, 179 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);180 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);178 pmanager->AddProcess(new G4MuIonisation, -1,-1, 1); 179 pmanager->AddProcess(new G4MuBremsstrahlung, -1,-1, 2); 180 pmanager->AddProcess(new G4MuPairProduction, -1,-1, 3); 181 181 182 182 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 183 pmanager->AddProcess(new G4ionIonisation, -1, 183 pmanager->AddProcess(new G4ionIonisation, -1,-1, 1); 184 184 185 185 } else if ((!particle->IsShortLived()) && … … 187 187 (particle->GetParticleName() != "chargedgeantino")) { 188 188 //all others charged particles except geantino 189 pmanager->AddProcess(new G4hIonisation, -1, 189 pmanager->AddProcess(new G4hIonisation, -1,-1, 1); 190 190 } 191 191 } -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmStandard.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 3 2006/06/29 16:44:38 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmStandard.cc,v 1.4 2010/04/02 15:46:31 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 81 81 } else if (particleName == "e-") { 82 82 //electron 83 pmanager->AddProcess(new G4eIonisation, -1, 84 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);83 pmanager->AddProcess(new G4eIonisation, -1,-1,1); 84 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,2); 85 85 86 86 } else if (particleName == "e+") { 87 87 //positron 88 pmanager->AddProcess(new G4eIonisation, -1, 89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);88 pmanager->AddProcess(new G4eIonisation, -1,-1,1); 89 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,2); 90 90 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,3); 91 91 … … 93 93 particleName == "mu-" ) { 94 94 //muon 95 pmanager->AddProcess(new G4MuIonisation, -1, 96 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2,2);97 pmanager->AddProcess(new G4MuPairProduction, -1, 3,3);95 pmanager->AddProcess(new G4MuIonisation, -1,-1,1); 96 pmanager->AddProcess(new G4MuBremsstrahlung, -1,-1,2); 97 pmanager->AddProcess(new G4MuPairProduction, -1,-1,3); 98 98 99 99 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 100 pmanager->AddProcess(new G4ionIonisation, -1, 100 pmanager->AddProcess(new G4ionIonisation, -1,-1,1); 101 101 102 102 } else if ((!particle->IsShortLived()) && … … 104 104 (particle->GetParticleName() != "chargedgeantino")) { 105 105 //all others charged particles except geantino 106 pmanager->AddProcess(new G4hIonisation, -1, 1,1);106 pmanager->AddProcess(new G4hIonisation, -1,-1,1); 107 107 } 108 108 } -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 7 2009/11/19 17:30:25maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysicsList.cc,v 1.9 2010/04/05 13:45:17 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 183 183 // 184 184 G4EmProcessOptions emOptions; 185 emOptions.SetStepFunction(1., 1*mm);186 185 emOptions.SetIntegral(false); 187 emOptions.SetLossFluctuations(false);188 186 } 189 187 … … 227 225 228 226 void PhysicsList::SetCuts() 229 { 227 { 228 // fixe lower limit for cut 229 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV); 230 230 231 // set cut values for gamma at first and for e- second and next for e+, 231 232 // because some processes for e+/e- need cut values for gamma -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsListMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:44:43 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/TestEm13/src/PrimaryGeneratorAction.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:44:45 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/TestEm13/src/RunAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 6 2006/06/29 16:44:47 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: RunAction.cc,v 1.8 2010/04/05 13:45:17 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 47 47 48 48 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim) 49 : detector(det), primary(prim) , ProcCounter(0)49 : detector(det), primary(prim) 50 50 { } 51 51 … … 64 64 G4RunManager::GetRunManager()->SetRandomNumberStore(false); 65 65 CLHEP::HepRandom::showEngineStatus(); 66 67 ProcCounter = new ProcessesCount;68 }69 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......71 72 void RunAction::CountProcesses(G4String procName)73 {74 //does the process already encounted ?75 size_t nbProc = ProcCounter->size();76 size_t i = 0;77 while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;78 if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));79 80 (*ProcCounter)[i]->Count();81 66 } 82 67 … … 108 93 G4int survive = 0; 109 94 G4cout << "\n Process calls frequency --->"; 110 for (size_t i=0; i< ProcCounter->size();i++) { 111 G4String procName = (*ProcCounter)[i]->GetName(); 112 G4int count = (*ProcCounter)[i]->GetCounter(); 95 std::map<G4String,G4int>::iterator it; 96 for (it = procCounter.begin(); it != procCounter.end(); it++) { 97 G4String procName = it->first; 98 G4int count = it->second; 113 99 totalCount += count; 114 100 G4cout << "\t" << procName << " = " << count; 115 101 if (procName == "Transportation") survive = count; 116 } 102 } 117 103 G4cout << G4endl; 118 104 if (totalCount == 0) return; … … 130 116 //compute cross section and related quantities 131 117 // 132 G4double CrossSection = std::log(1./ratio)/tickness;118 G4double CrossSection = - std::log(ratio)/tickness; 133 119 G4double massicCS = CrossSection/density; 134 120 … … 142 128 G4EmCalculator emCalculator; 143 129 G4double sumc = 0.0; 144 for ( size_t i=0; i< ProcCounter->size();i++) {145 G4String procName = (*ProcCounter)[i]->GetName();130 for (it = procCounter.begin(); it != procCounter.end(); it++) { 131 G4String procName = it->first; 146 132 G4double massSigma = 147 133 emCalculator.GetCrossSectionPerVolume(energy,particle, … … 167 153 G4cout.precision(prec); 168 154 169 // delete and remove all contents in ProcCounter 170 while (ProcCounter->size()>0){ 171 OneProcessCount* aProcCount=ProcCounter->back(); 172 ProcCounter->pop_back(); 173 delete aProcCount; 174 } 175 delete ProcCounter; 155 // remove all contents in procCounter 156 procCounter.clear(); 176 157 177 158 // show Rndm status -
trunk/examples/extended/electromagnetic/TestEm13/src/SteppingAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 7 2009/09/25 11:27:13maire Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: SteppingAction.cc,v 1.8 2010/04/02 15:46:31 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 53 53 G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName(); 54 54 55 //count real interaction or transmitted beam 56 // 57 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge(); 58 G4TrackVector* secondary = fpSteppingManager->GetSecondary(); 59 G4bool interaction = ((charge == 0.) || ((*secondary).size() > 0)); 60 G4bool transmit = (endPoint->GetStepStatus() <= fGeomBoundary); 61 62 if (interaction || transmit) { 63 runAction->CountProcesses(procName); 64 } 55 runAction->CountProcesses(procName); 65 56 66 57 // kill event after first interaction -
trunk/examples/extended/electromagnetic/TestEm13/src/SteppingVerbose.cc
r1230 r1337 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:44:51 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.