From 25c452731af43b7a47924b1f248a1392084ac5c4 Mon Sep 17 00:00:00 2001 From: Marko Petric <marko.petric@cern.ch> Date: Tue, 7 Apr 2015 16:43:36 +0000 Subject: [PATCH] Moved the position tag from being inside the shape enviroment (x_shape) to the global x_det enviroment. Otherwise there is a conflict between DetectorAssembly and Subtraction/UnionSolid since both read the same tag. --- DDDetectors/src/SubdetectorAssembly_geo.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/DDDetectors/src/SubdetectorAssembly_geo.cpp b/DDDetectors/src/SubdetectorAssembly_geo.cpp index c8d30e68e..7d8edcd6b 100644 --- a/DDDetectors/src/SubdetectorAssembly_geo.cpp +++ b/DDDetectors/src/SubdetectorAssembly_geo.cpp @@ -25,6 +25,16 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t) { Position pos; RotationZYX rot; + usePos = x_det.hasChild(_U(position)); + useRot = x_det.hasChild(_U(rotation)); + if( usePos ) { + pos = Position(x_det.position().x(), x_det.position().y(), x_det.position().z()); + } + if( useRot ) { + rot = RotationZYX(x_det.rotation().x(), x_det.rotation().y(), x_det.rotation().z()); + } + + if ( x_det.hasChild(_U(shape)) ) { xml_comp_t x_shape = x_det.child(_U(shape)); string type = x_shape.typeStr(); @@ -33,14 +43,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t) { printout(DEBUG,det_name,"+++ Creating detector assembly with shape of type:%s",type.c_str()); vol = Volume(det_name,solid,mat); - usePos = x_shape.hasChild(_U(position)); - useRot = x_shape.hasChild(_U(rotation)); - if( usePos ) { - pos = Position(x_shape.position().x(), x_shape.position().y(), x_shape.position().z()); - } - if( useRot ) { - rot = RotationZYX(x_shape.rotation().x(), x_shape.rotation().y(), x_shape.rotation().z()); - } + } else { printout(DEBUG,det_name,"+++ Creating detector assembly without shape"); -- GitLab