Skip to content
Snippets Groups Projects
Commit aab18d5b authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: start the development of Drift Chamber for CEPC.

parent 499f98e0
No related branches found
No related tags found
No related merge requests found
###############################################################################
# Package: DetDriftChamber
# Based on package: lcgeo
################################################################################
gaudi_subdir(DetDriftChamber v0r0)
gaudi_depends_on_subdirs(GaudiKernel)
find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED)
find_package(Geant4)
include(${Geant4_USE_FILE})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake )
include( DD4hep )
find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetDriftChamber)
set(DetDriftChamber_src
src/driftchamber/DriftChamber.cpp
)
gaudi_add_module(DetDriftChamber
${DetDriftChamber_src}
INCLUDE_DIRS
# DD4hep ROOT Geant4 src/include
LINK_LIBRARIES
# GaudiKernel
DD4hep ${DD4hep_COMPONENT_LIBRARIES}
# ROOT Geant4
)
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
message(STATUS "LIBRARY_OUTPUT_PATH -> ${LIBRARY_OUTPUT_PATH}")
dd4hep_generate_rootmap(DetDriftChamber)
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<info name="DriftChamber"
title="Test with Drift Chamber"
author="Tao Lin"
url="http://github.com/cepc/CEPCSW"
status="development"
version="v0">
<comment>Test with Drift Chamber</comment>
</info>
<includes>
<gdmlFile ref="elements.xml"/>
<gdmlFile ref="materials.xml"/>
</includes>
<define>
<constant name="world_size" value="30*m"/>
<constant name="world_x" value="world_size"/>
<constant name="world_y" value="world_size"/>
<constant name="world_z" value="world_size"/>
</define>
<display>
<vis name="Invisible" showDaughters="false" visible="false"/>
<vis name="InvisibleWithChildren" showDaughters="true" visible="false"/>
<vis name="VisibleRed" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
<vis name="VisibleBlue" r="0.0" g="0.0" b="1.0" showDaughters="false" visible="true"/>
<vis name="VisibleGreen" alpha="1.0" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/>
</display>
<detectors>
<detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true">
<!-- Use cm as unit if you want to use Pandora for reconstruction -->
</detector>
</detectors>
<readouts>
<readout name="DriftChamberHitsCollection">
<!-- <segmentation type="NoSegmentation"/> -->
<segmentation type="CartesianGridXYZ"
grid_size_x="1*cm"
grid_size_y="1*cm"
grid_size_z="1*cm"/>
<id>system:8,x:32:-10,y:-10,z:-12</id>
</readout>
</readouts>
</lccdd>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<materials>
<!--
Air by weight from
http://www.engineeringtoolbox.com/air-composition-24_212.html
-->
<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>
<!-- We model vakuum just as very thin air -->
<material name="Vacuum">
<D type="density" unit="g/cm3" value="0.0000000001" />
<fraction n="0.754" ref="N"/>
<fraction n="0.234" ref="O"/>
<fraction n="0.012" ref="Ar"/>
</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="Quartz">
<D type="density" value="2.2" unit="g/cm3"/>
<composite n="1" ref="Si"/>
<composite n="2" ref="O"/>
</material>
<material name="G10">
<D type="density" value="1.7" unit="g/cm3"/>
<fraction n="0.08" ref="Cl"/>
<fraction n="0.773" ref="Quartz"/>
<fraction n="0.147" ref="Epoxy"/>
</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="BoronOxide">
<D type="density" value="2.46" unit="g/cm3"/>
<composite n="2" ref="B"/>
<composite n="3" ref="O"/>
</material>
<material name="SodiumOxide">
<D type="density" value="2.65" unit="g/cm3"/>
<composite n="2" ref="Na"/>
<composite n="1" 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="PyrexGlass">
<D type="density" value="2.23" unit="g/cm3"/>
<fraction n="0.806" ref="SiliconOxide"/>
<fraction n="0.130" ref="BoronOxide"/>
<fraction n="0.040" ref="SodiumOxide"/>
<fraction n="0.023" ref="AluminumOxide"/>
</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="Rohacell31">
<D type="density" value="0.032" unit="g/cm3"/>
<composite n="9" ref="C"/>
<composite n="13" ref="H"/>
<composite n="2" ref="O"/>
<composite n="1" ref="N"/>
</material>
<material name="Rohacell31_50D">
<D type="density" value="0.016" unit="g/cm3"/>
<composite n="9" ref="C"/>
<composite n="13" ref="H"/>
<composite n="2" ref="O"/>
<composite n="1" ref="N"/>
</material>
<material name="RPCGasDefault" state="gas">
<D type="density" value="0.0037" unit="g/cm3"/>
<composite n="209" ref="C"/>
<composite n="239" ref="H"/>
<composite n="381" ref="F"/>
</material>
<material name="PolystyreneFoam">
<D type="density" value="0.0056" unit="g/cm3"/>
<fraction n="1.0" ref="Polystyrene"/>
</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="PEEK">
<D value="1.37" unit="g/cm3" />
<composite n="19" ref="C"/>
<composite n="12" ref="H" />
<composite n="3" ref="O" />
</material>
<material name="G4_BGO" state="solid">
<MEE unit="eV" value="534.1"/>
<D value="7.13" unit="g/cm3" />
<fraction n="0.154126" ref="O"/>
<fraction n="0.174820" ref="Ge" />
<fraction n="0.671054" ref="Bi" />
</material>
</materials>
//====================================================================
// Detector description implementation of the Drift Chamber
//--------------------------------------------------------------------
//
// Author: Tao Lin
//
//====================================================================
#include "DD4hep/DetFactoryHelper.h"
#include "XML/Layering.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "DDSegmentation/Segmentation.h"
#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl;
#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl;
static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
xml_h e,
dd4hep::SensitiveDetector sens) {
xml_det_t x_det = e;
std::string det_name = x_det.nameStr();
std::string det_type = x_det.typeStr();
dd4hep::DetElement sdet(det_name, x_det.id());
dd4hep::Volume motherVol = theDetector.pickMotherVolume(sdet);
dd4hep::Material det_mat(theDetector.material("Air"));
dd4hep::Tube det_solid(23.5, 171.6, 222.5);
dd4hep::Volume det_vol(det_name+"_vol", det_solid, det_mat);
dd4hep::Transform3D transform(dd4hep::Rotation3D(),
dd4hep::Position(0,0,0));
dd4hep::PlacedVolume phv = motherVol.placeVolume(det_vol,transform);
if ( x_det.isSensitive() ) {
dd4hep::SensitiveDetector sd = sens;
det_vol.setSensitiveDetector(sens);
sd.setType("tracker");
}
if ( x_det.hasAttr(_U(id)) ) {
phv.addPhysVolID("system",x_det.id());
}
sdet.setPlacement(phv);
MYDEBUG("Build Detector Drift Chamber successfully.");
return sdet;
}
DECLARE_DETELEMENT(DriftChamber, create_detector);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment