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
18c817a9
Commit
18c817a9
authored
10 years ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
PolarGridRPhi2: Change position and cellID functions
use the cellBoundaries based positionToBin and binToPosition functions
parent
a238e5c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDSegmentation/src/PolarGridRPhi2.cpp
+8
-6
8 additions, 6 deletions
DDSegmentation/src/PolarGridRPhi2.cpp
with
8 additions
and
6 deletions
DDSegmentation/src/PolarGridRPhi2.cpp
+
8
−
6
View file @
18c817a9
/*
/*
* PolarGridRPhi2.cpp
* PolarGridRPhi2.cpp
*
*
* Created on:
Sept
1
6
, 201
4
* Created on:
March
1
7
, 201
5
* Author: Marko Petric
* Author: Marko Petric
, Andre Sailer
*/
*/
#include
"DDSegmentation/PolarGridRPhi2.h"
#include
"DDSegmentation/PolarGridRPhi2.h"
...
@@ -35,8 +35,9 @@ PolarGridRPhi2::~PolarGridRPhi2() {
...
@@ -35,8 +35,9 @@ PolarGridRPhi2::~PolarGridRPhi2() {
Vector3D
PolarGridRPhi2
::
position
(
const
CellID
&
cellID
)
const
{
Vector3D
PolarGridRPhi2
::
position
(
const
CellID
&
cellID
)
const
{
_decoder
->
setValue
(
cellID
);
_decoder
->
setValue
(
cellID
);
Vector3D
position
;
Vector3D
position
;
double
R
=
binToPosition
((
*
_decoder
)[
_rId
].
value
(),
_gridRValues
[
0
],
_offsetR
);
const
int
rBin
=
(
*
_decoder
)[
_rId
].
value
();
double
phi
=
binToPosition
((
*
_decoder
)[
_phiId
].
value
(),
_gridPhiValues
[
0
],
_offsetPhi
);
double
R
=
binToPosition
(
rBin
,
_gridRValues
,
_offsetR
);
double
phi
=
binToPosition
((
*
_decoder
)[
_phiId
].
value
(),
_gridPhiValues
[
rBin
],
_offsetPhi
+
_gridPhiValues
[
rBin
]
*
0.5
);
position
.
X
=
R
*
cos
(
phi
);
position
.
X
=
R
*
cos
(
phi
);
position
.
Y
=
R
*
sin
(
phi
);
position
.
Y
=
R
*
sin
(
phi
);
...
@@ -50,8 +51,9 @@ Vector3D PolarGridRPhi2::position(const CellID& cellID) const {
...
@@ -50,8 +51,9 @@ Vector3D PolarGridRPhi2::position(const CellID& cellID) const {
double
phi
=
atan2
(
localPosition
.
Y
,
localPosition
.
X
);
double
phi
=
atan2
(
localPosition
.
Y
,
localPosition
.
X
);
double
R
=
sqrt
(
localPosition
.
X
*
localPosition
.
X
+
localPosition
.
Y
*
localPosition
.
Y
);
double
R
=
sqrt
(
localPosition
.
X
*
localPosition
.
X
+
localPosition
.
Y
*
localPosition
.
Y
);
(
*
_decoder
)[
_rId
]
=
positionToBin
(
R
,
_gridRValues
[
0
],
_offsetR
);
const
int
rBin
=
positionToBin
(
R
,
_gridRValues
,
_offsetR
);
(
*
_decoder
)[
_phiId
]
=
positionToBin
(
phi
,
_gridPhiValues
[
0
],
_offsetPhi
);
(
*
_decoder
)[
_rId
]
=
rBin
;
(
*
_decoder
)[
_phiId
]
=
positionToBin
(
phi
,
_gridPhiValues
[
rBin
],
_offsetPhi
+
_gridPhiValues
[
rBin
]
*
0.5
);
return
_decoder
->
getValue
();
return
_decoder
->
getValue
();
}
}
...
...
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