Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
advanced/microelectronics/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 // -------------------------------------------------------------------
27 // $Id: SteppingAction.cc,v 1.1 2012-09-21 mraine Exp $
28 // -------------------------------------------------------------------
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
31 
32 #include "Analysis.hh"
33 
34 #include "SteppingAction.hh"
35 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 
39 #include "G4SystemOfUnits.hh"
40 #include "G4SteppingManager.hh"
41 #include "G4VTouchable.hh"
42 #include "G4VPhysicalVolume.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45 
47 {}
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
52 {}
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55 
57 {
60  G4double x,y,z,xp,yp,zp;
61 
62  if (step->GetTrack()->GetDynamicParticle()->GetDefinition() ->GetParticleName() == "e-") flagParticle = 1;
63  if (step->GetTrack()->GetDynamicParticle()->GetDefinition() ->GetParticleName() == "proton") flagParticle = 2;
64  if (step->GetTrack()->GetDynamicParticle()->GetDefinition() ->GetParticleName() == "GenericIon") flagParticle = 3;
65 
66  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="msc") flagProcess =10;
67  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="e-_G4MicroElecElastic") flagProcess =11;
68  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="e-_G4MicroElecInelastic") flagProcess =12;
69  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="eCapture") flagProcess =13;
70 
71  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="p_G4MicroElecInelastic") flagProcess =14;
72 
73  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="ion_G4MicroElecInelastic") flagProcess =15;
74 
75  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="hIoni") flagProcess =16;
76  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()=="eIoni") flagProcess =17;
77 
78  if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName()!="Transportation")
79  {
80  x=step->GetPreStepPoint()->GetPosition().x()/nanometer;
81  y=step->GetPreStepPoint()->GetPosition().y()/nanometer;
82  z=step->GetPreStepPoint()->GetPosition().z()/nanometer;
83  xp=step->GetPostStepPoint()->GetPosition().x()/nanometer;
84  yp=step->GetPostStepPoint()->GetPosition().y()/nanometer;
85  zp=step->GetPostStepPoint()->GetPosition().z()/nanometer;
86 
87  // get analysis manager
88  G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
89 
90  // fill ntuple
91  analysisManager->FillNtupleDColumn(0, flagParticle);
92  analysisManager->FillNtupleDColumn(1, flagProcess);
93  analysisManager->FillNtupleDColumn(2, x);
94  analysisManager->FillNtupleDColumn(3, y);
95  analysisManager->FillNtupleDColumn(4, z);
96  analysisManager->FillNtupleDColumn(5, step->GetTotalEnergyDeposit()/eV);
97  analysisManager->FillNtupleDColumn(6, std::sqrt((x-xp)*(x-xp)+(y-yp)*(y-yp)+(z-zp)*(z-zp))/nm);
98  analysisManager->FillNtupleDColumn(7, (step->GetPreStepPoint()->GetKineticEnergy() - step->GetPostStepPoint()->GetKineticEnergy())/eV );
99  analysisManager->AddNtupleRow();
100  }
101 }
Float_t x
Definition: compare.C:6
G4StepPoint * GetPreStepPoint() const
static constexpr double nm
Definition: G4SIunits.hh:112
Float_t y
Definition: compare.C:6
Double_t z
const G4String & GetParticleName() const
double z() const
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetPosition() const
G4Track * GetTrack() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:411
G4double GetTotalEnergyDeposit() const
static constexpr double eV
Definition: G4SIunits.hh:215
G4CsvAnalysisManager G4AnalysisManager
Definition: g4csv_defs.hh:77
Definition: G4Step.hh:76
G4StepPoint * GetPostStepPoint() const
void UserSteppingAction(const G4Step *)
G4double GetKineticEnergy() const
double x() const
double y() const
const G4VProcess * GetProcessDefinedStep() const
const G4DynamicParticle * GetDynamicParticle() const
static constexpr double nanometer
Definition: G4SIunits.hh:101