Skip to content
Snippets Groups Projects
Commit 4f3d486e authored by Andreas Salzburger's avatar Andreas Salzburger
Browse files

initial import of DD4hep iadet

parent a9510693
Branches
Tags
No related merge requests found
Pipeline #1251898 passed
......@@ -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
......
......@@ -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
......
......@@ -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
......
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
......
<?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>
<?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>
// 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment