Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
54c9fbc0
Commit
54c9fbc0
authored
8 years ago
by
Daniel Jeans
Committed by
Frank Gaede
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed to compile against latest DD4hep version (extra BitField64 constructor)
parent
451b8ad6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDSegmentation/include/DDSegmentation/MegatileLayerGridXY.h
+6
-0
6 additions, 0 deletions
DDSegmentation/include/DDSegmentation/MegatileLayerGridXY.h
DDSegmentation/src/MegatileLayerGridXY.cpp
+26
-17
26 additions, 17 deletions
DDSegmentation/src/MegatileLayerGridXY.cpp
with
32 additions
and
17 deletions
DDSegmentation/include/DDSegmentation/MegatileLayerGridXY.h
+
6
−
0
View file @
54c9fbc0
...
@@ -38,9 +38,15 @@ namespace DD4hep {
...
@@ -38,9 +38,15 @@ namespace DD4hep {
public:
public:
/// Default constructor passing the encoding string
/// Default constructor passing the encoding string
MegatileLayerGridXY
(
const
std
::
string
&
cellEncoding
=
""
);
MegatileLayerGridXY
(
const
std
::
string
&
cellEncoding
=
""
);
/// Default constructor used by derived classes passing an existing decoder
MegatileLayerGridXY
(
BitField64
*
decoder
);
/// destructor
/// destructor
virtual
~
MegatileLayerGridXY
();
virtual
~
MegatileLayerGridXY
();
void
setup
();
/// determine the position based on the cell ID
/// determine the position based on the cell ID
virtual
Vector3D
position
(
const
CellID
&
cellID
)
const
;
virtual
Vector3D
position
(
const
CellID
&
cellID
)
const
;
/// determine the cell ID based on the position
/// determine the cell ID based on the position
...
...
This diff is collapsed.
Click to expand it.
DDSegmentation/src/MegatileLayerGridXY.cpp
+
26
−
17
View file @
54c9fbc0
...
@@ -19,6 +19,20 @@ namespace DD4hep {
...
@@ -19,6 +19,20 @@ namespace DD4hep {
/// default constructor using an encoding string
/// default constructor using an encoding string
MegatileLayerGridXY
::
MegatileLayerGridXY
(
const
std
::
string
&
cellEncoding
)
:
MegatileLayerGridXY
::
MegatileLayerGridXY
(
const
std
::
string
&
cellEncoding
)
:
CartesianGrid
(
cellEncoding
)
{
CartesianGrid
(
cellEncoding
)
{
setup
();
}
MegatileLayerGridXY
::
MegatileLayerGridXY
(
BitField64
*
decode
)
:
CartesianGrid
(
decode
)
{
setup
();
}
/// destructor
MegatileLayerGridXY
::~
MegatileLayerGridXY
()
{
}
void
MegatileLayerGridXY
::
setup
()
{
// define type and description
// define type and description
_type
=
"MegatileLayerGridXY"
;
_type
=
"MegatileLayerGridXY"
;
_description
=
"Cartesian segmentation in the local XY-plane: megatiles, containing integer number of tiles/strips/cells"
;
_description
=
"Cartesian segmentation in the local XY-plane: megatiles, containing integer number of tiles/strips/cells"
;
...
@@ -36,16 +50,11 @@ namespace DD4hep {
...
@@ -36,16 +50,11 @@ namespace DD4hep {
SegmentationParameter
::
NoUnit
,
true
);
SegmentationParameter
::
NoUnit
,
true
);
for
(
int
i
=
0
;
i
<
MAX_LAYERS
;
i
++
)
{
for
(
int
i
=
0
;
i
<
MAX_LAYERS
;
i
++
)
{
_nCellsX
[
i
]
=
0
;
_nCellsX
[
i
]
=
0
;
_nCellsY
[
i
]
=
0
;
_nCellsY
[
i
]
=
0
;
}
}
}
}
/// destructor
MegatileLayerGridXY
::~
MegatileLayerGridXY
()
{
}
/// determine the position based on the cell ID
/// determine the position based on the cell ID
Vector3D
MegatileLayerGridXY
::
position
(
const
CellID
&
cID
)
const
{
Vector3D
MegatileLayerGridXY
::
position
(
const
CellID
&
cID
)
const
{
...
@@ -65,9 +74,9 @@ namespace DD4hep {
...
@@ -65,9 +74,9 @@ namespace DD4hep {
cellPosition
.
Y
=
cellIndexY
*
(
_currentSegInfo
.
megaTileSizeY
/
_currentSegInfo
.
nCellsY
)
+
_currentSegInfo
.
megaTileOffsetY
;
cellPosition
.
Y
=
cellIndexY
*
(
_currentSegInfo
.
megaTileSizeY
/
_currentSegInfo
.
nCellsY
)
+
_currentSegInfo
.
megaTileOffsetY
;
if
(
abs
(
cellPosition
.
X
)
>
10000
||
abs
(
cellPosition
.
Y
)
>
10000
)
{
if
(
abs
(
cellPosition
.
X
)
>
10000
||
abs
(
cellPosition
.
Y
)
>
10000
)
{
std
::
cout
<<
"crazy cell position: "
<<
cellPosition
.
X
<<
" "
<<
cellPosition
.
Y
<<
std
::
endl
;
std
::
cout
<<
"crazy cell position: "
<<
cellPosition
.
X
<<
" "
<<
cellPosition
.
Y
<<
std
::
endl
;
std
::
cout
<<
"layer, wafer, cellx,y indices: "
<<
layerIndex
<<
" "
<<
waferIndex
<<
" "
<<
cellIndexX
<<
" "
<<
cellIndexY
<<
std
::
endl
;
std
::
cout
<<
"layer, wafer, cellx,y indices: "
<<
layerIndex
<<
" "
<<
waferIndex
<<
" "
<<
cellIndexX
<<
" "
<<
cellIndexY
<<
std
::
endl
;
assert
(
0
&&
"crazy cell position?"
);
assert
(
0
&&
"crazy cell position?"
);
}
}
return
cellPosition
;
return
cellPosition
;
...
@@ -111,10 +120,10 @@ namespace DD4hep {
...
@@ -111,10 +120,10 @@ namespace DD4hep {
return
cellDimensions
(
layerIndex
,
waferIndex
);
return
cellDimensions
(
layerIndex
,
waferIndex
);
}
}
void
MegatileLayerGridXY
::
setSpecialMegaTile
(
unsigned
int
layer
,
unsigned
int
tile
,
void
MegatileLayerGridXY
::
setSpecialMegaTile
(
unsigned
int
layer
,
unsigned
int
tile
,
double
sizex
,
double
sizey
,
double
sizex
,
double
sizey
,
double
offsetx
,
double
offsety
,
double
offsetx
,
double
offsety
,
unsigned
int
ncellsx
,
unsigned
int
ncellsy
)
{
unsigned
int
ncellsx
,
unsigned
int
ncellsy
)
{
std
::
pair
<
int
,
int
>
tileid
(
layer
,
tile
);
std
::
pair
<
int
,
int
>
tileid
(
layer
,
tile
);
segInfo
sinf
;
segInfo
sinf
;
...
@@ -134,15 +143,15 @@ namespace DD4hep {
...
@@ -134,15 +143,15 @@ namespace DD4hep {
std
::
pair
<
unsigned
int
,
unsigned
int
>
tileid
(
layerIndex
,
waferIndex
);
std
::
pair
<
unsigned
int
,
unsigned
int
>
tileid
(
layerIndex
,
waferIndex
);
if
(
specialMegaTiles_layerWafer
.
find
(
tileid
)
==
specialMegaTiles_layerWafer
.
end
()
)
{
// standard megatile
if
(
specialMegaTiles_layerWafer
.
find
(
tileid
)
==
specialMegaTiles_layerWafer
.
end
()
)
{
// standard megatile
_currentSegInfo
.
megaTileSizeX
=
_megaTileSizeX
;
_currentSegInfo
.
megaTileSizeX
=
_megaTileSizeX
;
_currentSegInfo
.
megaTileSizeY
=
_megaTileSizeY
;
_currentSegInfo
.
megaTileSizeY
=
_megaTileSizeY
;
_currentSegInfo
.
megaTileOffsetX
=
_megaTileOffsetX
;
_currentSegInfo
.
megaTileOffsetX
=
_megaTileOffsetX
;
_currentSegInfo
.
megaTileOffsetY
=
_megaTileOffsetY
;
_currentSegInfo
.
megaTileOffsetY
=
_megaTileOffsetY
;
_currentSegInfo
.
nCellsX
=
_nCellsX
[
layerIndex
];
_currentSegInfo
.
nCellsX
=
_nCellsX
[
layerIndex
];
_currentSegInfo
.
nCellsY
=
_nCellsY
[
layerIndex
];
_currentSegInfo
.
nCellsY
=
_nCellsY
[
layerIndex
];
}
else
{
// special megatile
}
else
{
// special megatile
_currentSegInfo
=
specialMegaTiles_layerWafer
.
find
(
tileid
)
->
second
;
_currentSegInfo
=
specialMegaTiles_layerWafer
.
find
(
tileid
)
->
second
;
}
}
}
}
std
::
vector
<
double
>
MegatileLayerGridXY
::
cellDimensions
(
const
unsigned
int
layerIndex
,
const
unsigned
int
waferIndex
)
const
{
std
::
vector
<
double
>
MegatileLayerGridXY
::
cellDimensions
(
const
unsigned
int
layerIndex
,
const
unsigned
int
waferIndex
)
const
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment