diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt index 99f69db93378bb98211f59797c779e23ba83d3c7..c71a0e0238adc3b8abac8e51e01a48ba7edc765b 100644 --- a/Detector/DetCRD/CMakeLists.txt +++ b/Detector/DetCRD/CMakeLists.txt @@ -40,6 +40,7 @@ gaudi_add_module(DetCRD src/Tracker/SiTracker_otkbarrel_v02_geo.cpp src/Tracker/SiTracker_otkendcap_v02_geo.cpp src/Other/ParaffinEndcap_v01.cpp + src/Other/ConcreteWall_v01.cpp LINK ${DD4hep_COMPONENT_LIBRARIES} DetIdentifier diff --git a/Detector/DetCRD/compact/CRD_common_v01/ConcreteWall_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/ConcreteWall_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..9076ad484a8a96e7186f398390b1b9f92403768f --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/ConcreteWall_v01_01.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd> + +<define> + <constant name="concrete_position_z" value="592.5*cm"/> + <constant name="concrete_hole_rmin" value="65*cm"/> + <constant name="concrete_wall_size" value="520*cm"/> + <constant name="concrete_wall_hz" value="50*cm"/> +</define> + +<detectors> + <detector name="ConcreteWall" type="ConcreteWall_v01" vis="VisibleBrown" material="Concrete"> + <!-- Use cm as unit if you want to use Pandora for reconstruction --> + <position x="0" y="0" z="concrete_position_z"/> + <dimensions rmax="concrete_wall_size" rmin="concrete_hole_rmin" dz="concrete_wall_hz"/> + </detector> +</detectors> + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v02/materials.xml b/Detector/DetCRD/compact/CRD_common_v02/materials.xml index 8f2954d596cf23b7ea42d9990b4cef6fb0c3d4f7..0f9bc69eb8044d4daae3a1ab34e3accc84f54b68 100644 --- a/Detector/DetCRD/compact/CRD_common_v02/materials.xml +++ b/Detector/DetCRD/compact/CRD_common_v02/materials.xml @@ -852,6 +852,15 @@ <composite n="1" ref="C" /> </material> + <material name="Concrete"> + <D value="2.4" unit="g/cm3"/> + <composite n="23" ref="Si"/> + <composite n="13" ref="O"/> + <composite n="5" ref="Ca"/> + <composite n="1" ref="Al"/> + <composite n="1" ref="Fe"/> + </material> + <material name="CF_ITK"> <D type="density" value="1.60885" unit="g/cm3"/> <fraction n="1.0" ref="CarbonFiber"/> diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml index 1df0d1aa2ca9667074fae51a23c272c78b28b2bf..47ba76e1b1f56df9be49b81755b9fa153df0b9bd 100644 --- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml +++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml @@ -62,6 +62,7 @@ <include ref="../CRD_common_v01/Muon_Barrel_v01_04.xml"/> <include ref="../CRD_common_v01/Muon_Endcap_v01_02.xml"/> <include ref="../CRD_common_v01/ParaffinEndcap_v01_01.xml"/> + <!--include ref="../CRD_common_v01/ConcreteWall_v01_01.xml"/--> <fields> <field name="InnerSolenoid" type="solenoid" diff --git a/Detector/DetCRD/src/Other/ConcreteWall_v01.cpp b/Detector/DetCRD/src/Other/ConcreteWall_v01.cpp new file mode 100644 index 0000000000000000000000000000000000000000..20dc63b66d3cd8f29002eed426858ced3dcc5c25 --- /dev/null +++ b/Detector/DetCRD/src/Other/ConcreteWall_v01.cpp @@ -0,0 +1,69 @@ +#include "DD4hep/DetFactoryHelper.h" +#include "XML/Layering.h" +#include "XML/Utilities.h" +#include "DDRec/DetectorData.h" +#include "DDSegmentation/Segmentation.h" +#include "DD4hep/Shapes.h" + +#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl; +#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl; + +using dd4hep::rec::LayeredCalorimeterData; + +static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, + xml_h e, + [[maybe_unused]] dd4hep::SensitiveDetector sens) { + xml_det_t x_det = e; + std::string det_name = x_det.nameStr(); + std::string det_type = x_det.typeStr(); + MYDEBUGVAL(det_name); + MYDEBUGVAL(det_type); + + xml_dim_t pos(x_det.child(_U(position))); + xml_dim_t dim(x_det.child(_U(dimensions))); + + dd4hep::DetElement sdet("det", 1771); + dd4hep::Material det_mat(theDetector.material("Concrete")); + + dd4hep::Box box_shape(0.5 * dim.rmax(), 0.5 * dim.rmax(), 0.5 * dim.dz()); + dd4hep::Tube hole_shape(0, dim.rmin(), 0.5 * dim.dz()); + + dd4hep::Transform3D transform_hole( + dd4hep::Rotation3D(), + dd4hep::Position(0, 0, 0) + ); + + dd4hep::SubtractionSolid solid = dd4hep::SubtractionSolid(box_shape, hole_shape, transform_hole); + + dd4hep::Volume det_vol_with_hole(det_name + "_withHole", solid, det_mat); + + dd4hep::Transform3D transform( + dd4hep::Rotation3D(), + dd4hep::Position(pos.x(), pos.y(), pos.z()) + ); + + dd4hep::Transform3D transform_01( + dd4hep::Rotation3D(), + dd4hep::Position(pos.x(), pos.y(), -1 * pos.z()) + ); + + dd4hep::PlacedVolume pv; + dd4hep::DetElement both_endcap(det_name, x_det.id()); + dd4hep::Volume motherVol = theDetector.pickMotherVolume(both_endcap); + dd4hep::DetElement sdetA = sdet; + dd4hep::Ref_t(sdetA)->SetName((det_name + "_A").c_str()); + dd4hep::DetElement sdetB = sdet.clone(det_name + "_B", 1772); + + pv = motherVol.placeVolume(det_vol_with_hole, transform); + + both_endcap.setPlacement(pv); + both_endcap.add(sdetA); + both_endcap.add(sdetB); + + pv = motherVol.placeVolume(det_vol_with_hole, transform_01); + sdetB.setPlacement(pv); + + MYDEBUG("create_detector DONE. "); + return both_endcap; +} +DECLARE_DETELEMENT(ConcreteWall_v01, create_detector)