Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
sebouh137 committed Sep 15, 2023
2 parents 1138508 + 898186b commit 385d753
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DDCore/src/segmentations/HexGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ namespace dd4hep {

/// determine the position based on the cell ID
Vector3D HexGrid::position(const CellID& cID) const {
int layer= _decoder->get(cID,_staggerKeyword);
int layer=0;
if (_stagger) layer= _decoder->get(cID,_staggerKeyword);

Vector3D cellPosition;
cellPosition.X = _decoder->get(cID,_xId )*1.5*_sideLength+_offsetX+_sideLength/2.;
cellPosition.Y = _decoder->get(cID,_yId )*std::sqrt(3)/2.*_sideLength+ _offsetY+_sideLength*std::sqrt(3)/2.;
Expand Down Expand Up @@ -92,7 +94,8 @@ namespace dd4hep {
/// determine the cell ID based on the position
CellID HexGrid::cellID(const Vector3D& localPosition, const Vector3D& /* globalPosition */, const VolumeID& vID) const {
CellID cID = vID ;
int layer= _decoder->get(cID,_staggerKeyword);
int layer=0;
if (_stagger) layer= _decoder->get(cID,_staggerKeyword);

double x=localPosition.X-_offsetX;
double y=localPosition.Y-_offsetY;
Expand Down

0 comments on commit 385d753

Please sign in to comment.