|
|
|||
File indexing completed on 2026-04-03 07:52:11
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 /// \file RunAction.hh 0027 /// \brief Definition of the RunAction class 0028 0029 #ifndef RunAction_h 0030 #define RunAction_h 1 0031 0032 #include "G4AnalysisManager.hh" 0033 #include "G4UserRunAction.hh" 0034 #include "globals.hh" 0035 0036 class DetectorConstruction; 0037 class PhysicsList; 0038 class PrimaryGeneratorAction; 0039 0040 class G4Run; 0041 0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0043 0044 class RunAction : public G4UserRunAction 0045 { 0046 public: 0047 RunAction(DetectorConstruction*, PhysicsList*, PrimaryGeneratorAction*); 0048 virtual ~RunAction(); 0049 0050 virtual void BeginOfRunAction(const G4Run*); 0051 virtual void EndOfRunAction(const G4Run*); 0052 0053 inline void FillTallyEdep(G4int n, G4double e); 0054 inline void FillEdep(G4double de, G4double eni); 0055 inline void AddProjRange(G4double x); 0056 inline void AddPrimaryStep(); 0057 0058 private: 0059 void BookHisto(); 0060 0061 G4AnalysisManager* fAnalysisManager; 0062 DetectorConstruction* fDetector; 0063 PhysicsList* fPhysics; 0064 PrimaryGeneratorAction* fKinematic; 0065 G4double* fTallyEdep; 0066 G4double fProjRange, fProjRange2; 0067 G4double fEdeptot, fEniel; 0068 G4int fNbPrimarySteps; 0069 G4int fRange; 0070 }; 0071 0072 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0073 0074 inline void RunAction::FillTallyEdep(G4int n, G4double e) 0075 { 0076 fTallyEdep[n] += e; 0077 } 0078 0079 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0080 0081 inline void RunAction::FillEdep(G4double de, G4double eni) 0082 { 0083 fEdeptot += de; 0084 fEniel += eni; 0085 } 0086 0087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0088 0089 inline void RunAction::AddProjRange(G4double x) 0090 { 0091 fProjRange += x; 0092 fProjRange2 += x * x; 0093 ++fRange; 0094 } 0095 0096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0097 0098 inline void RunAction::AddPrimaryStep() 0099 { 0100 ++fNbPrimarySteps; 0101 } 0102 0103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0104 0105 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|