Geometry
TrackerNumberingBuilder
plugins
CmsDetConstruction.cc
Go to the documentation of this file.
1
#include "
DetectorDescription/Core/interface/DDFilteredView.h
"
2
#include "
DetectorDescription/DDCMS/interface/DDFilteredView.h
"
3
#include "
Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h
"
4
#include "
Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h
"
5
#include "
DataFormats/DetId/interface/DetId.h
"
6
7
template
<
class
FilteredView>
8
void
CmsDetConstruction<FilteredView>::buildSmallDetsforGlued
(FilteredView& fv,
9
GeometricDet
* mother,
10
const
std::string
& attribute) {
11
GeometricDet
* det =
new
GeometricDet
(&fv,
12
CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum
.
type
(
13
ExtractStringFromDDD<FilteredView>::getString
(attribute, &fv)));
14
static
const
std::string
stereo =
"TrackerStereoDetectors"
;
15
16
if
(
ExtractStringFromDDD<FilteredView>::getString
(stereo, &fv) ==
"true"
) {
17
uint32_t
temp
= 1;
18
det->
setGeographicalID
(
DetId
(
temp
));
19
}
else
{
20
uint32_t
temp
= 2;
21
det->
setGeographicalID
(
DetId
(
temp
));
22
}
23
24
mother->
addComponent
(det);
25
}
26
27
template
<
class
FilteredView>
28
void
CmsDetConstruction<FilteredView>::buildSmallDetsforStack
(FilteredView& fv,
29
GeometricDet
* mother,
30
const
std::string
& attribute) {
31
GeometricDet
* det =
new
GeometricDet
(&fv,
32
CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum
.
type
(
33
ExtractStringFromDDD<FilteredView>::getString
(attribute, &fv)));
34
static
const
std::string
isLower =
"TrackerLowerDetectors"
;
35
static
const
std::string
isUpper =
"TrackerUpperDetectors"
;
36
37
if
(
ExtractStringFromDDD<FilteredView>::getString
(isLower, &fv) ==
"true"
) {
38
uint32_t
temp
= 1;
39
det->
setGeographicalID
(
DetId
(
temp
));
40
}
else
if
(
ExtractStringFromDDD<FilteredView>::getString
(isUpper, &fv) ==
"true"
) {
41
uint32_t
temp
= 2;
42
det->
setGeographicalID
(
DetId
(
temp
));
43
}
else
{
44
edm::LogError
(
"DetConstruction"
) <<
" module defined in a Stack but not upper either lower!? "
;
45
}
46
mother->
addComponent
(det);
47
}
48
49
template
<
class
FilteredView>
50
void
CmsDetConstruction<FilteredView>::buildComponent
(FilteredView& fv,
51
GeometricDet
* mother,
52
const
std::string
& attribute) {
53
//
54
// at this level I check whether it is a merged detector or not
55
//
56
57
GeometricDet
* det =
new
GeometricDet
(&fv,
58
CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum
.
type
(
59
ExtractStringFromDDD<FilteredView>::getString
(attribute, &fv)));
60
61
//Phase1 mergedDet: searching for sensors
62
if
(
CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum
.
type
(
63
ExtractStringFromDDD<FilteredView>::getString
(attribute, &fv)) ==
GeometricDet::mergedDet
) {
64
// I have to go one step lower ...
65
bool
dodets = fv.firstChild();
// descend to the first Layer
66
while
(dodets) {
67
buildSmallDetsforGlued(fv, det, attribute);
68
dodets = fv.nextSibling();
// go to next layer
69
/*
70
Add algo to sort the merged DET
71
*/
72
}
73
fv.parent();
74
75
}
76
77
//Phase2 stackDet: same procedure, different nomenclature
78
else
if
(
CmsTrackerLevelBuilder<FilteredView>::theCmsTrackerStringToEnum
.
type
(
79
ExtractStringFromDDD<FilteredView>::getString
(attribute, &fv)) ==
GeometricDet::OTPhase2Stack
) {
80
bool
dodets = fv.firstChild();
81
while
(dodets) {
82
buildSmallDetsforStack(fv, det, attribute);
83
dodets = fv.nextSibling();
84
}
85
fv.parent();
86
}
87
88
mother->
addComponent
(det);
89
}
90
91
template
class
CmsDetConstruction<DDFilteredView>
;
92
template
class
CmsDetConstruction<cms::DDFilteredView>
;
CmsTrackerLevelBuilder
Definition:
CmsTrackerLevelBuilder.h:31
CmsDetConstruction.h
groupFilesInBlocks.temp
list temp
Definition:
groupFilesInBlocks.py:142
ExtractStringFromDDD
Definition:
ExtractStringFromDDD.h:12
CmsDetConstruction::buildSmallDetsforStack
void buildSmallDetsforStack(FilteredView &, GeometricDet *, const std::string &)
Definition:
CmsDetConstruction.cc:28
DetId
Definition:
DetId.h:17
DDFilteredView.h
GeometricDet::mergedDet
Definition:
GeometricDet.h:68
GeometricDet::setGeographicalID
void setGeographicalID(DetId id)
Definition:
GeometricDet.h:97
GeometricDet
Definition:
GeometricDet.h:30
DDFilteredView.h
CmsDetConstruction::buildSmallDetsforGlued
void buildSmallDetsforGlued(FilteredView &, GeometricDet *, const std::string &)
Definition:
CmsDetConstruction.cc:8
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition:
MessageLogger.h:183
CmsDetConstruction
Definition:
CmsDetConstruction.h:12
ExtractStringFromDDD.h
type
type
Definition:
HCALResponse.h:21
GeometricDet::OTPhase2Stack
Definition:
GeometricDet.h:78
DetId.h
CmsDetConstruction::buildComponent
void buildComponent(FilteredView &, GeometricDet *, const std::string &) override
Definition:
CmsDetConstruction.cc:50
GeometricDet::addComponent
void addComponent(GeometricDet *)
Definition:
GeometricDet.cc:210
Generated for CMSSW Reference Manual by
1.8.16