Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
extended/medical/dna/pdb4dna/src/SteppingAction.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // Delage et al. PDB4DNA: implementation of DNA geometry from the Protein Data
31 // Bank (PDB) description for Geant4-DNA Monte-Carlo
32 // simulations (submitted to Comput. Phys. Commun.)
33 // The Geant4-DNA web site is available at http://geant4-dna.org
34 //
35 // $Id$
36 //
39 
40 #include "SteppingAction.hh"
41 
42 #include "DetectorConstruction.hh"
43 #include "G4EventManager.hh"
44 #include "EventAction.hh"
45 #include "G4LogicalVolumeStore.hh"
46 #include "G4RunManager.hh"
47 #include "G4SteppingManager.hh"
48 #include "G4SystemOfUnits.hh"
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 :G4UserSteppingAction(),RunInitObserver(),fpEventAction(0),fpDetector(0)
54 {
55 }
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 {
61 }
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64 
66 {
68  GetUserEventAction();
70  GetUserDetectorConstruction();
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
75 void SteppingAction::UserSteppingAction(const G4Step* theStep)
76 {
78  "Transportation")
79  {
80  // Get position and edep of current step
81  //
82  G4double x = theStep->GetPreStepPoint()->GetPosition().x()/nanometer;
83  G4double y = theStep->GetPreStepPoint()->GetPosition().y()/nanometer;
84  G4double z = theStep->GetPreStepPoint()->GetPosition().z()/nanometer;
85  G4double edepStep = theStep->GetTotalEnergyDeposit()/eV;
86 
87  G4LogicalVolume* targetVolume =
89  G4LogicalVolume* theVolume =
91 
92  if ((edepStep > 0.) && (theVolume==targetVolume))
93  {
94  // Add edep to this event
95  //
96  fpEventAction->AddEdepEvent(edepStep);
97  if (fpDetector->GetBarycenterList()==NULL)
98  {
99  G4cout << "Barycenter list is null!!!" << G4endl;
100  }
101  else
102  {
103  CheckAndProcessDNAHit(x,y,z,edepStep);
104  }
105  }
106  }
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112  G4double edepStep)
113 {
114  int numStrand=0;
115  int numNucl=0;
116  int intResidue=-1; // 0 for Phospat, 1 for Sugar, 2 for Base
117  unsigned short int hit = (fpDetector->GetPDBlib()).ComputeMatchEdepDNA(
120  x*10., y*10., z*10.,// x10 => angstrom<->nm
121  numStrand, numNucl, intResidue);
122 
123  if (hit==1)
124  {
125  if ((intResidue==0)||(intResidue==1)) //Edep in Phosphate or Sugar
126  {
127  fpEventAction->AddEdepToNucleotide(numStrand,numNucl,edepStep);
128  return true;
129  }
130  else
131  {
132  return false;
133  }
134  }
135  else
136  {
137  return false;
138  }
139 }
Float_t x
Definition: compare.C:6
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:80
G4LogicalVolume * GetLogicalVolume() const
G4StepPoint * GetPreStepPoint() const
#define G4endl
Definition: G4ios.hh:61
Float_t y
Definition: compare.C:6
Double_t z
G4bool CheckAndProcessDNAHit(G4double x, G4double y, G4double z, G4double edep)
double z() const
G4VPhysicalVolume * GetPhysicalVolume() const
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
const G4ThreeVector & GetPosition() const
static G4EventManager * GetEventManager()
const G4String & GetProcessName() const
Definition: G4VProcess.hh:411
G4double GetTotalEnergyDeposit() const
static constexpr double eV
Definition: G4SIunits.hh:215
Definition: G4Step.hh:76
G4StepPoint * GetPostStepPoint() const
void UserSteppingAction(const G4Step *)
G4GLOB_DLL std::ostream G4cout
double x() const
double y() const
const G4VProcess * GetProcessDefinedStep() const
static G4LogicalVolumeStore * GetInstance()
Simple detector construction with a box volume placed in a world.
void AddEdepToNucleotide(G4int numStrand, G4int numNucl, G4double edep)
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
static constexpr double nanometer
Definition: G4SIunits.hh:101