Back to home page

EIC code displayed by LXR

 
 

    


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

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 polarisation/Pol01/include/RunAction.hh
0027 /// \brief Definition of the RunAction class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #ifndef RunAction_h
0034 #define RunAction_h 1
0035 
0036 #include "G4AnalysisManager.hh"
0037 #include "G4UserRunAction.hh"
0038 #include "G4VAccumulable.hh"
0039 #include "globals.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 class DetectorConstruction;
0044 class PrimaryGeneratorAction;
0045 class G4Run;
0046 class G4ParticleDefinition;
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0049 
0050 class RunAction : public G4UserRunAction
0051 {
0052     class ParticleStatistics : public G4VAccumulable
0053     {
0054       public:
0055         ParticleStatistics(const G4String& name);
0056         ~ParticleStatistics();
0057         void EventFinished();
0058         void FillData(G4double kinEnergy, G4double costheta, G4double longitudinalPolarization);
0059         void PrintResults(G4int totalNumberOfEvents);
0060 
0061         void Reset() override;
0062         void Merge(const G4VAccumulable& other) override;
0063 
0064       private:
0065         G4int fCurrentNumber;
0066         G4int fTotalNumber, fTotalNumber2;
0067         G4double fSumEnergy, fSumEnergy2;
0068         G4double fSumPolarization, fSumPolarization2;
0069         G4double fSumCosTheta, fSumCosTheta2;
0070     };
0071 
0072   public:
0073     RunAction(DetectorConstruction*, PrimaryGeneratorAction* = nullptr);
0074     virtual ~RunAction();
0075 
0076     virtual void BeginOfRunAction(const G4Run*);
0077     virtual void EndOfRunAction(const G4Run*);
0078 
0079     void CountProcesses(G4String&);
0080 
0081     void FillData(const G4ParticleDefinition* particle, G4double kinEnergy, G4double costheta,
0082                   G4double phi, G4double longitudinalPolarization);
0083 
0084     void EventFinished();
0085 
0086   private:
0087     void BookHisto();
0088     void SaveHisto(G4int nevents);
0089 
0090     const G4ParticleDefinition* fGamma;
0091     const G4ParticleDefinition* fElectron;
0092     const G4ParticleDefinition* fPositron;
0093 
0094     DetectorConstruction* fDetector;
0095     PrimaryGeneratorAction* fPrimary;
0096 
0097     G4AnalysisManager* fAnalysisManager;
0098 
0099     G4int fTotalEventCount;
0100 };
0101 
0102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0103 
0104 #endif