Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:09:51

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 Par04RunAction.hh
0027 /// \brief Definition of the Par04RunAction class
0028 
0029 #ifndef PAR04RUNACTION_HH
0030 #define PAR04RUNACTION_HH
0031 
0032 #include "Par04EventInformation.hh"  // for Par04EventInformation
0033 #include "Par04PrimaryGeneratorAction.hh"
0034 
0035 #include "G4Event.hh"  // for G4Event
0036 #include "G4ParticleGun.hh"  // for G4ParticleGun
0037 #include "G4ParticleTable.hh"  // for G4ParticleTable
0038 #include "G4SystemOfUnits.hh"  // for GeV
0039 #include "G4UserRunAction.hh"
0040 
0041 #include <CLHEP/Units/SystemOfUnits.h>  // for GeV
0042 #include <G4String.hh>  // for G4String
0043 #include <G4ThreeVector.hh>  // for G4ThreeVector
0044 #include <G4Types.hh>  // for G4int
0045 #include <G4VUserPrimaryGeneratorAction.hh>  // for G4VUserPrimaryGeneratorA...
0046 #include <string>  // for basic_string
0047 class G4ParticleDefinition;
0048 class Par04EventAction;
0049 class G4Run;
0050 class Par04DetectorConstruction;
0051 
0052 /**
0053  * @brief Run action
0054  *
0055  * Create analysis file and define control histograms for showers in detectors.
0056  * Histograms are configured taking into account the dimensions of the readout mesh.
0057  * Ntuple with hits is also stored. It contains energy of the primary particle,
0058  * coordinates (cylindrical) of the hit and the deposited energy.
0059  *
0060  */
0061 
0062 class Par04RunAction : public G4UserRunAction
0063 {
0064   public:
0065     /// Constructor. Defines the histograms.
0066     Par04RunAction(Par04DetectorConstruction* aDetector, Par04EventAction* aEventAction);
0067     virtual ~Par04RunAction();
0068 
0069     /// Open the file for the analysis
0070     virtual void BeginOfRunAction(const G4Run*) final;
0071     /// Write and close the file
0072     virtual void EndOfRunAction(const G4Run*) final;
0073 
0074   private:
0075     /// Pointer to detector construction to retrieve the detector dimensions to
0076     /// setup the histograms
0077     Par04DetectorConstruction* fDetector;
0078     /// Pointer to event action to save hits
0079     Par04EventAction* fEventAction;
0080     /// Timer measurement
0081     std::chrono::steady_clock::time_point fChronoStart;
0082     std::chrono::steady_clock::time_point fChronoEnd;
0083 };
0084 
0085 #endif /* PAR04RUNACTION_HH */