From 5a3cb420c4a91fed4548796c1439258fc110b53a Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 08:31:39 +0100 Subject: [PATCH 1/5] add pre-commit check-xml test --- .github/workflows/pre-commit.yml | 23 +++++++++++++++++++++++ .pre-commit-config.yaml | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..68a1db8f2 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..23ef8b85a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-xml From 3c50628da368fa27cacaa2ff67fbd1016ed5e01a Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 16:21:55 +0100 Subject: [PATCH 2/5] make SiD pass check-xml --- SiD/compact/SiD_o1_v01/BeamPipe.xml | 4 ++-- SiD/compact/SiD_o1_v01/HCalBarrel_o1_v03_00.xml | 9 +++++---- SiD/compact/SiD_o1_v01/HCalEndcap_o1_v03_00.xml | 3 ++- SiD/compact/SiD_o1_v01/Support.xml | 2 ++ SiD/compact/SiD_o2_v01/BeamPipe.xml | 4 ++-- SiD/compact/SiD_o2_v01/Support.xml | 2 ++ SiD/compact/SiD_o2_v02/BeamPipe.xml | 2 ++ SiD/compact/SiD_o2_v02/Support.xml | 2 ++ SiD/compact/SiD_o2_v03/BeamPipe.xml | 2 ++ SiD/compact/SiD_o2_v03/Support.xml | 2 ++ SiD/compact/SiD_o2_v04/Support.xml | 2 ++ SiD/compact/SiD_o3_v02/BeamPipe.xml | 2 ++ SiD/compact/SiD_o3_v02/Support.xml | 2 ++ SiD/compact/sidloi3/BeamPipe.xml | 5 ++--- SiD/compact/sidloi3/EcalEndcap.xml | 4 ++-- SiD/compact/sidloi3/Support.xml | 2 ++ 16 files changed, 35 insertions(+), 14 deletions(-) diff --git a/SiD/compact/SiD_o1_v01/BeamPipe.xml b/SiD/compact/SiD_o1_v01/BeamPipe.xml index b6ecd319c..ab5500496 100644 --- a/SiD/compact/SiD_o1_v01/BeamPipe.xml +++ b/SiD/compact/SiD_o1_v01/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe @@ -84,5 +85,4 @@ - - + diff --git a/SiD/compact/SiD_o1_v01/HCalBarrel_o1_v03_00.xml b/SiD/compact/SiD_o1_v01/HCalBarrel_o1_v03_00.xml index facb801d3..9ddd7f34b 100644 --- a/SiD/compact/SiD_o1_v01/HCalBarrel_o1_v03_00.xml +++ b/SiD/compact/SiD_o1_v01/HCalBarrel_o1_v03_00.xml @@ -1,8 +1,8 @@ @@ -38,8 +38,9 @@ - + + + diff --git a/SiD/compact/SiD_o1_v01/HCalEndcap_o1_v03_00.xml b/SiD/compact/SiD_o1_v01/HCalEndcap_o1_v03_00.xml index 04948230a..3185b0c34 100644 --- a/SiD/compact/SiD_o1_v01/HCalEndcap_o1_v03_00.xml +++ b/SiD/compact/SiD_o1_v01/HCalEndcap_o1_v03_00.xml @@ -42,7 +42,8 @@ - + + diff --git a/SiD/compact/SiD_o1_v01/Support.xml b/SiD/compact/SiD_o1_v01/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o1_v01/Support.xml +++ b/SiD/compact/SiD_o1_v01/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/SiD_o2_v01/BeamPipe.xml b/SiD/compact/SiD_o2_v01/BeamPipe.xml index b6ecd319c..ab5500496 100644 --- a/SiD/compact/SiD_o2_v01/BeamPipe.xml +++ b/SiD/compact/SiD_o2_v01/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe @@ -84,5 +85,4 @@ - - + diff --git a/SiD/compact/SiD_o2_v01/Support.xml b/SiD/compact/SiD_o2_v01/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o2_v01/Support.xml +++ b/SiD/compact/SiD_o2_v01/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/SiD_o2_v02/BeamPipe.xml b/SiD/compact/SiD_o2_v02/BeamPipe.xml index d4046a3a3..ab5500496 100644 --- a/SiD/compact/SiD_o2_v02/BeamPipe.xml +++ b/SiD/compact/SiD_o2_v02/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe @@ -84,3 +85,4 @@ + diff --git a/SiD/compact/SiD_o2_v02/Support.xml b/SiD/compact/SiD_o2_v02/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o2_v02/Support.xml +++ b/SiD/compact/SiD_o2_v02/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/SiD_o2_v03/BeamPipe.xml b/SiD/compact/SiD_o2_v03/BeamPipe.xml index d4046a3a3..ab5500496 100644 --- a/SiD/compact/SiD_o2_v03/BeamPipe.xml +++ b/SiD/compact/SiD_o2_v03/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe @@ -84,3 +85,4 @@ + diff --git a/SiD/compact/SiD_o2_v03/Support.xml b/SiD/compact/SiD_o2_v03/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o2_v03/Support.xml +++ b/SiD/compact/SiD_o2_v03/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/SiD_o2_v04/Support.xml b/SiD/compact/SiD_o2_v04/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o2_v04/Support.xml +++ b/SiD/compact/SiD_o2_v04/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/SiD_o3_v02/BeamPipe.xml b/SiD/compact/SiD_o3_v02/BeamPipe.xml index d4046a3a3..ab5500496 100644 --- a/SiD/compact/SiD_o3_v02/BeamPipe.xml +++ b/SiD/compact/SiD_o3_v02/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe @@ -84,3 +85,4 @@ + diff --git a/SiD/compact/SiD_o3_v02/Support.xml b/SiD/compact/SiD_o3_v02/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/SiD_o3_v02/Support.xml +++ b/SiD/compact/SiD_o3_v02/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + diff --git a/SiD/compact/sidloi3/BeamPipe.xml b/SiD/compact/sidloi3/BeamPipe.xml index 71a42230e..ae07f91d9 100644 --- a/SiD/compact/sidloi3/BeamPipe.xml +++ b/SiD/compact/sidloi3/BeamPipe.xml @@ -1,3 +1,4 @@ + Beampipe Central Be Beampipe @@ -78,6 +79,4 @@ - - - + diff --git a/SiD/compact/sidloi3/EcalEndcap.xml b/SiD/compact/sidloi3/EcalEndcap.xml index 575e2e1fa..3b6beb576 100644 --- a/SiD/compact/sidloi3/EcalEndcap.xml +++ b/SiD/compact/sidloi3/EcalEndcap.xml @@ -1,4 +1,4 @@ - + EM Calorimeter Endcaps @@ -11,7 +11,7 @@ - + diff --git a/SiD/compact/sidloi3/Support.xml b/SiD/compact/sidloi3/Support.xml index 67cb683ca..7b734ccd9 100644 --- a/SiD/compact/sidloi3/Support.xml +++ b/SiD/compact/sidloi3/Support.xml @@ -1,3 +1,4 @@ + Double-walled Carbon Fiber support tube @@ -368,3 +369,4 @@ + From c69db4796f46db14c6b519173a7636d5073060f4 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 16:23:27 +0100 Subject: [PATCH 3/5] make IDEA pass check-xml --- FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml b/FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml index 73139600f..a40f6248b 100644 --- a/FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml +++ b/FCCee/IDEA/compact/IDEA_o1_v01/IDEA_o1_v01.xml @@ -11,7 +11,7 @@ url="no" status="development" version="1.0"> - + One stop shop for a baseline / the latest developments of the FCCee Detector concept. @@ -39,6 +39,6 @@ - + From 5b2af710b588efc495d3c90880d35d458f70da63 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 16:24:24 +0100 Subject: [PATCH 4/5] make CLD pass check-xml --- .../CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml | 121 +++++++++--------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/FCCee/CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml b/FCCee/CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml index 452fbb597..07abf8214 100644 --- a/FCCee/CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml +++ b/FCCee/CLD/compact/FCCee_o0_v01/FCCee_o0_v01.xml @@ -4,32 +4,32 @@ - + The compact format for the FCCee Detector design - + - + - - + + - - + + @@ -40,21 +40,21 @@ - + - + - + - + - + @@ -67,9 +67,9 @@ @@ -81,15 +81,15 @@ - - - + + + - + 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 @@ -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 - + - + - + @@ -140,7 +140,7 @@ - + @@ -177,35 +177,35 @@ - + - + - + - + - + - + @@ -213,31 +213,31 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -425,8 +425,7 @@ --> - + - From c26597a9e3a36faa78ab8f194bdc45bd59ced9bd Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 16:25:15 +0100 Subject: [PATCH 5/5] make example pass check-xml --- example/sequences.xml | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/example/sequences.xml b/example/sequences.xml index 360038951..4c9e0db4c 100644 --- a/example/sequences.xml +++ b/example/sequences.xml @@ -3,23 +3,23 @@ - - + - + - @@ -84,7 +84,7 @@ may be shared between many sensitive detectors. Alternatively filters may be directly attached to the sensitive detector in question. Attributes are directly passed as properties to the filter action. - + Note: registered global filters MUST be unique. However, not all filters need to registered.... --> @@ -114,7 +114,7 @@ Note: Action sequences exist for each of the various geant4 callback, which are explained in the documentation, such as EventAction, RunAction, etc and the calls after processing the hits of each sensitive detector. - + --> @@ -162,13 +162,13 @@ - + - + @@ -180,7 +180,7 @@ - + @@ -189,8 +189,8 @@ - - + + @@ -210,12 +210,12 @@ - - - - - + + + + + @@ -251,6 +251,6 @@ applyBirksLawFlag="false"/> - +