SimG4Core
Geometry
src
DDG4SensitiveConverter.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Geometry/interface/DDG4SensitiveConverter.h
"
2
#include "
SimG4Core/Geometry/interface/SensitiveDetectorCatalog.h
"
3
4
#include "
DetectorDescription/Core/interface/DDLogicalPart.h
"
5
6
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
7
#include "
FWCore/Utilities/interface/Exception.h
"
8
9
#include "G4LogicalVolume.hh"
10
11
DDG4SensitiveConverter::DDG4SensitiveConverter
() {}
12
13
DDG4SensitiveConverter::~DDG4SensitiveConverter
() {}
14
15
void
DDG4SensitiveConverter::upDate
(
const
DDG4DispContainer
&ddg4s,
SensitiveDetectorCatalog
&
catalog
) {
16
edm::LogVerbatim
(
"SimG4CoreGeometry"
) <<
" DDG4SensitiveConverter::upDate() starts"
;
17
18
for
(
auto
ddg4 : ddg4s) {
19
const
DDLogicalPart
*
part
= (ddg4->getDDLogicalPart());
20
G4LogicalVolume *
result
= (ddg4->getG4LogicalVolume());
21
22
std::string
sClassName =
getString
(
"SensitiveDetector"
,
part
);
23
std::string
sROUName =
getString
(
"ReadOutName"
,
part
);
24
std::string
fff =
result
->GetName();
25
if
(sClassName !=
"NotFound"
) {
26
edm::LogVerbatim
(
"SimG4CoreGeometry"
)
27
<<
" DDG4SensitiveConverter: Sensitive "
<< fff <<
" Class Name "
<< sClassName <<
" ROU Name "
<< sROUName;
28
fff =
result
->GetName();
29
catalog
.insert(sClassName, sROUName, fff);
30
}
31
}
32
}
33
34
std::string
DDG4SensitiveConverter::getString
(
const
std::string
&
ss
,
const
DDLogicalPart
*
part
) {
35
std::vector<std::string>
temp
;
36
DDValue
val
(
ss
);
37
std::vector<const DDsvalues_type *>
result
=
part
->specifics();
38
bool
foundIt =
false
;
39
for
(
auto
stype :
result
) {
40
foundIt =
DDfetch
(stype,
val
);
41
if
(foundIt)
42
break
;
43
}
44
if
(foundIt) {
45
temp
=
val
.strings();
46
if
(
temp
.size() != 1) {
47
edm::LogError
(
"SimG4CoreGeometry"
) <<
"DDG4SensitiveConverter - ERROR: I need 1 "
<<
ss
<<
" tags"
;
48
throw
cms::Exception
(
"SimG4CoreGeometry"
,
49
" DDG4SensitiveConverter::getString Problem with "
50
"Region tags - one and only one allowed: "
+
51
ss
);
52
}
53
return
temp
[0];
54
}
55
return
"NotFound"
;
56
}
DDG4SensitiveConverter.h
MessageLogger.h
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition:
getEcalConditions_orcoffint2r_cff.py:40
DDG4DispContainer
std::vector< DDG4Dispatchable * > DDG4DispContainer
Definition:
DDG4DispContainer.h:8
groupFilesInBlocks.temp
list temp
Definition:
groupFilesInBlocks.py:142
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
part
part
Definition:
HCALResponse.h:20
SensitiveDetectorCatalog
Definition:
SensitiveDetectorCatalog.h:10
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition:
DDsvalues.cc:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
DDG4SensitiveConverter::~DDG4SensitiveConverter
virtual ~DDG4SensitiveConverter()
Definition:
DDG4SensitiveConverter.cc:13
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition:
DDLogicalPart.h:93
SensitiveDetectorCatalog.h
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
DDLogicalPart.h
DDG4SensitiveConverter::upDate
void upDate(const DDG4DispContainer &ddg4s, SensitiveDetectorCatalog &)
Definition:
DDG4SensitiveConverter.cc:15
DDG4SensitiveConverter::DDG4SensitiveConverter
DDG4SensitiveConverter()
Definition:
DDG4SensitiveConverter.cc:11
heppy_batch.val
val
Definition:
heppy_batch.py:351
DDValue
Definition:
DDValue.h:21
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
Exception
Definition:
hltDiff.cc:246
Exception.h
mps_fire.result
result
Definition:
mps_fire.py:311
DDG4SensitiveConverter::getString
std::string getString(const std::string &, const DDLogicalPart *)
Definition:
DDG4SensitiveConverter.cc:34
Generated for CMSSW Reference Manual by
1.8.16