Changeset 1337 for trunk/examples/extended/electromagnetic/TestEm1/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/electromagnetic/TestEm1/src
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm1/src/DetectorConstruction.cc
r1230 r1337 27 27 // 28 28 // $Id: DetectorConstruction.cc,v 1.8 2007/11/12 15:48:58 maire Exp $ 29 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $29 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 30 30 // 31 31 // -
trunk/examples/extended/electromagnetic/TestEm1/src/DetectorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:36: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/TestEm1/src/EventAction.cc
r1230 r1337 25 25 // 26 26 // 27 // $Id: EventAction.cc,v 1. 7 2007/11/12 15:48:58 maireExp $28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // $Id: EventAction.cc,v 1.9 2010/06/07 05:40:45 perl Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // … … 38 38 39 39 #include "G4Event.hh" 40 #include "G4TrajectoryContainer.hh"41 #include "G4Trajectory.hh"42 #include "G4VVisManager.hh"43 40 #include "G4UnitsTable.hh" 44 41 … … 75 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 73 77 void EventAction::EndOfEventAction(const G4Event* evt)74 void EventAction::EndOfEventAction(const G4Event*) 78 75 { 79 76 if (drawFlag != "none") G4cout << " Energy deposit: " 80 77 << G4BestUnit(TotalEnergyDeposit,"Energy") 81 78 << G4endl; 82 83 if (G4VVisManager::GetConcreteInstance())84 {85 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();86 G4int n_trajectories = 0;87 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();88 for(G4int i=0; i<n_trajectories; i++)89 { G4Trajectory* trj = (G4Trajectory*)90 ((*(evt->GetTrajectoryContainer()))[i]);91 if (drawFlag == "all") trj->DrawTrajectory(100);92 else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))93 trj->DrawTrajectory(100);94 }95 }96 79 } 97 80 -
trunk/examples/extended/electromagnetic/TestEm1/src/EventActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:37:01 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/TestEm1/src/HistoManager.cc
r1230 r1337 25 25 // 26 26 // $Id: HistoManager.cc,v 1.13 2008/09/12 16:32:25 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/TestEm1/src/HistoMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.6 2007/11/12 15:48:58 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/TestEm1/src/PhysListEmStandard.cc
r1230 r1337 26 26 // 27 27 // $Id: PhysListEmStandard.cc,v 1.21 2009/11/13 15:44:28 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsList.cc
r1230 r1337 26 26 // 27 27 // $Id: PhysicsList.cc,v 1.12 2009/09/15 12:51:49 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsListMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:37:19 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/TestEm1/src/PrimaryGeneratorAction.cc
r1230 r1337 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:37:21 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:37:23 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/TestEm1/src/RunAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 19 2006/06/29 16:37:25 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: RunAction.cc,v 1.20 2010/04/06 11:11:24 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 47 47 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin, 48 48 HistoManager* histo) 49 :detector(det), primary(kin), ProcCounter(0),histoManager(histo)49 :detector(det), primary(kin), histoManager(histo) 50 50 { } 51 51 … … 70 70 projRange = projRange2 = 0.; 71 71 transvDev = transvDev2 = 0.; 72 ProcCounter = new ProcessesCount;73 72 74 73 //histograms 75 74 // 76 75 histoManager->book(); 77 }78 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......80 81 void RunAction::CountProcesses(G4String procName)82 {83 //does the process already encounted ?84 size_t nbProc = ProcCounter->size();85 size_t i = 0;86 while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;87 if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));88 89 (*ProcCounter)[i]->Count();90 76 } 91 77 … … 132 118 << G4endl; 133 119 134 //frequency of processes call 135 G4cout << "\n nb of process calls per event: \n "; 136 for (size_t i=0; i< ProcCounter->size();i++) 137 G4cout << std::setw(12) << (*ProcCounter)[i]->GetName(); 120 //frequency of processes call 121 std::map<G4String,G4int>::iterator it; 122 G4cout << "\n nb of process calls per event: \n "; 123 for (it = procCounter.begin(); it != procCounter.end(); it++) 124 G4cout << std::setw(12) << it->first; 138 125 139 126 G4cout << "\n "; 140 for ( size_t j=0; j< ProcCounter->size();j++)141 G4cout << std::setw(12) << ((*ProcCounter)[j]->GetCounter())/dNbOfEvents;127 for (it = procCounter.begin(); it != procCounter.end(); it++) 128 G4cout << std::setw(12) << (it->second)/dNbOfEvents; 142 129 G4cout << G4endl; 143 130 … … 186 173 G4cout.precision(prec); 187 174 188 // delete and remove all contents in ProcCounter 189 while (ProcCounter->size()>0){ 190 OneProcessCount* aProcCount=ProcCounter->back(); 191 ProcCounter->pop_back(); 192 delete aProcCount; 193 } 194 delete ProcCounter; 195 175 // remove all contents in procCounter 176 procCounter.clear(); 177 196 178 //save histograms 197 179 histoManager->save(); -
trunk/examples/extended/electromagnetic/TestEm1/src/StepMax.cc
r1230 r1337 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:37: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/TestEm1/src/StepMaxMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:37:29 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/TestEm1/src/SteppingAction.cc
r1230 r1337 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.8 2006/06/29 16:37:31 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/TestEm1/src/SteppingVerbose.cc
r1230 r1337 26 26 // 27 27 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:37:34 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/TrackingAction.cc
r1230 r1337 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.10 2006/06/29 16:37:36 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.