diff --git a/Algorithms/Digitization/CMakeLists.txt b/Algorithms/Digitization/CMakeLists.txt index 1e533338a804681654e3abb2b0587bd33b90665f..f3711765e8eb83ffe23691492d21c914632307a5 100644 --- a/Algorithms/Digitization/CMakeLists.txt +++ b/Algorithms/Digitization/CMakeLists.txt @@ -7,7 +7,7 @@ target_include_directories( PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) target_link_libraries( ACTFWDigitization - PRIVATE ACTFramework ActsCore ActsDigitizationPlugin IdentificationPlugin) + PRIVATE ACTFramework ActsCore ActsDigitizationPlugin IdentificationPlugin Boost::program_options) install( TARGETS ACTFWDigitization diff --git a/Algorithms/Fatras/CMakeLists.txt b/Algorithms/Fatras/CMakeLists.txt index 53a30f68fc1a038839cdfac305efc6bd65607410..94b1a6b05e7c17a0f32c6a204ffb7038e4096623 100644 --- a/Algorithms/Fatras/CMakeLists.txt +++ b/Algorithms/Fatras/CMakeLists.txt @@ -6,7 +6,7 @@ target_include_directories( $<INSTALL_INTERFACE:include>) target_link_libraries( ACTFWFatras - PUBLIC ActsCore FatrasCore ACTFramework) + PUBLIC ActsCore FatrasCore ACTFramework Boost::program_options) install( TARGETS ACTFWFatras diff --git a/Algorithms/Fitting/CMakeLists.txt b/Algorithms/Fitting/CMakeLists.txt index c45d995ec5ac5311f994ecc1bd2a515516158b60..b4798935a3cc98bf45c4fcda715f4babfd7c8fad 100644 --- a/Algorithms/Fitting/CMakeLists.txt +++ b/Algorithms/Fitting/CMakeLists.txt @@ -8,7 +8,7 @@ target_include_directories( $<INSTALL_INTERFACE:include>) target_link_libraries( ACTFWFitting - PUBLIC ActsCore ACTFramework) + PUBLIC ActsCore ACTFramework Boost::program_options) install( TARGETS ACTFWFitting diff --git a/Detectors/DD4hepDetector/CMakeLists.txt b/Detectors/DD4hepDetector/CMakeLists.txt index 52565e3b31ef2e15b26ec7937a90edd27ee38531..a0302d47831e16b5c656010859913373e9b71b49 100644 --- a/Detectors/DD4hepDetector/CMakeLists.txt +++ b/Detectors/DD4hepDetector/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library( + add_library( ACTFWDD4hepDetector SHARED src/Demonstrator/DemonstratorBarrel_geo.cpp src/Demonstrator/DemonstratorBeamPipe_geo.cpp @@ -6,6 +6,7 @@ add_library( src/FCChh/FCChhTrackerTkLayout_Beampipe.cpp src/FCChh/FCChhTrackerTkLayout_Endcap.cpp src/IBL/IBLSimpleBarrel_geo.cpp + src/iDetector/iDCylinder_geo.cpp src/OpenDataDetector/ODDCylinder_geo.cpp src/OpenDataDetector/ODDPixelBarrel_geo.cpp src/OpenDataDetector/ODDPixelEndcap_geo.cpp diff --git a/Detectors/DD4hepDetector/compact/iDetector/.txt b/Detectors/DD4hepDetector/compact/iDetector/.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Detectors/DD4hepDetector/compact/iDetector/iDetector.xml b/Detectors/DD4hepDetector/compact/iDetector/iDetector.xml new file mode 100644 index 0000000000000000000000000000000000000000..c34c3fa0725edc688c43401d46da2dab33d9aa19 --- /dev/null +++ b/Detectors/DD4hepDetector/compact/iDetector/iDetector.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd"> + + <includes> + <gdmlFile ref="../elements.xml"/> + <gdmlFile ref="iDetectorMaterial.xml"/> + </includes> + + <info name="Demonstrator" + title="Demonstrator" + author="Andreas.Salzburger@cern.ch" url="" status="test" version="0"> + <comment>Demonstrator Detector for the acts webpage and documentation</comment> + </info> + <define> + <!--World--> + <constant name="world_size" value="10.*m"/> + <constant name="world_x" value="world_size"/> + <constant name="world_y" value="world_size"/> + <constant name="world_z" value="world_size"/> + <!--Dimensions of the beam pipe --> + <constant name="bp_rmin" value="23.6*mm"/> + <constant name="bp_rmax" value="24.4*mm"/> + <constant name="bp_length" value="2.*m"/> + + </define> + + <display> + <vis name="Beryllium" r="0.8" g="0.8" b="0.8" alpha="0.9" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="Silicon" r="0." g="0." b="0.5" alpha="1.0" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="Kapton" r="0.1328125" g="0.55859375" b="0.02734375" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="CarbonFiber" r="0.4" g="0.4" b="0.4" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="CarbonFoam" r="0.5" g="0.5" b="0.5" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="violet" r="0.4" g="0." b="0.4" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="red" r="0.6" g="0." b="0." alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="yellow" r="0.65" g="0.65" b="0." alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="orange" r="0.65" g="0.35" b="0." alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="blue" r="0." g="0." b="0.5" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="green" r="0." g="0.5" b="0." alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="grey" r="0.7" g="0.6" b="0.5" alpha="1" showDaugthers="true" visible="true" drawingStyle="solid"/> + <vis name="bluetrans" alpha="0.5" r="0.0" g="0.0" b="0.5" showDaughters="true" visible="true"/> + </display> + + <detectors> + <detector id="0" name="BeamPipe" type="iDCylinder" vis="Beryllium"> + <beampipe/> + <tubs name="BeamPipe" rmin="bp_rmin" rmax="bp_rmax" dz="bp_length" material="Beryllium"/> + </detector> + </detectors> +</lccdd> diff --git a/Detectors/DD4hepDetector/compact/iDetector/iDetectorMaterial.xml b/Detectors/DD4hepDetector/compact/iDetector/iDetectorMaterial.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c95bf842d5ea9d4dfd460faf2dc186200d68d03 --- /dev/null +++ b/Detectors/DD4hepDetector/compact/iDetector/iDetectorMaterial.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<materials> + + + <material name="Air"> + <D type="density" unit="g/cm3" value="0.0012"/> + <fraction n="0.754" ref="N"/> + <fraction n="0.234" ref="O"/> + <fraction n="0.012" ref="Ar"/> + </material> + + <material name="Vacuum"> + <D type="density" unit="g/cm3" value="0.00000001" /> + <fraction n="1" ref="H" /> + </material> + + <material Z="4" name="Beryllium" state="solid"> + <MEE unit="eV" value="63.7"/> + <D unit="g/cm3" value="1.848"/> + <atom unit="g/mole" value="9.01218"/> + <fraction n="1" ref="Be"/> + </material> + + <material name="Epoxy"> + <D type="density" value="1.3" unit="g/cm3"/> + <composite n="44" ref="H"/> + <composite n="15" ref="C"/> + <composite n="7" ref="O"/> + </material> + + <material name="Polystyrene"> + <D value="1.032" unit="g/cm3"/> + <composite n="19" ref="C"/> + <composite n="21" ref="H"/> + </material> + + <material name="Steel235"> + <D value="7.85" unit="g/cm3"/> + <fraction n="0.998" ref="Fe"/> + <fraction n=".002" ref="C"/> + </material> + + <material name="SiliconOxide"> + <D type="density" value="2.65" unit="g/cm3"/> + <composite n="1" ref="Si"/> + <composite n="2" ref="O"/> + </material> + + <material name="AluminumOxide"> + <D type="density" value="3.89" unit="g/cm3"/> + <composite n="2" ref="Al"/> + <composite n="3" ref="O"/> + </material> + + <material name="CarbonFoam"> + <D type="density" value="0.245" unit="g/cm3"/> + <fraction n="0.65" ref="C"/> + <fraction n="0.35" ref="Epoxy"/> +</material> + + <material name="CarbonFiber"> + <D type="density" value="1.5" unit="g/cm3"/> + <fraction n="0.65" ref="C"/> + <fraction n="0.35" ref="Epoxy"/> + </material> + + <material name="CarbonFiber_50D"> + <D type="density" value="0.75" unit="g/cm3"/> + <fraction n="0.65" ref="C"/> + <fraction n="0.35" ref="Epoxy"/> + </material> + + <material name="PolystyreneFoam"> + <D type="density" value="0.0056" unit="g/cm3"/> + <fraction n="1.0" ref="Polystyrene"/> + </material> + + <material name="PE"> + <D type="density" value="0.95" unit="g/cm3"/> + <fraction n="4" ref="H"/> + <fraction n="2" ref="C"/> + </material> + + <material name="Kapton"> + <D value="1.43" unit="g/cm3" /> + <composite n="22" ref="C"/> + <composite n="10" ref="H" /> + <composite n="2" ref="N" /> + <composite n="5" ref="O" /> + </material> + + + <material name="LAr"> + <D value="1.396" unit="g/cm3" /> + <composite n="1" ref="Ar"/> + </material> + +</materials> diff --git a/Detectors/DD4hepDetector/src/iDetector/iDCylinder_geo.cpp b/Detectors/DD4hepDetector/src/iDetector/iDCylinder_geo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50a423a29915133eefaad21fac81179081e15074 --- /dev/null +++ b/Detectors/DD4hepDetector/src/iDetector/iDCylinder_geo.cpp @@ -0,0 +1,58 @@ +// This file is part of the Acts project. +// +// Copyright (C) 2019 CERN for the benefit of the Acts project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#include "Acts/Plugins/DD4hep/ActsExtension.hpp" +#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" +#include "DD4hep/DetFactoryHelper.h" + +using namespace std; +using namespace dd4hep; + +static Ref_t +create_element(Detector& oddd, xml_h xml, SensitiveDetector sens) +{ + + xml_det_t x_det = xml; + string detName = x_det.nameStr(); + + // Make Volume + xml_comp_t x_det_tubs = x_det.child(_U(tubs)); + + // Make DetElement + DetElement cylinderElement(detName, x_det.id()); + + // add Extension to Detlement for the RecoGeometry + Acts::ActsExtension* pcExtension = new Acts::ActsExtension(); + bool isBeamPipe = x_det.hasChild(_U(beampipe)); + pcExtension->addType("passive cylinder", "layer"); + if (isBeamPipe) { pcExtension->addType("beampipe", "layer"); } + // Add the proto layer material + for (xml_coll_t lmat(x_det_tubs, _Unicode(layer_material)); lmat; ++lmat) { + xml_comp_t x_layer_material = lmat; + xmlToProtoSurfaceMaterial(x_layer_material, *pcExtension, "layer_material"); + } + cylinderElement.addExtension<Acts::ActsExtension>(pcExtension); + + string shapeName = x_det_tubs.nameStr(); + Tube tubeShape( + shapeName, x_det_tubs.rmin(), x_det_tubs.rmax(), x_det_tubs.dz()); + Volume tubeVolume( + detName, tubeShape, oddd.material(x_det_tubs.materialStr())); + tubeVolume.setVisAttributes(oddd, x_det.visStr()); + + // Place it in the mother + Volume motherVolume = oddd.pickMotherVolume(cylinderElement); + PlacedVolume placedTube = motherVolume.placeVolume(tubeVolume); + placedTube.addPhysVolID(detName, cylinderElement.id()); + cylinderElement.setPlacement(placedTube); + + // And return the element for further parsing + return cylinderElement; +} + +DECLARE_DETELEMENT(iDCylinder, create_element)