Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit check-xml test #300

Merged
merged 5 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pre-commit

on: [push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3.1
- uses: aidasoft/run-lcg-view@v4
with:
release-platform: LCG_101/x86_64-centos7-clang12-opt
run: |
export PYTHONPATH=$(python -m site --user-site):$PYTHONPATH
export PATH=/root/.local/bin:$PATH
pip install --upgrade --user pip
pip install pre-commit --user
# Use virtualenv from the LCG release
pip uninstall --yes virtualenv
pre-commit run --show-diff-on-failure \
--color=always \
--all-files
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-xml
121 changes: 60 additions & 61 deletions FCCee/CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">

<info name="FCCee_o0_v01"
title="FCCee detector model option 0 version 01"
status="development"
status="development">
<comment>The compact format for the FCCee Detector design</comment>
</info>

<includes>
<gdmlFile ref="elements.xml"/>
<gdmlFile ref="materials.xml"/>
</includes>

<define>
<constant name="world_side" value="7000*mm"/>
<constant name="world_x" value="world_side"/>
<constant name="world_y" value="world_side"/>
<constant name="world_z" value="world_side"/>
<constant name="CrossingAngle" value="0.030*rad"/>

<constant name="CrossingAngle" value="0.030*rad"/>

<!-- <constant name="CrossingAngle" value="-0.030*rad"/> -->


<constant name="SolenoidField" value="2*tesla"/>


<constant name="DetID_NOTUSED" value=" 0"/>

<constant name="DetID_VXD_Barrel" value=" 1"/>
Expand All @@ -40,21 +40,21 @@

<constant name="DetID_OT_Barrel" value=" 5"/>
<constant name="DetID_OT_Endcap" value=" 6"/>

<constant name="DetID_ECal_Barrel" value=" 20"/>
<constant name="DetID_ECal_Endcap" value=" 29"/>
<constant name="DetID_ECal_Plug" value=" 21"/>

<constant name="DetID_HCAL_Barrel" value=" 10"/>
<constant name="DetID_HCAL_Endcap" value=" 11"/>
<constant name="DetID_HCAL_Ring" value=" 12"/>

<constant name="DetID_Yoke_Barrel" value=" 13"/>
<constant name="DetID_Yoke_Endcap" value=" 14"/>

<constant name="DetID_LumiCal" value=" 15"/>
<constant name="DetID_BeamCal" value=" 16"/>

<constant name="BeamPipeWidth" value="0.5*mm" />
<constant name="CentralBeamPipe_zmax" value="25*cm"/>
<constant name="SeparatedBeamPipe_z" value="100*cm"/>
Expand All @@ -67,9 +67,9 @@

<!-- a cone until lumi front face, within the 100 mrad cone. To be followed by a Tube in the support of InnerTracker_o2_v03_02.xml -->
<!--

<constant name="ConeBeamPipe_zmax" value="1300*mm"/>
<constant name="ConeBeamPipe_rmax_1" value="131*mm"/>
<constant name="ConeBeamPipe_rmax_1" value="131*mm"/>
-->
<!-- instead : the support cone extends until the end of the inner tracker, no Tube -->
<constant name="InnerTracker_half_length" value="2190*mm" />
Expand All @@ -81,15 +81,15 @@
<constant name="SeparatedBeamPipe_rmax" value="12*mm"/>
<constant name="BeamPipeTantalShieldWidth" value="0.5*mm"/>
<constant name="BeamPipe_end" value="12500*mm"/>



<!-- ################### ENVELOPE PARAMETERS ######################################################## -->

<comment> suggested naming convention:

main parameters:

DET_inner_radius : inner radius of tube like envelope ( inscribed cylinder )
DET_outer_radius : outer radius of tube like envelope ( circumscribed cylinder )
DET_half_length : half length along z axis
Expand All @@ -99,19 +99,19 @@
DET_outer_symmetry : number of sides on the inside ( 0 for tube )
DET_inner_phi0 : optional rotation of the inner polygon ( in r-phi plane )
DET_outer_phi0 : optional rotation of the outer polygon ( in r-phi plane )

additional parameters for cutting away volumes/shapes use one of the above with a number
appended and/or an extra specifiaction such as cone ( for a cut away cone )

DET_inner_radius_1
DET_outer_radius_2
DET_cone_min_z
DET_cone_max_z

</comment>

<constant name="env_safety" value="0.1*mm"/>

<!-- for ILD central VTX : -->

<constant name="TUBE_IPInnerTube_end_z" value="80*mm"/>
Expand Down Expand Up @@ -140,7 +140,7 @@
<constant name="VXD_cryostat_option" value="0"/>

<!--
<constant name="FTD_half_length" value="1100*mm"/>
<constant name="FTD_half_length" value="1100*mm"/>
<constant name="FTD_inner_radius" value=" 115*cm"/>
<constant name="FTD_outer_radius_1" value="115*cm"/>
<constant name="FTD_outer_radius_2" value="115*cm"/>
Expand Down Expand Up @@ -168,7 +168,7 @@
<constant name="Vertex_outer_radius" value="111*mm"/>
<constant name="Vertex_half_length" value="260*mm"/>
-->

<constant name="Vertex_inner_radius" value="21*mm"/>
<constant name="Vertex_outer_radius" value="111*mm"/>
<constant name="Vertex_half_length" value="260*mm"/>
Expand All @@ -177,67 +177,67 @@
<constant name="InnerTracker_outer_radius" value="580*mm"/>
<!--<constant name="InnerTracker_half_length" value="2345*mm"/> -->
<!-- <constant name="InnerTracker_half_length" value="2190*mm" /> --> <!-- given above -->

<constant name="OuterTracker_inner_radius" value="580*mm"/>
<constant name="OuterTracker_outer_radius" value="1500*mm - 0.1*mm"/> <!-- to avoid overlap with CaloFace-->
<constant name="OuterTracker_half_length" value="2190*mm"/>

<constant name="ECalBarrel_inner_radius" value="1500*mm"/>
<constant name="ECalBarrel_outer_radius" value="1659*mm"/>
<constant name="ECalBarrel_half_length" value="2250*mm"/>
<constant name="ECalBarrel_symmetry" value="12"/>

<constant name="ECalEndcap_inner_radius" value="410*mm"/>
<constant name="ECalEndcap_outer_radius" value="1700*mm"/>
<constant name="ECalEndcap_min_z" value="2350*mm"/>
<constant name="ECalEndcap_max_z" value="2509*mm"/>
<constant name="ECalEndcap_outer_symmetry" value="12"/>
<constant name="ECalEndcap_inner_symmetry" value="12"/>

<constant name="ECalPlug_inner_radius" value="260*mm"/>
<constant name="ECalPlug_outer_radius" value="380*mm"/>
<constant name="ECalPlug_min_z" value="2350*mm"/>
<constant name="ECalPlug_max_z" value="2509*mm"/>
<constant name="ECalPlug_outer_symmetry" value="12"/>
<constant name="ECalPlug_inner_symmetry" value="12"/>

<constant name="HCalBarrel_inner_radius" value="1697*mm"/>
<constant name="HCalBarrel_outer_radius" value="3287*mm"/>
<constant name="HCalBarrel_half_length" value="2250*mm"/>
<constant name="HCalBarrel_symmetry" value="12"/>

<constant name="HCalEndcap_inner_radius" value="250*mm"/>
<constant name="HCalEndcap_outer_radius" value="3203*mm"/>
<constant name="HCalEndcap_min_z" value="2539*mm"/>
<constant name="HCalEndcap_max_z" value="4129*mm"/>
<constant name="HCalEndcap_symmetry" value="12"/>
<constant name="HCalEndcap_zcutout" value="200*mm"/>
<constant name="HCalEndcap_rcutout" value="180*mm"/>

<constant name="HCalRing_inner_radius" value="1730*mm"/>
<constant name="HCalRing_outer_radius" value="HCalEndcap_outer_radius"/>
<constant name="HCalRing_min_z" value="2400*mm"/>
<constant name="HCalRing_max_z" value="2539*mm"/>
<constant name="HCalRing_symmetry" value="12"/>

<constant name="Solenoid_inner_radius" value="3440*mm"/>
<constant name="Solenoid_outer_radius" value="4192*mm"/>
<constant name="Solenoid_half_length" value="4129*mm"/>
<constant name="Solenoid_Coil_half_length" value="3900*mm"/>
<constant name="Solenoid_Coil_half_length" value="3900*mm"/>
<constant name="Solenoid_Coil_radius" value="3778*mm"/>

<constant name="YokeBarrel_inner_radius" value="4418*mm"/>
<constant name="YokeBarrel_outer_radius" value="7004*mm"/>
<constant name="YokeBarrel_half_length" value="4129*mm"/>
<constant name="YokeBarrel_symmetry" value="12"/>

<constant name="YokeEndcap_inner_radius" value="630*mm"/>
<constant name="YokeEndcap_outer_radius" value="7004*mm"/>
<constant name="YokeEndcap_min_z" value="4179*mm"/>
<constant name="YokeEndcap_max_z" value="5179*mm"/>
<constant name="YokeEndcap_outer_symmetry" value="12"/>
<constant name="YokeEndcap_inner_symmetry" value="0"/>

<constant name="CompSol_min_z" value="1300*mm"/>

<!--
Expand All @@ -257,7 +257,7 @@




<constant name="BeamCal_inner_radius" value="32*mm"/>
<constant name="BeamCal_outer_radius" value="150*mm"/>
<constant name="BeamCal_min_z" value="3181*mm"/>
Expand All @@ -268,23 +268,23 @@
<constant name="Kicker_outer_radius" value="25*mm"/>
<constant name="Kicker_min_z" value="3480*mm"/>
<constant name="Kicker_max_z" value="3780*mm"/>

<constant name="BPM_inner_radius" value="36*mm"/>
<constant name="BPM_outer_radius" value="55*mm"/>
<constant name="BPM_min_z" value="3790*mm"/>
<constant name="BPM_max_z" value="3880*mm"/>
<constant name="BPM_max_z" value="3880*mm"/>

<constant name="QD0_min_z" value="2200*mm"/>
<constant name="QD0_max_z" value="5400*mm"/>
<constant name="QD0Coil_outer_radius" value="30*mm"/>
<constant name="CollimatorInFrontOfQD0_dz" value="20*cm"/>
<constant name="CollimatorInFrontOfQD0_dz" value="20*cm"/>
<constant name="CollimatorInFrontOfQD0_radius" value="10*mm"/>
<constant name="CollimatorInFrontOfQD0_dr" value="16*mm"/>

<constant name="tracker_region_zmax" value="OuterTracker_half_length"/>
<constant name="tracker_region_rmax" value="OuterTracker_outer_radius"/>
</define>

<limits>
<limitset name="cal_limits">
<limit name="step_length_max" particles="*" value="5.0" unit="mm" />
Expand All @@ -308,9 +308,9 @@
<limitsetref name="SiTrackerBarrelRegionLimitSet"/>
</region>
</regions>



<display>

<!--
Expand All @@ -335,35 +335,35 @@
<vis name="LCALVis" alpha="1.0" r="0.25" g="0.88" b="0.81" showDaughters="true" visible="true"/>

<vis name="BCALVis" alpha="1.0" r="0.0" g="0.4" b="0.4" showDaughters="true" visible="true"/>
<vis name="KICKVis" alpha="1.0" r="1.0" g="0.498" b="0.0" showDaughters="true" visible="true"/>
<vis name="KICKVis" alpha="1.0" r="1.0" g="0.498" b="0.0" showDaughters="true" visible="true"/>
<vis name="QD0CoilIVis" alpha="1.0" r="1.0" g="0.498" b="0.0" showDaughters="true" visible="true"/>
<vis name="QD0CoilOVis" alpha="1.0" r="1.0" g="0.25" b="0.0" showDaughters="true" visible="true"/>
<vis name="CompSolVis" alpha="1.0" r="0.5" g="0.5" b="0.0" showDaughters="true" visible="true"/>
<vis name="ScreenSolVis" alpha="0.0" r="1" g="1" b="0" showDaughters="true" visible="true"/>
<vis name="ColliVis" alpha="1.0" r="0.7" g="0.5" b="1" showDaughters="true" visible="true"/>
<vis name="TantalumVis" alpha="0.0" r="1" g="0.5" b="0.5" showDaughters="true" visible="true"/>

<vis name="BPMVis" alpha="1.0" r="0.25" g="0.88" b="0.81" showDaughters="true" visible="true"/>
<vis name="SupportVis" alpha="1" r="0.2" g="0.2" b="0.2" showDaughters="false" visible="true"/>
<vis name="BPMVis" alpha="1.0" r="0.25" g="0.88" b="0.81" showDaughters="true" visible="true"/>
<vis name="SupportVis" alpha="1" r="0.2" g="0.2" b="0.2" showDaughters="false" visible="true"/>
</display>

<include ref="Materials_v01.xml"/>

<include ref="Beampipe_o3_v01.xml"/>
<include ref="Beampipe_o3_v01.xml"/>
<!-- <include ref="Beampipe_o3_v01_noMask.xml"/> -->

<include ref="BeamInstrumentation_o3_v01.xml"/>
<include ref="BeamInstrumentation_o3_v01.xml"/>
<include ref="LumiCal_o3_v01_01.xml"/>

<include ref="Vertex_o3_v03.xml"/>
<include ref="Vertex_o3_v03.xml"/>

<include ref="InnerTracker_o3_v03.xml"/>
<include ref="InnerTracker_o3_v03.xml"/>
<include ref="OuterTracker_o2_v03_03.xml"/>

<include ref="ECalBarrel_o2_v01_01.xml"/>
<include ref="ECalEndcap_o2_v01_01.xml"/>
<include ref="ECalPlug_o1_v01_01.xml"/>

<include ref="HCalBarrel_o1_v01_01.xml"/>
<include ref="HCalEndcap_o1_v01_01.xml"/>

Expand Down Expand Up @@ -425,8 +425,7 @@
-->


</fields>
</fields>


</lccdd>

4 changes: 2 additions & 2 deletions FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
url="no"
status="development"
version="1.0">
<comment>
<comment>
One stop shop for a baseline / the latest developments of the FCCee Detector concept.
</comment>
</info>
Expand Down Expand Up @@ -39,6 +39,6 @@
<!-- Vertex.xml comes from FCCee_o2_v02 /-->
<include ref="Vertex.xml"/>
<include ref="SimplifiedDriftChamber.xml"/>
<include ref="Calorimeter.xml">
<include ref="Calorimeter.xml"/>

</lccdd>
4 changes: 2 additions & 2 deletions SiD/compact/SiD_o1_v01/BeamPipe.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<lccdd>
<comment>Beampipe</comment>

<detectors>
Expand Down Expand Up @@ -84,5 +85,4 @@
<!-- <zplane rmin="0.*cm" rmax="6.0*cm" z="-tracking_region_zmax" /> -->
<!-- </detector> -->
</detectors>


</lccdd>
Loading