Back to home page

EIC code displayed by LXR

 
 

    


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

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 // TETRunAction.hh
0027 //
0028 // Author: Haegin Han
0029 // Reference: ICRP Publication 145. Ann. ICRP 49(3), 2020.
0030 // Geant4 Contributors: J. Allison and S. Guatelli
0031 //
0032 
0033 #ifndef TETRunAction_h
0034 #define TETRunAction_h 1
0035 
0036 #include <ostream>
0037 #include <fstream>
0038 #include <map>
0039 
0040 #include "G4RunManager.hh"
0041 #include "G4UnitsTable.hh"
0042 #include "G4UserRunAction.hh"
0043 #include "G4SystemOfUnits.hh"
0044 
0045 #include "TETRun.hh"
0046 #include "TETPrimaryGeneratorAction.hh"
0047 #include "TETModelImport.hh"
0048 
0049 // *********************************************************************
0050 // The main function of this UserRunAction class is to produce the result
0051 // data and print them.
0052 // -- GenerateRun: Generate TETRun class which will calculate the sum of
0053 //                  energy deposition.
0054 // -- BeginOfRunAction: Set the RunManager to print the progress at the
0055 //                      interval of 10%.
0056 // -- EndOfRunAction: Print the run result by G4cout and std::ofstream.
0057 //  └-- PrintResult: Method to print the result.
0058 // *********************************************************************
0059 
0060 class TETRunAction : public G4UserRunAction
0061 {
0062 public:
0063  explicit TETRunAction(TETModelImport* tetData, G4String output);
0064  virtual ~TETRunAction() = default;
0065 
0066 public:
0067  virtual G4Run* GenerateRun() override;
0068  virtual void BeginOfRunAction(const G4Run*) override;
0069  virtual void EndOfRunAction(const G4Run*) override;
0070 
0071  void PrintResult(std::ostream &out);
0072   
0073 private:
0074  TETModelImport* fTetData;
0075  TETRun*         fRun;
0076  G4int           fNumOfEvent;
0077  G4int           fRunID;
0078  G4String        fOutputFile;
0079 };
0080 #endif
0081 
0082 
0083 
0084 
0085