Skip to content
Snippets Groups Projects
Commit 6d043478 authored by Frank Gaede's avatar Frank Gaede
Browse files

- split vxd ladders into two at +/- z

    => demonstrates bug with signed encoder fields:
        <id>system:5,side:-2,layer:9,module:8,sensor:8</id>   
   leads to duplicate volumes 
         <id>system:5,side:2,layer:9,module:8,sensor:8</id>
   does not !

parent 4bc99f9b
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
#include "VXDData.h" #include "VXDData.h"
//#include "GearWrapper.h"
using namespace std; using namespace std;
using namespace DD4hep; using namespace DD4hep;
...@@ -33,6 +34,11 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ...@@ -33,6 +34,11 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) {
vxd_data->id = x_det.id(); vxd_data->id = x_det.id();
// //--------------- create gear::ZPlanarParameters and add them as Extension
// GearZPlanarParameters* gearZPlanar = new GearZPlanarParameters ;
// vxd.addExtension<GearZPlanarParameters>( gearZPlanar ) ;
// //--------------------------------------------------------------------
for(xml_coll_t c(e,_U(layer)); c; ++c) { for(xml_coll_t c(e,_U(layer)); c; ++c) {
xml_comp_t x_layer (c); xml_comp_t x_layer (c);
...@@ -119,16 +125,35 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ...@@ -119,16 +125,35 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) {
double lthick = sens_thick + supp_thick ; double lthick = sens_thick + supp_thick ;
Position pos( (radius + lthick/2.)*cos(phi) - offset * sin( phi ) ,
(radius + lthick/2.)*sin(phi) + offset * cos( phi ) ,
0. ) ;
RotationZYX rot( 0, 0 , phi ) ; RotationZYX rot( 0, 0 , phi ) ;
pv = assembly.placeVolume( laddervol,Transform3D(RotationZ(phi),pos)); #if 0
pv = assembly.placeVolume( laddervol,Transform3D( rot, Position( (radius + lthick/2.)*cos(phi) - offset * sin( phi ) ,
(radius + lthick/2.)*sin(phi) + offset * cos( phi ) ,
0. ) ));
pv.addPhysVolID("layer", layer_id ).addPhysVolID( "module" , j ).addPhysVolID("sensor", 0 ) ; pv.addPhysVolID("layer", layer_id ).addPhysVolID( "module" , j ).addPhysVolID("sensor", 0 ) ;
#else
// put one wafer at plus z and one at minus z
pv = assembly.placeVolume( laddervol, Transform3D( rot , Position( (radius + lthick/2.)*cos(phi) - offset * sin( phi ) ,
(radius + lthick/2.)*sin(phi) + offset * cos( phi ) ,
zhalf ) ) );
pv.addPhysVolID("layer", layer_id ).addPhysVolID( "module" , j ).addPhysVolID("sensor", 0 ).addPhysVolID("side", 1 ) ;
pv = assembly.placeVolume( laddervol, Transform3D( rot , Position( (radius + lthick/2.)*cos(phi) - offset * sin( phi ) ,
(radius + lthick/2.)*sin(phi) + offset * cos( phi ) ,
-zhalf ) ) );
pv.addPhysVolID("layer", layer_id ).addPhysVolID( "module" , j ).addPhysVolID("sensor", 0 ).addPhysVolID("side", -1 ) ; ;
#endif
//pv = assembly.placeVolume( sensvol, pos, rot ) ; //pv = assembly.placeVolume( sensvol, pos, rot ) ;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment