- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: TestEm8.cc,v 1.9 2010/05/21 18:15:04 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 26 // $Id: TestEm8.cc,v 1.10 2010/09/08 09:12:10 vnivanch Exp $ 27 // GEANT4 tag $Name: examples-V09-03-09 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 34 #include "Randomize.hh" 36 35 37 #include " Em8DetectorConstruction.hh"36 #include "DetectorConstruction.hh" 38 37 #include "PhysicsList.hh" 39 #include "Em8PrimaryGeneratorAction.hh" 40 #include "Em8RunAction.hh" 41 #include "Em8EventAction.hh" 42 #include "Em8SteppingAction.hh" 43 #include "Em8SteppingVerbose.hh" 38 #include "PrimaryGeneratorAction.hh" 39 #include "RunAction.hh" 40 #include "EventAction.hh" 44 41 45 42 #ifdef G4VIS_USE … … 55 52 int main(int argc,char** argv) 56 53 { 57 58 54 //choose the Random engine 59 60 55 CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); 61 56 62 //my Verbose output class63 64 G4VSteppingVerbose::SetInstance(new Em8SteppingVerbose);65 66 57 // Construct the default run manager 67 68 58 G4RunManager * runManager = new G4RunManager; 69 59 70 60 // set mandatory initialization classes 71 72 Em8DetectorConstruction* detector;73 detector = new Em8DetectorConstruction;74 runManager->SetUserInitialization(detector);75 61 runManager->SetUserInitialization(new PhysicsList); 62 PrimaryGeneratorAction* gun = new PrimaryGeneratorAction(); 63 runManager->SetUserInitialization(new DetectorConstruction(gun)); 76 64 77 65 // set user action classes 78 79 runManager->SetUserAction(new Em8PrimaryGeneratorAction(detector)); 80 81 Em8RunAction* runAction = new Em8RunAction; 82 83 runManager->SetUserAction(runAction); 84 85 Em8EventAction* eventAction = new Em8EventAction(runAction); 86 87 runManager->SetUserAction(eventAction); 88 89 Em8SteppingAction* steppingAction = new Em8SteppingAction(detector, 90 eventAction, 91 runAction); 92 runManager->SetUserAction(steppingAction); 66 runManager->SetUserAction(gun); 67 runManager->SetUserAction(new RunAction()); 68 runManager->SetUserAction(new EventAction()); 93 69 94 70 G4UImanager* UI = G4UImanager::GetUIpointer(); … … 96 72 if (argc!=1) // batch mode 97 73 { 98 G4String command = "/control/execute ";99 G4String fileName = argv[1];100 UI->ApplyCommand(command+fileName);74 G4String command = "/control/execute "; 75 G4String fileName = argv[1]; 76 UI->ApplyCommand(command+fileName); 101 77 } 102 78 … … 104 80 { 105 81 #ifdef G4VIS_USE 106 G4VisManager* visManager = new G4VisExecutive;107 visManager->Initialize();82 G4VisManager* visManager = new G4VisExecutive; 83 visManager->Initialize(); 108 84 #endif 109 85 … … 115 91 116 92 #ifdef G4VIS_USE 117 delete visManager;93 delete visManager; 118 94 #endif 119 95 }
Note: See TracChangeset
for help on using the changeset viewer.