Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
examples
advanced
composite_calorimeter
src
CCalSensitiveDetectors.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
//
27
// File: CCalSensitiveDetectors.cc
28
// Description: Provides a map of logicalvolume pointers which can be sensitive
30
31
#include "
CCalSensitiveDetectors.hh
"
32
33
//#define debug
34
35
CCalSensitiveDetectors
*
CCalSensitiveDetectors::theInstance
= 0;
36
37
38
CCalSensitiveDetectors
*
CCalSensitiveDetectors::getInstance
() {
39
if
(!
theInstance
)
theInstance
=
new
CCalSensitiveDetectors
;
40
return
theInstance
;
41
}
42
43
44
void
CCalSensitiveDetectors::registerVolume
(
const
G4String
&
string
,
45
G4LogicalVolume
*
logv
) {
46
47
theLVs
.insert(mmslv::value_type(
string
, logv));
48
#ifdef debug
49
G4cout
<<
"CCalSensitiveDetectors : Register "
<< logv->
GetName
()
50
<<
" in category "
<<
string
<<
G4endl
;
51
#endif
52
}
53
54
std::vector<G4LogicalVolume*>
CCalSensitiveDetectors::getVolumes
(
const
G4String
&
string
,
55
bool
exist) {
56
57
mmslv::const_iterator mmscite;
58
std::pair<mmslv::iterator, mmslv::iterator> mmsdi;
59
mmsdi =
theLVs
.equal_range(
string
);
60
std::vector<G4LogicalVolume*> lvs;
61
for
(mmscite = mmsdi.first; mmscite != mmsdi.second; mmscite++ ) {
62
lvs.push_back(const_cast<G4LogicalVolume*>((*mmscite).second));
63
}
64
65
if
(exist)
G4cout
<<
"CCalSensitiveDetector : "
<< lvs.size()
66
<<
" detectors for "
<<
string
<<
G4endl
;
67
68
return
lvs;
69
}
70
71
72
bool
CCalSensitiveDetectors::setSensitive
(
const
G4String
&
string
,
73
G4VSensitiveDetector
* sens) {
74
75
bool
result
=
false
;
76
mmslv::const_iterator mmscite;
77
std::pair<mmslv::iterator, mmslv::iterator> mmsdi;
78
mmsdi =
theLVs
.equal_range(
string
);
79
for
(mmscite = mmsdi.first; mmscite != mmsdi.second; mmscite++ ) {
80
G4LogicalVolume
* lv =
const_cast<
G4LogicalVolume
*
>
((*mmscite).second);
81
lv ->
SetSensitiveDetector
(sens);
82
result =
true
;
83
#ifdef debug
84
G4cout
<<
" Associate SD "
<< sens->
GetName
() <<
" to "
<< lv->
GetName
()
85
<<
G4endl
;
86
#endif
87
}
88
return
result
;
89
90
}
logv
void logv(const uint32_t size, G4double const *__restrict__ iarray, G4double *__restrict__ oarray)
G4VSensitiveDetector
Definition:
G4VSensitiveDetector.hh:50
CCalSensitiveDetectors.hh
CCalSensitiveDetectors::registerVolume
void registerVolume(const G4String &name, G4LogicalVolume *)
Definition:
CCalSensitiveDetectors.cc:44
G4endl
#define G4endl
Definition:
G4ios.hh:61
G4String
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4String.hh:45
CCalSensitiveDetectors::setSensitive
bool setSensitive(const G4String &string, G4VSensitiveDetector *sens)
Definition:
CCalSensitiveDetectors.cc:72
result
G4double G4ParticleHPJENDLHEData::G4double result
Definition:
G4ParticleHPJENDLHEData.cc:257
CCalSensitiveDetectors::CCalSensitiveDetectors
CCalSensitiveDetectors()
Definition:
CCalSensitiveDetectors.hh:50
G4VSensitiveDetector::GetName
G4String GetName() const
Definition:
G4VSensitiveDetector.hh:146
G4LogicalVolume
Definition:
G4LogicalVolume.hh:190
CCalSensitiveDetectors::getInstance
static CCalSensitiveDetectors * getInstance()
Definition:
CCalSensitiveDetectors.cc:38
CCalSensitiveDetectors::getVolumes
std::vector< G4LogicalVolume * > getVolumes(const G4String &name, bool exists=0)
Definition:
CCalSensitiveDetectors.cc:54
G4cout
G4GLOB_DLL std::ostream G4cout
CCalSensitiveDetectors::theLVs
mmslv theLVs
Definition:
CCalSensitiveDetectors.hh:53
CCalSensitiveDetectors::theInstance
static CCalSensitiveDetectors * theInstance
Definition:
CCalSensitiveDetectors.hh:50
G4LogicalVolume::GetName
const G4String & GetName() const
CCalSensitiveDetectors
Definition:
CCalSensitiveDetectors.hh:41
G4LogicalVolume::SetSensitiveDetector
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
Definition:
G4LogicalVolume.cc:444
다음에 의해 생성됨 :
1.8.5