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 1222 additions and 232 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<lccdd> <lccdd>
<define> <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="30*um"/> <documentation>
<constant name="VertexBarrel_rmin1" value="3.3*cm"/> #### Vertex Tracker Barrel Parameters
<constant name="VertexBarrel_rmin2" value="5.7*cm"/>
<constant name="VertexBarrelModule_maxThickness" value="VertexBarrel_rmin2 - VertexBarrel_rmin1"/> - The sensor modules are 2 half-cylinders.
<constant name="VertexBarrel_length" value="VertexTrackerBarrel_length"/> - There are 2 sensitive layers
<constant name="VertexBarrel_thickness" value="0.05/100*9.37*cm"/> - Each sensor has a thickness is 40um
<constant name="VertexBarrelService_thickness" value="VertexBarrel_thickness-ITS3Thickness"/> - There is an outer shell for structural support 300um thick.
<constant name="VertexBarrel_rmin" value="VertexBarrel_rmin1"/> - The ID of this shell is set (arbitrarily) to 10 cm.
<constant name="VertexBarrel_rmax" value="VertexBarrel_rmin2+VertexBarrelModule_maxThickness"/>
<constant name="VertexBarrelLayer_rOffset" value="4.0*mm"/> ##### Sensor layers
<comment> TODO: These should be computed </comment> Currently there are 2 sensor layers. Each is composed of 2 half-cylinders modules with only 40um of silicon thickness.
<constant name="VertexBarrel_NModules1" value="14"/>
<constant name="VertexBarrel_NModules2" value="24"/> ##### Support shell
<!-- Simple carbon fiber support shell.
<constant name="VertexTrackerEndcapP_rmin" value="VertexTrackerInnerRadius"/>
<constant name="VertexTrackerEndcapP_rmax" value="VertexTrackerOuterRadius"/> </documentation>
<constant name="VertexTrackerEndcapP_zmin" value="VertexTrackerBarrel_length + 5*mm"/>
<constant name="VertexBarrel_length" value="300.0*mm"/>
<constant name="VertexTrackerEndcapN_rmin" value="VertexTrackerInnerRadius"/> <constant name="VertexTrackerEndcapP_rmin" value="VertexTrackingRegion_rmin"/>
<constant name="VertexTrackerEndcapN_rmax" value="VertexTrackerOuterRadius"/> <constant name="VertexTrackerEndcapN_rmin" value="VertexTrackingRegion_rmin"/>
<constant name="VertexTrackerEndcapN_zmin" value="VertexTrackerBarrelLength + 5*mm"/> <constant name="VertexTrackerEndcapP_rmax" value="VertexTrackingRegion_rmax"/>
--> <constant name="VertexTrackerEndcapN_rmax" value="VertexTrackingRegion_rmax"/>
<constant name="VertexTrackerEndcapN_zmin" value="VertexTrackerBarrel_zmax"/> <constant name="VertexTrackerEndcapP_zmax" value="VertexTrackingRegionP_zmax"/>
<constant name="VertexTrackerEndcapP_zmin" value="VertexTrackerBarrel_zmax"/> <constant name="VertexTrackerEndcapN_zmax" value="VertexTrackingRegionN_zmax"/>
<constant name="VertexEndcap_NLayers" value="1"/> <constant name="VertexBarrelLayer_length" value="VertexBarrel_length - 1*mm"/>
<constant name="VertexTrackerEndcap_delta" value="(VertexTrackerEndcapP_zmax - VertexTrackerEndcapP_zmin)/VertexEndcap_NLayers"/> <constant name="VertexBarrelMod_length" value="VertexBarrel_length - 2*mm"/>
<constant name="VertexEndcapLayer_dz" value="(VertexTrackerEndcapP_zmax - VertexTrackerEndcapP_zmin)/VertexEndcap_NLayers"/>
<constant name="VertexBarrelSensor_thickness" value="ITS3Thickness"/>
<constant name="VertexEndcapModOpeningAngle" value="30.0*degree"/> <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"/>
<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"/>
<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_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_x2" value="2.0*VertexTrackerEndcapP_rmax*sin(VertexEndcapModOpeningAngle/2.0)"/>
<constant name="VertexEndcapMod1_y" value="VertexTrackerEndcapP_rmax*cos(VertexEndcapModOpeningAngle/2.0) - VertexTrackerEndcapP_rmin"/> <constant name="VertexEndcapMod1_y" value="VertexTrackerEndcapP_rmax*cos(VertexEndcapModOpeningAngle/2.0) - VertexTrackerEndcapP_rmin"/>
</define> <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"/>
<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>
</display> </display>
<detectors> <detectors>
<documentation level="5">
<!-- ### Actual detectors
<detector id="VertexBarrelSubAssembly_ID" </documentation>
name="VertexBarrelSubAssembly"
type="DD4hep_SubdetectorAssembly"
vis="TrackerSubAssemblyVis">
<composite name="VertexBarrel" />
</detector>
<detector id="VertexEndcapSubAssembly_ID"
name="VertexEndcapSubAssembly"
type="DD4hep_SubdetectorAssembly"
vis="TrackerSubAssemblyVis">
<composite name="VertexEndcapN" />
<composite name="VertexEndcapP" />
</detector>
-->
<detector <detector
id="VertexBarrel_ID" id="VertexBarrel_0_ID"
name="VertexBarrel" name="VertexBarrel"
type="athena_VertexBarrel" type="athena_VertexBarrel"
readout="VertexBarrelHits" readout="VertexBarrelHits"
insideTrackingVolume="true"> insideTrackingVolume="true">
<dimensions <dimensions
rmin="VertexBarrel_rmin-VertexBarrelLayer_rOffset" rmin="VertexBarrelLayer_rmin1"
rmax="VertexBarrel_rmax-VertexBarrelLayer_rOffset" rmax="VertexBarrelSupport_rmax"
length="VertexBarrel_length"/> length="VertexBarrel_length" />
<comment>Barrel Modules</comment> <comment>Vertex Barrel Modules</comment>
<module name="Module1" vis="PurpleVis"> <module name="Module1" vis="VertexLayerVis">
<frame material="CarbonFiber_25percent" vis="BlueGreenVis" <module_component name="ITS3"
width="15*mm" material="Silicon"
height="10.0*mm" sensitive="true"
length="VertexBarrel_length-1.0*mm" width="VertexBarrelStave1_width"
thickness="0.1 * mm"/> length="VertexBarrelMod_length"
<module_component name="peek1" material="PEEK" sensitive="false" thickness="VertexBarrelSensor_thickness"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="2.0*mm" /> vis="VertexLayerVis" />
<module_component name="silicon" material="Silicon" sensitive="true" </module>
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="1.0*mm"> <module name="Module2" vis="VertexLayerVis">
<!--position x="0" y="0*mm" z="-0.025*mm" --> /> <module_component name="ITS3"
</module_component> material="Silicon"
<module_component name="peek2" material="PEEK" sensitive="false" sensitive="true"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="2.0*mm" /> width="VertexBarrelStave2_width"
length="VertexBarrelMod_length"
thickness="VertexBarrelSensor_thickness"
vis="VertexLayerVis" />
</module> </module>
<module name="Module2"> <module name="SupportShell" vis="VertexSupportVis">
<frame material="CarbonFiber_25percent" vis="BlueGreenVis" <module_component name="CF Shell"
width="15*mm" material="CarbonFiber"
height="10.0*mm" sensitive="false"
length="VertexBarrel_length-1.0*mm" width="VertexBarrelShellStave_width"
thickness="0.1 * mm"/> length="VertexBarrelShell_length"
<module_component name="peek1" material="PEEK" sensitive="false" thickness="VertexBarrelShell_thickness"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="2.0*mm" /> vis="VertexSupportVis" />
<module_component name="silicon" material="Silicon" sensitive="true"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="1.0*mm">
<!--position x="0" y="0*mm" z="-0.025*mm"/-->
</module_component>
<module_component name="peek2" material="PEEK" sensitive="false"
width="14.0*mm" length="VertexBarrel_length-0.1*mm" thickness="2.0*mm" />
</module> </module>
<comment> Layers composed of many arrayed modules </comment> <comment> Layers composed of many arrayed modules </comment>
<layer module="Module1" id="1" vis="VertexVis"> <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="VertexLayerVis">
<barrel_envelope <barrel_envelope
inner_r="VertexBarrel_rmin1-VertexBarrelLayer_rOffset" inner_r="VertexBarrelLayer_rmin2"
outer_r="VertexBarrel_rmin2-VertexBarrelLayer_rOffset-1.0*mm" outer_r="VertexBarrelLayer_rmax2"
z_length="VertexBarrel_length"/> z_length="VertexBarrelLayer_length" />
<rphi_layout phi_tilt="10.0*degree" nphi="VertexBarrel_NModules1" phi0="0.0" rc="VertexBarrel_rmin1" dr="0.0 * mm"/> <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"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer> </layer>
<layer module="Module2" id="2" vis="VertexVis"> <layer module="SupportShell" id="3" vis="VertexSupportVis">
<barrel_envelope <barrel_envelope
inner_r="VertexBarrel_rmin2-VertexBarrelLayer_rOffset" inner_r="VertexBarrelSupport_rmin"
outer_r="VertexBarrel_rmax-VertexBarrelLayer_rOffset" outer_r="VertexBarrelSupport_rmax"
z_length="VertexBarrel_length"/> z_length="VertexBarrelSupport_length" />
<rphi_layout phi_tilt="10.0*degree" nphi="VertexBarrel_NModules2" phi0="0.0" rc="VertexBarrel_rmin2" dr="0.0 * mm"/> <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"/> <z_layout dr="0.0 * mm" z0="0.0 * mm" nz="1"/>
</layer> </layer>
</detector> </detector>
<detector <detector
id="VertexEndcapP_ID" id="VertexEndcapP_0_ID"
name="VertexEndcapP" name="VertexEndcapP"
type="refdet_TrapEndcapTracker" type="athena_TrapEndcapTracker"
readout="VertexEndcapHits" readout="VertexEndcapHits"
vis="AnlRed" vis="TrackerVis"
reflect="false"> 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"> <module name="Module1" vis="AnlProcess_Blue">
<trd x1="VertexEndcapMod1_x1/2.0" x2="VertexEndcapMod1_x2/2.0" z="VertexEndcapMod1_y/2"/> <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="ITS3Thickness" material="Silicon" sensitive="true"/>
<module_component thickness="0.25/100*9.37*cm-ITS3Thickness" material="Silicon"/> <module_component thickness="VertexEndcapAluminumThickness" material="Aluminum"/>
<module_component thickness="VertexCarbon_thickness" material="CarbonFiber"/>
</module> </module>
<layer id="1"> <layer id="1">
<envelope vis="AnlRed" <envelope vis="TrackerVis"
rmin="VertexTrackerEndcapP_rmin" rmin="VertexTrackerEndcapP_rmin"
rmax="VertexTrackerEndcapP_rmax" rmax="VertexTrackerEndcapP_rmax"
length="VertexEndcapLayer_dz" length="VertexEndcapLayer_thickness"
zstart="VertexTrackerEndcapP_zmin" /> zstart="VertexTrackerEndcapP_zmin + VertexEndcapLayer_dz/2.0" />
<ring vis="AnlRed" <layer_material surface="representing" binning="binPhi,binR" bins0="20*VertexEndcap_NModules" bins1="256"/>
<ring vis="TrackerVis"
r="VertexTrackerEndcapP_rmin+VertexEndcapMod1_y/2.0" r="VertexTrackerEndcapP_rmin+VertexEndcapMod1_y/2.0"
zstart="25.0*mm" zstart="0.0"
nmodules="12" dz="2.5 * mm" module="Module1" /> nmodules="VertexEndcap_NModules" dz="VertexEndcapMod_dz" module="Module1" />
</layer> </layer>
</detector> </detector>
<detector <detector
id="VertexEndcapN_ID" id="VertexEndcapN_0_ID"
name="VertexEndcapN" name="VertexEndcapN"
type="refdet_TrapEndcapTracker" type="athena_TrapEndcapTracker"
readout="VertexEndcapHits" readout="VertexEndcapHits"
vis="AnlRed" vis="TrackerVis"
reflect="true"> 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"> <module name="Module1" vis="AnlProcess_Blue">
<trd x1="VertexEndcapMod1_x1/2.0" x2="VertexEndcapMod1_x2/2.0" z="VertexEndcapMod1_y/2"/> <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="ITS3Thickness" material="Silicon" sensitive="true"/>
<module_component thickness="0.25/100*9.37*cm-ITS3Thickness" material="Silicon"/> <module_component thickness="VertexEndcapAluminumThickness" material="Aluminum"/>
<module_component thickness="VertexCarbon_thickness" material="CarbonFiber"/>
</module> </module>
<layer id="1"> <layer id="1">
<envelope vis="AnlRed" <envelope vis="TrackerVis"
rmin="VertexTrackerEndcapN_rmin" rmin="VertexTrackerEndcapN_rmin"
rmax="VertexTrackerEndcapN_rmax" rmax="VertexTrackerEndcapN_rmax"
length="VertexEndcapLayer_dz" length="VertexEndcapLayer_thickness"
zstart="VertexTrackerEndcapN_zmin" /> zstart="VertexTrackerEndcapN_zmin + VertexEndcapLayer_dz/2.0" />
<ring vis="AnlRed" <layer_material surface="representing" binning="binPhi,binR" bins0="20*VertexEndcap_NModules" bins1="256"/>
<ring vis="TrackerVis"
r="VertexTrackerEndcapN_rmin+VertexEndcapMod1_y/2.0" r="VertexTrackerEndcapN_rmin+VertexEndcapMod1_y/2.0"
zstart="-25.0*mm" zstart="0.0"
nmodules="12" dz="2.5 * mm" module="Module1" /> nmodules="VertexEndcap_NModules" dz="VertexEndcapMod_dz" module="Module1" />
</layer> </layer>
</detector> </detector>
<!--
<detector id="VertexEndcapP_ID"
name="VertexEndcapP"
type="athena_SimpleDiskTracker"
readout="VertexEndcapHits"
insideTrackingVolume="true"
reflect="false" vis="AnlRed">
<position x="0" y="0" z="0.0*mm"/>
<layer id="1" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 0.5*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin-3*mm"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<slice material="Silicon" thickness="1.0*mm" vis="AnlOrange" sensitive="true"/>
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="2" vis="AnlOrange"
inner_z="VertexTrackerEndcapP_zmin + 1.5*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapP_rmin"
outer_r="VertexTrackerEndcapP_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<slice material="Silicon" thickness="1.0*mm" vis="AnlOrange" sensitive="true"/>
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
</detector>
<detector id="VertexEndcapN_ID"
name="VertexEndcapN"
type="athena_SimpleDiskTracker"
readout="VertexEndcapHits"
insideTrackingVolume="true"
reflect="true" vis="AnlRed">
<position x="0" y="0" z="-0.0*mm-1.0e-9*mm"/>
<layer id="1" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 0.5*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<slice material="Silicon" thickness="1.0*mm" vis="AnlOrange" sensitive="true"/>
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
<layer id="2" vis="AnlOrange"
inner_z="VertexTrackerEndcapN_zmin + 1.5*VertexTrackerEndcap_delta"
inner_r="VertexTrackerEndcapN_rmin"
outer_r="VertexTrackerEndcapN_rmax">
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
<slice material="Silicon" thickness="1.0*mm" vis="AnlOrange" sensitive="true"/>
<slice material="Air" thickness="1.0*mm" vis="AnlOrange" />
</layer>
</detector>
-->
</detectors> </detectors>
<readouts> <readouts>
<readout name="VertexBarrelHits"> <readout name="VertexBarrelHits">
<segmentation type="CartesianGridXY" grid_size_x="0.050*mm" grid_size_y="0.050*mm" /> <segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id>
</readout> </readout>
<readout name="VertexEndcapHits"> <readout name="VertexEndcapHits">
<segmentation type="CartesianGridXY" grid_size_x="0.20*mm" grid_size_y="0.20*mm" /> <segmentation type="CartesianGridXZ" grid_size_x="0.010*mm" grid_size_z="0.010*mm" />
<id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id>
</readout> </readout>
</readouts> </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
...@@ -18,21 +18,22 @@ from matplotlib.patches import Rectangle, Circle ...@@ -18,21 +18,22 @@ from matplotlib.patches import Rectangle, Circle
CRYSTAL_SIZE = (20., 20., 200.) # mm CRYSTAL_SIZE = (20., 20., 200.) # mm
CRYSTAL_GAP = 0.5 # mm CRYSTAL_GAP = 0.5 # mm
CRYSTAL_ALIGNMENT = [ CRYSTAL_ALIGNMENT = [
(7, 17), (7, 17), (7, 17), (6, 18), (5, 21), (5, 21), (5, 21), (4, 22),
(6, 18), (5, 19), (3, 19), (0, 22), (3, 23), (0, 26), (0, 24), (0, 24),
(0, 22), (0, 22), (0, 22), (0, 22), (0, 24), (0, 24), (0, 24), (0, 24),
(0, 20), (0, 20), (0, 18), (0, 18), (0, 22), (0, 22), (0, 20), (0, 20),
(0, 16), (0, 16), (0, 14), (0, 14), (0, 18), (0, 18), (0, 16), (0, 16),
(0, 12), (0, 12), (0, 6), (0, 6), (0, 14), (0, 14), (0, 12), (0, 12),
(0, 6), (0, 6),
] ]
GLASS_SIZE = (40., 40., 400.) # mm GLASS_SIZE = (40., 40., 400.) # mm
GLASS_GAP = 1.0 # mm GLASS_GAP = 1.0 # mm
GLASS_ALIGNMENT = [ GLASS_ALIGNMENT = [
(12, 11), (12, 11), (12, 11), (11, 11), (13, 10), (13, 10), (13, 10), (12, 10),
(11, 11), (11, 11), (10, 12), (9, 12), (12, 10), (12, 10), (11, 11), (10, 11),
(8, 13), (7, 14), (6, 14), (3, 16), (9, 12), (8, 13), (7, 13), (6, 14),
(0, 19), (0, 18), (0, 18), (0, 16), (3, 16), (0, 18), (0, 18), (0, 16),
(0, 16), (0, 14), (0, 13), (0, 11), (0, 16), (0, 14), (0, 13), (0, 11),
(0, 10), (0, 7), (0, 3), (0, 10), (0, 7), (0, 3),
] ]
...@@ -92,7 +93,7 @@ def compact_constants(path, names): ...@@ -92,7 +93,7 @@ def compact_constants(path, names):
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-s', '--save', default='compact/ce_ecal_crystal_glass.xml', parser.add_argument('-s', '--save', default='ce_ecal_placement_test.xml',
help='path to save compact file.') help='path to save compact file.')
parser.add_argument('-c', '--compact', default='', parser.add_argument('-c', '--compact', default='',
help='compact file to get contant to plot') help='compact file to get contant to plot')
......
...@@ -44,28 +44,30 @@ done ...@@ -44,28 +44,30 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
# Side view # Side view (lines)
dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim dawncut -1 0 0 1 ${INPUT_FILE} ${FILE_TAG}.prim
dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim # dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
../../bin/dawn_tweak --mag 10 # dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
dawn -d ${FILE_TAG}.prim ../../bin/dawn_tweak --mag 10 --draw 3 --theta 165 --phi 75 --light-theta 180 --light-phi 90
dawn -d ${FILE_TAG}.prim
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \ -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}_full.pdf -f ${FILE_TAG}_full.pdf
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox -thinlinemode solid -aaVector yes -r 600
# Top view # Top view
#dawncut 0 -1 0 1 ${INPUT_FILE} ${FILE_TAG}.prim
dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
dawncut 0 -1 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim dawncut 0 -1 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
../../bin/dawn_tweak --theta 270 --mag 20 ../../bin/dawn_tweak --mag 10 --draw 1 --theta 90 --phi 90
dawn -d ${FILE_TAG}.prim dawn -d ${FILE_TAG}.prim
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_top_full.pdf ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_top_full.pdf
gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \ -c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}_top_full.pdf -f ${FILE_TAG}_top_full.pdf
pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox -thinlinemode solid -aaVector yes
1.34392e+07
90
180
0
0
0
25000
2.0
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.001
0.001
0.001
3
71
0.001
0
0
1
evince
0
0
1.34392e+07
0
180
0
0
0
0
8
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
1
1
evince
0
0
...@@ -18,7 +18,7 @@ tan () ...@@ -18,7 +18,7 @@ tan ()
function print_the_help { function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> " echo "USAGE: $0 -i <PRIM_FILE> <slices ...> "
echo " OPTIONS: " echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)" echo " -t,--tag filename tag (default: view1)"
exit exit
...@@ -48,12 +48,16 @@ do ...@@ -48,12 +48,16 @@ do
shift # past argument shift # past argument
shift # past value shift # past value
;; ;;
*) # unknown option -[a-zA-Z]*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1" echo "unknown option $1"
print_the_help print_the_help
shift # past argument shift # past argument
;; ;;
*) # positional options
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac esac
done done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
...@@ -62,17 +66,6 @@ set -- "${POSITIONAL[@]}" # restore positional parameters ...@@ -62,17 +66,6 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
echo "view12 produces a series of slightly rotated XY slices a different z locations. Along beamline" echo "view12 produces a series of slightly rotated XY slices a different z locations. Along beamline"
# slice at z = 2m
# note the offset has to change with sign of the direction to cut in the opposite direction.
dawncut 0 0 1 2005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut 0 0 -1 -2000 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
dawn -d ${FILE_TAG}b.prim
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}b_full.pdf
pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
original_file_tag="${FILE_TAG}" original_file_tag="${FILE_TAG}"
make_slice(){ make_slice(){
...@@ -90,9 +83,10 @@ make_slice(){ ...@@ -90,9 +83,10 @@ make_slice(){
rm "${FILE_TAG}_temp0.prim" rm "${FILE_TAG}_temp0.prim"
rm "${FILE_TAG}.prim" rm "${FILE_TAG}.prim"
} }
for zzz in $(seq 50 50 2000) ;
for zzz in $@ ;
do do
make_slice ${zzz} & make_slice ${zzz}
done done
wait wait
......
...@@ -9,7 +9,7 @@ function print_the_help { ...@@ -9,7 +9,7 @@ function print_the_help {
exit exit
} }
FILE_TAG="view2" FILE_TAG="view13"
INPUT_FILE="g4_0000.prim" INPUT_FILE="g4_0000.prim"
......
0.0
72.5
189.5
0
0
0
1500
55
3
0.001
0
1
1
1
0.5
0.5
0.5
25.5
71
0.001
0.001
0.001
1
70
0.001
1
0
1
evince
0
0
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
function print_the_help { function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> " echo "USAGE: $0 -i <PRIM_FILE> <slices ...> "
echo " OPTIONS: " echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)" echo " -t,--tag filename tag (default: view1)"
exit exit
...@@ -53,34 +53,22 @@ do ...@@ -53,34 +53,22 @@ do
shift # past argument shift # past argument
shift # past value shift # past value
;; ;;
*) # unknown option -[a-zA-Z]*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1" echo "unknown option $1"
print_the_help print_the_help
shift # past argument shift # past argument
;; ;;
*) # positional options
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac esac
done done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
# units are mm # units are mm
echo "view14 produces a series of slightly rotated XY slices a different z locations. Along beamline"
# slice at z = 2m
# note the offset has to change with sign of the direction to cut in the opposite direction.
dawncut 0 0 1 10005 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut 0 0 -1 -1000 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
dawn -d ${FILE_TAG}b.prim
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 175 550 675] /PAGES pdfmark" \
-f ${FILE_TAG}b_full.pdf
pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
echo "done ..."
original_file_tag="${FILE_TAG}" original_file_tag="${FILE_TAG}"
make_slice(){ make_slice(){
...@@ -102,7 +90,8 @@ make_slice(){ ...@@ -102,7 +90,8 @@ make_slice(){
rm "${FILE_TAG}_temp0.prim" rm "${FILE_TAG}_temp0.prim"
rm "${FILE_TAG}.prim" rm "${FILE_TAG}.prim"
} }
for zzz in $(seq 150 50 2000) ;
for zzz in $@ ;
do do
make_slice ${zzz} make_slice ${zzz}
done done
......
0.0
72.5
189.5
0
0
0
1500
50
3
0.001
0
1
1
1
0.5
0.5
0.5
25.5
71
0.001
0.001
0.001
1
70
0.001
1
0
1
evince
0
0
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
function print_the_help { function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> " echo "USAGE: $0 -i <PRIM_FILE> <slices ...> "
echo " OPTIONS: " echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)" echo " -t,--tag filename tag (default: view1)"
exit exit
...@@ -53,12 +53,16 @@ do ...@@ -53,12 +53,16 @@ do
shift # past argument shift # past argument
shift # past value shift # past value
;; ;;
*) # unknown option -[a-zA-Z]*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1" echo "unknown option $1"
print_the_help print_the_help
shift # past argument shift # past argument
;; ;;
*) # positional options
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac esac
done done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
...@@ -104,7 +108,7 @@ make_slice(){ ...@@ -104,7 +108,7 @@ make_slice(){
rm "${FILE_TAG}.prim" rm "${FILE_TAG}.prim"
} }
for zzz in $(seq 150 50 2000) ; for zzz in $@ ;
do do
make_slice ${zzz} make_slice ${zzz}
done done
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
0 0
0 0
8 8
3 1
0.001 0.001
0 0
1 1
......
1.34392e+07
90
180
0
0
0
0
1
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.001
0.001
0.001
3
71
0.001
0
0
1
evince
0
0
#!/bin/bash
#export DAWN_PS_PREVIEWER="derp"
function print_the_help {
echo "USAGE: $0 <PRIM_FILE> "
echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)"
exit
}
FILE_TAG="view20"
INPUT_FILE="../../g4_0000.prim"
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-t|--tag)
FILE_TAG="$2"
shift # past argument
shift # past value
;;
-i|--input)
INPUT_FILE="$2"
shift # past argument
shift # past value
;;
*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1"
print_the_help
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
# Top view with a thin slice down the middle
dawncut 0 1 0 1 ${INPUT_FILE} ${FILE_TAG}_top_temp0.prim
dawncut 0 -1 0 1 ${FILE_TAG}_top_temp0.prim ${FILE_TAG}_top.prim
../../bin/dawn_tweak --mag 2 --draw 1 --theta 90 --phi 90
dawn -d ${FILE_TAG}_top.prim
ps2pdf ${FILE_TAG}_top.eps ${FILE_TAG}_top_full.pdf
gs -o ${FILE_TAG}_top.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}_top_full.pdf
pdftoppm ${FILE_TAG}_top.pdf ${FILE_TAG}_top -png -singlefile -cropbox -thinlinemode solid -aaVector yes
# Side view (lines)
dawncut 1 0 0 1 ${INPUT_FILE} ${FILE_TAG}_temp0.prim
dawncut -1 0 0 1 ${FILE_TAG}_temp0.prim ${FILE_TAG}.prim
../../bin/dawn_tweak --mag 1 --draw 1 --theta 180 --phi 90
dawn -d ${FILE_TAG}.prim
ps2pdf ${FILE_TAG}.eps ${FILE_TAG}_full.pdf
gs -o ${FILE_TAG}.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [51 250 550 590] /PAGES pdfmark" \
-f ${FILE_TAG}_full.pdf
pdftoppm ${FILE_TAG}.pdf ${FILE_TAG} -png -singlefile -cropbox -thinlinemode solid -aaVector yes
#npdet_info print EcalEndcapN_z0 --value-only ../../athena.xml
#180.5 cm
zcut=$(npdet_info print EcalEndcapN_z0 --value-only ${DETECTOR_PATH}/athena.xml )
NMOD1=$(npdet_info print EcalEndcapN_NModules_Sector1 --value-only ${DETECTOR_PATH}/calorimeters.xml )
NMOD2=$(npdet_info print EcalEndcapN_NModules_Sector2 --value-only ${DETECTOR_PATH}/calorimeters.xml )
echo "NMOD1 = ${NMOD1}"
echo "NMOD2 = ${NMOD2}"
echo "zcut = ${zcut}"
# Top view with a thin slice down the middle
dawncut 0 0 1 -1800 ${INPUT_FILE} ${FILE_TAG}_endcapN_temp0.prim
dawncut 0 0 -1 2200 ${FILE_TAG}_endcapN_temp0.prim ${FILE_TAG}_endcapN.prim
../../bin/dawn_tweak --mag 5 --draw 3 --theta 180 --phi 0
dawn -d ${FILE_TAG}_endcapN.prim
ps2pdf ${FILE_TAG}_endcapN.eps ${FILE_TAG}_endcapN_full.pdf
gs -o ${FILE_TAG}_endcapN.pdf -sDEVICE=pdfwrite \
-c "[/CropBox [50 170 550 670] /PAGES pdfmark" \
-f ${FILE_TAG}_endcapN_full.pdf
pdftoppm ${FILE_TAG}_endcapN.pdf ${FILE_TAG}_endcapN -png -singlefile -cropbox -thinlinemode solid \
-aaVector yes -r 1200
convert -pointsize 180 -fill black -draw "text 200,200 \"$NMOD1 Crystals\"" \
${FILE_TAG}_endcapN.png ${FILE_TAG}_endcapN.png
convert -pointsize 180 -fill black -draw "text 200,400 \"$NMOD2 Glasses\"" \
${FILE_TAG}_endcapN.png ${FILE_TAG}_endcapN.png
1.34392e+07
0
0
1
0
0
491.1
1.2
5
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
1
1
evince
0
0
1.34392e+07
0
180
0
0
0
0
8.6
1
0.001
0
1
1
1
0.5
0.5
0.5
19
71
0.01
0.01
0.01
3
70
0.01
1
1
1
evince
0
0
...@@ -59,6 +59,7 @@ INPUT_FILE=${FILE_TAG}_input.prim ...@@ -59,6 +59,7 @@ INPUT_FILE=${FILE_TAG}_input.prim
# units are mm # units are mm
dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim dawncut 0 0 -1 1 ${INPUT_FILE} ${FILE_TAG}a_temp0.prim
dawncut 0 0 1 1 ${FILE_TAG}a_temp0.prim ${FILE_TAG}a.prim dawncut 0 0 1 1 ${FILE_TAG}a_temp0.prim ${FILE_TAG}a.prim
../../bin/dawn_tweak --mag 14
dawn -d ${FILE_TAG}a.prim dawn -d ${FILE_TAG}a.prim
ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf ps2pdf ${FILE_TAG}a.eps ${FILE_TAG}a_full.pdf
gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}a.pdf -sDEVICE=pdfwrite \
...@@ -69,6 +70,7 @@ pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox ...@@ -69,6 +70,7 @@ pdftoppm ${FILE_TAG}a.pdf ${FILE_TAG}a -png -singlefile -cropbox
#SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick ) #SiTracker Endcap layer 5 zstart = 860mm ( 90 mm thick )
dawncut 0 0 1 945 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim dawncut 0 0 1 945 ${INPUT_FILE} ${FILE_TAG}b_temp0.prim
dawncut 0 0 -1 -865 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim dawncut 0 0 -1 -865 ${FILE_TAG}b_temp0.prim ${FILE_TAG}b.prim
../../bin/dawn_tweak --mag 14
dawn -d ${FILE_TAG}b.prim dawn -d ${FILE_TAG}b.prim
ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf ps2pdf ${FILE_TAG}b.eps ${FILE_TAG}b_full.pdf
gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}b.pdf -sDEVICE=pdfwrite \
...@@ -79,6 +81,7 @@ pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox ...@@ -79,6 +81,7 @@ pdftoppm ${FILE_TAG}b.pdf ${FILE_TAG}b -png -singlefile -cropbox
#SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick ) #SiTracker Endcap layer 4 zstart = 695mm ( 90 mm thick )
dawncut 0 0 1 780 ${INPUT_FILE} ${FILE_TAG}c_temp0.prim dawncut 0 0 1 780 ${INPUT_FILE} ${FILE_TAG}c_temp0.prim
dawncut 0 0 -1 -700 ${FILE_TAG}c_temp0.prim ${FILE_TAG}c.prim dawncut 0 0 -1 -700 ${FILE_TAG}c_temp0.prim ${FILE_TAG}c.prim
../../bin/dawn_tweak --mag 14
dawn -d ${FILE_TAG}c.prim dawn -d ${FILE_TAG}c.prim
ps2pdf ${FILE_TAG}c.eps ${FILE_TAG}c_full.pdf ps2pdf ${FILE_TAG}c.eps ${FILE_TAG}c_full.pdf
gs -o ${FILE_TAG}c.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}c.pdf -sDEVICE=pdfwrite \
...@@ -101,6 +104,7 @@ pdftoppm ${FILE_TAG}d.pdf ${FILE_TAG}d -png -singlefile -cropbox ...@@ -101,6 +104,7 @@ pdftoppm ${FILE_TAG}d.pdf ${FILE_TAG}d -png -singlefile -cropbox
# slice at z = -2m # slice at z = -2m
dawncut 0 0 1 430 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim dawncut 0 0 1 430 ${INPUT_FILE} ${FILE_TAG}e_temp0.prim
dawncut 0 0 -1 -370 ${FILE_TAG}e_temp0.prim ${FILE_TAG}e.prim dawncut 0 0 -1 -370 ${FILE_TAG}e_temp0.prim ${FILE_TAG}e.prim
../../bin/dawn_tweak --mag 14
dawn -d ${FILE_TAG}e.prim dawn -d ${FILE_TAG}e.prim
ps2pdf ${FILE_TAG}e.eps ${FILE_TAG}e_full.pdf ps2pdf ${FILE_TAG}e.eps ${FILE_TAG}e_full.pdf
gs -o ${FILE_TAG}e.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}e.pdf -sDEVICE=pdfwrite \
...@@ -111,6 +115,7 @@ pdftoppm ${FILE_TAG}e.pdf ${FILE_TAG}e -png -singlefile -cropbox ...@@ -111,6 +115,7 @@ pdftoppm ${FILE_TAG}e.pdf ${FILE_TAG}e -png -singlefile -cropbox
#SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick ) #SiTracker Endcap layer 1 zstart = 200mm ( 30 mm thick )
dawncut 0 0 1 225 ${INPUT_FILE} ${FILE_TAG}f_temp0.prim dawncut 0 0 1 225 ${INPUT_FILE} ${FILE_TAG}f_temp0.prim
dawncut 0 0 -1 205 ${FILE_TAG}f_temp0.prim ${FILE_TAG}f.prim dawncut 0 0 -1 205 ${FILE_TAG}f_temp0.prim ${FILE_TAG}f.prim
../../bin/dawn_tweak --mag 14
dawn -d ${FILE_TAG}f.prim dawn -d ${FILE_TAG}f.prim
ps2pdf ${FILE_TAG}f.eps ${FILE_TAG}f_full.pdf ps2pdf ${FILE_TAG}f.eps ${FILE_TAG}f_full.pdf
gs -o ${FILE_TAG}f.pdf -sDEVICE=pdfwrite \ gs -o ${FILE_TAG}f.pdf -sDEVICE=pdfwrite \
......
/** \addtogroup PID
* \brief Type: **Barrel bar detector (think DIRC) with longitudinal frame**.
* \author S. Joosten
*
* \ingroup PID
*
*
* \code
* \endcode
*
* @{
*/
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "XML/Layering.h"
#include <array>
using namespace std;
using namespace dd4hep;
/** Barrel Bar detector with optional framek
*
* - Optional "frame" tag within the module element (frame eats part of the module width
* and is longitudinal at both sides)
* - Detector is setup as a "tracker" so we can use the hits to perform fast MC
* for e.g. the DIRC
*
*/
static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h e, SensitiveDetector sens)
{
typedef vector<PlacedVolume> Placements;
xml_det_t x_det = e;
Material air = description.air();
int det_id = x_det.id();
string det_name = x_det.nameStr();
DetElement sdet(det_name, det_id);
map<string, Volume> volumes;
map<string, Placements> sensitives;
map<string, std::vector<rec::VolPlane>> volplane_surfaces;
PlacedVolume pv;
dd4hep::xml::Dimension dimensions(x_det.dimensions());
xml_dim_t dirc_pos = x_det.position();
map<string, std::array<double, 2>> module_thicknesses;
Tube topVolumeShape(dimensions.rmin(), dimensions.rmax(), dimensions.length() * 0.5);
Volume assembly(det_name, topVolumeShape, air);
sens.setType("tracker");
// loop over the modules
for (xml_coll_t mi(x_det, _U(module)); mi; ++mi) {
xml_comp_t x_mod = mi;
string m_nam = x_mod.nameStr();
if (volumes.find(m_nam) != volumes.end()) {
printout(ERROR, "BarrelBarDetectorWithSideFrame",
string((string("Module with named ") + m_nam + string(" already exists."))).c_str());
throw runtime_error("Logics error in building modules.");
}
int ncomponents = 0;
int sensor_number = 1;
double total_thickness = 0;
// Compute module total thickness from components
xml_coll_t ci(x_mod, _U(module_component));
for (ci.reset(), total_thickness = 0.0; ci; ++ci) {
total_thickness += xml_comp_t(ci).thickness();
}
// the module assembly volume
Assembly m_vol(m_nam);
volumes[m_nam] = m_vol;
m_vol.setVisAttributes(description, x_mod.visStr());
// Optional module frame.
// frame is 2 longitudinal bars at the side of the module
//
// |___| <-- example module cross section (x-y plane), frame is flush with the
// bottom of the module and protrudes on the top if needed
//
// Get frame width, as it impacts the main module for being built. We
// construct the actual frame structure later (once we know the module width)
double frame_width = 0;
if (x_mod.hasChild("frame")) {
xml_comp_t m_frame = x_mod.child(_U(frame));
frame_width = m_frame.width();
}
double thickness_so_far = 0.0;
double thickness_sum = -total_thickness / 2.0;
double max_component_width = 0;
for (xml_coll_t ci(x_mod, _U(module_component)); ci; ++ci, ++ncomponents) {
xml_comp_t x_comp = ci;
xml_comp_t x_pos = x_comp.position(false);
string c_nam = _toString(ncomponents, "component%d");
double box_width = x_comp.width() - 2 * frame_width;
max_component_width = fmax(max_component_width, box_width);
Box c_box{box_width / 2, x_comp.length() / 2, x_comp.thickness() / 2};
Volume c_vol{c_nam, c_box, description.material(x_comp.materialStr())};
pv = m_vol.placeVolume(c_vol, Position(0, 0, thickness_sum + x_comp.thickness() / 2.0));
c_vol.setRegion(description, x_comp.regionStr());
c_vol.setLimitSet(description, x_comp.limitsStr());
c_vol.setVisAttributes(description, x_comp.visStr());
if (x_comp.isSensitive()) {
c_vol.setSensitiveDetector(sens);
sensitives[m_nam].push_back(pv);
module_thicknesses[m_nam] = {thickness_so_far + x_comp.thickness() / 2.0,
total_thickness - thickness_so_far - x_comp.thickness() / 2.0};
// -------- create a measurement plane for the tracking surface attched to the sensitive volume -----
rec::Vector3D u(0., 1., 0.);
rec::Vector3D v(0., 0., 1.);
rec::Vector3D n(1., 0., 0.);
// compute the inner and outer thicknesses that need to be assigned to the tracking surface
// depending on wether the support is above or below the sensor
double inner_thickness = module_thicknesses[m_nam][0];
double outer_thickness = module_thicknesses[m_nam][1];
rec::SurfaceType type(rec::SurfaceType::Sensitive);
rec::VolPlane surf(c_vol, type, inner_thickness, outer_thickness, u, v, n); //,o ) ;
volplane_surfaces[m_nam].push_back(surf);
}
thickness_sum += x_comp.thickness();
thickness_so_far += x_comp.thickness();
}
// Now add-on the frame
if (x_mod.hasChild("frame")) {
xml_comp_t m_frame = x_mod.child(_U(frame));
double frame_thickness = getAttrOrDefault<double>(m_frame, _U(thickness), total_thickness);
Box lframe_box{m_frame.width() / 2., m_frame.length() / 2., frame_thickness / 2.};
Box rframe_box{m_frame.width() / 2., m_frame.length() / 2., frame_thickness / 2.};
// Keep track of frame with so we can adjust the module bars appropriately
Volume lframe_vol{"left_frame", lframe_box, description.material(m_frame.materialStr())};
Volume rframe_vol{"right_frame", rframe_box, description.material(m_frame.materialStr())};
lframe_vol.setVisAttributes(description, m_frame.visStr());
rframe_vol.setVisAttributes(description, m_frame.visStr());
m_vol.placeVolume(lframe_vol, Position(frame_width / 2. + max_component_width / 2, 0.,
frame_thickness / 2. - total_thickness / 2.0));
m_vol.placeVolume(rframe_vol, Position(-frame_width / 2. - max_component_width / 2, 0.,
frame_thickness / 2. - total_thickness / 2.0));
}
}
// now build the layers
for (xml_coll_t li(x_det, _U(layer)); li; ++li) {
xml_comp_t x_layer = li;
xml_comp_t x_barrel = x_layer.child(_U(barrel_envelope));
xml_comp_t x_layout = x_layer.child(_U(rphi_layout));
xml_comp_t z_layout = x_layer.child(_U(z_layout)); // Get the <z_layout> element.
int lay_id = x_layer.id();
string m_nam = x_layer.moduleStr();
string lay_nam = _toString(x_layer.id(), "layer%d");
Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0);
Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume.
lay_vol.setVisAttributes(description, x_layer.visStr());
double phi0 = x_layout.phi0(); // Starting phi of first module.
double phi_tilt = x_layout.phi_tilt(); // Phi tilt of a module.
double rc = x_layout.rc(); // Radius of the module center.
int nphi = x_layout.nphi(); // Number of modules in phi.
double rphi_dr = x_layout.dr(); // The delta radius of every other module.
double phi_incr = (M_PI * 2) / nphi; // Phi increment for one module.
double phic = phi0; // Phi of the module center.
double z0 = z_layout.z0(); // Z position of first module in phi.
double nz = z_layout.nz(); // Number of modules to place in z.
double z_dr = z_layout.dr(); // Radial displacement parameter, of every other module.
Volume module_env = volumes[m_nam];
DetElement lay_elt(sdet, _toString(x_layer.id(), "layer%d"), lay_id);
Placements& sensVols = sensitives[m_nam];
// Z increment for module placement along Z axis.
// Adjust for z0 at center of module rather than
// the end of cylindrical envelope.
double z_incr = nz > 1 ? (2.0 * z0) / (nz - 1) : 0.0;
// Starting z for module placement along Z axis.
double module_z = -z0;
int module = 1;
// Loop over the number of modules in phi.
for (int ii = 0; ii < nphi; ii++) {
double dx = z_dr * std::cos(phic + phi_tilt); // Delta x of module position.
double dy = z_dr * std::sin(phic + phi_tilt); // Delta y of module position.
double x = rc * std::cos(phic); // Basic x module position.
double y = rc * std::sin(phic); // Basic y module position.
// Loop over the number of modules in z.
for (int j = 0; j < nz; j++) {
string module_name = _toString(module, "module%d");
DetElement mod_elt(lay_elt, module_name, module);
Transform3D tr(RotationZYX(0, ((M_PI / 2) - phic - phi_tilt), -M_PI / 2), Position(x, y, module_z));
pv = lay_vol.placeVolume(module_env, tr);
pv.addPhysVolID("module", module);
pv.addPhysVolID("section", j);
mod_elt.setPlacement(pv);
for (size_t ic = 0; ic < sensVols.size(); ++ic) {
PlacedVolume sens_pv = sensVols[ic];
DetElement comp_de(mod_elt, std::string("de_") + sens_pv.volume().name(), module);
comp_de.setPlacement(sens_pv);
rec::volSurfaceList(comp_de)->push_back(volplane_surfaces[m_nam][ic]);
}
/// Increase counters etc.
module++;
// Adjust the x and y coordinates of the module.
x += dx;
y += dy;
// Flip sign of x and y adjustments.
dx *= -1;
dy *= -1;
// Add z increment to get next z placement pos.
module_z += z_incr;
}
phic += phi_incr; // Increment the phi placement of module.
rc += rphi_dr; // Increment the center radius according to dr parameter.
rphi_dr *= -1; // Flip sign of dr parameter.
module_z = -z0; // Reset the Z placement parameter for module.
}
// Create the PhysicalVolume for the layer.
pv = assembly.placeVolume(lay_vol); // Place layer in mother
pv.addPhysVolID("layer", lay_id); // Set the layer ID.
lay_elt.setAttributes(description, lay_vol, x_layer.regionStr(), x_layer.limitsStr(), x_layer.visStr());
lay_elt.setPlacement(pv);
}
sdet.setAttributes(description, assembly, x_det.regionStr(), x_det.limitsStr(), x_det.visStr());
assembly.setVisAttributes(description.invisible());
pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0, 0, dirc_pos.z()));
pv.addPhysVolID("system", det_id); // Set the subdetector system ID.
sdet.setPlacement(pv);
return sdet;
}
//@}
// clang-format off
DECLARE_DETELEMENT(BarrelBarDetectorWithSideFrame, create_BarrelBarDetectorWithSideFrame)
DECLARE_DETELEMENT(athena_FakeDIRC, create_BarrelBarDetectorWithSideFrame)