Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
examples
extended
field
field01
src
F01CalorimeterSD.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
//
30
// $Id: F01CalorimeterSD.cc 76248 2013-11-08 11:19:52Z gcosmo $
31
//
32
//
33
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35
36
#include "
F01CalorimeterSD.hh
"
37
38
#include "
F01CalorHit.hh
"
39
#include "
F01DetectorConstruction.hh
"
40
41
#include "
G4VPhysicalVolume.hh
"
42
#include "
G4Step.hh
"
43
#include "
G4VTouchable.hh
"
44
#include "
G4TouchableHistory.hh
"
45
#include "
G4SDManager.hh
"
46
47
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48
49
F01CalorimeterSD::F01CalorimeterSD
(
G4String
name
,
50
F01DetectorConstruction
* det)
51
:
G4VSensitiveDetector
(name),
52
fCalCollection(0),
53
fDetector(det),
54
fHitID(new
G4int
[500])
55
{
56
collectionName
.
insert
(
"CalCollection"
);
57
}
58
59
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
61
F01CalorimeterSD::~F01CalorimeterSD
()
62
{
63
delete
[]
fHitID
;
64
}
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
void
F01CalorimeterSD::Initialize
(
G4HCofThisEvent
*)
69
{
70
fCalCollection
=
new
F01CalorHitsCollection
71
(
SensitiveDetectorName
,
collectionName
[0]);
72
for
(
G4int
j=0;j<1; j++) {
fHitID
[j] = -1;};
73
}
74
75
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
77
G4bool
F01CalorimeterSD::ProcessHits
(
G4Step
* step,
G4TouchableHistory
*)
78
{
79
G4double
edep
= step->
GetTotalEnergyDeposit
();
80
G4double
stepl = 0.;
81
82
stepl = step->
GetStepLength
();
83
84
if
((edep == 0.) && (stepl == 0.) )
return
false
;
85
86
G4TouchableHistory
* theTouchable
87
= (
G4TouchableHistory
*)(step->
GetPreStepPoint
()->
GetTouchable
());
88
89
G4VPhysicalVolume
* physVol = theTouchable->
GetVolume
();
90
91
G4int
number = 0;
92
if
(
fHitID
[number]==-1)
93
{
94
F01CalorHit
* calHit =
new
F01CalorHit
();
95
if
(physVol ==
fDetector
->
GetAbsorber
()) calHit->
AddAbs
(edep,stepl);
96
fHitID
[number] =
fCalCollection
->
insert
(calHit) - 1;
97
if
(
verboseLevel
>0)
98
G4cout
<<
" New Calorimeter Hit on F01: "
<< number <<
G4endl
;
99
}
100
else
101
{
102
if
(physVol ==
fDetector
->
GetAbsorber
())
103
(*
fCalCollection
)[
fHitID
[number]]->AddAbs(edep,stepl);
104
if
(
verboseLevel
>0)
105
G4cout
<<
" Energy added to F01: "
<< number <<
G4endl
;
106
}
107
return
true
;
108
}
109
110
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111
112
void
F01CalorimeterSD::EndOfEvent
(
G4HCofThisEvent
* hce)
113
{
114
static
G4int
hcID = -1;
115
if
(hcID<0)
116
{ hcID =
G4SDManager::GetSDMpointer
()->
GetCollectionID
(
collectionName
[0]); }
117
hce->
AddHitsCollection
(hcID,
fCalCollection
);
118
}
119
120
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
G4SDManager::GetCollectionID
G4int GetCollectionID(G4String colName)
Definition:
G4SDManager.cc:135
name
const XML_Char * name
Definition:
expat.h:151
G4StepPoint::GetTouchable
const G4VTouchable * GetTouchable() const
F01CalorimeterSD::~F01CalorimeterSD
virtual ~F01CalorimeterSD()
Definition:
F01CalorimeterSD.cc:61
F01CalorimeterSD::Initialize
virtual void Initialize(G4HCofThisEvent *)
Definition:
F01CalorimeterSD.cc:68
F01CalorHit
Definition:
F01CalorHit.hh:45
F01CalorimeterSD::fDetector
F01DetectorConstruction * fDetector
Definition:
F01CalorimeterSD.hh:62
G4Step::GetPreStepPoint
G4StepPoint * GetPreStepPoint() const
G4endl
#define G4endl
Definition:
G4ios.hh:61
F01CalorimeterSD::fCalCollection
F01CalorHitsCollection * fCalCollection
Definition:
F01CalorimeterSD.hh:61
G4HCofThisEvent::AddHitsCollection
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
Definition:
G4HCofThisEvent.cc:61
G4String
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4String.hh:45
F01CalorimeterSD::fHitID
G4int * fHitID
Definition:
F01CalorimeterSD.hh:63
G4VSensitiveDetector::SensitiveDetectorName
G4String SensitiveDetectorName
Definition:
G4VSensitiveDetector.hh:105
F01CalorimeterSD::F01CalorimeterSD
F01CalorimeterSD(G4String, F01DetectorConstruction *)
Definition:
F01CalorimeterSD.cc:49
F01CalorHitsCollection
G4THitsCollection< F01CalorHit > F01CalorHitsCollection
Definition:
F01CalorHit.hh:82
G4double
double G4double
Definition:
G4Types.hh:76
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4VSensitiveDetector::verboseLevel
G4int verboseLevel
Definition:
G4VSensitiveDetector.hh:108
G4VPhysicalVolume.hh
G4CollectionNameVector::insert
void insert(G4String str)
Definition:
G4CollectionNameVector.hh:42
G4THitsCollection::insert
G4int insert(T *aHit)
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4THitsCollection.hh:105
G4TouchableHistory
Definition:
G4TouchableHistory.hh:53
F01CalorimeterSD.hh
Definition of the F01CalorimeterSD class.
G4TouchableHistory::GetVolume
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Step::GetStepLength
G4double GetStepLength() const
G4VTouchable.hh
F01DetectorConstruction::GetAbsorber
const G4VPhysicalVolume * GetAbsorber()
Definition:
F01DetectorConstruction.hh:95
G4Step::GetTotalEnergyDeposit
G4double GetTotalEnergyDeposit() const
G4Step
Definition:
G4Step.hh:76
edep
Double_t edep
Definition:
human_phantom/macro.C:13
F01CalorimeterSD::ProcessHits
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)
Definition:
F01CalorimeterSD.cc:77
G4SDManager::GetSDMpointer
static G4SDManager * GetSDMpointer()
Definition:
G4SDManager.cc:40
G4int
int G4int
Definition:
G4Types.hh:78
G4SDManager.hh
G4VSensitiveDetector::collectionName
G4CollectionNameVector collectionName
Definition:
G4VSensitiveDetector.hh:99
F01CalorimeterSD::EndOfEvent
virtual void EndOfEvent(G4HCofThisEvent *)
Definition:
F01CalorimeterSD.cc:112
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:82
F01DetectorConstruction
Definition:
F01DetectorConstruction.hh:56
G4TouchableHistory.hh
G4cout
G4GLOB_DLL std::ostream G4cout
F01DetectorConstruction.hh
Definition of the F01DetectorConstruction class.
G4Step.hh
G4HCofThisEvent
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4HCofThisEvent.hh:64
F01CalorHit.hh
Definition of the F01CalorHit class.
F01CalorHit::AddAbs
void AddAbs(G4double de, G4double dl)
Definition:
F01CalorHit.hh:63
다음에 의해 생성됨 :
1.8.5