Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // << 27 /// \file medical/GammaTherapy/src/CheckVolume << 28 /// \brief Implementation of the CheckVolumeSD << 29 // << 30 // ------------------------------------------- 23 // ------------------------------------------------------------- 31 // 24 // 32 // ---------- CheckVolumeSD ------------- 25 // ---------- CheckVolumeSD ------------- 33 // 26 // 34 // Modified: 27 // Modified: 35 // 28 // 36 // ------------------------------------------- 29 // ------------------------------------------------------------- 37 30 38 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 39 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 40 33 41 #include "CheckVolumeSD.hh" 34 #include "CheckVolumeSD.hh" 42 35 43 #include "Run.hh" << 44 << 45 #include "G4Gamma.hh" << 46 #include "G4LogicalVolume.hh" << 47 #include "G4Positron.hh" << 48 #include "G4RunManager.hh" 36 #include "G4RunManager.hh" 49 #include "G4SystemOfUnits.hh" << 50 #include "G4Track.hh" << 51 #include "G4VPhysicalVolume.hh" 37 #include "G4VPhysicalVolume.hh" >> 38 #include "G4LogicalVolume.hh" >> 39 #include "G4Track.hh" >> 40 #include "G4Positron.hh" 52 #include "globals.hh" 41 #include "globals.hh" >> 42 #include "Histo.hh" >> 43 #include "G4Gamma.hh" 53 44 54 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 55 46 56 CheckVolumeSD::CheckVolumeSD(const G4String& n << 47 CheckVolumeSD::CheckVolumeSD(const G4String& name) >> 48 :G4VSensitiveDetector(name), >> 49 theHisto(Histo::GetPointer()), >> 50 evno(0) >> 51 {} 57 52 58 //....oooOO0OOooo........oooOO0OOooo........oo 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 59 54 60 CheckVolumeSD::~CheckVolumeSD() {} << 55 CheckVolumeSD::~CheckVolumeSD() >> 56 {} 61 57 62 //....oooOO0OOooo........oooOO0OOooo........oo 58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 63 59 64 void CheckVolumeSD::Initialize(G4HCofThisEvent << 60 void CheckVolumeSD::Initialize(G4HCofThisEvent*) >> 61 { >> 62 evno++; >> 63 if(0 < theHisto->GetVerbose()) >> 64 G4cout << "CheckVolumeSD: Begin Of Event # " << evno << G4endl; >> 65 } 65 66 66 //....oooOO0OOooo........oooOO0OOooo........oo 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 67 68 68 G4bool CheckVolumeSD::ProcessHits(G4Step* aSte 69 G4bool CheckVolumeSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) 69 { 70 { 70 Run* run = static_cast<Run*>(G4RunManager::G << 71 << 72 const G4Track* track = aStep->GetTrack(); 71 const G4Track* track = aStep->GetTrack(); 73 G4double e = track->GetKineticEnergy(); 72 G4double e = track->GetKineticEnergy(); 74 if (track->GetDefinition() == G4Gamma::Gamma 73 if (track->GetDefinition() == G4Gamma::Gamma()) { 75 G4ThreeVector p = track->GetPosition(); 74 G4ThreeVector p = track->GetPosition(); 76 G4double x = p.x(); 75 G4double x = p.x(); 77 G4double y = p.y(); 76 G4double y = p.y(); 78 G4double r = std::sqrt(x * x + y * y); << 77 G4double r = std::sqrt(x*x + y*y); 79 run->AddPhantomGamma(e, r); << 78 theHisto->AddGamma(e,r); 80 } 79 } 81 if (run->GetVerbose()) { << 80 if(1 < theHisto->GetVerbose()) { 82 G4cout << "CheckVolumeSD: energy = " << e << 81 G4cout << "CheckVolumeSD: energy = " << e/MeV >> 82 << G4endl; 83 } 83 } 84 return true; 84 return true; 85 } 85 } 86 86 87 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 88 88 89 void CheckVolumeSD::EndOfEvent(G4HCofThisEvent << 89 void CheckVolumeSD::EndOfEvent(G4HCofThisEvent*) >> 90 {} 90 91 91 //....oooOO0OOooo........oooOO0OOooo........oo 92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 93 93 void CheckVolumeSD::clear() {} << 94 void CheckVolumeSD::clear() >> 95 {} 94 96 95 //....oooOO0OOooo........oooOO0OOooo........oo 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 98 97 void CheckVolumeSD::PrintAll() {} << 99 >> 100 void CheckVolumeSD::PrintAll() >> 101 {} 98 102 99 //....oooOO0OOooo........oooOO0OOooo........oo 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 104 >> 105 100 106