Skip to content

Commit

Permalink
add test for DCHdigi
Browse files Browse the repository at this point in the history
  • Loading branch information
atolosadelgado committed Aug 9, 2024
1 parent b7a6ee5 commit 2a58e2c
Show file tree
Hide file tree
Showing 8 changed files with 2,333 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DCHdigi/include/DCHdigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ struct DCHdigi final
// machinery for smearing the position

/// along the sense wire position resolution in mm
Gaudi::Property<float> m_z_resolution{this, "zResolution_mm", 10.0,
Gaudi::Property<float> m_z_resolution{this, "zResolution_mm", 0.1,
"Spatial resolution in the z direction (from reading out the wires at both sides) [mm]"};
/// xy resolution in mm
Gaudi::Property<float> m_xy_resolution{this, "xyResolution_mm", 10., "Spatial resolution in the xy direction [mm]"};
Gaudi::Property<float> m_xy_resolution{this, "xyResolution_mm", 0.1, "Spatial resolution in the xy direction [mm]"};

/// create seed using the uid
SmartIF<IUniqueIDGenSvc> m_uidSvc;
Expand Down
34 changes: 34 additions & 0 deletions DCHdigi/test/test_DCHdigi/check_DCHdigi_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# file: check_DCHdigi_output.py
# author: Alvaro Tolosa-Delgado, CERN 2024
# to run: python3 check_DCHdigi_output.py
# goal: check distance hit-wire and print out a number:
# 0 : calculation of distance hit-wire was done properly
# 1 : problem with calculation of distance hit-wire
# 2 : problem with calculation of hit-projection position onto the wire

import ROOT

exit_code=0
# open debug output file generated by DCHdigi alg
f=ROOT.TFile("dch_digi_alg_debug.root")

# retrieve the hit-wire distance distribution
hDpw=f.Get("hDpw")
hDpw.Rebin(10)
# retrieve the distance at which the distance distribution has its maximum
distance_hit_wire_more_frequent=hDpw.GetXaxis().GetBinCenter( hDpw.GetMaximumBin() )
# the distance hit wire has the maximum around d=0.66cm
# if it is not the case, that means something weird is going on...
if 0.05 < abs(distance_hit_wire_more_frequent - 0.65) :
exit_code+=1

# retrieve the hit-projection onto the wire to the wire distance distribution
hDww=f.Get("hDww")
# since the hit-projection onto the wire should be a point on the wire, the distance should be zero
# and all the counts are pushed to the bin number 1 (which is excluded from the integral)
hDww_integral=hDww.Integral(2,-1)
if hDww_integral != 0 :
exit_code+=2

# we have to print the exit code, so it can be captured by the bash script
print(exit_code)
197 changes: 197 additions & 0 deletions DCHdigi/test/test_DCHdigi/compact/DCH_standalone_o1_v02.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<lccdd >

<info name="DCH standalone"
title="DCHsubdetector"
author="A. Tolosa Delgado, Brieuc Francois"
url="https://indico.cern.ch/"
status="development"
version="o1, v02">
<comment>The compact format of the DCH subdetector, built from XLSX spreadsheet</comment>
</info>


<include ref="${DD4hepINSTALL}/DDDetectors/compact/detector_types.xml" />

<includes>
<gdmlFile ref="elements_o1_v01.xml"/>
<gdmlFile ref="materials_o1_v02.xml"/>
</includes>

<define>
<constant name="world_size" value="25*m"/>
<constant name="world_x" value="world_size"/>
<constant name="world_y" value="world_size"/>
<constant name="world_z" value="world_size"/>
<constant name="tracker_region_zmax" value="world_size"/>
<constant name="tracker_region_rmax" value="world_size"/>
</define>

<!-- %%%%%% Central Drift Chamber Basic Parameters %%%%%% -->
<!-- %%%%%% based on the geometry version "IDEA231026" %%%%%% -->
<define>
<!-- Drift Chamber parameters -->
<constant name="DetID_DCH" value=" 3"/>
<!-- Gas and vesssel geometry parameters -->
<constant name="DCH_inner_cyl_R_total" value=" 349 * mm " />
<constant name="DCH_outer_cyl_R_total" value=" 2001 * mm " />
<constant name="DCH_half_length_total" value=" 2250 * mm " />

<!-- Gas (active volume) geometry -->
<constant name="DCH_gas_inner_cyl_R" value=" 350 * mm " />
<constant name="DCH_gas_outer_cyl_R" value=" 2000 * mm " />
<constant name="DCH_gas_Lhalf" value=" 2000 * mm " />

<!-- Vessel cylinder surrounds the gas cylinder in radius and z -->
<!-- Inner wall and outer wall have different thickness-->
<constant name="DCH_vessel_thickness_innerR" value=" DCH_gas_inner_cyl_R - DCH_inner_cyl_R_total" />
<constant name="DCH_vessel_thickness_outerR" value=" DCH_outer_cyl_R_total - DCH_gas_outer_cyl_R" />
<!-- Wall that make up the base of the cylindrical vessel includes services-->
<!-- filling the space from z=2m to z=2.25m -->
<constant name="DCH_vessel_disk_zmin" value=" DCH_gas_Lhalf" />
<constant name="DCH_vessel_disk_zmax" value=" DCH_half_length_total" />



<!-- Position of guard wires -->
<!-- _z0 := at z=0 -->
<!-- _zL2 := at z=DCH_Lhalf -->
<constant name="DCH_guard_inner_r_at_z0" value=" DCH_gas_inner_cyl_R + 4*mm " />
<constant name="DCH_guard_outer_r_at_zL2" value=" DCH_gas_outer_cyl_R - 12.5*mm " />

<!-- Parametrization of number of cells ands layer/superlayer -->
<constant name="DCH_ncell" value=" 192 " />
<constant name="DCH_ncell_increment" value=" 48 " />
<constant name="DCH_nsuperlayers" value=" 14 " />
<constant name="DCH_nlayersPerSuperlayer" value=" 8 " />
<constant name="DCH_ncell_per_sector" value=" 24 " />

<!-- Alfa = twistangle/2 -->
<constant name="DCH_alpha" value=" 15*deg " />

<!-- Parameters of first layer -->
<constant name="DCH_first_sense_r" value=" DCH_guard_inner_r_at_z0 + 8*mm " />
<constant name="DCH_first_width" value=" 2*pi* DCH_first_sense_r / DCH_ncell" />

<!--
Details about geometry of wires:
- guard wire: 50 um Al (core), 0.3 um Ag (coating)
- sense wire: 20 um W (core), 0.3 um Au (coating)
- field wires top/bottom: 40 um Al (core), 0.3 um Ag (coating)
- field wire center: 50 um Al (core), 0.3 um Ag (coating)
-->
<!-- sense wire thickness (total) -->
<constant name="DCH_SWire_thickness" value="0.0203*mm" />

<!-- Field Side (top/bottom) wire thickness (total) -->
<constant name="DCH_FSideWire_thickness" value="0.0403*mm" />

<!-- Field Central wire thickness (total) -->
<constant name="DCH_FCentralWire_thickness" value="0.0503*mm" />

</define>

<limits>
<limitset name="DCH_limits">
<limit name="step_length_max" particles="e[+-]" value="1.0" unit="mm" />
<limit name="step_length_max" particles="mu[+-]" value="2.0" unit="mm" />
<limit name="step_length_max" particles="*" value="1.0" unit="mm" />
</limitset>
</limits>
<regions>
<region name="DCH_region" eunit="eV" lunit="mm" cut="1.0" threshold="1.0">
<limitsetref name="DCH_limits"/>
</region>
</regions>

<detectors>
<detector
id="DetID_DCH"
name="DCH_v2"
type="DriftChamber_o1_v02_T"
readout="DCHCollection"
region="DCH_region"
limits="DCH_limits"
buildLayers="True"
printExcelTable="False"
>
<!-- Dummy tag to build only few sectors in order to check for overlaps in less than 1 min -->
<!-- <debugGeometry/> -->
<!-- /detectors/detector/vessel -->
<vessel
mainMaterial="CarbonFibStr"
fillmaterial_outerR="PolystyreneFoam"
fillmaterial_endcap="PolystyreneFoam"
fillmaterial_fraction_outerR="0.67"
fillmaterial_fraction_endcap="0.94"
visSkin="dch_vessel_vis"
visBulk="dch_vessel_bulk_vis"
>
</vessel>
<!-- /detectors/detector/gas -->
<gas
material="GasHe_90Isob_10"
vis="dch_gas_vis"
>
</gas>
<!-- /detectors/detector/wires -->
<wires
vis="dch_no_vis_nodaughters"
buildSenseWires="True"
buildFieldWires="True"
SWire_thickness ="DCH_SWire_thickness"
FSideWire_thickness ="DCH_FSideWire_thickness"
FCentralWire_thickness="DCH_FCentralWire_thickness"
SWire_material ="DCH_SWireMat"
FSideWire_material ="DCH_FSideWireMat"
FCentralWire_material ="DCH_FCentralWireMat"
>
</wires>
</detector>
</detectors>

<readouts>
<readout name="DCHCollection">
<!-- superlayer: from 0 to 13 -->
<!-- layer: from 0 to 7 (within a superlayer) -->
<!-- nphi: max of nphi will be 816 (192+13*48) -->
<id>system:5,superlayer:5,layer:4,nphi:11,stereosign:-1</id>
</readout>
</readouts>

<display>
<vis name="dch_aerogel_vis" r="236/256" g="237/256" b="232/256" alpha="0.5" showDaughters="true" visible="true" />
<vis name="dch_gas_vis" r="227/256" g="239/256" b="217/256" alpha="0.5" showDaughters="true" visible="true" />
<vis name="dch_vessel_vis" r="244/256" g="177/256" b="132/256" alpha="0.5" showDaughters="true" visible="true" />
<vis name="dch_cooling_vis" r="254/256" g="230/256" b="151/256" alpha="0.5" showDaughters="false" visible="true" />
<vis name="dch_sensor_vis" r="255/256" g="0/256" b="0/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis" r="255/256" g="230/256" b="153/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis1" r="128/256" g="230/256" b="153/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis2" r="128/256" g="128/256" b="153/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis3" r="128/256" g="128/256" b="256/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis4" r="000/256" g="128/256" b="256/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis5" r="000/256" g="000/256" b="256/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis6" r="256/256" g="000/256" b="256/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis7" r="256/256" g="128/256" b="256/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis8" r="256/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis9" r="256/256" g="128/256" b="000/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis10" r="128/256" g="256/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis11" r="128/256" g="256/256" b="000/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis12" r="000/256" g="256/256" b="000/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis13" r="000/256" g="256/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis14" r="000/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis15" r="000/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis16" r="000/256" g="128/256" b="055/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis17" r="000/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis18" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis19" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis20" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_layer_vis21" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="false" visible="true" />
<vis name="dch_no_vis_nodaughters" showDaughters="false" visible="false" />
<vis name="dch_no_vis" showDaughters="true" visible="false" />
<vis name="dch_envelope_vis" r="0/256" g="96/256" b="156/256" alpha="0.3" showDaughters="true" visible="true" />
<vis name="dch_vessel_bulk_vis" r="236/256" g="000/256" b="000/256" alpha="1.00" showDaughters="true" visible="false" />
</display>


</lccdd>

Loading

0 comments on commit 2a58e2c

Please sign in to comment.