From fbf83d9329a7e9c2e07c654760e77d7978458a3b Mon Sep 17 00:00:00 2001 From: Christian Grefe <Christian.Grefe@cern.ch> Date: Thu, 6 Nov 2014 16:13:49 +0000 Subject: [PATCH] Updated the example to populate the subdetector extension --- .../CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp b/examples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp index a20463e4a..6b4477093 100644 --- a/examples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp +++ b/examples/CLICSiD/src/PolyhedraBarrelCalorimeter2_geo.cpp @@ -10,10 +10,12 @@ #include "XML/Layering.h" #include "DDRec/Extensions/LayeringExtensionImpl.h" +#include "DDRec/Extensions/SubdetectorExtensionImpl.h" using namespace std; using namespace DD4hep; using namespace DD4hep::Geometry; +using namespace DD4hep::DDRec; static void placeStaves(DetElement& parent, DetElement& stave, double rmin, int numsides, double total_thickness, Volume envelopeVolume, double innerAngle, Volume sectVolume) { @@ -88,7 +90,7 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double layer_dim_x = innerFaceLen / 2 - gap * 2; int layer_num = 1; - DDRec::LayeringExtensionImpl* layeringExtension = new DDRec::LayeringExtensionImpl(); + LayeringExtensionImpl* layeringExtension = new LayeringExtensionImpl(); Position layerNormal(0,0,1); // Set envelope volume attributes. @@ -171,7 +173,14 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { env_phv.addPhysVolID("barrel", 0); sdet.setPlacement(env_phv); - sdet.addExtension<DDRec::LayeringExtension>(layeringExtension); + SubdetectorExtensionImpl* subdetExt = new SubdetectorExtensionImpl(sdet); + subdetExt->setIsBarrel(true); + subdetExt->setNSides(numSides); + subdetExt->setRMin(rmin); + subdetExt->setRMax(rmin + totalThickness); + + sdet.addExtension<SubdetectorExtension>(subdetExt); + sdet.addExtension<LayeringExtension>(layeringExtension); return sdet; } -- GitLab