Back to home page

EIC code displayed by LXR

 
 

    


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

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 RE06/src/RE06RunAction.cc
0027 /// \brief Implementation of the RE06RunAction class
0028 //
0029 //
0030 
0031 #include "RE06RunAction.hh"
0032 
0033 #include "RE06Run.hh"
0034 #include "RE06SteppingVerbose.hh"
0035 
0036 #include "G4ProductionCuts.hh"
0037 #include "G4Region.hh"
0038 #include "G4RegionStore.hh"
0039 #include "G4UnitsTable.hh"
0040 #include "G4VSteppingVerbose.hh"
0041 #include "G4ios.hh"
0042 
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 RE06RunAction::RE06RunAction() : G4UserRunAction()
0046 {
0047   ;
0048 }
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 
0052 RE06RunAction::~RE06RunAction()
0053 {
0054   ;
0055 }
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0058 
0059 G4Run* RE06RunAction::GenerateRun()
0060 {
0061   return new RE06Run;
0062 }
0063 
0064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0065 
0066 void RE06RunAction::BeginOfRunAction(const G4Run*)
0067 {
0068   RE06SteppingVerbose* sv = (RE06SteppingVerbose*)(G4VSteppingVerbose::GetInstance());
0069 
0070   sv->InitializeTimers();
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0074 
0075 void RE06RunAction::EndOfRunAction(const G4Run* aRun)
0076 {
0077   static G4String regName[3] = {"Calor-A", "Calor-B", "Calor-C"};
0078 
0079   const RE06Run* theRun = (const RE06Run*)aRun;
0080 
0081   if (IsMaster()) {
0082     G4cout << "############################################################" << G4endl;
0083     G4cout << " Run Summary - Number of events : " << theRun->GetNumberOfEvent() << G4endl;
0084     G4cout << "############################################################" << G4endl;
0085 
0086     G4double nEvt = (G4double)(theRun->GetNumberOfEvent());
0087     for (size_t i = 0; i < 3; i++) {
0088       size_t ih1 = 2 * i;
0089       size_t ih2 = 2 * i + 1;
0090 
0091       G4Region* region = G4RegionStore::GetInstance()->GetRegion(regName[i]);
0092       G4ProductionCuts* cuts = region->GetProductionCuts();
0093       G4cout << "Region : " << region->GetName() << G4endl;
0094       G4cout << " Production thresholds :" << G4endl << "   "
0095              << " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"), "Length") << "    e- "
0096              << G4BestUnit(cuts->GetProductionCut("e-"), "Length") << "    e+ "
0097              << G4BestUnit(cuts->GetProductionCut("e+"), "Length") << G4endl;
0098       G4cout << " Energy deposition in an event :" << G4endl << "   "
0099              << " Absorber " << G4BestUnit((theRun->GetTotalE(ih1)) / nEvt, "Energy")
0100              << "      Gap " << G4BestUnit((theRun->GetTotalE(ih2)) / nEvt, "Energy") << G4endl;
0101       G4cout << " Number of secondaries in an event :" << G4endl << "   "
0102              << " gamma in Absorber " << (theRun->GetNGamma(ih1)) / nEvt << "    in Gap "
0103              << (theRun->GetNGamma(ih2)) / nEvt << G4endl << "   "
0104              << " e-    in Absorber " << (theRun->GetNElectron(ih1)) / nEvt << "    in Gap "
0105              << (theRun->GetNElectron(ih2)) / nEvt << G4endl << "   "
0106              << " e+    in Absorber " << (theRun->GetNPositron(ih1)) / nEvt << "    in Gap "
0107              << (theRun->GetNPositron(ih2)) / nEvt << G4endl;
0108       G4cout << " Minimum kinetic energy of generated secondaries :" << G4endl << "   "
0109              << " gamma in Absorber " << G4BestUnit(theRun->GetEMinGamma(ih1), "Energy")
0110              << "    in Gap " << G4BestUnit(theRun->GetEMinGamma(ih2), "Energy") << G4endl << "   "
0111              << " e-    in Absorber " << G4BestUnit(theRun->GetEMinElectron(ih1), "Energy")
0112              << "    in Gap " << G4BestUnit(theRun->GetEMinElectron(ih2), "Energy") << G4endl
0113              << "   "
0114              << " e+    in Absorber " << G4BestUnit(theRun->GetEMinPositron(ih1), "Energy")
0115              << "    in Gap " << G4BestUnit(theRun->GetEMinPositron(ih2), "Energy") << G4endl;
0116       G4cout << " Total track length of e+/e- in an event :" << G4endl << "   "
0117              << " Absorber " << G4BestUnit((theRun->GetTotalL(ih1)) / nEvt, "Length")
0118              << "      Gap " << G4BestUnit((theRun->GetTotalL(ih2)) / nEvt, "Length") << G4endl;
0119       G4cout << " Total number of steps of e+/e- in an event :" << G4endl << "   "
0120              << " Absorber " << (theRun->GetNStep(ih1)) / nEvt << "      Gap "
0121              << (theRun->GetNStep(ih2)) / nEvt << G4endl;
0122       G4cout << "------------------------------------------------------------" << G4endl;
0123       G4cout << "Scores in parallel geometry" << G4endl;
0124       G4cout << "layer   eDep/evt  nGamma/evt nElec/evt  nPosi/evt  stpLen/evt nStep/evt" << G4endl;
0125       for (size_t k = 0; k < 20; k++) {
0126         G4cout << std::setw(8) << k;
0127         for (size_t j = 0; j < 6; j++) {
0128           G4cout << " " << std::setw(10) << (theRun->GetParaValue(i, j, k)) / nEvt;
0129         }
0130         G4cout << G4endl;
0131       }
0132       G4cout << "############################################################" << G4endl;
0133     }
0134   }
0135   else {
0136     G4cout << "CPU Time spent by each region" << G4endl;
0137     RE06SteppingVerbose* sv = (RE06SteppingVerbose*)(G4VSteppingVerbose::GetInstance());
0138     sv->Report();
0139   }
0140 }
0141 
0142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......