Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:34

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