Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
examples
extended
hadronic
Hadr07
src
extended/hadronic/Hadr07/src/TrackingAction.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
//
28
//
29
// $Id: TrackingAction.cc 74997 2013-10-25 10:52:13Z gcosmo $
30
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "TrackingAction.hh"
35
36
#include "Run.hh"
37
#include "HistoManager.hh"
38
39
#include "
G4Track.hh
"
40
#include "
G4StepStatus.hh
"
41
#include "
G4RunManager.hh
"
42
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45
TrackingAction::TrackingAction
()
46
:
G4UserTrackingAction
()
47
{ }
48
49
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50
51
void
TrackingAction::PreUserTrackingAction
(
const
G4Track
*
track
)
52
{
53
//count secondary particles
54
if
(track->
GetTrackID
() == 1)
return
;
55
G4int
iabs = track->
GetTouchableHandle
()->
GetCopyNumber
();
56
G4String
name
= track->
GetDefinition
()->
GetParticleName
();
57
G4double
energy
= track->
GetKineticEnergy
();
58
Run
* run =
static_cast<
Run
*
>
(
59
G4RunManager::GetRunManager
()->
GetNonConstCurrentRun
());
60
if
(iabs > 0) run->
ParticleCount
(iabs,name,energy);
61
}
62
63
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64
65
void
TrackingAction::PostUserTrackingAction
(
const
G4Track
* track)
66
{
67
// get Run
68
Run
* run
69
=
static_cast<
Run
*
>
(
70
G4RunManager::GetRunManager
()->
GetNonConstCurrentRun
());
71
72
// where are we ?
73
G4StepStatus
status = track->
GetStep
()->
GetPostStepPoint
()->
GetStepStatus
();
74
75
//status of primary particle : absorbed, transmited, reflected ?
76
if
(track->
GetTrackID
() == 1) {
77
G4int
flag = 0;
78
if
(status ==
fWorldBoundary
) {
79
if
(track->
GetMomentumDirection
().
x
() > 0.) flag = 1;
80
else
flag = 2;
81
}
82
run->
AddTrackStatus
(flag);
83
}
84
85
// keep only emerging particles
86
if
(status !=
fWorldBoundary
)
return
;
87
88
// count particles
89
const
G4ParticleDefinition
* particle = track->
GetParticleDefinition
();
90
G4String
name = particle->
GetParticleName
();
91
G4double
energy = track->
GetKineticEnergy
();
92
run->
ParticleCount
(0,name,energy);
93
95
}
96
97
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
G4RunManager::GetRunManager
static G4RunManager * GetRunManager()
Definition:
G4RunManager.cc:80
G4Track::GetKineticEnergy
G4double GetKineticEnergy() const
name
const XML_Char * name
Definition:
expat.h:151
Run::AddTrackStatus
void AddTrackStatus(G4int i)
Definition:
extended/electromagnetic/TestEm11/src/Run.cc:128
G4UserTrackingAction
Definition:
G4UserTrackingAction.hh:54
G4ParticleDefinition::GetParticleName
const G4String & GetParticleName() const
Definition:
G4ParticleDefinition.hh:121
G4Track::GetTrackID
G4int GetTrackID() const
G4String
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4String.hh:45
G4Track::GetTouchableHandle
const G4TouchableHandle & GetTouchableHandle() const
G4Track::GetParticleDefinition
const G4ParticleDefinition * GetParticleDefinition() const
G4Track::GetDefinition
G4ParticleDefinition * GetDefinition() const
Run::ParticleCount
void ParticleCount(G4String, G4double)
Definition:
extended/hadronic/Hadr03/src/Run.cc:114
TrackingAction::PostUserTrackingAction
void PostUserTrackingAction(const G4Track *)
Definition:
advanced/amsEcal/src/TrackingAction.cc:58
fWorldBoundary
Definition:
G4StepStatus.hh:52
G4double
double G4double
Definition:
G4Types.hh:76
G4StepPoint::GetStepStatus
G4StepStatus GetStepStatus() const
G4Track
Definition:
G4Track.hh:76
energy
double energy
Definition:
plottest35.C:25
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:73
G4StepStatus
G4StepStatus
Definition:
G4StepStatus.hh:49
G4Step::GetPostStepPoint
G4StepPoint * GetPostStepPoint() const
G4Track::GetStep
const G4Step * GetStep() const
G4VTouchable::GetCopyNumber
G4int GetCopyNumber(G4int depth=0) const
G4RunManager.hh
G4RunManager::GetNonConstCurrentRun
G4Run * GetNonConstCurrentRun() const
Definition:
G4RunManager.hh:528
G4Track.hh
TrackingAction::TrackingAction
TrackingAction()
Definition:
extended/electromagnetic/TestEm2/src/TrackingAction.cc:42
G4int
int G4int
Definition:
G4Types.hh:78
CLHEP::Hep3Vector::x
double x() const
G4StepStatus.hh
G4Track::GetMomentumDirection
const G4ThreeVector & GetMomentumDirection() const
track
Float_t track
Definition:
extended/medical/dna/range/plot.C:35
TrackingAction::PreUserTrackingAction
void PreUserTrackingAction(const G4Track *)
Definition:
advanced/amsEcal/src/TrackingAction.cc:53
Run
Definition:
advanced/amsEcal/include/Run.hh:46
다음에 의해 생성됨 :
1.8.5