Commit 64fcc24a authored by Jihee Kim's avatar Jihee Kim
Browse files

Merge branch '11-implement-ce_gem' into 'master'

Resolve "Implement ce_GEM"

Closes #11

See merge request !32
parents d3450678 fc52120c
Pipeline #7964 passed with stages
in 2 minutes and 40 seconds
<lccdd>
<comment> Electron endcap GEM tracking </comment>
<define>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<detectors>
<detector id="ce_GEM_ID" name="ce_GEM" type="ce_GEM" readout="ce_GEM_Hits" vis="ce_GEMVis" insideTrackingVloume="true">
<dimensions rmin="ce_GEM_rmin" rmax="ce_GEM_rmax" length="ce_GEM_length"/>
<position x="ce_GEM_x_pos" y="ce_GEM_y_pos" z="ce_GEM_z_pos"/>
<layer repeat="ce_GEM_layer" vis="ce_GEM_layerVis">
<slice name="Ar10CO2_slice" material="Ar10CO2" thickness="ce_GEM_layer_thickness" sensitive="true"/>
</layer>
</detector>
</detectors>
<readouts>
<readout name="ce_GEM_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,layer:8,x:32:-16,y:-16</id>
</readout>
</readouts>
<plugins>
</plugins>
<fields>
</fields>
</lccdd>
......@@ -130,7 +130,7 @@
===================
Unused IDs: 75-99
TBD
TBD
</comment>
<comment>
......@@ -189,10 +189,12 @@
=====================================
Modular RICH ID: 130
Unused IDs: 131-139
Electron Endcap GEM tracking ID: 131
Unused IDs: 132-139
</comment>
<constant name="ce_MRICH_ID" value="130"/>
<constant name="ce_GEM_ID" value="131"/>
<comment>
=====================================
......@@ -531,8 +533,21 @@
<constant name="ce_MRICHLength" value="15*cm"/>
<constant name="ce_MRICHZMin" value="-EcalEndcap_zmin+10.*cm"/>
<comment>
------------------
ce_GEM Parameters
------------------
</comment>
<constant name="ce_GEM_rmin" value="5.0 * cm"/> <comment> temporary number. Need beampipe radius </comment>
<!--<constant name="ce_GEM_rmin" value="0.0 * cm"/>-->
<constant name="ce_GEM_rmax" value="HcalEndcapN_rmin + 8.0 * cm"/> <comment> temporary number to avoid overlaps </comment>
<!--<constant name="ce_GEM_rmax" value="45.0 * cm + 50.0 * cm"/>-->
<constant name="ce_GEM_length" value="30.0 * cm"/>
<constant name="ce_GEM_x_pos" value="0.0 * cm"/>
<constant name="ce_GEM_y_pos" value="0.0 * cm"/>
<constant name="ce_GEM_z_pos" value="-SolenoidLength/2.0 + ce_GEM_length/2.0"/>
<constant name="ce_GEM_layer" value="8"/>
<constant name="ce_GEM_layer_thickness" value="1.0 * cm"/>
</define>
......@@ -53,6 +53,8 @@
<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"/>
<vis name="ce_GEMVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="cb_GEM_layerVis" alpha="0.8" r= "0.8" g="0.4" b="0.3" showDaughters="true" visible="true"/>
<comment>
Deprecated colors.
......
......@@ -186,4 +186,12 @@
<composite n="4" ref="O"/>
</material>
<material name="Ar10CO2">
<D type="density" value="1.802" unit="mg / cm3"/>
<composite n="0.891" ref="Argon"/>
<!--<composite n="0.109" ref="CarbonDioxide"/>-->
<composite n="0.036" ref="C"/>
<composite n="0.073" ref="O"/>
</material>
</materials>
......@@ -122,6 +122,7 @@
<include ref="compact/hcal.xml"/>
<include ref="compact/forward_rich.xml"/>
<include ref="compact/ce_mrich.xml"/>
<include ref="compact/ce_GEM.xml"/>
<!--
<include ref="compact/roman_pots.xml"/>
-->
......
#include <XML/Helper.h>
//////////////////////////////////
// Electron Endcap GEM Tracking
//////////////////////////////////
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();
xml_dim_t pos = x_det.position();
Material Vacuum = desc.material("Vacuum");
// Create Global Volume
Tube ce_GEM_GVol_Solid(RIn, ROut, SizeZ / 2.0, 0., 360.0 * deg);
Volume detVol("ce_GEM_GVol_Logic", ce_GEM_GVol_Solid, Vacuum);
detVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
// Construct 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 layerSizeZ = x_slice.thickness();
double layerRIn;
double layerROut;
double layerPosZ;
// Loop over layers
for(int i = 0; i < repeat; i++) {
layerRIn = RIn + 1.0 * cm + ((double)i * 0.5) * cm;
layerROut = ROut - 25.0 * cm + ((double)i * 2.0) * cm;
layerPosZ = SizeZ / 2.0 - 5.0 * cm - ((double)i * 3.0) * cm;
layerSizeZ = 1.0 * cm;
string logic_layer_name = detName + _toString(i, "_Logic_lay_%d");
Volume layerVol(logic_layer_name,Tube(layerRIn, layerROut, layerSizeZ / 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, layerPosZ);
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(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID);
det.setPlacement(detPV);
return det;
}
DECLARE_DETELEMENT(ce_GEM, 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