Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // 28 //....oooOO0OOooo........oooOO0OOooo........oo 29 //....oooOO0OOooo........oooOO0OOooo........oo 30 31 #include "RunAction.hh" 32 33 #include "G4EmCalculator.hh" 34 #include "G4Run.hh" 35 36 #include "Run.hh" 37 #include "RunActionMessenger.hh" 38 39 //....oooOO0OOooo........oooOO0OOooo........oo 40 41 RunAction::RunAction(G4bool isP) 42 : G4UserRunAction(), 43 fRun(nullptr), 44 isPIXE(isP), 45 fNbProjections(1), 46 fNbSlices(1), 47 fNbPixels(1), 48 fInterFlag(false), 49 fInterruptedProjectionIndex(0) 50 51 { 52 fRunMessenger = new RunActionMessenger(this) 53 } 54 55 //....oooOO0OOooo........oooOO0OOooo........oo 56 57 RunAction::~RunAction() 58 { 59 delete fRunMessenger; 60 } 61 62 //....oooOO0OOooo........oooOO0OOooo........oo 63 64 G4Run* RunAction::GenerateRun() 65 { 66 fRun = new Run(isPIXE, fNbProjections, fNbSl 67 return fRun; 68 } 69 70 //....oooOO0OOooo........oooOO0OOooo........oo 71 72 void RunAction::BeginOfRunAction(const G4Run*) 73 { 74 if (IsMaster()) { 75 if (fInterFlag) { 76 G4cout << "####Resume simulation####" << 77 } 78 79 G4cout << "Scan information: " << G4endl < 80 << "; Slice_index " << fRun->GetCur 81 << fRun->GetCurrentPixel() << G4end 82 } 83 } 84 85 //....oooOO0OOooo........oooOO0OOooo........oo 86 87 void RunAction::EndOfRunAction(const G4Run*) 88 { 89 if (isMaster) fRun->EndOfRun(); 90 } 91 void RunAction::SetScanParameters(G4int nbProj 92 { 93 fNbProjections = nbProjections; 94 fNbSlices = nbSlices; 95 fNbPixels = nbPixels; 96 } 97 98 //....oooOO0OOooo........oooOO0OOooo........oo 99 100 void RunAction::SetInterruptionFlag(G4bool int 101 { 102 fInterFlag = inter; 103 } 104 105 //....oooOO0OOooo........oooOO0OOooo........oo 106 107 void RunAction::SetResumeProjectionIndex(G4int 108 { 109 if (fInterFlag) fInterruptedProjectionIndex 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oo 113