Changeset 1337 for trunk/examples/extended/electromagnetic/TestEm14/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm14/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm14/src/DetectorConstruction.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.4 2006/06/29 16:45:33 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/TestEm14/src/DetectorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:45:35 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/TestEm14/src/EventAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 3 2006/06/29 16:45:37 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: EventAction.cc,v 1.6 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/TestEm14/src/EventActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:45:39 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/TestEm14/src/HistoManager.cc
r1230 r1337 25 25 // 26 26 // $Id: HistoManager.cc,v 1.7 2008/09/24 18:53:56 maire 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/TestEm14/src/HistoMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.4 2007/11/13 12:17:07 maire 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/TestEm14/src/PhysListEmLivermore.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.cc,v 1. 4 2009/11/19 10:36:37maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmLivermore.cc,v 1.5 2010/04/02 13:22:02 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/TestEm14/src/PhysListEmPenelope.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmPenelope.cc,v 1. 4 2009/11/19 10:36:37maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmPenelope.cc,v 1.5 2010/04/02 13:22:02 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/TestEm14/src/PhysListEmStandard.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 4 2006/10/24 16:54:16maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysListEmStandard.cc,v 1.5 2010/04/02 13:22:02 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 82 82 } else if (particleName == "e-") { 83 83 //electron 84 pmanager->AddProcess(new G4eIonisation, -1, 85 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);84 pmanager->AddProcess(new G4eIonisation, -1,-1,1); 85 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,2); 86 86 87 87 } else if (particleName == "e+") { 88 88 //positron 89 pmanager->AddProcess(new G4eIonisation, -1, 90 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);89 pmanager->AddProcess(new G4eIonisation, -1,-1,1); 90 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,2); 91 91 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,3); 92 92 … … 94 94 particleName == "mu-" ) { 95 95 //muon 96 pmanager->AddProcess(new G4MuIonisation, -1, 97 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2,2);98 pmanager->AddProcess(new G4MuPairProduction, -1, 3,3);96 pmanager->AddProcess(new G4MuIonisation, -1,-1,1); 97 pmanager->AddProcess(new G4MuBremsstrahlung, -1,-1,2); 98 pmanager->AddProcess(new G4MuPairProduction, -1,-1,3); 99 99 100 100 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 101 pmanager->AddProcess(new G4ionIonisation, -1, 101 pmanager->AddProcess(new G4ionIonisation, -1,-1,1); 102 102 103 103 } else if ((!particle->IsShortLived()) && … … 105 105 (particle->GetParticleName() != "chargedgeantino")) { 106 106 //all others charged particles except geantino 107 pmanager->AddProcess(new G4hIonisation, -1, 1,1);107 pmanager->AddProcess(new G4hIonisation, -1,-1,1); 108 108 } 109 109 } -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 6 2009/11/19 10:36:37maire Exp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: PhysicsList.cc,v 1.8 2010/04/05 18:02:39 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 { 230 // set cut values for gamma at first and for e- second and next for e+, 231 // because some processes for e+/e- need cut values for gamma 232 SetCutValue(cutForGamma, "gamma"); 233 SetCutValue(cutForElectron, "e-"); 234 SetCutValue(cutForPositron, "e+"); 227 { 228 // fixe lower limit for cut 229 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV); 230 231 // set cut values for gamma at first and for e- second and next for e+, 232 // because some processes for e+/e- need cut values for gamma 233 SetCutValue(cutForGamma, "gamma"); 234 SetCutValue(cutForElectron, "e-"); 235 SetCutValue(cutForPositron, "e+"); 235 236 } 236 237 -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsListMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:45:55 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/TestEm14/src/PrimaryGeneratorAction.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:45:57 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/TestEm14/src/RunAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 4 2006/09/06 09:56:06maire Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: RunAction.cc,v 1.5 2010/04/05 18:02:39 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 49 49 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim, 50 50 HistoManager* histo) 51 : detector(det), primary(prim), ProcCounter(0),histoManager(histo)51 : detector(det), primary(prim), histoManager(histo) 52 52 { } 53 53 … … 67 67 CLHEP::HepRandom::showEngineStatus(); 68 68 69 ProcCounter = new ProcessesCount;70 69 totalCount = 0; 71 70 sumTrack = sumTrack2 = 0.; … … 73 72 74 73 histoManager->book(); 75 }76 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......78 79 void RunAction::CountProcesses(G4String procName)80 {81 //does the process already encounted ?82 size_t nbProc = ProcCounter->size();83 size_t i = 0;84 while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;85 if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));86 87 (*ProcCounter)[i]->Count();88 74 } 89 75 … … 113 99 //frequency of processes 114 100 G4cout << "\n Process calls frequency --->"; 115 for (size_t i=0; i< ProcCounter->size();i++) { 116 G4String procName = (*ProcCounter)[i]->GetName(); 117 G4int count = (*ProcCounter)[i]->GetCounter(); 101 std::map<G4String,G4int>::iterator it; 102 for (it = procCounter.begin(); it != procCounter.end(); it++) { 103 G4String procName = it->first; 104 G4int count = it->second; 118 105 G4cout << "\t" << procName << " = " << count; 119 106 if (procName == "Transportation") survive = count; 120 107 } 121 108 122 109 if (survive > 0) { 123 110 G4cout << "\n\n Nb of incident particles surviving after " … … 160 147 G4EmCalculator emCalculator; 161 148 G4double sumc = 0.0; 162 for ( size_t i=0; i< ProcCounter->size();i++) {163 G4String procName = (*ProcCounter)[i]->GetName();149 for (it = procCounter.begin(); it != procCounter.end(); it++) { 150 G4String procName = it->first; 164 151 G4double massSigma = 165 152 emCalculator.GetCrossSectionPerVolume(energy,particle, … … 177 164 178 165 //restore default format 179 G4cout.precision(prec); 180 181 // delete and remove all contents in ProcCounter 182 while (ProcCounter->size()>0){ 183 OneProcessCount* aProcCount=ProcCounter->back(); 184 ProcCounter->pop_back(); 185 delete aProcCount; 186 } 187 delete ProcCounter; 166 G4cout.precision(prec); 167 168 // remove all contents in procCounter 169 procCounter.clear(); 188 170 189 171 histoManager->save(); -
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 5 2007/06/23 22:23:20maire Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: SteppingAction.cc,v 1.6 2010/04/02 13:22:02 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 #include "RunAction.hh" 35 35 #include "HistoManager.hh" 36 #include "SteppingMessenger.hh"37 36 38 37 #include "G4RunManager.hh" … … 43 42 RunAction* RuAct, HistoManager* Hist) 44 43 :primary(prim),runAction(RuAct), histoManager(Hist) 45 { 46 stepMessenger = new SteppingMessenger(this); 47 fract = 0.1; 48 } 44 { } 49 45 50 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 51 47 52 48 SteppingAction::~SteppingAction() 53 { 54 delete stepMessenger; 55 } 49 { } 56 50 57 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 60 54 { 61 55 G4StepPoint* endPoint = aStep->GetPostStepPoint(); 62 G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName(); 63 G4TrackVector* secondary = fpSteppingManager->GetSecondary(); 56 G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName(); 64 57 G4bool transmit = (endPoint->GetStepStatus() <= fGeomBoundary); 65 58 if (transmit) runAction->CountProcesses(procName); … … 67 60 //count real processes and sum track length 68 61 G4double stepLength = aStep->GetStepLength(); 69 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge(); 70 if ((charge == 0.) || ((charge != 0.) && (((*secondary).size() > 0)))) 71 { 72 runAction->CountProcesses(procName); 73 runAction->SumTrack(stepLength); 74 } 62 runAction->CountProcesses(procName); 63 runAction->SumTrack(stepLength); 75 64 } 76 65 77 66 //plot final state (only if continuous energy loss is small enough) 78 67 // 79 G4double edep = aStep->GetTotalEnergyDeposit();80 G4double E0 = primary->GetParticleGun()->GetParticleEnergy();81 if (edep < fract*E0) {82 68 83 84 85 86 87 88 69 //scattered primary particle 70 // 71 G4int id = 1; 72 if (aStep->GetTrack()->GetTrackStatus() == fAlive) { 73 G4double energy = endPoint->GetKineticEnergy(); 74 histoManager->FillHisto(id,energy); 89 75 90 91 92 93 94 76 id = 2; 77 G4ThreeVector direction = endPoint->GetMomentumDirection(); 78 G4double costeta = direction.x(); 79 histoManager->FillHisto(id,costeta); 80 } 95 81 96 97 98 //G4TrackVector* secondary = fpSteppingManager->GetSecondary();99 100 101 102 103 82 //secondaries 83 // 84 G4TrackVector* secondary = fpSteppingManager->GetSecondary(); 85 for (size_t lp=0; lp<(*secondary).size(); lp++) { 86 G4double charge = (*secondary)[lp]->GetDefinition()->GetPDGCharge(); 87 if (charge != 0.) id = 3; else id = 5; 88 G4double energy = (*secondary)[lp]->GetKineticEnergy(); 89 histoManager->FillHisto(id,energy); 104 90 105 106 107 108 91 id++; 92 G4ThreeVector direction = (*secondary)[lp]->GetMomentumDirection(); 93 G4double costeta = direction.x(); 94 histoManager->FillHisto(id,costeta); 109 95 110 //energy tranferred to charged secondaries 111 if (charge != 0.) runAction->SumeTransf(energy); 112 } 96 //energy tranferred to charged secondaries 97 if (charge != 0.) runAction->SumeTransf(energy); 113 98 } 114 99 -
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingVerbose.cc
r1230 r1337 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:46:05 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.