diff --git a/ci_GEM.xml b/ci_GEM.xml new file mode 100644 index 0000000000000000000000000000000000000000..7614dd5f64378ff4816fd61791d986fc257e0d78 --- /dev/null +++ b/ci_GEM.xml @@ -0,0 +1,70 @@ +<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"> +> + + <!-- Some information about detector --> + <info name="Central Ion GEM" title="Central Ion GEM" + author="Marshall Scott" + url="https://eicweb.phy.anl.gov/EIC/detectors/reference_detector.git" + status="development" + version="v1 2021-03-23"> + <comment>Central Ion GEM</comment> + </info> + + <!-- Use DD4hep elements and materials definitions --> + <includes> + <gdmlFile ref="elements.xml"/> + <gdmlFile ref="materials.xml"/> + </includes> + + <!-- Define the dimensions of the world volume --> + <define> + <constant name="ci_GEM_id" value="1"> + <constant name="ci_GEM_rin" value="10 * cm"> + <constant name="ci_GEM_rout" value="95 * cm"> + <constant name="ci_GEM_sizez" value="30 * cm"> + <constant name="ci_GEM_shiftz" value="0 * cm"> + <constant name="ci_GEM_posz" value="0 * cm"> + <constant name="ci_GEM_posx" value="0 * cm"> + <constant name="ci_GEM_nlayers" value="8"> + </define> + + <limits> + </limits> + + <regions> + </regions> + + <!-- Common Generic visualization attributes --> + <!-- change this --> + <comment>Common Generic visualization attributes</comment> + <display> + <vis name="ci_GEMVis" r= "0.8" g="0.4" b="0.3" alpha="0.8" showDaughters="true" visible="true"/> + </display> + + <!-- Define detector --> + <detectors> + <comment> + Central Ion GEM + </comment> + <detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis"> + <material name="Ar10CO2"/> <!-- G4_Galactic --> + <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" sizez="ci_GEM_sizez" delta="ci_GEM_shiftz" z="ci_GEM_posz" x="ci_GEM_posx" nlayers="ci_GEM_nlayers"/> + <layer id="0" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="1" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="2" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="3" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="4" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="5" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="6" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + <layer id="7" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" /> + </detector> + </detectors> + + <plugins> + </plugins> + + + + diff --git a/compact/ci_GEM.xml b/compact/ci_GEM.xml new file mode 100644 index 0000000000000000000000000000000000000000..6496579bd6b8a9ab80499a4f08435c1a33b97e8b --- /dev/null +++ b/compact/ci_GEM.xml @@ -0,0 +1,62 @@ +<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"> + + <!-- Some information about detector --> + <info name="Central Ion GEM" title="Central Ion GEM" + author="Marshall Scott" + url="https://eicweb.phy.anl.gov/EIC/detectors/reference_detector.git" + status="development" + version="v1 2021-03-23"> + <comment>Central Ion GEM</comment> + </info> + + <!-- Use DD4hep elements and materials definitions --> + <includes> + </includes> + + <define> + <!-- + <constant name="ci_GEM_id" value="1"> + <constant name="ci_GEM_rin" value="10 * cm"> + <constant name="ci_GEM_rout" value="95 * cm"> + <constant name="ci_GEM_sizez" value="30 * cm"> + <constant name="ci_GEM_shiftz" value="0 * cm"> + <constant name="ci_GEM_posz" value="0 * cm"> + <constant name="ci_GEM_posx" value="0 * cm"> + <constant name="ci_GEM_nlayers" value="8"> + --> + </define> + + <limits> + </limits> + + <regions> + </regions> + + <display> + </display> + + <!-- Define detector --> + <detectors> + <comment> + Central Ion GEM + </comment> + <detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis"> + <material name="Ar10CO2"/> + <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" z_length="ci_GEM_sizez" z_offset="ci_GEM_shiftz" z="ci_GEM_posz" x="ci_GEM_posx" number="ci_GEM_nlayers" rmax1="ci_HCAL_lay_rin -1. * cm"/> + <layer id="0" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 0) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 0) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 0) * cm" dz="1 * cm" /> + <layer id="1" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 1) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 1) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 1) * cm" dz="1 * cm" /> + <layer id="2" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 2) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 2) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 2) * cm" dz="1 * cm" /> + <layer id="3" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 3) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 3) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 3) * cm" dz="1 * cm" /> + <layer id="4" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 4) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 4) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 4) * cm" dz="1 * cm" /> + <layer id="5" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 5) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 5) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 5) * cm" dz="1 * cm" /> + <layer id="6" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 6) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 6) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 6) * cm" dz="1 * cm" /> + <layer id="7" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 7) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 7) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 7) * cm" dz="1 * cm" /> + </detector> + </detectors> + + <plugins> + </plugins> + +</lccdd> \ No newline at end of file diff --git a/compact/ci_HCAL.xml b/compact/ci_HCAL.xml new file mode 100644 index 0000000000000000000000000000000000000000..923be2cc873ff4f58bcbf7f974a7ba3279e4034b --- /dev/null +++ b/compact/ci_HCAL.xml @@ -0,0 +1,59 @@ +<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"> + + <!-- Some information about detector--> + <info name="Central Ion HCAL" title="Central Ion HCAL" + author="Marshall Scott" + url="https://eicweb.phy.anl.gov/EIC/detectors/reference_detector.git" + status="development" + version="v1 2021-03-31"> + <comment>Central Ion HCAL</comment> + </info> + + <includes> + </includes> + + <limits> + </limits> + + <regions> + </regions> + + <display> + </display> + + <!-- Define detector --> + <detectors> + <comment> + Central Ion HCAL + </comment> + <detector id="ci_HCAL_id" name="ci_HCAL" type="ci_HCAL" insideTrackingVolume="false" vis="ci_HCALVis"> + <material name="Iron"/> + <dimensions rmin="ci_HCAL_rin" rmax="ci_HCAL_rout" z_length="ci_HCAL_sizez" z_offset="ci_HCAL_shiftz" z="ci_HCAL_posz" x="ci_HCAL_posx" number="ci_HCAL_nlayers" rmin1="ci_HCAL_lay_rin" rmax1="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness"/> + <layer id="0" z="-ci_HCAL_sizez * 0.5 + (1 + 0) * ci_HCAL_lay_thickness + (1 + 0) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="1" z="-ci_HCAL_sizez * 0.5 + (1 + 1) * ci_HCAL_lay_thickness + (1 + 1) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="2" z="-ci_HCAL_sizez * 0.5 + (1 + 2) * ci_HCAL_lay_thickness + (1 + 2) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="3" z="-ci_HCAL_sizez * 0.5 + (1 + 3) * ci_HCAL_lay_thickness + (1 + 3) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="4" z="-ci_HCAL_sizez * 0.5 + (1 + 4) * ci_HCAL_lay_thickness + (1 + 4) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="5" z="-ci_HCAL_sizez * 0.5 + (1 + 5) * ci_HCAL_lay_thickness + (1 + 5) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="6" z="-ci_HCAL_sizez * 0.5 + (1 + 6) * ci_HCAL_lay_thickness + (1 + 6) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="7" z="-ci_HCAL_sizez * 0.5 + (1 + 7) * ci_HCAL_lay_thickness + (1 + 7) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="8" z="-ci_HCAL_sizez * 0.5 + (1 + 8) * ci_HCAL_lay_thickness + (1 + 8) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="9" z="-ci_HCAL_sizez * 0.5 + (1 + 9) * ci_HCAL_lay_thickness + (1 + 9) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="10" z="-ci_HCAL_sizez * 0.5 + (1 + 10) * ci_HCAL_lay_thickness + (1 + 10) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="11" z="-ci_HCAL_sizez * 0.5 + (1 + 11) * ci_HCAL_lay_thickness + (1 + 11) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="12" z="-ci_HCAL_sizez * 0.5 + (1 + 12) * ci_HCAL_lay_thickness + (1 + 12) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="13" z="-ci_HCAL_sizez * 0.5 + (1 + 13) * ci_HCAL_lay_thickness + (1 + 13) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="14" z="-ci_HCAL_sizez * 0.5 + (1 + 14) * ci_HCAL_lay_thickness + (1 + 14) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="15" z="-ci_HCAL_sizez * 0.5 + (1 + 15) * ci_HCAL_lay_thickness + (1 + 15) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="16" z="-ci_HCAL_sizez * 0.5 + (1 + 16) * ci_HCAL_lay_thickness + (1 + 16) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="17" z="-ci_HCAL_sizez * 0.5 + (1 + 17) * ci_HCAL_lay_thickness + (1 + 17) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="18" z="-ci_HCAL_sizez * 0.5 + (1 + 18) * ci_HCAL_lay_thickness + (1 + 18) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + <layer id="19" z="-ci_HCAL_sizez * 0.5 + (1 + 19) * ci_HCAL_lay_thickness + (1 + 19) * 5 * cm" inner_r="ci_HCAL_lay_rin" outer_r="ci_HCAL_lay_rout" dz="ci_HCAL_lay_thickness" /> + </detector> + </detectors> + + <plugins> + </plugins> +</lccdd> \ No newline at end of file diff --git a/compact/definitions.xml b/compact/definitions.xml index 70d2b520f8fbdf357032167bbb3628a302259ef7..d06f7ab5f73255c00478c31bacd2dc376b24defb 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -26,7 +26,7 @@ endcapP/endcapN are the endcaps at positive/negative z values. See https://acts.readthedocs.io/en/latest/plugins/dd4hep.html for more details. - The tracking geometry needs to beconstructed from cylinders from the inside out. For this reason + The tracking geometry needs to be constructed from cylinders from the inside out. For this reason each layer needs its own subsystem assembly. This increases the number of top level system IDs. For example the silicon tracker needs 3 IDs for each area (endcap+barrel+endcap) and a subassembly for each layer. Therefore it needs a minimum of 20 IDs. Therefore we will allocate blocks of ~25 for each major subsystem. @@ -127,7 +127,7 @@ <comment> =================== - (75-99 Reserved IDs + (75-99) Reserved IDs =================== Unused IDs: 75-99 @@ -156,7 +156,7 @@ <comment> ===================================== - (110-119Hadronic Calorimeter + (110-119) Hadronic Calorimeter ===================================== HCal subsystem ID: 110 @@ -570,10 +570,53 @@ ce_MRICH Parameters -------------------------- </comment> +<<<<<<< HEAD <constant name="ce_MRICHRMin" value="15*cm"/> <constant name="ce_MRICHRMax" value="100*cm"/> <constant name="ce_MRICHLength" value="BackwardCherenkovLength"/> <constant name="ce_MRICHZMin" value="-EcalEndcapN_zmin+ce_MRICHLength"/> +======= + <constant name="ce_MRICHRMin" value="15*cm"/> + <constant name="ce_MRICHRMax" value="100*cm"/> + <constant name="ce_MRICHLength" value="15*cm"/> + <constant name="ce_MRICHZMin" value="-EcalEndcap_zmin+10.*cm"/> + + <comment> + -------------------------- + Central Ion HCal Parameters + -------------------------- + + </comment> + <constant name="ci_HCAL_id" value="200"/> + <constant name="ci_HCAL_rin" value="SolenoidBarrel_rmax + 1 * cm"/><!-- Original = 0cm --> + <constant name="ci_HCAL_rout" value="300 * cm"/> + <constant name="ci_HCAL_sizez" value="160 * cm"/> + <constant name="ci_HCAL_shiftz" value="5 * cm"/> + <constant name="ci_HCAL_posz" value="0 * cm"/> + + <constant name="ci_HCAL_nlayers" value="20"/> + <constant name="ci_HCAL_lay_rin" value="ci_HCAL_rin"/> <!-- Original = 80cm --> + <constant name="ci_HCAL_lay_rout" value="ci_HCAL_rout - 1 * cm"/> + <constant name="ci_HCAL_lay_thickness" value="2* cm"/> + <constant name="ci_HCAL_lay_gapz" value="2* cm"/> + + <comment> + -------------------------- + Central Ion GEM Parameters + -------------------------- + </comment> + <constant name="ci_GEM_id" value="201"/> + <constant name="ci_GEM_rin" value="10 * cm"/> + <constant name="ci_GEM_rout" value="95 * cm"/> + <constant name="ci_GEM_sizez" value="30 * cm"/> + <constant name="ci_GEM_shiftz" value="0 * cm"/> + <constant name="ci_GEM_posz" value="0 * cm"/> + <constant name="ci_GEM_posx" value="0 * cm"/> + <constant name="ci_GEM_nlayers" value="8"/> + + + +>>>>>>> 57cf00b (Changed .xml files and ci_GEM.cpp) <comment> ------------------ diff --git a/compact/display.xml b/compact/display.xml index 5befdb0e535e3d4eefebe823f47aaecc26ebffdf..d0733f6da83fd198c2c1c7e08af2593834b12e65 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -56,6 +56,9 @@ <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="ci_GEMVis" r= "0.8" g="0.4" b="0.3" alpha="0.8" showDaughters="true" visible="true"/> + <vis name="ci_HCALVis" r= "0.6" g="0" b="0.6" alpha="1.0" showDaughters="true" visible="true"/> + <comment> Deprecated colors. </comment> diff --git a/compact/materials.xml b/compact/materials.xml index 837b7f028d3138380804a505b5dbe1ca64ed71ab..2a6857a4c6a98dacfcbd1877dec6cb0122537a60 100644 --- a/compact/materials.xml +++ b/compact/materials.xml @@ -11,7 +11,7 @@ <fraction n="0.234" ref="O"/> <fraction n="0.012" ref="Ar"/> </material> - <!-- We model vakuum just as very thin air --> + <!-- We model vacuum just as very thin air --> <material name="Vacuum"> <D type="density" unit="g/cm3" value="0.0000000001"/> <fraction n="0.754" ref="N"/> @@ -185,6 +185,12 @@ <composite n="1" ref="W"/> <composite n="4" ref="O"/> </material> + <material name="Ar10CO2"> + <D type="density" value="1.802e-3" unit="g / cm3"/> + <composite n="10" ref="Ar"/> + <composite n="1" ref="C"/> + <composite n="2" ref="O"/> + </material> <material name="Ar10CO2"> <D type="density" value="1.802" unit="mg / cm3"/> diff --git a/reference_detector.xml b/reference_detector.xml index 6d46ffadf8cf6fa61388e2cfce0e109912e177ca..9f0b2a088dcd2268bbc017db46f65a8f8a683d44 100644 --- a/reference_detector.xml +++ b/reference_detector.xml @@ -114,20 +114,34 @@ <include ref="reference_detector/vertex_tracker.xml"/> <include ref="compact/silicon_tracker.xml"/> --> + <!-- <include ref="ip6/beampipe.xml"/> + --> <include ref="compact/solenoid.xml"/> + + <!-- <include ref="compact/ecal.xml"/> <include ref="compact/cb_CTD_Si.xml"/> <include ref="compact/ce_mrich.xml"/> <include ref="compact/ce_GEM.xml"/> <include ref="compact/ffi_ZDC.xml"/> - + --> <!-- <include ref="compact/forward_rich.xml"/> <include ref="compact/hcal.xml"/> + --> + <include ref="compact/ci_HCAL.xml"/> + <!-- + <include ref="compact/ci_GEM.xml"/> + --> + + <!-- <include ref="compact/roman_pots.xml"/> --> +<!-- <include ref="eic/forward_ion_beamline.xml"/> +--> + <detectors> </detectors> diff --git a/src/ci_GEM.cpp b/src/ci_GEM.cpp new file mode 100644 index 0000000000000000000000000000000000000000..73cb6363eb225fd84c85d682f729f2ce6ceb1c63 --- /dev/null +++ b/src/ci_GEM.cpp @@ -0,0 +1,54 @@ +#include <XML/Helper.h> +/////////////////////////// +// Central Ion GEM +/////////////////////////// + +using namespace dd4hep; + +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) +{ + + xml::DetElement detElem = handle; + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + xml::Component dims = detElem.dimensions(); + double SizeZ = dims.z_length(); // Size in Z direction + double ROut = dims.rmax(); // Outer radius + double RIn = dims.rmin(); // Inner radius + double ShiftZ = dims.z_offset(); + double X = dims.x(); + double Z = dims.z(); + int Nlayers = dims.number(); + double HCAL_rmin = dims.rmax1(); // Maximum radius that the layer can be + Material mat = desc.material(detElem.materialStr()); + Material vac = desc.material("Vacuum"); + + //Outer Volume + Tube ci_GEM_GVol_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg); + Volume detVol("ci_GEM_GVol_Logic", ci_GEM_GVol_Solid, vac); + + //Adding layers to placed volume + for (xml_coll_t li(detElem,_U(layer)); li; ++li){ + xml_comp_t x_layer = li; + std::string layer_name = detName + _toString(x_layer.id(), "_layer%d"); + double outer_r = x_layer.outer_r(); + if (outer_r > HCAL_rmin){outer_r = HCAL_rmin;} + + Volume layer_vol(layer_name, Tube(x_layer.inner_r(), outer_r, x_layer.dz()), mat); + layer_vol.setVisAttributes(desc.visAttributes(detElem.visStr())); + Position layer_pos(0, 0, x_layer.z()); + PlacedVolume layer_phv = detVol.placeVolume(layer_vol, layer_pos); + layer_phv.addPhysVolID("layer", x_layer.id()); + } + + 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); + det.setPlacement(detPV); + + return det; +} +// clang-format off +DECLARE_DETELEMENT(ci_GEM, createDetector) diff --git a/src/ci_HCAL.cpp b/src/ci_HCAL.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8cd0cc7413932732045288bcd5f8e73ca5b2ed7d --- /dev/null +++ b/src/ci_HCAL.cpp @@ -0,0 +1,56 @@ +#include <XML/Helper.h> +/////////////////////////// +// Central Ion GEM +/////////////////////////// + +using namespace dd4hep; + +static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) +{ + + xml::DetElement detElem = handle; + std::string detName = detElem.nameStr(); + int detID = detElem.id(); + xml::Component dims = detElem.dimensions(); + double RIn = dims.rmin(); + double ROut = dims.rmax(); + double SizeZ = dims.z_length(); + double ShiftZ = dims.z_offset(); + double PosZ = dims.z(); + double lay_RIn = dims.rmin1(); + double lay_ROut = dims.rmax1(); + double lay_dz = dims.dz(); + Material mat_iron = desc.material("Iron"); + Material mat_vac = desc.material("Vacuum"); + + //Outer volume + Tube ci_Hcal_Solid(RIn, ROut, SizeZ / 2., 0., 360 * dd4hep::deg); + Volume envelopeVol("ci_Hcal_Logic", ci_Hcal_Solid, mat_vac); + + //Iron tube for the layers + Tube ci_Hcal_detSolid(lay_RIn, lay_ROut, lay_dz / 2., 0., 360 * dd4hep::deg); + + //Adding layers to placed detector volume + for (xml_coll_t li(detElem,_U(layer)); li; ++li){ + xml_comp_t x_layer = li; + std::string layer_name = detName + _toString(x_layer.id(), "_layer%d"); + Volume layer_vol(layer_name, ci_Hcal_detSolid, mat_iron); + layer_vol.setVisAttributes(detElem.visStr()); + sens.setType("calorimeter"); + layer_vol.setSensitiveDetector(sens); + Position layer_pos(0, 0, x_layer.z()); + PlacedVolume layer_phv = envelopeVol.placeVolume(layer_vol, layer_pos); + layer_phv.addPhysVolID("layer", x_layer.id()); + } + + DetElement det(detName, detID); + Volume motherVol = desc.pickMotherVolume(det); + Transform3D tr(RotationZYX(0,0,0), Position(0, 0, ShiftZ)); + PlacedVolume detPV = motherVol.placeVolume(envelopeVol, tr); + detPV.addPhysVolID("system", detID); + det.setPlacement(detPV); + + return det; +} +// clang-format off +DECLARE_DETELEMENT(ci_HCAL, createDetector)