diff --git a/compact/cb_VTX.xml b/compact/cb_VTX.xml new file mode 100644 index 0000000000000000000000000000000000000000..45ffee548023dc5e524f7c7e8d93f2b9731a6b28 --- /dev/null +++ b/compact/cb_VTX.xml @@ -0,0 +1,36 @@ +<lccdd> + + <comment> Central Barrel Vertex Detector </comment> + + <define> + </define> + + <limits> + </limits> + + <regions> + </regions> + + <display> + </display> + + <detectors> + <detector id="cb_VTX_ID" name="cb_VTX" type="cb_VTX" readout="cb_VTX_Hits" vis="cb_VTXVis" insideTrackingVloume="true"> + <dimensions rmin="cb_VTX_rmin" rmax="cb_VTX_rmax" length="cb_VTX_length"/> + <position x="cb_VTX_x_pos" y="cb_VTX_y_pos" z="cb_VTX_z_pos"/> + </detector> + </detectors> + + <readouts> + <readout name="cb_VTX_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> diff --git a/compact/definitions.xml b/compact/definitions.xml index 4ebaf809292550702b243de3aba3a6e0b10c342b..7c3cf99fee06ee89b04cea782f8366407521c4cc 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -331,6 +331,14 @@ <constant name="VertexTrackerOuterRadius" value="90.0*mm"/> <constant name="VertexTrackerOuterBarrelLength" value="400.0*mm"/> + + <constant name="cb_VTX_rmin" value="33.0*mm"/> + <constant name="cb_VTX_rmax" value="SiliconTrackerInnerRadius - 5.0*mm"/> + <constant name="cb_VTX_length" value="SiliconTrackerInnerBarrelLength"/> + + <constant name="cb_VTX_x_pos" value="0.0*mm"/> + <constant name="cb_VTX_y_pos" value="0.0*mm"/> + <constant name="cb_VTX_z_pos" value="0.0*mm"/> <comment> -------------------------- diff --git a/compact/display.xml b/compact/display.xml index 5befdb0e535e3d4eefebe823f47aaecc26ebffdf..7d74ea181e1519112bcbd8a5a2f8b270e2251a40 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -55,6 +55,7 @@ <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"/> + <vis name="cb_VTXVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/> <comment> Deprecated colors. diff --git a/reference_detector.xml b/reference_detector.xml index 6d46ffadf8cf6fa61388e2cfce0e109912e177ca..b6b33a1bd7363847c720b05afbbb15ecc74e0343 100644 --- a/reference_detector.xml +++ b/reference_detector.xml @@ -121,7 +121,7 @@ <include ref="compact/ce_mrich.xml"/> <include ref="compact/ce_GEM.xml"/> <include ref="compact/ffi_ZDC.xml"/> - + <include ref="compact/cb_VTX.xml"/> <!-- <include ref="compact/forward_rich.xml"/> <include ref="compact/hcal.xml"/> diff --git a/src/cb_VTX.cpp b/src/cb_VTX.cpp new file mode 100644 index 0000000000000000000000000000000000000000..768ff7f9e0d2282490ba3bffe730bfb20afcc9dd --- /dev/null +++ b/src/cb_VTX.cpp @@ -0,0 +1,44 @@ +#include <XML/Helper.h> +#include "DDRec/Surface.h" +#include "DDRec/DetectorData.h" +#include "DD4hep/OpticalSurfaces.h" +#include "DD4hep/DetFactoryHelper.h" +#include "DD4hep/Printout.h" +////////////////////////////////// +// Central Barrel Vertex Detector +////////////////////////////////// + +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 cb_VTX_GVol_Solid(RIn, ROut, SizeZ / 2.0, 0., 360.0 * deg); + Volume detVol("cb_VTX_GVol_Logic", cb_VTX_GVol_Solid, Vacuum); + detVol.setVisAttributes(desc.visAttributes(x_det.visStr())); + + DetElement det(detName, detID); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, pos.z())); + PlacedVolume detPV = motherVol.placeVolume(detVol, tr); + detPV.addPhysVolID("system", detID); + detPV.addPhysVolID("barrel", 1); + det.setPlacement(detPV); + return det; +} + +DECLARE_DETELEMENT(cb_VTX, createDetector)