Ignore:
Timestamp:
Nov 5, 2010, 4:08:39 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc

    r1337 r1342  
    2424// ********************************************************************
    2525//
    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 $
    2928//
    3029//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3534#include "Randomize.hh"
    3635
    37 #include "Em8DetectorConstruction.hh"
     36#include "DetectorConstruction.hh"
    3837#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"
    4441
    4542#ifdef G4VIS_USE
     
    5552int main(int argc,char** argv)
    5653{
    57 
    5854  //choose the Random engine
    59 
    6055  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
    6156 
    62   //my Verbose output class
    63 
    64   G4VSteppingVerbose::SetInstance(new Em8SteppingVerbose);
    65    
    6657  // Construct the default run manager
    67 
    6858  G4RunManager * runManager = new G4RunManager;
    6959
    7060  // set mandatory initialization classes
    71 
    72   Em8DetectorConstruction* detector;
    73   detector = new Em8DetectorConstruction;
    74   runManager->SetUserInitialization(detector);
    7561  runManager->SetUserInitialization(new PhysicsList);
     62  PrimaryGeneratorAction* gun = new PrimaryGeneratorAction();
     63  runManager->SetUserInitialization(new DetectorConstruction(gun));
    7664 
    7765  // 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());
    9369 
    9470  G4UImanager* UI = G4UImanager::GetUIpointer(); 
     
    9672  if (argc!=1)   // batch mode 
    9773    {
    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);
    10177    }
    10278   
     
    10480    {
    10581#ifdef G4VIS_USE
    106    G4VisManager* visManager = new G4VisExecutive;
    107    visManager->Initialize();
     82      G4VisManager* visManager = new G4VisExecutive;
     83      visManager->Initialize();
    10884#endif   
    10985     
     
    11591     
    11692#ifdef G4VIS_USE
    117      delete visManager;
     93      delete visManager;
    11894#endif     
    11995    }
Note: See TracChangeset for help on using the changeset viewer.