Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • EIC/detectors/athena
  • zwzhao/athena
  • FernandoTA/athena
  • palspeic/athena
4 results
Show changes
Showing
with 1822 additions and 146 deletions
<lccdd>
<define>
<constant name="CrystalModule_sx" value="20.00*mm"/>
<constant name="CrystalModule_sy" value="20.00*mm"/>
<constant name="CrystalModule_sz" value="200.00*mm"/>
<constant name="CrystalModule_wrap" value="0.50*mm"/>
<constant name="GlassModule_sx" value="40.00*mm"/>
<constant name="GlassModule_sy" value="40.00*mm"/>
<constant name="GlassModule_sz" value="400.00*mm"/>
<constant name="GlassModule_wrap" value="1.00*mm"/>
<constant name="CrystalModule_z0" value="10.*cm"/>
<constant name="GlassModule_z0" value="0.0*cm"/>
<constant name="EcalEndcapN_z0" value="-EcalEndcapN_zmin-max(CrystalModule_sz,GlassModule_sz)/2."/>
<constant name="CrystalModule_dx" value="CrystalModule_sx + CrystalModule_wrap"/>
<constant name="CrystalModule_dy" value="CrystalModule_sy + CrystalModule_wrap"/>
<constant name="GlassModule_dx" value="GlassModule_sx + GlassModule_wrap"/>
<constant name="GlassModule_dy" value="GlassModule_sy + GlassModule_wrap"/>
</define>
<detectors>
<comment> </comment>
<documentation level="10">
#### Backwards Endcap EM Calorimeter
Backwards Endcap EM Calorimeter, placements generated by script
</documentation>
<detector id="ECalEndcapN_ID" name="EcalEndcapN" type="HomogeneousCalorimeter" readout="EcalEndcapNHits">
<position x="0" y="0" z="EcalEndcapN_z0"/>
<rotation x="0" y="0" z="0"/>
<placements>
<lines sector="1" mirrorx="true" mirrory="true">
<module sizex="CrystalModule_sx" sizey="CrystalModule_sy" sizez="CrystalModule_sz" material="PbWO4" vis="EcalEndcapNModuleVis"/>
<wrapper thickness="CrystalModule_wrap" material="Epoxy" vis="InvisibleWithDaughters"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*1/2." z="CrystalModule_z0" begin="5" nmods="21"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*3/2." z="CrystalModule_z0" begin="5" nmods="21"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*5/2." z="CrystalModule_z0" begin="5" nmods="21"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*7/2." z="CrystalModule_z0" begin="4" nmods="22"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*9/2." z="CrystalModule_z0" begin="3" nmods="23"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*11/2." z="CrystalModule_z0" begin="0" nmods="26"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*13/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*15/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*17/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*19/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*21/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*23/2." z="CrystalModule_z0" begin="0" nmods="24"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*25/2." z="CrystalModule_z0" begin="0" nmods="22"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*27/2." z="CrystalModule_z0" begin="0" nmods="22"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*29/2." z="CrystalModule_z0" begin="0" nmods="20"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*31/2." z="CrystalModule_z0" begin="0" nmods="20"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*33/2." z="CrystalModule_z0" begin="0" nmods="18"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*35/2." z="CrystalModule_z0" begin="0" nmods="18"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*37/2." z="CrystalModule_z0" begin="0" nmods="16"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*39/2." z="CrystalModule_z0" begin="0" nmods="16"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*41/2." z="CrystalModule_z0" begin="0" nmods="14"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*43/2." z="CrystalModule_z0" begin="0" nmods="14"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*45/2." z="CrystalModule_z0" begin="0" nmods="12"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*47/2." z="CrystalModule_z0" begin="0" nmods="12"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*49/2." z="CrystalModule_z0" begin="0" nmods="6"/>
<line axis="x" x="CrystalModule_dx/2." y="CrystalModule_dy*51/2." z="CrystalModule_z0" begin="0" nmods="6"/>
</lines>
<lines sector="2" mirrorx="true" mirrory="true">
<module sizex="GlassModule_sx" sizey="GlassModule_sy" sizez="GlassModule_sz" material="PbGlass" vis="EcalEndcapNModuleVis"/>
<wrapper thickness="GlassModule_wrap" material="Epoxy" vis="InvisibleWithDaughters"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*1/2." z="GlassModule_z0" begin="13" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*3/2." z="GlassModule_z0" begin="13" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*5/2." z="GlassModule_z0" begin="13" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*7/2." z="GlassModule_z0" begin="12" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*9/2." z="GlassModule_z0" begin="12" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*11/2." z="GlassModule_z0" begin="12" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*13/2." z="GlassModule_z0" begin="11" nmods="11"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*15/2." z="GlassModule_z0" begin="10" nmods="11"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*17/2." z="GlassModule_z0" begin="9" nmods="12"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*19/2." z="GlassModule_z0" begin="8" nmods="13"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*21/2." z="GlassModule_z0" begin="7" nmods="13"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*23/2." z="GlassModule_z0" begin="6" nmods="14"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*25/2." z="GlassModule_z0" begin="3" nmods="16"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*27/2." z="GlassModule_z0" begin="0" nmods="18"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*29/2." z="GlassModule_z0" begin="0" nmods="18"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*31/2." z="GlassModule_z0" begin="0" nmods="16"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*33/2." z="GlassModule_z0" begin="0" nmods="16"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*35/2." z="GlassModule_z0" begin="0" nmods="14"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*37/2." z="GlassModule_z0" begin="0" nmods="13"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*39/2." z="GlassModule_z0" begin="0" nmods="11"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*41/2." z="GlassModule_z0" begin="0" nmods="10"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*43/2." z="GlassModule_z0" begin="0" nmods="7"/>
<line axis="x" x="GlassModule_dx/2." y="GlassModule_dy*45/2." z="GlassModule_z0" begin="0" nmods="3"/>
</lines>
</placements>
</detector>
</detectors>
<readouts>
<comment>Effectively no segmentation, the segmentation is used to provide cell dimension info</comment>
<readout name="EcalEndcapNHits">
<segmentation type="MultiSegmentation" key="sector">
<segmentation name="CrystalSeg" key_value="1" type="CartesianGridXY" grid_size_x="CrystalModule_dx" grid_size_y="CrystalModule_dy"/>
<segmentation name="GlassSeg" key_value="2" type="CartesianGridXY" grid_size_x="GlassModule_dx" grid_size_y="GlassModule_dy"/>
</segmentation>
<id>system:8,sector:4,module:20,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
<lccdd>
<display>
<vis name="EcalBarrelEnvelope_vis" alpha="0.9" r="0.99" g="0.5" b="0" showDaughters="true" visible="false" />
<vis name="EcalBarrelStave_vis" alpha="0.9" r="0.99" g="0.5" b="0" showDaughters="true" visible="false" />
<vis name="EcalBarrelFiberLayerVis" alpha="1.0" r="102/256" g="102/256" b="102/256" showDaughters="false" visible="true" />
<vis name="EcalBarrelFiberVis" alpha="1.0" r="0/256" g="130/256" b="202/256" showDaughters="false" visible="false" />
</display>
<define>
<comment>
---------------------------------------
EM Calorimeter Parameters with AstroPix
---------------------------------------
</comment>
<constant name="EcalBarrel_Support_thickness" value="5*cm"/>
<constant name="EcalBarrel_SiliconThickness" value="500*um"/>
<constant name="EcalBarrel_ElectronicsThickness" value="150*um"/>
<constant name="EcalBarrel_CopperThickness" value="100*um"/>
<constant name="EcalBarrel_KaptonThickness" value="200*um"/>
<constant name="EcalBarrel_EpoxyThickness" value="100*um"/>
<constant name="EcalBarrel_CarbonThickness" value="0.5*mm"/>
<constant name="EcalBarrel_CarbonSpacerWidth" value="4*mm"/>
<constant name="EcalBarrel_LayerSpacing" value="6.0*mm"/>
<constant name="EcalBarrel_FiberRadius" value="0.5*mm"/>
<constant name="EcalBarrel_FiberXSpacing" value="1.34*mm"/>
<constant name="EcalBarrel_FiberZSpacing" value="1.22*mm"/>
<comment>
For Pb/SiFi (GlueX): X0 ~ 1.45 cm
For W/SiFi (sPHENIX): X0 ~ 0.7 cm (but different fiber orientation)
</comment>
<constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing*12"/>
<constant name="EcalBarrel_ModRepeat" value="CaloSides"/>
<constant name="EcalBarrel_ModLength" value="0.5*m"/>
<constant name="EcalBarrel_ModWidth" value="0.5*m"/>
<constant name="EcalBarrel_AvailThickness" value="EcalBarrelEnvelope_thickness-EcalBarrel_Support_thickness"/>
<constant name="EcalBarrel_ImagingLayerThickness"
value="EcalBarrel_SiliconThickness
+ EcalBarrel_ElectronicsThickness
+ EcalBarrel_CopperThickness
+ EcalBarrel_KaptonThickness
+ EcalBarrel_EpoxyThickness
+ EcalBarrel_CarbonThickness
+ EcalBarrel_LayerSpacing
+ EcalBarrel_RadiatorThickness"/>
<constant name="EcalBarrelImagingLayers_max" value="6"/>
<constant name="EcalBarrelImagingLayers" value="min(EcalBarrelImagingLayers_max, floor(EcalBarrel_AvailThickness/EcalBarrel_ImagingLayerThickness))"/>
<constant name="EcalBarrel_FiberLayerThickness_max" value="max(0, EcalBarrel_AvailThickness-(EcalBarrelImagingLayers*EcalBarrel_ImagingLayerThickness-EcalBarrel_RadiatorThickness))"/>
<constant name="EcalBarrel_FiberLayerThickness" value="EcalBarrel_FiberZSpacing*12*15"/>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<detectors>
<comment>
---------------------
Barrel EM Calorimeter
---------------------
A layered EM calorimeter with tungsten and silicon (AstroPix)
</comment>
<detector
id="ECalBarrel_ID"
name="EcalBarrel"
type="athena_EcalBarrelHybrid"
readout="EcalBarrelHits"
calorimeterType="EM_BARREL"
vis="EcalBarrelEnvelope_vis"
offset="EcalBarrel_offset">
<dimensions numsides="EcalBarrel_ModRepeat"
rmin="EcalBarrel_rmin"
z="EcalBarrel_length"/>
<staves vis="EcalBarrelStave_vis">
<support inside="true" material="Steel235" vis="AnlOrange"
thickness="EcalBarrel_Support_thickness"
n_beams="3" grid_size="25.0*cm" >
</support>
</staves>
<comment>
---------------------------
Imaging layers with silicon
---------------------------
</comment>
<layer repeat="EcalBarrelImagingLayers-1" vis="AnlBlue">
<slice material="Silicon" thickness="EcalBarrel_SiliconThickness" sensitive="yes" limits="cal_limits" vis="AnlGray"/>
<slice material="Silicon" thickness="EcalBarrel_ElectronicsThickness" vis="AnlGold"/>
<slice material="Copper" thickness="EcalBarrel_CopperThickness" vis="AnlGray"/>
<slice material="Kapton" thickness="EcalBarrel_KaptonThickness" vis="AnlGold"/>
<slice material="Epoxy" thickness="EcalBarrel_EpoxyThickness" vis="AnlGray"/>
<slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/>
<slice material="Lead" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFibersVis">
<fiber material="PlasticScint"
sensitive="yes"
vis="EcalBarrelFiberVis"
radius="EcalBarrel_FiberRadius"
spacing_x="EcalBarrel_FiberXSpacing"
spacing_z="EcalBarrel_FiberZSpacing"/>
</slice>
<slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/>
<slice material="Air" thickness="EcalBarrel_LayerSpacing" vis="AnlGold"/>
</layer>
<comment>
---------------------------
Last imiging layer with thick scint fiber layer
---------------------------
</comment>
<layer repeat="1" vis="AnlBlue">
<slice material="Silicon" thickness="EcalBarrel_SiliconThickness" sensitive="yes" limits="cal_limits" vis="AnlGray"/>
<slice material="Silicon" thickness="EcalBarrel_ElectronicsThickness" vis="AnlGold"/>
<slice material="Copper" thickness="EcalBarrel_CopperThickness" vis="AnlGray"/>
<slice material="Kapton" thickness="EcalBarrel_KaptonThickness" vis="AnlGold"/>
<slice material="Epoxy" thickness="EcalBarrel_EpoxyThickness" vis="AnlGray"/>
<slice material="CarbonFiber" thickness="EcalBarrel_CarbonThickness" vis="AnlGold"/>
<slice material="Lead" thickness="min(EcalBarrel_FiberLayerThickness_max, EcalBarrel_FiberLayerThickness)"
vis="EcalBarrelFiberLayerVis">
<fiber material="PlasticScint"
sensitive="yes"
vis="EcalBarrelFiberVis"
radius="EcalBarrel_FiberRadius"
spacing_x="EcalBarrel_FiberXSpacing"
spacing_z="EcalBarrel_FiberZSpacing">
</fiber>
</slice>
</layer>
</detector>
</detectors>
<readouts>
<readout name="EcalBarrelHits">
<segmentation type="MultiSegmentation" key="fiber">
<segmentation name="LongiSeg" key_value="0x0" type="CartesianGridXY" grid_size_x="0.5*mm" grid_size_y="0.5*mm"/>
<segmentation name="RadialSeg" key_min="0x1" key_max="0xffffffff" type="NoSegmentation"/>
</segmentation>
<hits_collections>
<hits_collection name="EcalBarrelHits" key="fiber" key_value="0x0"/>
<hits_collection name="EcalBarrelScFiHits" key="fiber" key_min="0x1" key_max="0xffffffff"/>
</hits_collections>
<id>system:8,module:5,layer:4,slice:4,grid:9,fiber:9,x:39:-11,y:-14</id>
</readout>
</readouts>
</lccdd>
<lccdd>
<define>
</define>
<limits>
</limits>
<regions>
</regions>
<!-- Common Generic visualization attributes -->
<comment>Common Generic visualization attributes</comment>
<display>
</display>
<detectors>
<comment>
------------------------------------------
Forward (Positive Z) Endcap EM Calorimeter
------------------------------------------
An EM calorimeter with shashlik hexagon modules
</comment>
<detector id="ECalEndcapP_ID"
name="EcalEndcapP"
type="ShashlikCalorimeter"
readout="EcalEndcapPHits">
<position x="0" y="0" z="EcalEndcapP_zmin"/>
<placements>
<disk rmin="EcalEndcapP_rmin" rmax = "EcalEndcapP_rmax" sector="1">
<wrapper thickness="2*mm" material="Epoxy" vis="WhiteVis"/>
<module shape="square" side_length="50*mm" vis="EcalEndcapVis">
<layer repeat="EcalEndcapPLayer1_NRepeat" vis="EcalEndcapVis">
<slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
<slice material="Copper" thickness="EcalCopperThickness"/>
<slice material="Kapton" thickness="EcalKaptonThickness"/>
<slice material="Air" thickness="EcalAir1Thickness"/>
</layer>
<layer repeat="EcalEndcapPLayer2_NRepeat">
<slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
<slice material="Air" thickness="EcalAir2Thickness"/>
<slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
<slice material="Copper" thickness="EcalCopperThickness"/>
<slice material="Kapton" thickness="EcalKaptonThickness"/>
<slice material="Air" thickness="EcalAir1Thickness"/>
</layer>
<layer repeat="EcalEndcapPLayer3_NRepeat">
<slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
<slice material="Air" thickness="EcalAir2Thickness"/>
<slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
<slice material="Copper" thickness="EcalCopperThickness"/>
<slice material="Kapton" thickness="EcalKaptonThickness"/>
<slice material="Air" thickness="EcalAir1Thickness"/>
</layer>
</module>
</disk>
</placements>
</detector>
</detectors>
<!-- Definition of the readout segmentation/definition -->
<readouts>
<readout name="EcalEndcapPHits">
<segmentation type="NoSegmentation"/>
<id>system:8,sector:4,module:24,layer:8,slice:8</id>
</readout>
</readouts>
<plugins>
</plugins>
</lccdd>
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<constant name="ForwardRICH_zmin" value="BarrelTracking_length/2.0 + ForwardTracking_length "/>
<constant name="ForwardRICH_rmin" value="ForwardPID_rmin1"/>
<constant name="ForwardRICH_rmax0" value="TrackerBarrel_rmax"/>
<constant name="ForwardRICH_rmax1" value="EcalBarrel_rmin"/>
<constant name="ForwardRICH_rmax2" value="Solenoid_rmin-6*cm"/>
<constant name="ForwardRICHDepth" value="0.9*m"/>
<constant name="ForwardRICH_sensor_rmin" value="ForwardRICH_rmax1 - 40.*cm"/>
<constant name="ForwardRICH_sensor_rmax" value="ForwardRICH_rmax2"/>
</define>
<detectors>
<detector
id="ForwardRICH_ID"
name="GaseousRICH"
type="athena_GaseousRICH"
readout="ForwardRICHHits"
gas="N2cherenkov"
vis="RICHVis">
<dimensions
z0="ForwardRICH_zmin"
snout_length="ForwardRICH_length - ForwardRICHDepth"
length="ForwardRICH_length"
rmin="ForwardRICH_rmin"
rmax0="ForwardRICH_rmax0"
rmax1="ForwardRICH_rmax1"
rmax2="ForwardRICH_rmax2"/>
<mirrors thickness="1*mm" material="PyrexGlass" vis="GrayVis">
<position z="ForwardRICH_length - 13*cm"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="0*degree" roty="-15*degree" rotx="0"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="60*degree" roty="-15*degree" rotx="0"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="120*degree" roty="-15*degree" rotx="0"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="180*degree" roty="-15*degree" rotx="0"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="240*degree" roty="-15*degree" rotx="0"/>
<mirror curve="300*cm" rmin="ForwardRICH_rmin+5*mm" rmax="ForwardRICH_rmax1" phiw="58*degree"
rotz="300*degree" roty="-15*degree" rotx="0"/>
</mirrors>
<sensors>
<module sx="10*cm" sy="10*cm" sz="1.0*cm" gap="0.2*cm" material="Quartz" vis="AnlGold"/>
<comment>A thin optical material to accept optical photon in simulation</comment>
<optical material="AirOptical" thickness="0.1*mm"/>
<position z="8.*cm"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="0*degree" roty="-15*degree" rotx="0"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="60*degree" roty="-15*degree" rotx="0"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="120*degree" roty="-15*degree" rotx="0"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="180*degree" roty="-15*degree" rotx="0"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="240*degree" roty="-15*degree" rotx="0"/>
<sector rmin="ForwardRICH_sensor_rmin" rmax="ForwardRICH_sensor_rmax" phiw="58*degree"
rotz="300*degree" roty="-15*degree" rotx="0"/>
</sensors>
</detector>
</detectors>
<readouts>
<readout name="ForwardRICHHits">
<segmentation type="CartesianGridXY" grid_size_x="3*mm" grid_size_y="3*mm" />
<id>system:8,sector:8,module:16,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
......@@ -26,12 +26,10 @@
</display>
<detectors>
<detector id="MMTrackerBarrel_ID" name="MMTrackerBarrel" type="refdet_MMTrackerBarrel" readout="MMTrackerBarrelHits">
<detector id="MMTrackerBarrel_ID" name="MMTrackerBarrel" type="athena_MMTrackerBarrel" readout="MMTrackerBarrelHits">
<module name="Module1" vis="AnlGold">
<module_envelope
rmin="TrackerBarrel_rmax"
length="MMTrackerBarrelLayer1_length"
thickness="MMTrackerBarrel_delta" phi="90*degree" />
<module_envelope rmin="TrackerBarrel_rmax" length="MMTrackerBarrelLayer1_length" thickness="MMTrackerBarrel_delta"
phi="90*degree" />
<module_component thickness="1.0*mm" material="PEEK" sensitive="false">
<position x="0" />
</module_component>
......
<lccdd>
<comment> MRICH (alternative design) </comment>
<define>
<constant name="MRICH_rmin" value="10*cm"/>
<constant name="MRICH_rmax" value="BackwardPIDRegion_rmax"/>
<constant name="MRICH_length" value="BackwardPIDRegion_length"/>
<constant name="MRICH_zmin" value="BackwardPIDRegion_zmin"/>
<constant name="MRICHAerogel_thickness" value="30.0*mm"/>
<constant name="MRICHAerogel_width" value="126.5*mm"/>
<constant name="MRICHFoam_thickness" value="2*mm"/>
<constant name="MRICHFresnelLens_thickness" value="0.06*inch"/>
<constant name="MRICHAerogelLensGap_thickness" value="2*mm"/>
<constant name="MRICHPhotoDet_thickness" value="1.5*mm"/>
<constant name="MRICHPhotoDet_length" value="48.5*mm"/>
<constant name="MRICHGlassWindow_width" value="103.5*mm"/>
<constant name="MRICHGlassPhotoDet_thickness" value="5.0*mm"/>
<constant name="MRICHPhotoDetMCPlate_thickness" value="0.3*mm"/> <!-- FIXME: should be 1.2*mm with PyrexGlass25 -->
<constant name="MRICHPhotoDetAnode_thickness" value="3.8*mm"/>
<constant name="MRICHPhotoDetPCB_thickness" value="2.0*mm"/>
<constant name="MRICHPhotoDetCopper_thickness" value="0.1*mm"/>
<constant name="MRICHPhotoDetKapton_thickness" value="0.2*mm"/>
<constant name="MRICHRearExtraSpace_thickness" value="0.3*mm"/>
<constant name="MRICHLensPhotoDet_length" value="136.4*mm"/>
<constant name="MRICHFresnelLensEffectiveDiameter" value="6.0*inch"/>
<constant name="MRICHFresnelLensGroove_pitch" value="inch/125"/>
<constant name="MRICHCarbonFrame_thickness" value="1.0*mm"/>
<constant name="MRICHCarbonFrame_width" value="MRICHAerogel_width+2.0*MRICHFoam_thickness + 2.0*MRICHCarbonFrame_thickness"/>
<constant name="MRICHModules_nx" value="floor((MRICH_rmax-MRICH_rmin)/MRICHCarbonFrame_width)"/>
<constant name="MRICHModules_ny" value="floor((MRICH_rmax-MRICH_rmin)/MRICHCarbonFrame_width)"/>
<constant name="MRICHCarbonFrame_length"
value="MRICHAerogel_thickness
+ 2.0*MRICHCarbonFrame_thickness
+ 2.0*MRICHFoam_thickness
+ MRICHAerogelLensGap_thickness
+ MRICHFresnelLens_thickness
+ MRICHLensPhotoDet_length
+ MRICHGlassPhotoDet_thickness
+ 2.0*MRICHPhotoDetMCPlate_thickness
+ MRICHPhotoDetAnode_thickness
+ MRICHPhotoDetPCB_thickness
+ MRICHPhotoDetCopper_thickness
+ MRICHPhotoDetKapton_thickness
+ MRICHRearExtraSpace_thickness "/>
</define>
<limits>
</limits>
<regions>
</regions>
<display>
</display>
<detectors>
<detector id="MRICH_ID" name="MRICH" type="athena_MRICH"
readout="MRICHHits"
reflect="true"
projective="false"
vis="InvisibleWithDaughters"
material="Air">
<dimensions rmin="MRICH_rmin" rmax="MRICH_rmax" length="abs(MRICH_length)" zmin="MRICH_zmin"/>
<envelope thickness="MRICHCarbonFrame_thickness" material="CarbonFiber"/>
<module name="MRICH_module1"
vis="InvisibleWithDaughters"
width="MRICHCarbonFrame_width"
height="MRICHCarbonFrame_width"
length="MRICHCarbonFrame_length">
<aerogel vis="MRICH_aerogel_vis"
length="MRICHAerogel_thickness"
width="MRICHAerogel_width"
material="AerogelOptical">
<frame vis="MRICH_frame_vis" thickness="MRICHFoam_thickness" material="PolystyreneFoam" />
</aerogel>
<lens vis="MRICH_lens_vis" thickness="MRICHFresnelLens_thickness"
pitch="MRICHFresnelLensGroove_pitch" focal_length="6.0*inch"
effective_diameter="MRICHFresnelLensEffectiveDiameter"
width="MRICHAerogel_width"
material="AcrylicOptical"/>
<space thickness="MRICHLensPhotoDet_length"/>
<photodet width="MRICHGlassWindow_width" thickness="MRICHGlassPhotoDet_thickness" material="PyrexGlassOptical">
<sensor nx="2" ny="2" thickness="MRICHPhotoDet_thickness" width="MRICHPhotoDet_length" material="SiliconOxide"/>
<layer thickness="MRICHPhotoDetMCPlate_thickness" material="PyrexGlass"/> <!-- FIXME: should be PyrexGlass25 with 1.2*mm thickness -->
<layer thickness="MRICHPhotoDetMCPlate_thickness" material="PyrexGlass"/> <!-- FIXME: should be PyrexGlass25 with 1.2*mm thickness -->
<layer thickness="MRICHPhotoDetAnode_thickness" material="AluminumOxide"/>
<layer thickness="MRICHPhotoDetPCB_thickness" material="Fr4"/>
<layer thickness="MRICHPhotoDetCopper_thickness" material="Copper"/>
<layer thickness="MRICHPhotoDetKapton_thickness" material="Kapton"/>
</photodet>
</module>
</detector>
</detectors>
<readouts>
<readout name="MRICHHits">
<segmentation type="CartesianGridXY" grid_size_x="3*mm" grid_size_y="3*mm" />
<id>system:8,module:14,sensor:8,x:32:-16,y:-16</id>
</readout>
</readouts>
<!--Globals>
<Parameter Name="mrichInfo" Value="mrichmod/mrich_1_geoparams-0-0-4294967295-1527211159.xml"/>
</Globals-->
</lccdd>
......@@ -63,7 +63,7 @@
</display>
<detectors>
<detector id="RWellTrackerBarrel_ID" name="RWellTrackerBarrel" type="refdet_RWellTrackerBarrel" readout="RWellTrackerBarrelHits">
<detector id="RWellTrackerBarrel_ID" name="RWellTrackerBarrel" type="athena_RWellTrackerBarrel" readout="RWellTrackerBarrelHits">
<module name="Module1" vis="GreenVis">
<module_envelope
......
<lccdd>
<display>
</display>
<define>
</define>
<documentation level="10">
### Mixed tracking configuration
This configuration needs attention!
</documentation>
<include ref="rwell_tracker_barrel.xml">
<!--include ref="compact/ce_GEM.xml"/-->
<!--include ref="compact/mm_tracker_barrel.xml"/-->
<!--include ref="compact/cb_VTX_Barrel.xml"/-->
<!--include ref="compact/gem_tracker_endcap.xml"/-->
</lccdd>
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<comment>
THis value probably can live in the file that includes this one.
</comment>
<constant name="ITS3Thickness" value="40*um"/>
<constant name="VertexCarbon_thickness" value="0.12*mm"/>
<constant name="VertexEndcapAluminumThickness" value="0.15*mm"/>
<constant name="ITS3Thickness" value="0.03*mm"/>
<constant name="VertexBarrel_rmin1" value="3.3*cm"/>
<constant name="VertexBarrel_rmin2" value="5.7*cm"/>
<constant name="VertexBarrelModule_maxThickness" value="VertexBarrel_rmin2 - VertexBarrel_rmin1"/>
<constant name="VertexBarrel_length" value="30*cm"/>
<constant name="VertexBarrel_thickness" value="0.05/100*9.37*cm"/>
<constant name="VertexBarrelService_thickness" value="VertexBarrel_thickness-ITS3Thickness"/>
<constant name="VertexBarrel_rmin" value="VertexBarrel_rmin1"/>
<constant name="VertexBarrel_rmax" value="VertexBarrel_rmin2+VertexBarrelModule_maxThickness"/>
<constant name="VertexBarrelLayer_rOffset" value="4.0*mm"/>
<documentation>
#### Vertex Tracker Barrel Parameters
<comment> TODO: These should be computed </comment>
<constant name="VertexBarrel_NModules1" value="14"/>
<constant name="VertexBarrel_NModules2" value="24"/>
- The sensor modules are 2 half-cylinders.
- There are 2 sensitive layers
- Each sensor has a thickness is 40um
- There is an outer shell for structural support 300um thick.
- The ID of this shell is set (arbitrarily) to 10 cm.
<!--
##### Sensor layers
<constant name="VertexTrackerEndcapP_rmin" value="VertexTrackerInnerRadius"/>
<constant name="VertexTrackerEndcapP_rmax" value="VertexTrackerOuterRadius"/>
<constant name="VertexTrackerEndcapP_zmin" value="VertexTrackerBarrel_length + 5*mm"/>
Currently there are 2 sensor layers. Each is composed of 2 half-cylinders modules with only 40um of silicon thickness.
<constant name="VertexTrackerEndcapN_rmin" value="VertexTrackerInnerRadius"/>
<constant name="VertexTrackerEndcapN_rmax" value="VertexTrackerOuterRadius"/>
<constant name="VertexTrackerEndcapN_zmin" value="VertexTrackerBarrelLength + 5*mm"/>
-->
<constant name="VertexTrackerEndcapN_zmin" value="VertexTrackerBarrel_zmax"/>
<constant name="VertexTrackerEndcapP_zmin" value="VertexTrackerBarrel_zmax"/>
##### Support shell
<constant name="VertexEndcap_NLayers" value="5"/>
<constant name="VertexTrackerEndcap_delta" value="(VertexTrackerEndcapP_zmax - VertexTrackerEndcapP_zmin)/VertexEndcap_NLayers"/>
Simple carbon fiber support shell.
</define>
</documentation>
<constant name="VertexBarrel_length" value="300.0*mm"/>
<constant name="VertexTrackerEndcapP_rmin" value="VertexTrackingRegion_rmin"/>
<constant name="VertexTrackerEndcapN_rmin" value="VertexTrackingRegion_rmin"/>
<constant name="VertexTrackerEndcapP_rmax" value="VertexTrackingRegion_rmax"/>
<constant name="VertexTrackerEndcapN_rmax" value="VertexTrackingRegion_rmax"/>
<constant name="VertexTrackerEndcapP_zmax" value="VertexTrackingRegionP_zmax"/>
<constant name="VertexTrackerEndcapN_zmax" value="VertexTrackingRegionN_zmax"/>
<display>
</display>
<constant name="VertexBarrelLayer_length" value="VertexBarrel_length - 1*mm"/>
<constant name="VertexBarrelMod_length" value="VertexBarrel_length - 2*mm"/>
<constant name="VertexBarrelSensor_thickness" value="ITS3Thickness"/>
<constant name="VertexBarrelLayer_thickness" value="0.2*cm"/>
<constant name="VertexBarrelMod_thickness" value="0.1*cm"/>
<constant name="VertexBarrelMod1_rmin" value="3.4*cm"/>
<constant name="VertexBarrelMod2_rmin" value="5.7*cm"/>
<constant name="VertexBarrelLayer_rmin1" value="VertexBarrelMod1_rmin - VertexBarrelLayer_thickness/2.0"/>
<constant name="VertexBarrelLayer_rmin2" value="VertexBarrelMod2_rmin - VertexBarrelLayer_thickness/2.0"/>
<constant name="VertexBarrelLayer_rmax1" value="VertexBarrelLayer_rmin1 + VertexBarrelLayer_thickness"/>
<constant name="VertexBarrelLayer_rmax2" value="VertexBarrelLayer_rmin2 + VertexBarrelLayer_thickness"/>
<detectors>
<comment>
"Support" is to "shell" like "layer" is to "module", and is need for the flat stave barrel implementation.
</comment>
<constant name="VertexBarrelShell_rmin" value="10.0*cm"/>
<constant name="VertexBarrelShell_thickness" value="300*um"/>
<constant name="VertexBarrelShell_rmax" value="VertexBarrelShell_rmin + VertexBarrelShell_thickness"/>
<constant name="VertexBarrelShell_length" value="VertexBarrelLayer_length-VertexBarrelShell_thickness"/>
<detector id="VertexSubAssembly_ID"
name="VertexSubAssembly"
type="DD4hep_SubdetectorAssembly"
vis="TrackerSubAssemblyVis">
<composite name="VertexTrackerEndcapN"/>
<composite name="VertexTrackerEndcapP"/>
<composite name="VertexBarrel"/>
</detector>
<constant name="VertexBarrelSupport_thickness" value="1.0*cm"/>
<constant name="VertexBarrelSupport_rmin" value="VertexBarrelShell_rmin-VertexBarrelSupport_thickness/2.0"/>
<constant name="VertexBarrelSupport_rmax" value="VertexBarrelSupport_rmin + VertexBarrelSupport_thickness"/>
<constant name="VertexBarrelSupport_length" value="VertexBarrelLayer_length"/>
<constant name="VertexTrackerEndcapN_zmin" value="25*cm"/>
<constant name="VertexTrackerEndcapP_zmin" value="25*cm"/>
<constant name="VertexEndcap_NLayers" value="1"/>
<constant name="VertexTrackerEndcap_delta" value="(VertexTrackerEndcapP_zmax - VertexTrackerEndcapP_zmin)/VertexEndcap_NLayers"/>
<constant name="VertexEndcapLayer_dz" value="2*cm"/>
<constant name="VertexEndcapLayer_thickness" value="min(3*cm,VertexEndcapLayer_dz-0.5*cm)"/>
<constant name="VertexEndcap_NModules" value="12"/>
<constant name="VertexEndcapMod_dz" value="2.5*mm"/>
<constant name="VertexEndcapModOpeningAngle" value="360.0/VertexEndcap_NModules*degree + 0.5*degree"/>
<constant name="VertexEndcapMod1_x1" value="2.0*VertexTrackerEndcapP_rmin*sin(VertexEndcapModOpeningAngle/2.0)"/>
<constant name="VertexEndcapMod1_x2" value="2.0*VertexTrackerEndcapP_rmax*sin(VertexEndcapModOpeningAngle/2.0)"/>
<constant name="VertexEndcapMod1_y" value="VertexTrackerEndcapP_rmax*cos(VertexEndcapModOpeningAngle/2.0) - VertexTrackerEndcapP_rmin"/>
<comment> cone connecting vertex barrel to endcap </comment>
<!-- <constant name="VertexEndcapCone_zmax" value="VertexEndcapShell_zmin-0.2*cm"/> -->
<constant name="VertexSupportCarbon_thickness" value="2*mm"/>
<constant name="VertexEndcapCone_zmin" value="VertexBarrelLayer_length/2.0 + 0.1*cm"/>
<constant name="VertexEndcapCone_zmax" value="VertexTrackerEndcapN_zmin - 0.1*cm"/>
<constant name="VertexEndcapCone_rmin1" value="VertexEndcapCone_zmin * 36.26/49"/>
<!-- <constant name="VertexEndcapCone_rmin1" value="TrackerEndcapInner_rmax1"/> -->
<constant name="VertexEndcapCone_rmin2" value="VertexTrackerEndcapP_rmax"/>
<constant name="VertexEndcapConeService_rmin1" value="VertexEndcapCone_rmin1+VertexSupportCarbon_thickness+0.1*mm"/>
<constant name="VertexEndcapConeService_rmin2" value="VertexEndcapCone_rmin2+VertexSupportCarbon_thickness+0.1*mm"/>
<constant name="VertexEndcapConeService_thickness" value="0.6*mm"/>
<constant name="VertexEndcapCone_length" value="VertexEndcapCone_zmax - VertexEndcapCone_zmin"/>
<detector
id="VertexBarrel_ID"
<comment>
Extra parameters to approximate a cylinder as a set of skinny staves
due to ACTS limitations.
</comment>
<constant name="VertexBarrelStave_count" value="128"/>
<constant name="VertexBarrelStave1_width" value="2*VertexBarrelMod1_rmin * tan(180*degree/VertexBarrelStave_count)"/>
<constant name="VertexBarrelStave2_width" value="2*VertexBarrelMod2_rmin * tan(180*degree/VertexBarrelStave_count)"/>
<constant name="VertexBarrelShellStave_width" value="2*VertexBarrelShell_rmin * tan(180*degree/VertexBarrelStave_count)"/>
</define>
<display>
</display>
<detectors>
<documentation level="5">
### Actual detectors
</documentation>
<detector
id="VertexBarrel_0_ID"
name="VertexBarrel"
type="athena_VertexBarrel"
readout="VertexBarrelHits"
insideTrackingVolume="true">
<dimensions rmin="VertexBarrel_rmin-VertexBarrelLayer_rOffset" rmax="VertexBarrel_rmax-VertexBarrelLayer_rOffset" length="VertexBarrel_length"/>
<comment> Define available modules </comment>
<module name="Module1" vis="PurpleVis">
<frame width="15*mm" height="10.0*mm" length="VertexBarrel_length" thickness="0.1 * mm" material="CarbonFiber_25percent" vis="BlueGreenVis" />
<module_component name="silicon"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="0.05*mm" material="Silicon" sensitive="true">
<position z="-0.025*mm" y="0*mm"/>
</module_component>
<dimensions
rmin="VertexBarrelLayer_rmin1"
rmax="VertexBarrelSupport_rmax"
length="VertexBarrel_length" />
<comment>Vertex Barrel Modules</comment>
<module name="Module1" vis="VertexLayerVis">
<module_component name="ITS3"
material="Silicon"
sensitive="true"
width="VertexBarrelStave1_width"
length="VertexBarrelMod_length"
thickness="VertexBarrelSensor_thickness"
vis="VertexLayerVis" />
</module>
<module name="Module2">
<frame width="15*mm" height="10.0*mm" length="VertexBarrel_length" thickness="0.1 * mm" material="CarbonFiber_25percent" vis="BlueGreenVis" />
<module_component name="silicon"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="0.05*mm" material="Silicon" sensitive="true">
<position z="-0.025*mm" y="0*mm"/>
</module_component>
<module name="Module2" vis="VertexLayerVis">
<module_component name="ITS3"
material="Silicon"
sensitive="true"
width="VertexBarrelStave2_width"
length="VertexBarrelMod_length"
thickness="VertexBarrelSensor_thickness"
vis="VertexLayerVis" />
</module>
<module name="SupportShell" vis="VertexSupportVis">
<module_component name="CF Shell"
material="CarbonFiber"
sensitive="false"
width="VertexBarrelShellStave_width"
length="VertexBarrelShell_length"
thickness="VertexBarrelShell_thickness"
vis="VertexSupportVis" />
</module>
<comment> Layers composed of many arrayed modules </comment>
<layer module="Module1" id="1" vis="VertexVis">
<barrel_envelope
inner_r="VertexBarrel_rmin1-VertexBarrelLayer_rOffset"
outer_r="VertexBarrel_rmin2-VertexBarrelLayer_rOffset"
z_length="VertexBarrel_length"/>
<rphi_layout phi_tilt="10.0*degree" nphi="VertexBarrel_NModules1" phi0="0.0" rc="VertexBarrel_rmin1" dr="0.0 * mm"/>
<layer module="Module1" id="1" vis="VertexLayerVis">
<barrel_envelope
inner_r="VertexBarrelLayer_rmin1"
outer_r="VertexBarrelLayer_rmax1"
z_length="VertexBarrelLayer_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<comment>
phi0 : Starting phi of first module.
phi_tilt : Phi tilt of a module.
rc : Radius of the module center.
nphi : Number of modules in phi.
rphi_dr : The delta radius of every other module.
z0 : Z position of first module in phi.
nz : Number of modules to place in z.
dr : Radial displacement parameter, of every other module.
</comment>
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod1_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
<layer module="Module2" id="2" vis="VertexVis">
<barrel_envelope
inner_r="VertexBarrel_rmin2-VertexBarrelLayer_rOffset"
outer_r="VertexBarrel_rmax-VertexBarrelLayer_rOffset"
z_length="VertexBarrel_length"/>
<rphi_layout phi_tilt="10.0*degree" nphi="VertexBarrel_NModules2" phi0="0.0" rc="VertexBarrel_rmin2" dr="0.0 * mm"/>
<layer module="Module2" id="2" vis="VertexLayerVis">
<barrel_envelope
inner_r="VertexBarrelLayer_rmin2"
outer_r="VertexBarrelLayer_rmax2"
z_length="VertexBarrelLayer_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod2_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
<layer module="SupportShell" id="3" vis="VertexSupportVis">
<barrel_envelope
inner_r="VertexBarrelSupport_rmin"
outer_r="VertexBarrelSupport_rmax"
z_length="VertexBarrelSupport_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelShell_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
</detector>
<!--
<detector id="VertexEndcapP_ID" name="VertexTrackerEndcapP" type="ref_DiskTracker"
insideTrackingVolume="true" reflect="false" vis="AnlRed">
<position x="0" y="0" z="0"/>
<layer id="1" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 0*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="2" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 1*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="3" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 2*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="4" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 3*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="5" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 4*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<detector
id="VertexEndcapP_0_ID"
name="VertexEndcapP"
type="athena_TrapEndcapTracker"
readout="VertexEndcapHits"
vis="TrackerVis"
reflect="false">
<support material="CarbonFiber" name="sup_cone" vis="TrackerSupportVis">
<shape type="Cone"
rmin1="VertexEndcapCone_rmin1" rmax1="VertexEndcapCone_rmin1+VertexSupportCarbon_thickness"
rmin2="VertexEndcapCone_rmin2" rmax2="VertexEndcapCone_rmin2+VertexSupportCarbon_thickness" z="VertexEndcapCone_length/2.0"/>
<position x="0*cm" y="0*cm" z="(VertexEndcapCone_zmin+VertexEndcapCone_zmax)/2.0"/>
</support>
<support material="Aluminum" name="sup_cone_service" vis="TrackerSupportVis">
<shape type="Cone"
rmin1="VertexEndcapConeService_rmin1" rmax1="VertexEndcapConeService_rmin1+VertexEndcapConeService_thickness"
rmin2="VertexEndcapConeService_rmin2" rmax2="VertexEndcapConeService_rmin2+VertexEndcapConeService_thickness" z="VertexEndcapCone_length/2.0"/>
<position x="0*cm" y="0*cm" z="(VertexEndcapCone_zmin+VertexEndcapCone_zmax)/2.0"/>
</support>
<module name="Module1" vis="AnlProcess_Blue">
<trd x1="VertexEndcapMod1_x1/2.0" x2="VertexEndcapMod1_x2/2.0" z="VertexEndcapMod1_y/2"/>
<module_component thickness="ITS3Thickness" material="Silicon" sensitive="true"/>
<module_component thickness="VertexEndcapAluminumThickness" material="Aluminum"/>
<module_component thickness="VertexCarbon_thickness" material="CarbonFiber"/>
</module>
<layer id="1">
<envelope vis="TrackerVis"
rmin="VertexTrackerEndcapP_rmin"
rmax="VertexTrackerEndcapP_rmax"
length="VertexEndcapLayer_thickness"
zstart="VertexTrackerEndcapP_zmin + VertexEndcapLayer_dz/2.0" />
<layer_material surface="representing" binning="binPhi,binR" bins0="20*VertexEndcap_NModules" bins1="256"/>
<ring vis="TrackerVis"
r="VertexTrackerEndcapP_rmin+VertexEndcapMod1_y/2.0"
zstart="0.0"
nmodules="VertexEndcap_NModules" dz="VertexEndcapMod_dz" module="Module1" />
</layer>
</detector>
<detector id="VertexEndcapN_ID" name="VertexTrackerEndcapN" type="ref_DiskTracker"
insideTrackingVolume="true" reflect="true" vis="AnlRed">
<position x="0" y="0" z="0"/>
<layer id="1" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 0*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="2" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 1*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="3" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 2*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="4" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 3*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="5" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 4*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<detector
id="VertexEndcapN_0_ID"
name="VertexEndcapN"
type="athena_TrapEndcapTracker"
readout="VertexEndcapHits"
vis="TrackerVis"
reflect="true">
<support material="CarbonFiber" name="sup_cone" vis="TrackerSupportVis">
<shape type="Cone"
rmin2="VertexEndcapCone_rmin1" rmax2="VertexEndcapCone_rmin1+VertexSupportCarbon_thickness"
rmin1="VertexEndcapCone_rmin2" rmax1="VertexEndcapCone_rmin2+VertexSupportCarbon_thickness" z="VertexEndcapCone_length/2.0"/>
<position x="0*cm" y="0*cm" z="-1.0*(VertexEndcapCone_zmin+VertexEndcapCone_zmax)/2.0"/>
</support>
<support material="Aluminum" name="sup_cone_service" vis="TrackerSupportVis">
<shape type="Cone"
rmin2="VertexEndcapConeService_rmin1" rmax2="VertexEndcapConeService_rmin1+VertexEndcapConeService_thickness"
rmin1="VertexEndcapConeService_rmin2" rmax1="VertexEndcapConeService_rmin2+VertexEndcapConeService_thickness" z="VertexEndcapCone_length/2.0"/>
<position x="0*cm" y="0*cm" z="-1.0*(VertexEndcapCone_zmin+VertexEndcapCone_zmax)/2.0"/>
</support>
<module name="Module1" vis="AnlProcess_Blue">
<trd x1="VertexEndcapMod1_x1/2.0" x2="VertexEndcapMod1_x2/2.0" z="VertexEndcapMod1_y/2"/>
<module_component thickness="ITS3Thickness" material="Silicon" sensitive="true"/>
<module_component thickness="VertexEndcapAluminumThickness" material="Aluminum"/>
<module_component thickness="VertexCarbon_thickness" material="CarbonFiber"/>
</module>
<layer id="1">
<envelope vis="TrackerVis"
rmin="VertexTrackerEndcapN_rmin"
rmax="VertexTrackerEndcapN_rmax"
length="VertexEndcapLayer_thickness"
zstart="VertexTrackerEndcapN_zmin + VertexEndcapLayer_dz/2.0" />
<layer_material surface="representing" binning="binPhi,binR" bins0="20*VertexEndcap_NModules" bins1="256"/>
<ring vis="TrackerVis"
r="VertexTrackerEndcapN_rmin+VertexEndcapMod1_y/2.0"
zstart="0.0"
nmodules="VertexEndcap_NModules" dz="VertexEndcapMod_dz" module="Module1" />
</layer>
</detector>
-->
</detectors>
<readouts>
<readout name="VertexBarrelHits">
<segmentation type="CartesianGridXY" grid_size_x="0.050*mm" grid_size_y="0.050*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
<segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" />
<id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
</readout>
<readout name="VertexEndcapHits">
<segmentation type="CartesianGridXY" grid_size_x="0.20*mm" grid_size_y="0.20*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
<segmentation type="CartesianGridXZ" grid_size_x="0.010*mm" grid_size_z="0.010*mm" />
<id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout>
</readouts>
......
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<comment>
Main parameters
</comment>
<constant name="SiVertexSensor_thickness" value="40*um"/>
<constant name="VertexBarrelMod_length" value="280.0*mm"/>
<constant name="VertexBarrelMod_rmin" value="3.3*cm"/>
<constant name="VertexBarrelMod_offset" value="1.05*cm"/>
<constant name="VertexBarrelMod_count" value="3"/>
<constant name="VertexBarrelShell_thickness" value="300.0*um"/>
<documentation>
#### Vertex Tracker Barrel Parameters
- The sensor modules are 2 half-cylinders.
- There are 2 sensitive layers
- Each sensor has a thickness is 40um
- There is an outer shell for structural support 300um thick.
- The ID of this shell is set (arbitrarily) to 10 cm.
##### Sensor layers
Currently there are 2 sensor layers. Each is composed of 2 half-cylinders modules with only 40um of silicon thickness.
##### Support shell
Simple carbon fiber support shell.
</documentation>
<constant name="VertexBarrelEnvelope_length" value="VertexTrackingRegion_length"/>
<constant name="VertexBarrelLayer_length" value="VertexBarrelMod_length + 1*um"/>
<constant name="VertexBarrelLayer_thickness" value="0.2*cm"/>
<constant name="VertexBarrelMod_thickness" value="0.1*cm"/>
<constant name="VertexBarrelMod1_rmin" value="VertexBarrelMod_rmin"/>
<constant name="VertexBarrelMod2_rmin" value="VertexBarrelMod_rmin + 1 * VertexBarrelMod_offset"/>
<constant name="VertexBarrelMod3_rmin" value="VertexBarrelMod_rmin + 2 * VertexBarrelMod_offset"/>
<constant name="VertexBarrelLayer1_rmin" value="VertexBarrelMod_rmin - VertexBarrelLayer_thickness/2.0"/>
<constant name="VertexBarrelLayer1_rmax" value="VertexBarrelLayer1_rmin + VertexBarrelLayer_thickness"/>
<constant name="VertexBarrelLayer2_rmin" value="VertexBarrelLayer1_rmin + 1 * VertexBarrelMod_offset"/>
<constant name="VertexBarrelLayer2_rmax" value="VertexBarrelLayer2_rmin + VertexBarrelLayer_thickness"/>
<constant name="VertexBarrelLayer3_rmin" value="VertexBarrelLayer1_rmin + 2 * VertexBarrelMod_offset"/>
<constant name="VertexBarrelLayer3_rmax" value="VertexBarrelLayer3_rmin + VertexBarrelLayer_thickness"/>
<comment>
"Support" is to "shell" like "layer" is to "module", and is need for the flat stave barrel implementation.
</comment>
<constant name="VertexBarrelShell_rmin" value="VertexBarrelMod_rmin + VertexBarrelMod_count * VertexBarrelMod_offset"/>
<constant name="VertexBarrelShell_rmax" value="VertexBarrelShell_rmin + VertexBarrelShell_thickness"/>
<constant name="VertexBarrelShell_length" value="VertexBarrelMod_length"/>
<constant name="VertexBarrelSupport_thickness" value="0.1*cm"/>
<constant name="VertexBarrelSupport_rmin" value="VertexBarrelShell_rmin-VertexBarrelSupport_thickness/2.0"/>
<constant name="VertexBarrelSupport_rmax" value="VertexBarrelSupport_rmin + VertexBarrelSupport_thickness"/>
<constant name="VertexBarrelSupport_length" value="VertexBarrelLayer_length"/>
<comment>
Extra parameters to approximate a cylinder as a set of skinny staves
due to ACTS limitations.
</comment>
<constant name="VertexBarrelStave_count" value="128"/>
<constant name="VertexBarrelStave1_width" value="2*VertexBarrelMod1_rmin * tan(180*degree/VertexBarrelStave_count)"/>
<constant name="VertexBarrelStave2_width" value="2*VertexBarrelMod2_rmin * tan(180*degree/VertexBarrelStave_count)"/>
<constant name="VertexBarrelStave3_width" value="2*VertexBarrelMod3_rmin * tan(180*degree/VertexBarrelStave_count)"/>
<constant name="VertexBarrelShellStave_width" value="2*VertexBarrelShell_rmin * tan(180*degree/VertexBarrelStave_count)"/>
</define>
<display>
</display>
<detectors>
<documentation level="5">
### Actual detectors
</documentation>
<detector
id="VertexBarrel_0_ID"
name="VertexBarrel"
type="athena_VertexBarrel"
readout="VertexBarrelHits"
insideTrackingVolume="true">
<dimensions
rmin="VertexBarrelLayer1_rmin"
rmax="VertexBarrelSupport_rmax"
length="VertexBarrelEnvelope_length" />
<comment>Vertex Barrel Modules</comment>
<module name="Module1" vis="VertexLayerVis">
<module_component name="ITS3"
material="Silicon"
sensitive="true"
width="VertexBarrelStave1_width"
length="VertexBarrelMod_length"
thickness="SiVertexSensor_thickness"
vis="VertexLayerVis" />
</module>
<module name="Module2" vis="VertexLayerVis">
<module_component name="ITS3"
material="Silicon"
sensitive="true"
width="VertexBarrelStave2_width"
length="VertexBarrelMod_length"
thickness="SiVertexSensor_thickness"
vis="VertexLayerVis" />
</module>
<module name="Module3" vis="VertexLayerVis">
<module_component name="ITS3"
material="Silicon"
sensitive="true"
width="VertexBarrelStave3_width"
length="VertexBarrelMod_length"
thickness="SiVertexSensor_thickness"
vis="VertexLayerVis" />
</module>
<module name="SupportShell" vis="VertexSupportVis">
<module_component name="CF Shell"
material="CarbonFiber"
sensitive="false"
width="VertexBarrelShellStave_width"
length="VertexBarrelShell_length"
thickness="VertexBarrelShell_thickness"
vis="VertexSupportVis" />
</module>
<comment> Layers composed of many arrayed modules </comment>
<layer module="Module1" id="1" vis="VertexLayerVis">
<barrel_envelope
inner_r="VertexBarrelLayer1_rmin"
outer_r="VertexBarrelLayer1_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<comment>
phi0 : Starting phi of first module.
phi_tilt : Phi tilt of a module.
rc : Radius of the module center.
nphi : Number of modules in phi.
rphi_dr : The delta radius of every other module.
z0 : Z position of first module in phi.
nz : Number of modules to place in z.
dr : Radial displacement parameter, of every other module.
</comment>
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod1_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
<layer module="Module2" id="2" vis="VertexLayerVis">
<barrel_envelope
inner_r="VertexBarrelLayer2_rmin"
outer_r="VertexBarrelLayer2_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod2_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
<layer module="Module3" id="3" vis="VertexLayerVis">
<barrel_envelope
inner_r="VertexBarrelLayer3_rmin"
outer_r="VertexBarrelLayer3_rmax"
z_length="VertexBarrelLayer_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelMod3_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
<layer module="SupportShell" id="VertexBarrelMod_count + 1" vis="VertexSupportLayerVis">
<barrel_envelope
inner_r="VertexBarrelSupport_rmin"
outer_r="VertexBarrelSupport_rmax"
z_length="VertexBarrelSupport_length" />
<layer_material surface="outer" binning="binPhi,binZ" bins0="VertexBarrelStave_count" bins1="100" />
<rphi_layout phi_tilt="0.0*degree" nphi="VertexBarrelStave_count" phi0="0.0" rc="VertexBarrelShell_rmin" dr="0.0 * mm"/>
<z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer>
</detector>
</detectors>
<readouts>
<readout name="VertexBarrelHits">
<segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" />
<id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
</readout>
</readouts>
</lccdd>
# npsim --runType vis --compactFile athena.xml --random.seed 1 --enableGun --gun.energy 2*GeV --gun.thetaMin 90*deg --gun.thetaMax 90*deg --gun.distribution uniform --macro macro/dirc_vis.mac --outputFile dirc_vis.root
/vis/list
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
#
# Use this open statement to create a .prim file suitable for
# viewing in DAWN:
#/vis/open DAWNFILE
#
# Use this open statement to create a .heprep file suitable for
# viewing in HepRApp:
#/vis/open HepRepFile
#
# Use this open statement to create a .wrl file suitable for
# viewing in a VRML viewer:
#/vis/open VRML2FILE
#
# Disable auto refresh and quieten vis messages whilst scene and
# trajectories are established:
/vis/viewer/set/autoRefresh false
/vis/viewer/set/rotationStyle freeRotation
/vis/verbose errors
#
# Draw geometry:
/vis/drawVolume
# Specify zoom value:
/vis/viewer/zoom 1.4
# Specify style (surface or wireframe):
#/vis/viewer/set/style wireframe
#top
# /vis/viewer/set/viewpointThetaPhi -90. 0.
# /vis/viewer/set/viewpointVector 0 1 0.00000001
# /vis/viewer/set/upVector 1 0 0
#mcp
#/vis/viewer/set/viewpointVector -1 0 0.00000001
#/vis/viewer/set/upVector 0 1 0
#side
# /vis/viewer/set/viewpointVector 0 1 0.00000001
# /vis/viewer/set/upVector 0 -1 0
#lenses
#/vis/viewer/set/viewpointThetaPhi 30 30
#
#/vis/viewer/set/projection orthogonal
#/vis/viewer/zoomTo 4.5
#/vis/viewer/set/targetPoint -110 20 -10 cm
#/vis/viewer/set/background white
# Draw coordinate axes:
/vis/scene/add/axes 0 0 0 1 m
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
#/vis/modeling/trajectories/create/drawByCharge
#/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
#/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/modeling/trajectories/create/drawByParticleID
/vis/modeling/trajectories/drawByParticleID-0/set opticalphoton yellow
/vis/modeling/trajectories/drawByParticleID-0/setRGBA opticalphoton 1 0.8 0 0.3
/vis/modeling/trajectories/drawByParticleID-0/setRGBA e+ 1 0 1 1
/vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByParticleID-0/default/setStepPtsSize 2
# (if too many tracks cause core dump => /tracking/storeTrajectory 0)
#
# Draw hits at end of event:
#/vis/scene/add/hits
#
# To draw only gammas:
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#
# To invert the above, drawing all particles except gammas,
# keep the above two lines but also add:
#/vis/filtering/trajectories/particleFilter-0/invert true
#
# Many other options are available with /vis/modeling and /vis/filtering.
# For example, to select colour by particle ID:
#/vis/modeling/trajectories/create/drawByParticleID
#/vis/modeling/trajectories/drawByParticleID-0/set e- blue
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
/vis/viewer/set/projection p 40 deg
/vis/viewer/set/style s
/vis/viewer/set/hiddenEdge true
#/vis/viewer/set/background 1 1 1 0
#/vis/viewer/set/background 0 0 0 0
/vis/viewer/set/hiddenMarker
/vis/geometry/set/forceLineSegmentsPerCircle all 0 50
# /vis/viewer/set/globalLineWidthScale 1.5
# /vis/geometry/set/lineWidth all 0 1
/vis/ogl/set/displayListLimit 500000
#fp
#/vis/viewer/save
# #mcp
# /vis/viewer/set/viewpointVector -1 0 0.00000001
# /vis/viewer/set/upVector 0 1
# /vis/viewer/set/viewpointThetaPhi 9 41 deg
# /vis/viewer/zoomTo 6
# /vis/viewer/set/targetPoint 88.5358 -17.0546 18.8692 cm
# lens
# /vis/viewer/zoomTo 20
# /vis/viewer/set/viewpointThetaPhi 129.792 1.39204 deg
# /vis/viewer/set/targetPoint 100 20 210 cm
# # #lens side
# /vis/viewer/set/viewpointVector 1.31839e-16 -1 -6.93889e-18
# /vis/viewer/set/upVector 0 1 0
# /vis/viewer/set/projection orthogonal
# /vis/viewer/zoomTo 11
# /vis/viewer/scaleTo 1 1 1
# /vis/viewer/set/targetPoint 1.01299 -0.569503 2.15227 m
# side wedge
# /vis/viewer/set/viewpointVector -5.20417e-17 1 -3.46945e-18
# /vis/viewer/set/upVector 0 1 0
# /vis/viewer/set/projection orthogonal
# /vis/viewer/zoomTo 13.4
# /vis/viewer/scaleTo 1 1 1
# /vis/viewer/set/targetPoint 1.0404 -0.128502 2.17344 m
# whole length
# /vis/viewer/zoomTo 7.0883
# /vis/viewer/set/targetPoint 1.11348 -0.128502 0.164898 m
#/vis/ogl/export ev_1.png
# draw field
#/vis/scene/add/magneticField 10
#/vis/scene/create
#/vis/scene/add/volume
#
#/vis/sceneHandler/create VRML2FILE
#
#/vis/viewer/create
#
#/tracking/storeTrajectory 1
#/vis/scene/add/trajectories
#/vis/scene/endOfEventAction accumulate
/vis/viewer/refresh
/gps/verbose 2
/gps/particle pi-
/gps/number 1
#/gps/ene/type Gauss
/gps/ene/mono 6.0 GeV
#/gps/ene/sigma 3.0 GeV
#/gps/pos/type Volume
#/gps/pos/shape Cylinder
#/gps/pos/centre 0.0 0.0 0.0 cm
#/gps/pos/radius 0.01 cm
#/gps/pos/halfz 10 cm
/gps/position 0 0 0 cm
#/gps/direction 1 0 0
/gps/direction -1 0 0
#/gps/ang/type iso
#/gps/ang/mintheta 10 degree
#/gps/ang/maxtheta 170 degree
/vis/viewer/set/viewpointVector 0 -1 0
/vis/viewer/set/upVector -1 0 0
/vis/viewer/set/projection orthogonal
/vis/viewer/zoomTo 6.8984
/vis/viewer/scaleTo 1 1 1
/vis/viewer/set/targetPoint -0.987804 0.579407 2.01758 m
/run/beamOn 1
\ No newline at end of file
/run/initialize
#/vis/open OGL 800x800-0+0
/vis/open OGLIQt 800x800-0+0
#
/vis/drawVolume
/vis/viewer/set/viewpointThetaPhi 20 30
/vis/viewer/zoom 1.1
#/vis/viewer/set/style wireframe
#/vis/scene/add/axes 0 0 0 1 m
/vis/scene/add/trajectories rich smooth
/vis/modeling/trajectories/create/drawByCharge
#/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
#/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/scene/add/hits
/vis/scene/endOfEventAction accumulate 2
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#/vis/filtering/trajectories/particleFilter-0/invert true
#/vis/filtering/trajectories/particleFilter-0/verbose true
#/vis/filtering/trajectories/particleFilter-0/active true
/vis/ogl/set/displayListLimit 50000
/vis/viewer/flush
/gps/verbose 2
/gps/particle pi-
/gps/number 1
/gps/ene/type Gauss
/gps/ene/mono 8.0 GeV
/gps/ene/sigma 1.0 GeV
/gps/pos/type Volume
/gps/pos/shape Cylinder
/gps/pos/centre 0.0 0.0 0.0 cm
/gps/pos/radius 0.001 cm
/gps/pos/halfz 1 cm
/gps/position 0 0 0 cm
#/gps/direction 0 0.1 1.0
/gps/ang/type iso
/gps/ang/mintheta 10 degree
/gps/ang/maxtheta 20 degree
/run/beamOn 1
/vis/open OGL 800x800-0+0
/vis/drawVolume
/vis/viewer/set/viewpointThetaPhi 30 30
#/vis/viewer/zoom 30.
#/vis/viewer/set/style wireframe
#/vis/scene/add/axes 0 0 0 1 m
/vis/scene/add/trajectories rich smooth
/vis/modeling/trajectories/create/drawByCharge
#/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
#/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/scene/add/hits
/vis/scene/endOfEventAction accumulate 2
#/vis/filtering/trajectories/create/particleFilter
#/vis/filtering/trajectories/particleFilter-0/add gamma
#/vis/filtering/trajectories/particleFilter-0/invert true
#/vis/filtering/trajectories/particleFilter-0/verbose true
#/vis/filtering/trajectories/particleFilter-0/active true
/vis/ogl/set/displayListLimit 500000
/vis/viewer/flush
/run/beamOn 1
#/control/execute macro/gun.mac
# Usage example:
# npsim --runType vis --compactFile athena.xml --random.seed 1 --enableGun --gun.energy 2*GeV --gun.thetaMin 90*deg --gun.thetaMax 90*deg --gun.distribution uniform --macro macro/vis_OGL_along_z_beamOn_1.mac --outputFile test.root
/vis/open OGL 1920x1080
/vis/scene/create
/vis/scene/add/volume
/vis/sceneHandler/attach
/vis/viewer/zoom 10
/vis/viewer/flush
/vis/scene/add/trajectories
/vis/scene/add/hits
/run/beamOn 1
from __future__ import absolute_import, unicode_literals
import os
import time
import logging
import argparse
parser = argparse.ArgumentParser(
prog='checkOverlaps.py',
description='''Check for overlaps using Geant4''',
epilog='''
This program checks the compact detector file for overlaps using Geant4.
''')
parser.add_argument("-c", "--compact", help="compact detector file",default="athena.xml")
parser.add_argument("-r", "--resolution", help="number of points on surface",default="10000")
parser.add_argument("-t", "--tolerance", help="minimum distance (in mm) to report overlaps",default="0.1")
parser.add_argument("-v", "--verbose", help="print output", action='store_true')
args = parser.parse_args()
import DDG4
from g4units import keV, GeV, mm, ns, MeV
def run():
kernel = DDG4.Kernel()
description = kernel.detectorDescription()
kernel.loadGeometry(str("file:" + args.compact))
DDG4.importConstants(description)
geant4 = DDG4.Geant4(kernel)
ui = geant4.setupCshUI(ui=None)
ui.Commands = [
'/geometry/test/resolution {}'.format(args.resolution),
'/geometry/test/tolerance {}'.format(args.tolerance),
'/geometry/test/verbosity {}'.format(1 if args.verbose else 0),
'/geometry/test/run'
]
kernel.configure()
kernel.initialize()
kernel.run()
kernel.terminate()
if __name__ == "__main__":
run()
from __future__ import absolute_import, unicode_literals
import os
import time
import logging
import argparse
parser = argparse.ArgumentParser(
prog='convert_to_gdml.py',
description='''Convert DD4Hep description to GDML''',
epilog='''
This program converts the compact detector file to a single GDML file.
''')
parser.add_argument("-c", "--compact", help="compact detector file",default="athena.xml")
parser.add_argument("-o", "--output", help="gdml detector file",default="athena.gdml")
args = parser.parse_args()
import DDG4
from g4units import keV, GeV, mm, ns, MeV
def run():
kernel = DDG4.Kernel()
description = kernel.detectorDescription()
kernel.loadGeometry(str("file:" + args.compact))
DDG4.importConstants(description)
geant4 = DDG4.Geant4(kernel)
ui = geant4.setupCshUI(ui=None)
#
# Setup the GDML writer action
writer = DDG4.Action(kernel, 'Geant4GDMLWriteAction/Writer')
writer.enableUI()
kernel.registerGlobalAction(writer)
ui.Commands = [
'/ddg4/Writer/Output {}'.format(args.output),
'/ddg4/Writer/OverWrite 1',
'/ddg4/Writer/write'
]
kernel.configure()
kernel.initialize()
kernel.run()
kernel.terminate()
if __name__ == "__main__":
run()
#include "DD4hep/Detector.h"
#include "DDG4/Geant4Data.h"
#include "DDRec/CellIDPositionConverter.h"
#include "DDRec/SurfaceManager.h"
#include "DDRec/Surface.h"
#include "fmt/core.h"
/** Example using dd4hep
*/
void example_dd4hep(const char* fname = "test_tracker_disc.root"){
using namespace ROOT::Math;
// -------------------------
// Get the DD4hep instance
// Load the compact XML file
// Initialize the position converter tool
dd4hep::Detector& detector = dd4hep::Detector::getInstance();
detector.fromCompact("athena.xml");
dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
fmt::print("Detector Types:\n");
for(const auto& dtype : detector.detectorTypes() ) {
fmt::print(" {}\n", dtype);
}
fmt::print("\n");
fmt::print("All detector subsystem names:\n");
for(const auto& d : detector.detectors() ) {
fmt::print(" {}\n", d.first);
}
}
HepMC::Version 3.02.02
HepMC::Asciiv3-START_EVENT_LISTING
E 0 4 9
U GEV CM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 -9.9999999869440064e+00 1.0000000000000000e+01 5.1099888971089147e-04 4
P 2 1 22 -5.8225640056623670e-03 3.7747924008719728e-02 -2.9249301763891555e+00 2.9248270767857321e+00 -4.5408321610621201e-02 3
P 3 1 11 5.8225640056623670e-03 -3.7747924008719728e-02 -7.0750698105548508e+00 7.0751729232142679e+00 5.1101967722736764e-04 1
P 4 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131387851e+01 1.0000000000000000e+02 9.3827199999876709e-01 4
P 5 4 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131482922e+01 1.0000000000009507e+02 9.3827199999973643e-01 3
V -3 0 [2,5]
P 6 -3 553 -1.4745608418116361e-02 -8.6828685571490272e-01 4.7980031183979008e+00 1.0642943648781511e+01 9.4603000000109834e+00 2
P 7 -3 2212 8.9230444123625328e-03 9.0603477972421620e-01 9.2272664838178372e+01 9.2281883429672035e+01 9.3827200000070576e-01 1
P 8 6 -13 4.4907597498767587e-01 2.0906320322010372e+00 -2.1757837479786910e+00 3.0524760533554351e+00 1.0565800000001382e-01 1
P 9 6 13 -4.6382158340577534e-01 -2.9589188879149320e+00 6.9737868663710216e+00 7.5904675954137195e+00 1.0565800000002223e-01 1
E 0 4 10
U GEV CM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 -9.9999999869440064e+00 1.0000000000000000e+01 5.1099888971089147e-04 4
P 2 1 22 -2.6839726606050791e-04 1.1264659797828775e-03 -6.3401069726794805e+00 6.3401067668601172e+00 -1.9876609922101014e-03 3
P 3 1 11 2.6839726606050791e-04 -1.1264659797828775e-03 -3.6598930142645258e+00 3.6598932331398828e+00 5.1103633096365880e-04 1
P 4 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131387851e+01 1.0000000000000000e+02 9.3827199999876709e-01 4
P 5 4 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131482922e+01 1.0000000000009507e+02 9.3827199999973643e-01 3
V -3 0 [2,5]
P 6 -3 553 1.9156252814767760e-01 2.1790735768546463e-01 -2.8073109612741973e+00 9.8723072682332713e+00 9.4603000029807429e+00 2
P 7 -3 2212 -1.9183092541375127e-01 -2.1678089170561543e-01 9.6462802125352582e+01 9.6467799504704473e+01 9.3827199999779787e-01 1
P 8 6 -13 -2.4852998465289872e-01 2.3091049977702758e+00 -5.7337843777899966e+00 6.1871786743193251e+00 1.0565799999995498e-01 1
P 9 6 13 4.4342149179344215e-01 -2.1010576035711188e+00 2.9552377554469285e+00 3.6545395711486477e+00 1.0565800000003905e-01 1
P 10 6 22 -3.3289790532426214e-03 9.8599634176282647e-03 -2.8764338046322176e-02 3.0589019653741657e-02 3.2927225399135965e-10 1
E 0 4 9
U GEV CM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 -9.9999999869440064e+00 1.0000000000000000e+01 5.1099888971089147e-04 4
P 2 1 22 2.1549001953953920e-01 5.3446029602846556e-01 -6.2965867413439192e-01 6.1195545733789913e-01 -5.9503304168678661e-01 3
P 3 1 11 -2.1549001953953920e-01 -5.3446029602846556e-01 -9.3703413128096145e+00 9.3880445426621009e+00 5.0981276742689016e-04 1
P 4 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131387851e+01 1.0000000000000000e+02 9.3827199999876709e-01 4
P 5 4 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131482922e+01 1.0000000000009507e+02 9.3827199999973643e-01 3
V -3 0 [2,5]
P 6 -3 553 2.2825834022061950e-01 3.3334310888886032e-01 3.5569092662904950e+01 3.6807891116586688e+01 9.4603000000031017e+00 2
P 7 -3 2212 -1.2768320678757170e-02 2.0111718714536578e-01 6.3796846795456545e+01 6.3804064341873378e+01 9.3827200000094813e-01 1
P 8 6 -13 -3.2477759288923482e+00 3.3065214111492942e+00 1.3631832024299879e+01 1.4398581189769127e+01 1.0565800000146809e-01 1
P 9 6 13 3.4760342691128936e+00 -2.9731783022605436e+00 2.1937260638593418e+01 2.2409309926805506e+01 1.0565799999797114e-01 1
E 0 4 9
U GEV CM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 -9.9999999869440064e+00 1.0000000000000000e+01 5.1099888971089147e-04 4
P 2 1 22 8.1053930688133671e-03 -1.2356942914208306e-02 -2.8212751471844815e+00 2.8212599310500082e+00 -1.7442735092468440e-02 3
P 3 1 11 -8.1053930688133671e-03 1.2356942914208306e-02 -7.1787248397595249e+00 7.1787400689499918e+00 5.1101148051165002e-04 1
P 4 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131387851e+01 1.0000000000000000e+02 9.3827199999876709e-01 4
P 5 4 2212 0.0000000000000000e+00 0.0000000000000000e+00 9.9995598131482922e+01 1.0000000000009507e+02 9.3827199999973643e-01 3
V -3 0 [2,5]
P 6 -3 553 -2.4074047134142244e-02 2.6879165673024504e-02 5.1101881387075991e+00 1.0752330024333787e+01 9.4602999999952058e+00 2
P 7 -3 2212 3.2179440203073603e-02 -3.9236108587412617e-02 9.2064134846942238e+01 9.2068929908251562e+01 9.3827200000167510e-01 1
P 8 6 -13 3.4101173607658830e+00 -1.3038459453885907e+00 5.9422927439678519e+00 6.9750212423676778e+00 1.0565800000106459e-01 1
P 9 6 13 -3.4341914079000371e+00 1.3307251110616287e+00 -8.3210460525766239e-01 3.7773087819715596e+00 1.0565800000016515e-01 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 8.3077231638512800e-02 3.4688303864359871e-01 -9.3422177831854492e-01 1.0000001305604915e+00 5.1100000015238706e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 7.2104820115711854e-01 1.5628742640734802e-01 -1.8589415622754393e+00 2.0000000652802488e+00 5.1100000036965185e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 -1.4361173664326103e+00 -9.3836236801405426e-01 -2.4611060473140363e+00 3.0000000435201661e+00 5.1100000036965185e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 -2.6126728458756499e-01 2.0189611701651842e+00 -3.4431867796228350e+00 4.0000000326401244e+00 5.1099999515529708e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 8.5091281358231141e-01 -2.4919887833464918e+00 -4.2504046027827407e+00 5.0000000261121000e+00 5.1099999863153363e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 -2.5637625613563038e+00 2.9774447329110156e+00 -4.5345280230083720e+00 6.0000000217600835e+00 5.1100000210777007e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 8.5248676124549916e-01 1.3423464093622672e+00 -6.8169914507188132e+00 7.0000000186514999e+00 5.1100000210777007e-04 1
E 0 1 3
U GEV MM
P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+01 1.0000000000000000e+01 0.0000000000000000e+00 4
P 2 0 2212 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9.3799999999999994e-01 9.3799999999999994e-01 4
V -1 0 [1,2]
P 3 -1 11 2.7295844590149682e-01 -1.0660162875541499e+00 -7.9239575315293242e+00 8.0000000163200617e+00 5.1099999515529708e-04 1
E 0 1 3
U GEV MM
HepMC::Asciiv3-END_EVENT_LISTING
'''
A script to calcualte placement of ecal endcap modules
lxml is not included in container, get it by simply typing 'pip install lxml'
Author: Chao Peng (ANL)
Date: 06/17/2021
'''
import os
import numpy as np
import argparse
import DDG4
from lxml import etree as ET
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle, Circle
CRYSTAL_SIZE = (20., 20., 200.) # mm
CRYSTAL_GAP = 0.5 # mm
CRYSTAL_ALIGNMENT = [
(5, 21), (5, 21), (5, 21), (4, 22),
(3, 23), (0, 26), (0, 24), (0, 24),
(0, 24), (0, 24), (0, 24), (0, 24),
(0, 22), (0, 22), (0, 20), (0, 20),
(0, 18), (0, 18), (0, 16), (0, 16),
(0, 14), (0, 14), (0, 12), (0, 12),
(0, 6), (0, 6),
]
GLASS_SIZE = (40., 40., 400.) # mm
GLASS_GAP = 1.0 # mm
GLASS_ALIGNMENT = [
(13, 10), (13, 10), (13, 10), (12, 10),
(12, 10), (12, 10), (11, 11), (10, 11),
(9, 12), (8, 13), (7, 13), (6, 14),
(3, 16), (0, 18), (0, 18), (0, 16),
(0, 16), (0, 14), (0, 13), (0, 11),
(0, 10), (0, 7), (0, 3),
]
# calculate positions of modules with a quad-alignment and module size
def individual_placement(alignment, module_x, module_y, gap=0.):
placements = []
for row, (start, num) in enumerate(alignment):
for col in np.arange(start, start + num):
placements.append(((col + 0.5)*(module_y + gap), (row + 0.5)*(module_x + gap)))
placements = np.asarray(placements)
return np.vstack((placements,
np.vstack((placements.T[0]*-1., placements.T[1])).T,
np.vstack((placements.T[0], placements.T[1]*-1.)).T,
np.vstack((placements.T[0]*-1., placements.T[1]*-1.)).T))
def draw_placement(axis, colors=('teal'), module_alignment=((CRYSTAL_SIZE, CRYSTAL_GAP, CRYSTAL_ALIGNMENT))):
xmin, ymin, xmax, ymax = 0., 0., 0., 0.
patches = []
numbers = []
for color, (mod_size, mod_gap, alignment) in zip(colors, module_alignment):
placements = individual_placement(alignment, *mod_size[:2], mod_gap)
boxes = [Rectangle((x - (mod_size[0] + mod_gap)/2., y - (mod_size[1] + mod_gap)/2.), mod_size[0], mod_size[1])
for x, y in placements]
patches.append(Rectangle((0., 0.), *mod_size[:2], facecolor=color, alpha=0.5, edgecolor='k'))
numbers.append(len(placements))
pc = PatchCollection(boxes, facecolor=color, alpha=0.5, edgecolor='k')
xmin = min(xmin, placements.T[0].min() - 8.*(mod_size[0] + mod_gap))
ymin = min(ymin, placements.T[1].min() - 8.*(mod_size[1] + mod_gap))
xmax = max(xmax, placements.T[0].max() + 8.*(mod_size[0] + mod_gap))
ymax = max(ymax, placements.T[1].max() + 8.*(mod_size[1] + mod_gap))
# Add collection to axes
axis.add_collection(pc)
axis.set_xlim(xmin, xmax)
axis.set_ylim(ymin, ymax)
return axis, patches, numbers
def compact_constants(path, names):
if not os.path.exists(path):
print('Cannot find compact file \"{}\".'.format(path))
return []
kernel = DDG4.Kernel()
description = kernel.detectorDescription()
kernel.loadGeometry("file:{}".format(path))
try:
vals = [description.constantAsDouble(n) for n in names]
except:
print('Fail to extract values from {}, return empty.'.format(names))
vals = []
kernel.terminate()
return vals
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--save', default='ce_ecal_placement_test.xml',
help='path to save compact file.')
parser.add_argument('-c', '--compact', default='',
help='compact file to get contant to plot')
parser.add_argument('--radii-constants', dest='radii', default='EcalBarrel_rmin',
help='constant names in compact file to plot, seprate by \",\"')
parser.add_argument('--individual', dest='indiv', action='store_true',
help='individual block placements instead of line placements')
args = parser.parse_args()
data = ET.Element('lccdd')
defines = ET.SubElement(data, 'define')
# constants: name, value
CONSTANTS = [
('CrystalModule_sx', '{:.2f}*mm'.format(CRYSTAL_SIZE[0])),
('CrystalModule_sy', '{:.2f}*mm'.format(CRYSTAL_SIZE[1])),
('CrystalModule_sz', '{:.2f}*mm'.format(CRYSTAL_SIZE[2])),
('CrystalModule_wrap', '{:.2f}*mm'.format(CRYSTAL_GAP)),
('GlassModule_sx', '{:.2f}*mm'.format(GLASS_SIZE[0])),
('GlassModule_sy', '{:.2f}*mm'.format(GLASS_SIZE[1])),
('GlassModule_sz', '{:.2f}*mm'.format(GLASS_SIZE[2])),
('GlassModule_wrap', '{:.2f}*mm'.format(GLASS_GAP)),
('CrystalModule_z0', '10.*cm'),
('GlassModule_z0', '0.0*cm'),
('EcalEndcapN_z0', '-EcalEndcapN_zmin-max(CrystalModule_sz,GlassModule_sz)/2.'),
('CrystalModule_dx', 'CrystalModule_sx + CrystalModule_wrap'),
('CrystalModule_dy', 'CrystalModule_sy + CrystalModule_wrap'),
('GlassModule_dx', 'GlassModule_sx + GlassModule_wrap'),
('GlassModule_dy', 'GlassModule_sy + GlassModule_wrap'),
]
# line-by-line alignment start pos, total number of blocks
for name, value in CONSTANTS:
constant = ET.SubElement(defines, 'constant')
constant.set('name', name)
constant.set('value', value)
# this value will be used multiple times, so define it here
readout_name = 'EcalEndcapNHits'
# detector and its dimension/position/rotation
dets = ET.SubElement(data, 'detectors')
cmt = ET.SubElement(dets, 'comment')
cmt.text = ' Backwards Endcap EM Calorimeter, placements generated by script '
det = ET.SubElement(dets, 'detector')
det.set('id', 'ECalEndcapN_ID')
det.set('name', 'EcalEndcapN')
det.set('type', 'HomogeneousCalorimeter')
det.set('readout', readout_name)
pos = ET.SubElement(det, 'position')
pos.set('x', '0')
pos.set('y', '0')
pos.set('z', 'EcalEndcapN_z0')
rot = ET.SubElement(det, 'rotation')
rot.set('x', '0')
rot.set('y', '0')
rot.set('z', '0')
# placements of modules
plm = ET.SubElement(det, 'placements')
pltype = 'individuals' if args.indiv else 'lines'
# crystal
crystal = ET.SubElement(plm, pltype)
crystal.set('sector', '1')
crystal_mod = ET.SubElement(crystal, 'module')
crystal_mod.set('sizex', 'CrystalModule_sx')
crystal_mod.set('sizey', 'CrystalModule_sy')
crystal_mod.set('sizez', 'CrystalModule_sz')
crystal_mod.set('material', 'PbWO4')
crystal_mod.set('vis', 'AnlTeal')
crystal_wrap = ET.SubElement(crystal, 'wrapper')
crystal_wrap.set('thickness', 'CrystalModule_wrap')
crystal_wrap.set('material', 'Epoxy')
crystal_wrap.set('vis', 'WhiteVis')
# crystal placements (for individuals)
if args.indiv:
for m, (x, y) in enumerate(individual_placement(CRYSTAL_ALIGNMENT, *CRYSTAL_SIZE[:2], CRYSTAL_GAP)):
module = ET.SubElement(crystal, 'placement')
module.set('x', '{:.3f}*mm'.format(x))
module.set('y', '{:.3f}*mm'.format(y))
module.set('z', 'CrystalModule_z0')
module.set('id', '{:d}'.format(m))
# crystal placements (for lines)
else:
crystal.set('mirrorx', 'true')
crystal.set('mirrory', 'true')
for row, (begin, nmods) in enumerate(CRYSTAL_ALIGNMENT):
line = ET.SubElement(crystal, 'line')
line.set('axis', 'x')
line.set('x', 'CrystalModule_dx/2.')
line.set('y', 'CrystalModule_dy*{:d}/2.'.format(row*2 + 1))
line.set('z', 'CrystalModule_z0')
line.set('begin', '{:d}'.format(begin))
line.set('nmods', '{:d}'.format(nmods))
# glass
glass = ET.SubElement(plm, pltype)
glass.set('sector', '2')
glass_mod = ET.SubElement(glass, 'module')
glass_mod.set('sizex', 'GlassModule_sx')
glass_mod.set('sizey', 'GlassModule_sy')
glass_mod.set('sizez', 'GlassModule_sz')
# TODO: change glass material
glass_mod.set('material', 'PbGlass')
glass_mod.set('vis', 'AnlBlue')
glass_wrap = ET.SubElement(glass, 'wrapper')
glass_wrap.set('thickness', 'GlassModule_wrap')
glass_wrap.set('material', 'Epoxy')
glass_wrap.set('vis', 'WhiteVis')
# crystal placements (for individuals)
if args.indiv:
for m, (x, y) in enumerate(individual_placement(GLASS_ALIGNMENT, *GLASS_SIZE[:2], GLASS_GAP)):
module = ET.SubElement(glass, 'placement')
module.set('x', '{:.3f}*mm'.format(x))
module.set('y', '{:.3f}*mm'.format(y))
module.set('z', 'GlassModule_z0')
module.set('id', '{:d}'.format(m))
# crystal placements (for lines)
else:
glass.set('mirrorx', 'true')
glass.set('mirrory', 'true')
for row, (begin, nmods) in enumerate(GLASS_ALIGNMENT):
line = ET.SubElement(glass, 'line')
line.set('axis', 'x')
line.set('x', 'GlassModule_dx/2.')
line.set('y', 'GlassModule_dy*{:d}/2.'.format(row*2 + 1))
line.set('z', 'GlassModule_z0')
line.set('begin', '{:d}'.format(begin))
line.set('nmods', '{:d}'.format(nmods))
# readout
readouts = ET.SubElement(data, 'readouts')
cmt = ET.SubElement(readouts, 'comment')
cmt.text = 'Effectively no segmentation, the segmentation is used to provide cell dimension info'
readout = ET.SubElement(readouts, 'readout')
readout.set('name', readout_name)
seg = ET.SubElement(readout, 'segmentation')
# need segmentation to provide cell dimension info
# seg.set('type', 'NoSegmentation')
seg.set('type', 'MultiSegmentation')
seg.set('key', 'sector')
crystal_seg = ET.SubElement(seg, 'segmentation')
crystal_seg.set('name', 'CrystalSeg')
crystal_seg.set('key_value', '1')
crystal_seg.set('type', 'CartesianGridXY')
crystal_seg.set('grid_size_x', 'CrystalModule_dx')
crystal_seg.set('grid_size_y', 'CrystalModule_dy')
glass_seg = ET.SubElement(seg, 'segmentation')
glass_seg.set('name', 'GlassSeg')
glass_seg.set('key_value', '2')
glass_seg.set('type', 'CartesianGridXY')
glass_seg.set('grid_size_x', 'GlassModule_dx')
glass_seg.set('grid_size_y', 'GlassModule_dy')
rid = ET.SubElement(readout, 'id')
rid.text = 'system:8,sector:4,module:20,x:32:-16,y:-16'
text = ET.tostring(data, pretty_print=True)
with open(args.save, 'wb') as f:
f.write(text)
fig, ax = plt.subplots(figsize=(12, 12), dpi=160)
ax, patches, nblocks = draw_placement(ax, ['teal', 'royalblue'],
[(CRYSTAL_SIZE, CRYSTAL_GAP, CRYSTAL_ALIGNMENT), (GLASS_SIZE, GLASS_GAP, GLASS_ALIGNMENT)])
ax.set_xlabel('x (mm)', fontsize=24)
ax.set_ylabel('y (mm)', fontsize=24)
ax.tick_params(direction='in', labelsize=22, which='both')
ax.set_axisbelow(True)
ax.grid(linestyle=':', which='both')
ax.legend(patches, ['{} {}'.format(num, name) for num, name in zip(nblocks, ['PbWO$_4$', 'SciGlass'])], fontsize=24)
if args.compact and args.radii:
names = [c.strip() for c in args.radii.split(',')]
radii = compact_constants(args.compact, names)
for name, radius in zip(names, radii):
ax.add_patch(Circle((0, 0), radius*10., facecolor='none', edgecolor='k', linewidth=2))
ax.annotate(name, xy=(radius*10/1.4, radius*10/1.4), fontsize=22)
fig.savefig('ce_ecal_placement.png')
R__LOAD_LIBRARY(libDDCore.so)
R__LOAD_LIBRARY(libActsPluginDD4hep.so)
R__LOAD_LIBRARY(libDDG4.so)
R__LOAD_LIBRARY(libDDG4IO.so)
#include "DD4hep/Detector.h"
#include "DD4hep/DetElement.h"
#include "DD4hep/Objects.h"
#include "DD4hep/Detector.h"
#include "DDG4/Geant4Data.h"
#include "DDRec/CellIDPositionConverter.h"
#include "DDRec/SurfaceManager.h"
#include "DDRec/Surface.h"
#include "TCanvas.h"
#include "TChain.h"
#include "Acts/Geometry/TrackingGeometry.hpp"
#include "Acts/Geometry/TrackingVolume.hpp"
#include "Acts/Plugins/DD4hep/ConvertDD4hepDetector.hpp"
/** Example loading ACTs.
*
*
*/
void test_ACTS(const char* compact = "athena.xml"){
using namespace ROOT::Math;
// -------------------------
// Get the DD4hep instance
// Load the compact XML file
// Initialize the position converter tool
dd4hep::Detector& detector = dd4hep::Detector::getInstance();
detector.fromCompact(compact);
dd4hep::rec::CellIDPositionConverter cellid_converter(detector);
//std::unique_ptr<const Acts::TrackingGeometry>
auto acts_tracking_geometry = Acts::convertDD4hepDetector (detector.world(),Acts::Logging::Level::VERBOSE);
//acts_tracking_geometry = Acts::convertDD4hepDetector (detector.world(),Acts::Logging::Level::INFO);
if(acts_tracking_geometry) {
std::cout << "success?\n";
}
// if(acts_tracking_geometry->highestTrackingVolume()) {
// std::cout << " volume name \n ";
// std::cout << acts_tracking_geometry->highestTrackingVolume()->volumeName() << std::endl;
// } else {
// std::cout << "derp\n";
// }
//}
}