Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 /// \file Run.cc 27 /// \brief Implementation of the Run class 28 29 #include "Run.hh" 30 31 #include "Scorer.hh" 32 33 #include "G4Event.hh" 34 #include "G4HCofThisEvent.hh" 35 #include "G4RunManager.hh" 36 #include "G4SDManager.hh" 37 38 #include <map> 39 40 //....oooOO0OOooo........oooOO0OOooo........oo 41 42 Run::Run() : G4Run() 43 { 44 auto mfdet = dynamic_cast<G4MultiFunctionalD 45 G4SDManager::GetSDMpointer()->FindSensitiv 46 fpDose = mfdet->GetPrimitive(0); // Dose 47 fpGvalues = mfdet->GetPrimitive(1); // G-va 48 } 49 50 //....oooOO0OOooo........oooOO0OOooo........oo 51 52 void Run::RecordEvent(const G4Event* event) 53 { 54 if (event->IsAborted()) { 55 return; 56 } 57 // Hits collections 58 // 59 G4HCofThisEvent* pHCE = event->GetHCofThisEv 60 if (!pHCE) { 61 return; 62 } 63 64 auto evtMap = dynamic_cast<Scorer<Gvalues>*> 65 66 std::map<G4int, G4double*>::iterator itr; 67 68 for (itr = evtMap->GetMap()->begin(); itr != 69 G4double edep = *(itr->second); 70 fSumEne += edep; 71 } 72 G4Run::RecordEvent(event); 73 } 74 75 //....oooOO0OOooo........oooOO0OOooo........oo 76 77 void Run::Merge(const G4Run* aRun) 78 { 79 if (aRun == this) { 80 return; 81 } 82 const Run* localRun = dynamic_cast<const Run 83 fSumEne += localRun->fSumEne; 84 auto masterScorer = dynamic_cast<Scorer<Gval 85 auto localScorer = dynamic_cast<Scorer<Gvalu 86 masterScorer->AbsorbResultsFromWorkerScorer( 87 G4Run::Merge(aRun); 88 } 89 90 //....oooOO0OOooo........oooOO0OOooo........oo 91