Skip to content

Instantly share code, notes, and snippets.

@jdbrice
Last active September 28, 2021 20:18
Show Gist options
  • Save jdbrice/3956ae951956d6021954bce6124cb0f6 to your computer and use it in GitHub Desktop.
Save jdbrice/3956ae951956d6021954bce6124cb0f6 to your computer and use it in GitHub Desktop.
Work in progress sTGC geometry with pentagonal design
<Document file="StarVMC/Geometry/StgmGeo/StgmGeo1.xml">
<Replace match="GeV">*1.0E+0;</Replace>
<Replace match="MeV">*1.0E-3;</Replace>
<Replace match="keV">*1.0E-6;</Replace>
<Module name="StgmGeo1" comment="Forward Tracking System Geometry / developed for the sTGC tracker">
<Created date="08/19/2021" />
<Author name="Daniel Brandenburg" />
<CDE>AGECOM,GCONST,GCUNIT</CDE>
<Content>
STGM, <!-- STGC Mother volume -->
STMP, <!-- pentagon module of pcb -->
STMG, <!-- pentagon module of gas (active volume) -->
STFM, <!-- pentagon module full (pcb, gas, FEEs etc.) -->
STGP, <!-- pentagon sub shapes for gas module, pgon triangle -->
STGL, <!-- pentagon sub shapes for gas module, long box -->
STGS, <!-- pentagon sub shapes for gas module, short box -->
STPP, <!-- pentagon sub shapes for PCB module, pgon triangle -->
STPL, <!-- pentagon sub shapes for PCB module, long box -->
STPS, <!-- pentagon sub shapes for PCB module, short box -->
TFEA, <!-- sTGC FEE -->
TFEP, <!-- sTGC FEE plate -->
TFER, <!-- sTGC FEE rib -->
TFEI <!-- sTGC FEE PCB -->
</Content>
<varlist type="REAL">INCH,CM</varlist>
<Parameter name="INCH" value="2.54" />
<Parameter name="CM" value="1." />
<!-- Colors for the volumes -->
<varlist type="INTEGER" >
kBlack,kRed,kGreen,kBlue,kYellow,kViolet,kLightBlue
</varlist>
<!-- Values from this structure can be assigned in the Config.xml -->
<Structure name="MAIN" comment="Main configuration control structure, selects version at run time">
<var name="version" type="float" />
<var name="type" type="int" />
<var name="useids" type="float" />
<var name="active(20)" type="float" />
<var name="rmnDSK" type="float" /> <!-- min disk radius -->
<var name="rmxDSK" type="float" /> <!-- max disk radius -->
<var name="cutele" type="float" />
<var name="rotatez" type="float" />
<var name="rotateztgc" type="float" />
<var name="zsi(7)" type="float" />
</Structure>
<Structure name="TFEE" >
<var name="Vers" type="float" />
<var name="CardDX" type="float" />
<var name="CardDY" type="float" />
<var name="CardDZ" type="float" />
<var name="PlateDX" type="float" />
<var name="PlateDY" type="float" />
<var name="PlateDZ" type="float" />
<var name="AssemblyThickness" type="float" />
<var name="RibDX" type="float" />
<var name="RibDY" type="float" />
<var name="RibDZ" type="float" />
<var name="Pos(3)" type="float" />
</Structure>
<Structure name="PENT" >
<var name="ls" type="float" />
<var name="ss" type="float" />
<var name="dz" type="float" />
</Structure>
<varlist type="int">
ndisk/0/, idisk/0/, i, j, k, station, zplane
</varlist>
<varlist type="float" >
feeSO/2.133333333/, feeId/0/
</varlist>
<Inline name="eta2tan" type="real">
<Arguement type="real" name="etax" />
<Return value="tan(2*atan(exp(-etax)))" />
</Inline>
<Fill name="MAIN" comment="Select configuration" >
<var name="version" value="3.0" comment="selector" />
<var name="useids" value="1.0" comment="defines placement 0=in cave, 1=in idsm" />
<var name="active" value="{1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1}" comment="switch on/off up to 20 disks" />
<var name="rmnDSK" value="2.25" comment="default disk inner radius" />
<var name="rmxDSK" value="32.5" comment="default disk outer radius" />
<var name="cutele" value="1 MeV" comment="electron propagation threshold" />
<var name="type" value="1" comment="This is combined Si+sTGC" />
<var name="rotatez" value="0" comment="rotation angles for disk 2 and 3"/>
<var name="rotateztgc" value="0" comment="tgc rotation angles for disk 2, 3 and 4"/>
<var name="zsi" value="{93.3, 140.0, 186.6, 280.9, 303.7, 326.6, 349.4}" comment="Positions of the Si+TGC disks" />
</Fill>
<Use struct="MAIN" />
<Fill name="PENT" comment="sTGC Pentagon dimensions" >
<var name="ls" value="60.2361" comment="length of long side" />
<var name="ss" value="0.308571429 * PENT_ls" comment="length of short side" />
<var name="dz" value="0.5" comment="z depth of PCB" />
</Fill>
<Use struct="PENT" />
<Fill name="TFEE" comment="// frontEndElectronics" >
<var name="Vers" value="1" comment="// version of FrontEndElectronics " />
<var name="CardDX" value="1.47*0.110*INCH/2" comment="// 1.47 scale factor account for 9 lb of cables " />
<var name="CardDY" value="PENT_ss * 0.70 / 2.0" comment="FEEL, replace with precise value from CAD mdoel" />
<var name="CardDZ" value="TFEE_CardDY * 0.635135135 / 2.0" comment="FEES, replace with precise value from CAD model" />
<var name="PlateDX" value="0.110*INCH/2" comment="//... " />
<var name="PlateDY" value="4.650*INCH/2" comment="//... " />
<var name="PlateDZ" value="1.480*INCH" comment="//... " />
<var name="AssemblyThickness" value="TFEE_CardDX + TFEE_PlateDX" comment="//... " />
<var name="RibDX" value="0.820*INCH/2 - 2* TFEE_CardDX" comment="//... " />
<var name="RibDY" value="TFEE_CardDX" comment="//... " />
<var name="RibDZ" value="2.900*INCH/2 - 2* TFEE_CardDX" comment="//... " />
<var name="Pos" value="{1.6,4,10}" comment="// Fee assembly brik size " />
</Fill>
<Use struct="TFEE" />
<Mixture name="G10" dens="1.7" >
<Component name="Si" a="28.08" z="14" w="0.6*1*28./60." />
<Component name="O" a="16" z="8" w="0.6*2*16./60. + 0.4*4*16./174." />
<Component name="C" a="12" z="6" w="0.4*8*12./174." />
<Component name="H" a="1" z="1" w="0.4*14*1./174." />
</Mixture>
<Mixture name="NPCO2" dens="0.2529E-02" > <!--g/cm3-->
<Component name="C" a="12" z="6" w="28" />
<Component name="H" a="1" z="1" w="54" />
<Component name="O" a="16" z="8" w="11" />
</Mixture>
<!-- Create and place the FSTM mother volume in the CAVE -->
<Create block="STGM" />
<Placement block="STGM" in="CAVE" konly="ONLY" x="0" y="0" z="307.65" />
<Volume name="STGM" comment="FTS mother volume" >
<Material name="Air" />
<!-- STGM placement and params taken from old geometry -->
<Shape type="tube" rmin="5.90" rmax="85.0" dz="46.75" />
<Create block="STFM" />
<!-- First z-plane station -->
<!-- z relative to mother zcenter -->
zplane = -26.75;
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" />
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" >
<Rotation matrix="{0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="-6.5" z="zplane" block="STFM" >
<Rotation matrix="{-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="6.5" z="zplane" block="STFM" >
<Rotation matrix="{0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
station = 1;
<Info format="Positioning sTGC {2I}">station</Info>
zplane = -3.95;
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" />
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" >
<Rotation matrix="{0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="-6.5" z="zplane" block="STFM" >
<Rotation matrix="{-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="6.5" z="zplane" block="STFM" >
<Rotation matrix="{0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
station = 2;
<Info format="Positioning sTGC {2I}">station</Info>
zplane = +18.95;
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" />
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" >
<Rotation matrix="{0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="-6.5" z="zplane" block="STFM" >
<Rotation matrix="{-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="6.5" z="zplane" block="STFM" >
<Rotation matrix="{0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
station = 3;
<Info format="Positioning sTGC {2I}">station</Info>
zplane = +41.75;
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" />
<Placement in="STGM" y="0" x="0" z="zplane" block="STFM" >
<Rotation matrix="{0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="-6.5" z="zplane" block="STFM" >
<Rotation matrix="{-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STGM" y="0" x="6.5" z="zplane" block="STFM" >
<Rotation matrix="{0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
station = 4;
<Info format="Positioning sTGC {2I}">station</Info>
</Volume>
<Volume name="STFM" comment="STGC Full Module (single pentagon)" >
<Material name="Air" />
<Attribute for="STFM" seen="1" colo="3" />
<Shape type="tubs" rmin="5.90" rmax="85.0" dz="1.5" phi1="0" phi2="1.570796327" />
<Create block="STMP" />
<Create block="STMG" />
<Create block="TFEA" />
<!-- PCB, Gas, PCB sandwich -->
<Placement in="STFM" y="0" x="0" z="0.0" block="STMP"/>
<Placement in="STFM" y="0" x="0" z="0.5" block="STMG"/>
<Placement in="STFM" y="0" x="0" z="1.0" block="STMP"/>
<!-- Place the FEEs -->
<Placement in="STFM" x="PENT_ls - 2.133" y="(PENT_ss - TFEE_CardDY)/2.0 + (PENT_ss - TFEE_CardDY)/3.0" z="-5.6/2.0" block="TFEA" />
<Placement in="STFM" x="(PENT_ss - TFEE_CardDY)/2.0 + (PENT_ss - TFEE_CardDY)/3.0" y="PENT_ls - 2.133" z="-5.6/2.0" block="TFEA">
<Rotation matrix="{0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<!-- Diagonal -->
<Placement in="STFM" x="23.5486" y="53.1413" z="-5.6/2.0" block="TFEA">
<Rotation matrix="{0.707107, -0.707107, 0.0, 0.707107, 0.707107, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STFM" x="33.4716" y="43.2183" z="-5.6/2.0" block="TFEA">
<Rotation matrix="{0.707107, -0.707107, 0.0, 0.707107, 0.707107, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STFM" x="43.3946" y="33.2953" z="-5.6/2.0" block="TFEA">
<Rotation matrix="{0.707107, -0.707107, 0.0, 0.707107, 0.707107, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STFM" x="53.3176" y="23.3723" z="-5.6/2.0" block="TFEA">
<Rotation matrix="{0.707107, -0.707107, 0.0, 0.707107, 0.707107, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
</Volume>
<!-- PCB Pentagon (Module) -->
<Volume name="STMP" comment="STGC Module PCB (single pentagon)" >
<Material name="Air" />
<Attribute for="STMP" seen="1" colo="3" />
<Shape type="tubs" rmin="5.90" rmax="85.0" dz="0.5" phi1="0" phi2="1.570796327"/>
<Create block="STPP" />
<Create block="STPL" />
<Create block="STPS" />
<Placement in="STMP" y="18.5871394544" x="18.5871394544" z="0.0" konly="ONLY" block="STPP" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STMP" y="PENT_ss/2.0" x="PENT_ls/2.0" z="0.25" konly="ONLY" block="STPL" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STMP" y="39.4116197272" x="PENT_ss/2.0" z="0.25" konly="ONLY" block="STPS" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
</Volume>
<!-- Gas active volume pentagon (Module) -->
<Volume name="STMG" comment="STGC Module Gas active volume (single pentagon)" >
<Material name="Air" />
<Attribute for="STMG" seen="1" colo="3" />
<Shape type="tubs" rmin="5.90" rmax="85.0" dz="0.14" phi1="0" phi2="1.570796327" />
<Create block="STGP" />
<Create block="STGL" />
<Create block="STGS" />
<Placement in="STMG" y="18.5871394544" x="18.5871394544" z="0.0" konly="ONLY" block="STGP" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STMG" y="PENT_ss/2.0" x="PENT_ls/2.0" z="0.25" konly="ONLY" block="STGL" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
<Placement in="STMG" y="39.4116197272" x="PENT_ss/2.0" z="0.25" konly="ONLY" block="STGS" >
<Rotation matrix="{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}" />
</Placement>
</Volume>
<!-- Sub-shhapes of the pentagon for the PCB -->
<Block name="STPP" comment="pgon triangle for pentagon shape" >
<Material name="G10" />
<Attribute for="STPP" lwid="2" seen="1" colo="3" />
<Shape type="Pgon" phi1="0.0" rmx="{29.450262431173993, 29.450262431173993}" nz="2" npdiv="1" dphi="90.0" rmn="{0.0, 0.0}" zi="{0.0, 0.5}" />
</Block>
<Block name="STPL" comment="long box for pentagon shape" >
<Material name="G10" />
<Attribute for="STPL" lwid="2" seen="1" colo="3" />
<Shape type="BBox" dz="0.25" dx="PENT_ls/2.0" dy="PENT_ss/2.0" />
</Block>
<Block name="STPS" comment="short box for pentagon shape" >
<Material name="G10" />
<Attribute for="STPS" lwid="2" seen="1" colo="3" />
<Shape type="BBox" dz="0.25" dx="PENT_ss/2.0" dy="20.8244802728" />
</Block>
<!-- Sub-shhapes of the pentagon for the active gas chamber -->
<Block name="STGP" comment="gas pgon triangle for pentagon shape" >
<Material name="NPCO2" />
<Attribute for="STGP" lwid="2" seen="1" colo="2" />
<Shape type="Pgon" phi1="0.0" rmx="{29.450262431173993, 29.450262431173993}" nz="2" npdiv="1" dphi="90.0" rmn="{0.0, 0.0}" zi="{0.0, 0.5}" />
<Instrument block="STGP" >
<!-- Local coordinates 0.1 micron resolution -->
<Hit meas="z" opts="S" bins="0.01" />
<Hit meas="y" opts="S" bins="0.01" />
<Hit meas="x" opts="S" bins="0.01" />
<!-- Global coordinates 0.1 micron resolution-->
<Hit meas="zz" opts="S" bins="0.01" />
<Hit meas="yy" opts="S" bins="0.01" />
<Hit meas="xx" opts="S" bins="0.01" />
<!-- Time of flight, energy lost, direction cosines, total momentum -->
<Hit meas="ptot" nbits="16" min="0" max="100" />
<Hit meas="cx" nbits="16" />
<Hit meas="cy" nbits="16" />
<Hit meas="cz" nbits="16" />
<Hit meas="tof" nbits="16" />
<Hit meas="eloss" nbits="16" />
</Instrument>
</Block>
<Block name="STGL" comment="long box for pentagon shape" >
<Material name="NPCO2" />
<Attribute for="STGL" lwid="2" seen="1" colo="2" />
<Shape type="BBox" dz="0.25" dx="PENT_ls/2.0" dy="PENT_ss/2.0" />
<Instrument block="STGL" >
<!-- Local coordinates 0.1 micron resolution -->
<Hit meas="z" opts="S" bins="0.01" />
<Hit meas="y" opts="S" bins="0.01" />
<Hit meas="x" opts="S" bins="0.01" />
<!-- Global coordinates 0.1 micron resolution-->
<Hit meas="zz" opts="S" bins="0.01" />
<Hit meas="yy" opts="S" bins="0.01" />
<Hit meas="xx" opts="S" bins="0.01" />
<!-- Time of flight, energy lost, direction cosines, total momentum -->
<Hit meas="ptot" nbits="16" min="0" max="100" />
<Hit meas="cx" nbits="16" />
<Hit meas="cy" nbits="16" />
<Hit meas="cz" nbits="16" />
<Hit meas="tof" nbits="16" />
<Hit meas="eloss" nbits="16" />
</Instrument>
</Block>
<Block name="STGS" comment="short box for pentagon shape" >
<Material name="NPCO2" />
<Attribute for="STGS" lwid="2" seen="1" colo="2" />
<Shape type="BBox" dz="0.25" dx="PENT_ss/2.0" dy="20.8244802728" />
<Instrument block="STGS" >
<!-- Local coordinates 0.1 micron resolution -->
<Hit meas="z" opts="S" bins="0.01" />
<Hit meas="y" opts="S" bins="0.01" />
<Hit meas="x" opts="S" bins="0.01" />
<!-- Global coordinates 0.1 micron resolution-->
<Hit meas="zz" opts="S" bins="0.01" />
<Hit meas="yy" opts="S" bins="0.01" />
<Hit meas="xx" opts="S" bins="0.01" />
<!-- Time of flight, energy lost, direction cosines, total momentum -->
<Hit meas="ptot" nbits="16" min="0" max="100" />
<Hit meas="cx" nbits="16" />
<Hit meas="cy" nbits="16" />
<Hit meas="cz" nbits="16" />
<Hit meas="tof" nbits="16" />
<Hit meas="eloss" nbits="16" />
</Instrument>
</Block>
<!-- sTGC FEEs -->
<Block name="TFEA" comment="TGeoVolumeAssembly(FEE)" >
<Shape type="bbox" dx="TFEE_pos(1)" dy="TFEE_pos(2)" dz="TFEE_pos(3)" />
<Attribute for="TFEA" seen="1" colo="42" />
<Create block="TFEP" />
<!-- <Placement block="TFEP" /> -->
<Create block="TFER" />
<!-- <Placement block="TFER" x="-TFEE_RibDX-TFEE_CardDX" /> -->
<Create block="TFEI" /> <Placement block="TFEI" x="2*TFEE_CardDX" z="0.5" />
</Block>
<Block name="TFEP" comment="TFEPlate" >
<Attribute for="TFEP" seen="1" colo="kRed" />
<Material name="ALUMINIUM" />
<Shape type="bbox" dz="TFEE_PlateDZ" dx="TFEE_PlateDX" dy="TFEE_PlateDY" />
</Block>
<Block name="TFER" comment="TFERib" >
<Attribute for="TFER" seen="1" colo="1" />
<Material name="ALUMINIUM" />
<Shape type="bbox" dz="TFEE_RibDZ" dx="TFEE_RibDX" dy="TFEE_RibDY" />
</Block>
<Block name="TFEI" comment="TFEItself" >
<Attribute for="TFEI" seen="1" colo="kViolet" />
<Material name="G10" />
<Shape type="bbox" dz="TFEE_CardDZ" dx="TFEE_CardDX" dy="TFEE_CardDY" />
</Block>
</Module>
</Document>
@klendathu2k
Copy link

klendathu2k commented Sep 21, 2021

STGM mother volume is a tube, with half-z = 200cm, radius = 300 cm (inner 5.9 cm). Positioned once at z=300 cm. So there will be overlaps with other objects in the geometry. STGM should be placed as konly="MANY".

Also, recommend declaring it as an assembly, and setting attributes.

<Volume STGM assembly="True" comment=" ... "> <Material name="Air" /> <Attribute for="STGM" seen="0" colo="1" /> <Shape type="tube" rmin="5.90" rmax="300.0" dz="200" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment