diff --git a/compact/definitions.xml b/compact/definitions.xml index a684281bc4..c2b006e3e2 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -155,12 +155,15 @@ The unused IDs below are saved for future use. - DIRC subsystem ID: 90 - Barrel TRD subsystem ID: 91 - Barrel TOF subsystem ID: 92 - - Unused IDs: 93-99 + - Barrel TOF subassembly ID: 93 + - Barrel DIRC subassembly ID: 94 + - Unused IDs: 95-99 + #### (100-109) Electromagnetic Calorimeter diff --git a/compact/pid/dirc.xml b/compact/pid/dirc.xml index 05dcbf88d2..3cb6be10d0 100644 --- a/compact/pid/dirc.xml +++ b/compact/pid/dirc.xml @@ -91,9 +91,25 @@ + + + + + + + + + + + + diff --git a/src/DIRC_geo.cpp b/src/DIRC_geo.cpp index c88c1fb343..562895b56d 100644 --- a/src/DIRC_geo.cpp +++ b/src/DIRC_geo.cpp @@ -1,12 +1,14 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck, Dmitry Romanov +#include "DD4hepDetectorHelper.h" #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/OpticalSurfaces.h" #include "DD4hep/Printout.h" #include "DDRec/DetectorData.h" #include "DDRec/Surface.h" #include +#include ////////////////////////////////// // Central Barrel DIRC @@ -36,6 +38,9 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { // Detector type sens.setType("tracker"); + // Set detector type flagAdd commentMore actions + dd4hep::xml::setDetectorTypeFlag(xml_det, det); + // Entire DIRC assembly Assembly det_volume("DIRC"); det_volume.setVisAttributes(desc.visAttributes(xml_det.visStr())); @@ -43,6 +48,31 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) { det.setPlacement( desc.pickMotherVolume(det).placeVolume(det_volume, det_tr).addPhysVolID("system", det_id)); + // ACTS support + auto& envelope_params = + DD4hepDetectorHelper::ensureExtension(det); + if (xml_det.hasChild(_Unicode(envelope))) { + xml_comp_t x_envelope = xml_det.child(_Unicode(envelope)); + envelope_params.set("envelope_r_min", getAttrOrDefault(x_envelope, _U(rmin), 0.)); + envelope_params.set("envelope_r_max", getAttrOrDefault(x_envelope, _U(rmax), 0.)); + envelope_params.set("envelope_z_min", getAttrOrDefault(x_envelope, _U(zmin), 0.)); + envelope_params.set("envelope_z_max", getAttrOrDefault(x_envelope, _U(zmax), 0.)); + } + // Add the volume boundary material if configured + for (xml_coll_t boundary_material(xml_det, _Unicode(boundary_material)); boundary_material; + ++boundary_material) { + xml_comp_t x_boundary_material = boundary_material; + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_boundary_material, envelope_params, + "boundary_material"); + } + // Add the volume layer material if configured + for (xml_coll_t layer_material(xml_det, _Unicode(layer_material)); layer_material; + ++layer_material) { + xml_comp_t x_layer_material = layer_material; + DD4hepDetectorHelper::xmlToProtoSurfaceMaterial(x_layer_material, envelope_params, + "layer_material"); + } + // Construct module xml_comp_t xml_module = xml_det.child(_U(module));