Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:17

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Hadrontherapy advanced example for Geant4
0027 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
0028 
0029 #include "HadrontherapyActionInitialization.hh"
0030 #include "HadrontherapyPrimaryGeneratorAction.hh"
0031 #include "HadrontherapyRunAction.hh"
0032 #include "HadrontherapySteppingAction.hh"
0033 #include "HadrontherapyDetectorConstruction.hh"
0034 #include "G4GeneralParticleSource.hh"
0035 
0036 #include "HadrontherapyEventAction.hh"
0037 #include "G4RunManager.hh"
0038 
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 HadrontherapyActionInitialization::HadrontherapyActionInitialization(/*G4VUserDetectorConstruction* detConstruction*/)
0042 : G4VUserActionInitialization()//,
0043  // fDetectorConstruction(detConstruction)
0044 {}
0045 
0046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0047 
0048 HadrontherapyActionInitialization::~HadrontherapyActionInitialization()
0049 {//delete masterGPS;
0050 }
0051 
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 void HadrontherapyActionInitialization::BuildForMaster() const
0055 {
0056     // In MT mode, to be clearer, the RunAction class for the master thread might be
0057     // different than the one used for the workers.
0058     // This RunAction will be called before and after starting the
0059     // workers.
0060     // For more details, please refer to :
0061     // https://twiki.cern.ch/twiki/bin/view/Geant4/Geant4MTForApplicationDevelopers
0062     //
0063     // HadrontherapyRunAction* runAction= new HadrontherapyRunAction(fDetectorConstruction);
0064     // SetUserAction(runAction);
0065   HadrontherapyRunAction* pRunAction = new HadrontherapyRunAction();
0066   SetUserAction(pRunAction);
0067 }
0068 
0069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0070 
0071 void HadrontherapyActionInitialization::Build() const
0072 {       
0073  // Initialize the primary particles
0074   HadrontherapyPrimaryGeneratorAction *pPrimaryGenerator = new HadrontherapyPrimaryGeneratorAction();
0075   SetUserAction(pPrimaryGenerator);
0076     
0077   // Optional UserActions: run, event, stepping
0078   HadrontherapyRunAction* pRunAction = new HadrontherapyRunAction();
0079   SetUserAction(pRunAction);
0080 
0081     
0082   HadrontherapyEventAction* pEventAction = new HadrontherapyEventAction();
0083   SetUserAction(pEventAction);
0084     
0085   HadrontherapySteppingAction* steppingAction = new HadrontherapySteppingAction(pRunAction); 
0086   SetUserAction(steppingAction);  
0087 
0088 }
0089 
0090 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......