Commit 7e746039 authored by Jihee Kim's avatar Jihee Kim
Browse files

Merge branch '16-implement-cb_ctd_si' into 'master'

Resolve "Implement cb_CTD_SI"

Closes #16

See merge request !30
parents 10e66bf1 6e20e1a6
Pipeline #7887 failed with stages
in 2 minutes and 38 seconds
<lccdd>
<comment> Central Barrel Tracker Silicon </comment>
<define>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<detectors>
<detector id="cb_CTD_Si_ID" name="cb_CTD_Si" type="cb_CTD_Si" readout="cb_CTD_Si_Hits" vis="cb_CTDVis" insideTrackingVloume="true">
<dimensions rmin="cb_CTD_rmin" rmax="cb_CTD_rmax" length="cb_CTD_length" zmax="cb_CTD_zmax" gap="cb_CTD_Si_gap"/>
<layer repeat="cb_CTD_Si_layer" vis="cb_CTD_Si_layerVis">
<slice name="Silicon_slice" material="Si" sensitive="true"/>
</layer>
</detector>
</detectors>
<readouts>
<readout name="cb_CTD_Si_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,barrel:3,layer:4,x:32:-16,y:-16</id>
</readout>
</readouts>
<plugins>
</plugins>
<fields>
</fields>
</lccdd>
......@@ -122,6 +122,8 @@
<constant name="SiTrackerEndcapP_Layer5_ID" value="69"/>
<constant name="SiTrackerEndcapN_Layer5_ID" value="70"/>
<constant name="cb_CTD_Si_ID" value="74"/>
<comment>
===================
(75-99 Reserved IDs
......@@ -243,8 +245,8 @@
</comment>
<constant name="cb_Solenoid_rmin" value="0.0 * cm"/> <comment> Central Barrel Solenoid Inner diameter </comment>
<constant name="cb_Solenoid_rmax" value="137.0 * cm"/> <comment> Central Barrel Solenoid Outer diameter </comment>
<constant name="cb_Solenoid_z" value="400.0 * cm"/>
<constant name="cb_Solenoid_shift" value="0.0 * cm"/> <comment> Central Barrel Solenoid Size in Z direction </comment>
<constant name="cb_Solenoid_z" value="400.0 * cm"/> <comment> Central Barrel Solenoid Size in Z direction </comment>
<constant name="cb_Solenoid_shift" value="0.0 * cm"/>
<constant name="Solenoid_thickness" value="400*mm"/>
<constant name="Solenoid_rmin" value="2000.0*mm"/>
......@@ -318,6 +320,27 @@
<constant name="SiliconTrackerOuterRadius" value="Solenoid_rmax/2.0"/>
<constant name="SiliconTrackerOuterBarrelLength" value="SolenoidLength/2.0"/>
<comment>
-------------------------------
Central Barrel Tracker - Global
-------------------------------
</comment>
<constant name="cb_CTD_rmin" value="21.0 * cm"/>
<constant name="cb_CTD_rmax" value="80.0 * cm"/>
<constant name="cb_CTD_zmax" value="200.0 * cm"/>
<comment> Original Global parameter </comment>
<!--
<constant name="cb_CTD_zmax" value="120.0 * cm"/>
-->
<constant name="cb_CTD_length" value="SolenoidLength - cb_CTD_zmax"/>
<comment> After fix cb_Solenoid parameters </comment>
<!--
<constant name="cb_CTD_length" value="cb_Solenoid_z - cb_CTD_zmax"/>
-->
<comment> Si layer opiton </comment>
<constant name="cb_CTD_Si_gap" value="5.0 * cm"/>
<constant name="cb_CTD_Si_layer" value="15"/>
<comment>
------------
Calorimeters
......
......@@ -48,9 +48,11 @@
<vis name="RICHVis" alpha="0.5" r="1" g="0" b="1" showDaughters="false"/>
<vis name="BeamPipeVis" alpha="1" r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/>
<vis name="cb_SolenoidVis" alpha="0.4" r= "0.1" g="0.0" b="0.1" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCmoduleVis" alpha="1.0" r= "0.1" g="1.0" b="0.9" showDaughters="true" visible="true"/>
<vis name="cb_SolenoidVis" alpha="0.4" r= "0.1" g="0.0" b="0.1" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCmoduleVis" alpha="1.0" r= "0.1" g="1.0" b="0.9" showDaughters="true" visible="true"/>
<vis name="cb_CTDVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="cb_CTD_Si_layerVis" alpha="1.0" r= "0.9" g="1.0" b="0.1" showDaughters="true" visible="true"/>
<comment>
Deprecated colors.
......
......@@ -114,6 +114,7 @@
<include ref="reference_detector/vertex_tracker.xml"/>
<include ref="compact/silicon_tracker.xml"/>
-->
<include ref="compact/cb_CTD_Si.xml"/>
<include ref="ip6/beampipe.xml"/>
<include ref="compact/ffi_ZDC.xml"/>
<include ref="compact/solenoid.xml"/>
......
#include <XML/Helper.h>
//////////////////////////////////
// Central Barrel Tracker Silicon
//////////////////////////////////
using namespace std;
using namespace dd4hep;
static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
string detName = x_det.nameStr();
int detID = x_det.id();
xml_dim_t dim = x_det.dimensions();
double RIn = dim.rmin();
double ROut = dim.rmax();
double SizeZ = dim.length();
double SizeZCut = dim.zmax();
double SiLayerGap = dim.gap();
Material Vacuum = desc.material("Vacuum");
// Create Global Volume
Tube cb_CTD_GVol_Solid(RIn, ROut, SizeZ / 2.0, 0., 360.0 * deg);
Volume detVol("cb_CTD_GVol_Logic", cb_CTD_GVol_Solid, Vacuum);
detVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
// Construct Silicon Layers
xml_comp_t x_layer = x_det.child(_U(layer));
const int repeat = x_layer.repeat();
xml_comp_t x_slice = x_layer.child(_U(slice));
Material slice_mat = desc.material(x_slice.materialStr());
double layerRIn[100];
double layerROut[100];
// Loop over layers
for(int i = 0; i < repeat; i++) {
layerRIn[i] = RIn + (SiLayerGap * i);
layerROut[i] = RIn + (0.01 + SiLayerGap * i);
if (layerROut[i] > ROut)
continue;
string logic_layer_name = detName + _toString(i, "_Logic_lay_%d");
Volume layerVol(logic_layer_name,Tube(layerRIn[i], layerROut[i], SizeZ / 2.0, 0.0, 360.0 * deg), slice_mat);
layerVol.setVisAttributes(desc,x_layer.visStr());
sens.setType("tracker");
layerVol.setSensitiveDetector(sens);
Position layer_pos = Position(0.0, 0.0, 0.0);
PlacedVolume layerPV = detVol.placeVolume(layerVol, layer_pos);
layerPV.addPhysVolID("layer", i+1);
}
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, 0.0));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID);
detPV.addPhysVolID("barrel", 1);
det.setPlacement(detPV);
return det;
}
DECLARE_DETELEMENT(cb_CTD_Si, createDetector)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment