From 72c9480c116cd80dab6d7eb96c8a3abf955bd152 Mon Sep 17 00:00:00 2001 From: Armin Ilg Date: Thu, 19 Sep 2024 17:45:16 +0200 Subject: [PATCH] IDEA vertex and silicon wrapper for IDEA_o1_v03 (#363) * Leaving ZPlanarTracker as it is but instead make a new VertexBarrel_o1_v01_geo module * Added ability to have flex and support consisting of multiple components, ability to tilt whole modules. * First implementation of IDEA end-cap and adaption of barrel * Version of Barrel with correct sensitive surfaces (use teveDisplay to show them) * Improved structure of barrel detectors (layer - ladder+sensors) * Progress: The surface arrows are now displayed in the endcap, but the volumes not yet * Whole barrel is properly visible in teveDisplay, but don't mange to make good assembly structure * Also endcap shows all volumes in teveDisplay, but bad hierarchy * Endcap and barrel now run through ddsim overlap checker (overlaps still there) * IDEA Vertex working with ddsim, some overlaps still to be understood * Not working teveDisplay, endcap digitisation not working probably therefore * Fixed endcap, all surfaces visible in teveDisplay, managed to run ddsim and fccRec_e4h with vertex digitisation, but no vertices reco'd yet, bad hierarchy again * Non-working version, the sensitive volumes are wrong, no idea why, use the previous commit * Bad hierarchy, but otherwise working * Found way to remove mother volumes in sensitive and passives. Now all overlaps in Endcap gone * Removing unneeded lines * Recomputing bounding boxes, hasn't fixed the problem yet * Adding IDEA as FCCee_IDEA_o1_v01, not final yet, need to make sure that latest beam pipe and other files are used. There's also still an overlap between the CAD-imported vertex support and the vertex barrel * Adding again deleted file * Reverting changes to VertexBarrel_o1_v01_geo.cpp * Adding scripts * Addressing comments from MR, adding some tests for DDCAD files * Add DDCAD test * Adding test * Renamed constructor files * Changing naming convention to Vertex inner barrel, vertex outer barrel and vertex disks, adding working DDCAD import of vertex inner barrel support (using material budget estimation from FCCSW not working yet though, need to use g4MaterialScan). Adding example on how I install k4geo locally (install.sh) * SingleShape_geo not needed for DDCAD import, instead using DD4hep_TestShape_Creator from DD4hep * Changing CAD shape name * Adding all plotting scripts * Renaming constructor files, adding in latest changes * Add README file for the vertex detector constructors, remove HOM absorber * Make scripts working with command line input argument for xml file * Change folder structure as sugested by Brieuc * Fixed some paths * Testing test... * Increasing timeout for IDEA test * Fixing test * Using .obj file for Vertex inner barrel support instead of .stl, running now without Geant4 exceptions * Adding back hierarchy of vertex detector elements, visualisation does not work in teveDisplay (for the whole vertex) or in geoDisplay (for the disks), but is working when using scripts/build_view.sh * Add missing periphery components to outer barrel * Fix simulate script * ATLASPix3 modules were 90 degrees rotated, now fixed. Furthermore wrong distance between individual chips fixed * Removing unnecessary line * Test is working now for the key4hep nightly release, decreasing large timeout again * Reducing hierarchy by one level in the endcaps, so that it's visible in geoDisplay. Apparently three levels of hierarchy of assemblies is the limit, otherwise geoDisplay will not show the volumes. It is not working in teveDisplay however * Small script fixes * Moving IDEA scripts to FCCee/scripts as they are generally usable * Fixing paths using a /afs/cern.ch/user/a/afehr/lcgeo global variable * Cannot use environmental variable before it's defined * Found another way to get the correct paths for the scripts, using /cvmfs/sw-nightlies.hsf.org/key4hep/releases/2023-07-22/x86_64-centos7-gcc12.2.0-opt/k4geo/1c08affe597cf3b1c10c4e81cdbc95ab9e4a4d23=develop-q7e4mj/share/k4geo/compact for the DDCAD import in Vertex_IDEA_o1_v01.xml, should work once merged and added to the key4hep nightly * Deleting utils inside of IDEA folder * Addressing last comments from Andre * Adding suggested change to dd4hep2root * Addressing comments by Andre, still need to copy beam pipe from CLD * Using same beampipe as in CLD_o2_v05 * Renaming beampipe to match with CLD beampipe (identical at the moment, change name when they differ) * Fixing test and have correct name for beampipe also in main xml file. The test will only run once the IDEA folder is in the nightly Key4hep software stack * Moved volume creation within main part of program, so that correct volume names can be assigned. Furthermore changed DetElements in barrel constructor so that they can be properly accessed in k4RecTracker * Added functionality to have end of stave structures in vertex barrel. This is applied in the IDEA vertex detector. Other than this, also the width of the sensor support in the vertex barrel was corrected to be only 4.4 mm wide (instead of 8.8) * Added end-of-stave structures or proxies as well for the outer barrel, only end-cap missing * Making proxy end-of-stave structure smaller to not have overlaps * Unified description of readout and support structures, now called components. Multiple components can be added per stave and the name will be used to name the corresponding assembly. Furthermore fixed the sensitive/periphery regions in VTXIB layers 2 and 3 to be correct * Fixing volIDs in barrel, adding end-of-stave structures in barrel and end-cap. * Correcting material in beam pipe * Fixing test and for the moment comment out the vertex inner barrel support as it will fail the test, since the CAD file cannot be found. After the IDEA detector is in a nightly release, then the CAD file will be found and we can include these lines in the xml again * Changing to IDEA_o1_v02 * Add back vertex inner barrel support, other minor changes * Adding first version of Si wrapper * Add PC * Thanks to changes in FCCSW and DD4hep, now plotstyle.py from FCCSW can be imported directly and the DDCAD file can be imported in the same way as .xml files * Use VTXOB_r_max from dimensions in vertex detector. Not done yet for z max * Changing L3 of vertex inner barrel, and added possibility to have every second stave offset in r * Surfaces finally working, had to decrease the hierarchy of DetElements * Making detector constructors more efficient (more intermediate assemblies) and finalisation of first Si wrapper layout * Removing one level of DetElements, as otherwise the surfaces are not correctly added by Surfacemanager * Made the hole in Si wrapper barrel larger, not compatible with numbers from https://fcc-ee-detector-full-sim.docs.cern.ch/IDEA/ * Improving description of IDEA vertex disks, they should now match the design quite well. It includes rotation of disks of the two sides relative to each other and the correct staggering of staves in the disks * Updating VertexSupport to have origin at the IP and to have already a correct rotation * Correctly renaming VertexSupport * Removing overlaps in Si wrapper and vertex, filling holes in Si wrapper coverage with shorter tile and fixing the subdetector assembly of the Si wrapper * scripts/save_detector_to_root.sh can be provided with a second argument to define the output file name * Fixing change coming from wrong git rebase * Adding default values to offset in vertexBarrel end_z structures * Making Si Disk go to larger radii, as otherwise a large area is not covered by the barrel. Will need to investigate to instead make the barrel longer or put the disk closer to the IP * Fix some overlap * Put mistakingly deleted files back * Revert some stupid git mistake * Fixing some other git mistakes * Remove whitespace change * Remove whitespace change * Adding default dz value for endOfStave structure * Getting rid of one overlap, there is still one hidden somewhere in the Si wrapper * Trying to pass test without the DDCAD vertex support * Adding vertex support again as this is not the culprit * Reducing vertex clearance from IP further so that Vertex disks are fully in envelope * Adding module functionality to ZPlanarTracker_geo * Removing unnecessary includes in vertex constructors and fix VertexBarrel constructor problem * Increasing timeout for IDEA test * Small changes to fix visualisation * Merging inner and outer vertex barrel into one constructor to enable simper usage of CLD Reconstruction. Since the sensors have different pitches, the segmentation is removed. Need to find a solution to add different segmentations for different layers in the same detector * Adding first version of curved vertex * Revert "Merging inner and outer vertex barrel into one constructor to enable simper usage of CLD Reconstruction. Since the sensors have different pitches, the segmentation is removed. Need to find a solution to add different segmentations for different layers in the same detector" This reverts commit 96b28244490bd027c964eaad0b25a2188884c0f3. * Changing description * Separating inner vertex and outer vertex into two different files, so that inner vertex can more simply be replaced by curved vertex concept * Adding CLD with IDEA vertex * Removing assembly that is put into world and instead place the envelope (volume) there. Leave assemblies in detector constructors as they are * Adding LiquidNDecane to list, to ignore beam pipe material budget * Adding some way to reduce overlaps, but the curved structures require a very high artificial separation in r not to be detected as overlaps. Remaining overlap is between the envelopes and between the inner barrel envelope and beam pipe * Fix disk envelope * Changes to CLDwithIDEAvertex * Getting rid of overlap between endcap and outer barrel envelopes * Commenting out CAD volume for the moment * Fixing detID * Fixed all overlaps except for between disk environment and first disk. This is difficult to fix since the inner barrel is inserted inside the disks and is inside the space for the first disk, but no actual collision. Dont know yet how to fix * Fix to avoid overlaps * Temp fix for overlaps * Actually working version of CLD with IDEA vertex * Working configuration, fixing orientation of sensitive volumes in vertex inner barrel * Adding install.sh file * IDEA vertex detector outer barrel uses as well Cylindrical constructor, adding support for having multiple wafers/staves in z, have vertex inner and outer barrel in same constructor in order to have same detector ID (needed by iLCSoft), replacing some assemblies by volumes in Cylindrical constructor * Working! * Use same readout names as for CLD * My CLD with IDEA vertex * Making curved vertex asymmetric in layer 3 and 4, removing some longerons, and changing gap to 1.25 mm * Adding ability to have asymmetrical designs for the vertex detector, by using side=+1 or -1, to use a second wafer or stave with a different number of modules * Adding metal layer to curved vertex, fix module id issue by removing pixel segmentation, ... * VertexCylindrical now working with mother volume option (for Silicon wrapper), doing some final checks * Fix extrusion of longerons with mother volume * Fixed flex overlaps * Got rid of ALL overlaps in inner vertex (normal and ultra-light) and outer vertex. Need to include new inner vertex conical support * Removed all overlaps in both detectors. Added the inner vertex tube. Commented out the inner vertex support and the cooling cones as they produce overlaps (with themselves and with the vertex). * Fixed mother volume usage in silicon wrapper * All overlaps gone, also in Silicon Wrapper. Silicon Wrapper performant enough, very quick to build geometry and also easily viewable when exported to root file. Using one very long sensor in the silicon wrapper barrel and large sensors in the disks to reduce number of sensitive surfaces, which was taking very long. Everything else is with the same amount of detail however. Silicon wrapper geometry still the same as presented in Annecy Jan 2024 * Moving to v03 of IDEA, no overlaps found! * Updating my CLD_IDEAvertex * New branch with only IDEA_o1_v03 * Removing changes to v02 * Fixing v02 * Fixing v02, finally * Not working version, investigating * Add bounding boxes to assemblies - fixing bad reconstruction when using iLCSoft track reco * Removing old (non-curved) vertex barrel constructor. * Renaming VertexCylindrical to VertexBarrel and increase version of vertex constructors to o1_v02 * Updating README * Adding curved vertex sensitive surfaces (see DD4hep MR as well) * Final changes to have sensitive VolCylinder surface positioned correctly and having the origin vector pointing outwards * Addressing comments and update ALLEGRO, move some visibilities into the subdetector xml files * Fixing some final things for the PR * Fixing wrong VertexEndcap file * And also o1_v01 endcap file * WIP towards an updated silicon wrapper, with a more realistic geometry. Started with barrel * Adding Silicon Wrapper for ALLEGRO, reverting lumical vis change, formatting, correcting readout for vertex and silicon wrapper in ALLEGRO, adding drift chamber readout ID in ALLEGRO, using built-in pi * Removing mistakingly added drift chamber readout ID * Now have a rough version of how the SiWr updated barrel could look like. Added functionality to define layers without sensors (used for complex support structures), adjusted vertex accordingly * Properties of to-be-added global disk support proxies. Will need feature from SiliconWrapper branch to do this * Start adding disk proxy volumes * Finally made vertex disk supports running correctly (they had a wrongly defined mother volume). DDCAD files look fine in display, but need DD4hep material budget estimation for them (doesn't work with FCCSW estimation) * Renaming VertexBarrel_detailed * Comment out DDCAD files * Rotating inner vertex tube, making insensitive regions in phi for curved vertex * Changed inner vertex tube to use just 200 um of carbon fiber and have a continuous tube for the ultra-light vertex (afte discussions with Fabrizio) * Going full detail for the curved vertex, adding feature to name sensor components * Use as default the classic vertex * Removing again CLDIDEAvertex * For the moment remove updated silicon wrapper * Adding Rohacell to ALLEGRO, no overlaps in vertex/silicon wrapper * Update tests, also change to new vertex and silicon wrapper there * Remove .stl files, add them later in the same way as MDI files * Fixing silicon wrapper path... * Update utils/material_plots.py Co-authored-by: Andre Sailer --------- Co-authored-by: Armin Fehr Co-authored-by: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Co-authored-by: Armin Ilg Co-authored-by: Andre Sailer --- .../compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml | 5 +- .../compact/ALLEGRO_o1_v03/DectDimensions.xml | 105 +- .../ALLEGRO_o1_v03/SiliconWrapper_o1_v03.xml | 1 + .../VertexComplete_IDEA_o1_v03.xml | 1 + .../ALLEGRO_o1_v03/Vertex_IDEA_o1_v01.xml | 1 - .../compact/ALLEGRO_o1_v03/materials.xml | 7 +- .../DectDimensions_IDEA_o1_v03.xml | 175 +- .../IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml | 8 +- .../IDEA_o1_v03/SiliconWrapper_o1_v03.xml | 838 +++++++ .../VertexComplete_IDEA_o1_v03.xml | 1972 +++++++++++++++++ .../IDEA_o1_v03/Vertex_IDEA_o1_v01.xml | 726 ------ ...erials_o1_v02.xml => materials_o1_v03.xml} | 32 +- FCCee/IDEA/compact/README.md | 3 + detector/tracker/README.md | 10 +- .../VertexBarrel_detailed_o1_v01_geo.cpp | 2 +- .../VertexBarrel_detailed_o1_v02_geo.cpp | 544 +++++ .../VertexEndcap_detailed_o1_v01_geo.cpp | 2 +- .../VertexEndcap_detailed_o1_v02_geo.cpp | 426 ++++ scripts/save_detector_to_root.sh | 3 +- test/compact/DCH_standalone_o1_v02.xml | 2 +- test/compact/IDEA_withDRC_o1_v03.xml | 6 +- utils/material_plots.py | 10 +- utils/material_plots_2D.py | 3 +- 23 files changed, 3985 insertions(+), 897 deletions(-) create mode 120000 FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/SiliconWrapper_o1_v03.xml create mode 120000 FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/VertexComplete_IDEA_o1_v03.xml delete mode 120000 FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/Vertex_IDEA_o1_v01.xml create mode 100644 FCCee/IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.xml create mode 100644 FCCee/IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml delete mode 100644 FCCee/IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml rename FCCee/IDEA/compact/IDEA_o1_v03/{materials_o1_v02.xml => materials_o1_v03.xml} (94%) create mode 100644 detector/tracker/VertexBarrel_detailed_o1_v02_geo.cpp create mode 100644 detector/tracker/VertexEndcap_detailed_o1_v02_geo.cpp diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml index 7f2b2fb3f..fc2ca3b09 100644 --- a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml +++ b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml @@ -41,8 +41,9 @@ - - + + + diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml index d100e0a0f..82f00d088 100644 --- a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml +++ b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml @@ -18,36 +18,38 @@ - - - - - + - - - - - - - + + + + + + + + + + + + + - - + + - - - - - - - - - - - + + + + + + + + + + + @@ -79,14 +81,29 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -96,6 +113,16 @@ + + + + + + + + + + @@ -213,18 +240,16 @@ - - + - - + + - - - + + diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/SiliconWrapper_o1_v03.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/SiliconWrapper_o1_v03.xml new file mode 120000 index 000000000..70972fa9c --- /dev/null +++ b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/SiliconWrapper_o1_v03.xml @@ -0,0 +1 @@ +../../../IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.xml \ No newline at end of file diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/VertexComplete_IDEA_o1_v03.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/VertexComplete_IDEA_o1_v03.xml new file mode 120000 index 000000000..b0bf97dfa --- /dev/null +++ b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/VertexComplete_IDEA_o1_v03.xml @@ -0,0 +1 @@ +../../../IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml \ No newline at end of file diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/Vertex_IDEA_o1_v01.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/Vertex_IDEA_o1_v01.xml deleted file mode 120000 index cfab0871b..000000000 --- a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/Vertex_IDEA_o1_v01.xml +++ /dev/null @@ -1 +0,0 @@ -../../../IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml \ No newline at end of file diff --git a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/materials.xml b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/materials.xml index 338606639..4b0956cc5 100644 --- a/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/materials.xml +++ b/FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/materials.xml @@ -236,6 +236,11 @@ + + + + + @@ -243,7 +248,7 @@ - + diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/DectDimensions_IDEA_o1_v03.xml b/FCCee/IDEA/compact/IDEA_o1_v03/DectDimensions_IDEA_o1_v03.xml index e662f7a58..3a6e0fd32 100644 --- a/FCCee/IDEA/compact/IDEA_o1_v03/DectDimensions_IDEA_o1_v03.xml +++ b/FCCee/IDEA/compact/IDEA_o1_v03/DectDimensions_IDEA_o1_v03.xml @@ -18,47 +18,46 @@ - - - - - - + + - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + - - - - - - + + - - + + + + + + + - + @@ -83,21 +82,36 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + @@ -105,6 +119,16 @@ + + + + + + + + + + @@ -220,47 +244,34 @@ - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -269,9 +280,7 @@ - - @@ -281,7 +290,9 @@ - + + + diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml b/FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml index 949c55eb7..213071c79 100644 --- a/FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml +++ b/FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml @@ -7,7 +7,7 @@ @@ -20,7 +20,7 @@ - + @@ -46,13 +46,13 @@ - + - + diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.xml b/FCCee/IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.xml new file mode 100644 index 000000000..f55707337 --- /dev/null +++ b/FCCee/IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.xml @@ -0,0 +1,838 @@ + + + + + A Silicon Wrapper layer for the FCC-ee IDEA detector concept with timing to enable excellent PID together with drift chamber. + + Silicon wrapper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${GlobalTrackerReadoutID} + + + + ${GlobalTrackerReadoutID} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Silicon wrapper disks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml b/FCCee/IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml new file mode 100644 index 000000000..a82899dff --- /dev/null +++ b/FCCee/IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml @@ -0,0 +1,1972 @@ + + + + + A Vertex Detector for the FCC-ee IDEA detector concept, based on the engineered design by Fabrizio Palla and Filippo Bosi (INFN Pisa), implemented in DD4hep by Armin Ilg (UZH) + + Vertex inner barrel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vertex Assembly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${GlobalTrackerReadoutID} + + + ${GlobalTrackerReadoutID} + + + ${GlobalTrackerReadoutID} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vertex Detector Disks + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml b/FCCee/IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml deleted file mode 100644 index c38d19da7..000000000 --- a/FCCee/IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml +++ /dev/null @@ -1,726 +0,0 @@ - - - - - A Vertex Detector for the FCC-ee IDEA detector concept, based on the engineered design by Fabrizio Palla and Filippo Bosi (INFN Pisa) - - Vertex detector - - - - - - - - - - - - - Vertex Assembly - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${GlobalTrackerReadoutID} - - - ${GlobalTrackerReadoutID_OB} - - - ${GlobalTrackerReadoutID_Disk} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vertex Detector Disks - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v02.xml b/FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v03.xml similarity index 94% rename from FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v02.xml rename to FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v03.xml index 189bc202e..c7f888533 100644 --- a/FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v02.xml +++ b/FCCee/IDEA/compact/IDEA_o1_v03/materials_o1_v03.xml @@ -131,26 +131,11 @@ - - - - + + + - - - - - - - - - - - - - - @@ -185,7 +170,7 @@ - + @@ -272,15 +257,6 @@ - - - - - - - - - diff --git a/FCCee/IDEA/compact/README.md b/FCCee/IDEA/compact/README.md index fed6cf941..95f958f11 100644 --- a/FCCee/IDEA/compact/README.md +++ b/FCCee/IDEA/compact/README.md @@ -20,3 +20,6 @@ v02). NB: production threshold and step limit physics have to be tuned for the d July 2024: Added a detailed version of the muon system. The monolithic fiber dual-readout calorimeter (o1, v01) is added to the directory, but commented in the main file IDEA_o1_v03.xml for the sake of speed. Please remove the comments to include this calorimeter in the full IDEA detector. + +August 2024: Added an updated vertex detector (also with the ultra-light inner vertex option) and a more light-weight +implementation of the silicon wrapper. \ No newline at end of file diff --git a/detector/tracker/README.md b/detector/tracker/README.md index d2e213cfe..e95f83e0d 100644 --- a/detector/tracker/README.md +++ b/detector/tracker/README.md @@ -1,10 +1,16 @@ # Vertex detectors -## VertexBarrel_detailed and VertexDisks_detailed description +## VertexBarrel_detailed and VertexEndcap_detailed description + +### o1_v01 These two detector constructors were derived from ZPlanarTracker.cpp and from VertexEndcap_o1_v06.cpp and adapted to fit the needs of the [IDEA vertex detector engineering design](https://indico.cern.ch/event/1202105/timetable/#242-mechanical-integration-of). Both the barrel and the disks are made up of staves, that can feature an arbitrary number of cuboid layers to describe the support, readout and sensor structures. The sensors can be described by individual sensitive and insensitive pieces to form large, complex structures such as quad modules, that have an insensitive periphery. -More details can be found in the talks at the [FCC week 2023](https://indico.cern.ch/event/1202105/timetable/#356-idea-vertex-detector-in-ke) with an update the the [MDI meeting of the 10th of July 2023](https://indico.cern.ch/event/1292318/#5-vxd-implementation-in-full-s). Once public, the constructor and the resulting IDEA vertex detector are described in the MDI note for the mid-term review. +More details can be found in the talks at the [FCC week 2023](https://indico.cern.ch/event/1202105/timetable/#356-idea-vertex-detector-in-ke) with an update the the [MDI meeting of the 10th of July 2023](https://indico.cern.ch/event/1292318/#5-vxd-implementation-in-full-s). The constructor and the resulting IDEA vertex detector are described in the MDI note for the mid-term review (not public). + +### o1_v02 +These versions for the vertex barrel and disks fix previous issues with overlaps and enable to define in the xml file mother volumes to speed up the simulation by having less volumes per node in the volume hierarchy (especially relevant for the large-area silicon wrapper that also uses these constructors). +o1_v02 of the barrel also enables the use of curved support and sensor volumes needed to describe the ultra-light vertex detector proposed in the 2024 [FCC Physics Workshop](https://indico.cern.ch/event/1307378/timetable/?view=standard#84-vertex-detector-and-silicon) and [FCC Week](https://indico.cern.ch/event/1298458/timetable/#15-optimization-of-si-tracking). # Trackers diff --git a/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp b/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp index 801c854c2..04f4d24b6 100644 --- a/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp +++ b/detector/tracker/VertexBarrel_detailed_o1_v01_geo.cpp @@ -375,4 +375,4 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se return sdet; } -DECLARE_DETELEMENT(VertexBarrel_detailed_o1_v01,create_element) +DECLARE_DETELEMENT(VertexBarrel_detailed_o1_v01,create_element) \ No newline at end of file diff --git a/detector/tracker/VertexBarrel_detailed_o1_v02_geo.cpp b/detector/tracker/VertexBarrel_detailed_o1_v02_geo.cpp new file mode 100644 index 000000000..691e9736a --- /dev/null +++ b/detector/tracker/VertexBarrel_detailed_o1_v02_geo.cpp @@ -0,0 +1,544 @@ +// $Id: $ +//==================================================================== +// Based on ZPlanarTracker module from F. Gaede + +// Tracking detector to describe the FCC-ee IDEA vertex detector barrel. +// The vertex detector is assembled of stave structures which feature +// support and readout (flex) elements. Each stave features multiple +// individual modules, that consist of sensitive and insensitive +// sensor elements. From o1_v02 it is possible to define curved +// sensor and support elements. +//-------------------------------------------------------------------- +// +// Author : Armin Ilg +// +//==================================================================== +#include "DD4hep/DetFactoryHelper.h" +#include "XML/Utilities.h" +#include "XMLHandlerDB.h" +#include +#include "DDRec/Surface.h" + +using namespace std; + +using dd4hep::Assembly; +using dd4hep::Box; +using dd4hep::Tube; +using dd4hep::BUILD_ENVELOPE; +using dd4hep::DetElement; +using dd4hep::Detector; +using dd4hep::Material; +using dd4hep::PlacedVolume; +using dd4hep::Position; +using dd4hep::Ref_t; +using dd4hep::RotationZYX; +using dd4hep::SensitiveDetector; +using dd4hep::Transform3D; +using dd4hep::Translation3D; +using dd4hep::Volume; +using dd4hep::getAttrOrDefault; +using dd4hep::_toString; + +using dd4hep::rec::volSurfaceList; +using dd4hep::rec::Vector3D; +using dd4hep::rec::VolPlane; +using dd4hep::rec::VolCylinder; +using dd4hep::rec::SurfaceType; + +static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector sens) { + + xml_det_t x_det = e; + int m_id=0; + std::string det_name = x_det.nameStr(); + + DetElement sdet( det_name, x_det.id() ) ; + PlacedVolume pv; + + Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; + dd4hep::xml::setDetectorTypeFlag( e, sdet ) ; + + if( theDetector.buildType() == BUILD_ENVELOPE ) return sdet ; + + envelope.setVisAttributes(theDetector, x_det.visStr()); + sens.setType("tracker"); + + // Struct to support multiple readout or support layers (both using this struct) + struct componentsStruct{ + string name; + double r; + double offset; + double length; + double z_offset; + vector thicknesses; + vector offsets; + vector z_offsets; + vector rs; + vector phis; + vector volumes; + vector isCurved; + }; + + // Struct to support end-of-stave structures + struct endOfStaveStruct{ + string name; + double r; + double offset; + double z_offset; + vector thicknesses; + vector lengths; + vector dzs; + vector offsets; + vector z_offsets; + vector rs; + vector volumes; + vector side; + vector isCurved; + }; + + // Struct for sensors + struct sensorsStruct{ + string name; + double r; + double offset; + double thickness; + Material material; + vector sensitives; + vector xmin; + vector xmax; + vector ymin; + vector ymax; + vector phi_offsets; + vector names; + vector isCurved; + double width; + double length; + vector volumes; + }; + + // --- Module information struct --- + struct stave_information{ + string name; + double motherVolThickness; + double motherVolWidth; + + vector components_vec; + vector endOfStaves_vec; + vector sensorsVec; + + double stave_dr; + double stave_r; + double stave_length; + string staveVis; + }; + list stave_information_list; + + // --- Collect stave(s) information + for(xml_coll_t mi(x_det,_U(stave)); mi; ++mi, ++m_id) { + xml_comp_t x_stave = mi; + + stave_information m; + m.name = x_stave.nameStr(); + m.staveVis = x_stave.visStr(); + m.stave_length = x_stave.length(); + + m.stave_dr = x_stave.dr(0); // Offset for every second module in r + m.stave_r = x_stave.r(0); // Radius of stave + + m.motherVolThickness = getAttrOrDefault(x_stave, _Unicode(motherVolThickness), double(0.0)); + m.motherVolWidth = getAttrOrDefault(x_stave, _Unicode(motherVolWidth), double(0.0)); + + // Components + xml_coll_t c_components(x_stave,_U(components)); + for(c_components.reset(); c_components; ++c_components){ + componentsStruct components; + components.name = xml_comp_t(c_components).nameStr(); + components.r = xml_comp_t(c_components).r(0); + components.length = xml_comp_t(c_components).length(); + components.offset = xml_comp_t(c_components).offset(0); + components.z_offset = xml_comp_t(c_components).z_offset(0); + + + xml_coll_t c_component(c_components,_U(component)); + int iComponent = 0; + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + components.thicknesses.push_back(component.thickness()); + components.offsets.push_back(component.offset(0)); + components.z_offsets.push_back(component.z_offset(0)); + components.rs.push_back(component.r(0)); + components.phis.push_back(component.phi(0)); // Rotation of component around its own axis, not applicable for curved components + + bool isCurved = getAttrOrDefault(component, _Unicode(isCurved), bool(false)); + components.isCurved.push_back(isCurved); + Volume ele_vol; + + if(isCurved){ + double rmin = m.stave_r + components.r+components.rs.back(); + double half_width = component.width()/(2.*M_PI*rmin)*(2.0*M_PI)/2.; + double phi_offset = getAttrOrDefault(component, _Unicode(phi_offset), double(0.0)); + Tube ele_box = Tube(rmin, rmin+components.thicknesses.back(), components.length, -half_width + phi_offset, half_width + phi_offset); + ele_vol = Volume(components.name + _toString(iComponent, "_%d"), ele_box, theDetector.material(component.materialStr())); + } + else{ + Box ele_box = Box(component.thickness()/2., component.width()/2., components.length); + ele_vol = Volume(components.name + _toString(iComponent, "_%d"), ele_box, theDetector.material(component.materialStr())); + } + ele_vol.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), component.visStr()); + components.volumes.push_back(ele_vol); + + iComponent++; + } + m.components_vec.push_back(components); + } + + // End of stave structures + xml_coll_t c_endOfStave(x_stave,_U(end_z)); + for(c_endOfStave.reset(); c_endOfStave; ++c_endOfStave){ + endOfStaveStruct endOfStave; + endOfStave.offset = xml_comp_t(c_endOfStave).offset(0); + endOfStave.z_offset = xml_comp_t(c_endOfStave).z_offset(0); + endOfStave.r = xml_comp_t(c_endOfStave).r(0); + endOfStave.name = xml_comp_t(c_endOfStave).nameStr(); + + xml_coll_t c_component = xml_coll_t(c_endOfStave,_U(component)); + int iEndOfStave = 0; + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + endOfStave.thicknesses.push_back(component.thickness()); + endOfStave.dzs.push_back(component.dz(0)); + endOfStave.offsets.push_back(component.offset(0)); + endOfStave.z_offsets.push_back(component.z_offset(0)); + endOfStave.lengths.push_back(component.length()); + endOfStave.rs.push_back(component.r(0)); + + int side = getAttrOrDefault(component, _Unicode(side), int(0)); + + endOfStave.side.push_back(side); // 0 for both sides (default), +1 for +z side, -1 for -z side + bool isCurved = getAttrOrDefault(component, _Unicode(isCurved), bool(false)); + endOfStave.isCurved.push_back(isCurved); + Volume ele_vol; + + if(isCurved){ + double rmin = m.stave_r + endOfStave.r+endOfStave.rs.back(); + double half_width = component.width()/(2.*M_PI*rmin)*(2.0*M_PI)/2.; + double phi_offset = getAttrOrDefault(component, _Unicode(phi_offset), double(0.0)); + Tube ele_box = Tube(rmin, rmin+endOfStave.thicknesses.back(), component.length()/2., -half_width + phi_offset, half_width + phi_offset); + ele_vol = Volume(endOfStave.name + _toString(iEndOfStave, "_%d"), ele_box, theDetector.material(component.materialStr())); + } + else{ + Box ele_box = Box(component.thickness()/2., component.width()/2., component.length()/2.); + ele_vol = Volume(endOfStave.name + _toString(iEndOfStave, "_%d"), ele_box, theDetector.material(component.materialStr())); + } + ele_vol.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), component.visStr()); + + endOfStave.volumes.push_back(ele_vol); + iEndOfStave++; + } + m.endOfStaves_vec.push_back(endOfStave); + } + + // Sensor + xml_coll_t c_sensor(x_stave,_U(sensor)); + for(c_sensor.reset(); c_sensor; ++c_sensor){ + sensorsStruct sensor; + + sensor.r = xml_comp_t(c_sensor).r(0); + sensor.offset = xml_comp_t(c_sensor).offset(0); + sensor.thickness = xml_comp_t(c_sensor).thickness(); + sensor.material = theDetector.material(xml_comp_t(c_sensor).materialStr()); + sensor.name = xml_comp_t(c_sensor).nameStr(); + + xml_coll_t c_component = xml_coll_t(c_sensor,_U(component)); + int iSensor = 0; + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + sensor.sensitives.push_back(component.isSensitive()); + sensor.xmin.push_back(component.xmin()); + sensor.xmax.push_back(component.xmax()); + sensor.ymin.push_back(component.ymin()); + sensor.ymax.push_back(component.ymax()); + sensor.names.push_back(component.nameStr("sensor")); + + sensor.phi_offsets.push_back(getAttrOrDefault(component, _Unicode(phi_offset), double(0.0)) ); + + bool isCurved = getAttrOrDefault(component, _Unicode(isCurved), bool(false)); + sensor.isCurved.push_back(isCurved); + + // Already create volumes for all sensor components as this is independent of number of sensors per layer + Volume ele_vol; + if(isCurved){ + double rmin = m.stave_r + sensor.r; + double half_width = abs(component.xmax()-component.xmin())/rmin/2.; + double phi_offset = getAttrOrDefault(component, _Unicode(phi_offset), double(0.0)); + Tube ele_box = Tube(rmin, rmin + sensor.thickness, abs(component.ymax()-component.ymin())/2., -half_width+phi_offset, half_width+phi_offset); + ele_vol = Volume(sensor.names.back() + _toString(iSensor, "_%d"), ele_box, sensor.material); + } + else{ + Box ele_box = Box(sensor.thickness/2., abs(component.xmax()-component.xmin())/2., abs(component.ymax()-component.ymin())/2.); + ele_vol = Volume(sensor.names.back() + _toString(iSensor, "_%d"), ele_box, sensor.material); + } + + if(sensor.sensitives.back()) + ele_vol.setSensitiveDetector(sens); + ele_vol.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), component.visStr()); + sensor.volumes.push_back(ele_vol); + + iSensor++; + } + sensor.width = *max_element(sensor.xmax.begin(), sensor.xmax.end()) - *min_element(sensor.xmin.begin(), sensor.xmin.end()); + sensor.length = *max_element(sensor.ymax.begin(), sensor.ymax.end()) - *min_element(sensor.ymin.begin(), sensor.ymin.end()); + cout << det_name << ": Module: " << sensor.name << ", sensor width: " << to_string(sensor.width) << ", sensor length: " << to_string(sensor.length) << endl; + m.sensorsVec.push_back(sensor); + } + + stave_information_list.push_back(m); + cout << "Read stave information of stave " << m.name << endl; + } + + int iModule_tot = 0; + + //========= loop over layer elements in xml ====================================== + + cout << "Building " << det_name << " barrel detector " << det_name << "..." << endl; + for(xml_coll_t c(e, _U(layer) ); c; ++c) { + + xml_comp_t x_layer( c ); + + // child elements: ladder, sensitive and periphery + + int layer_id = x_layer.id(); + int side = getAttrOrDefault(x_layer, _Unicode(side), 0); // Use side=1 or -1 to use two staves/wafers with the same layer id + + double dr = x_layer.dr(0); // Spacing in r for every second stave. + double layer_offset = x_layer.offset(0); + double z_offset = x_layer.z_offset(0); + + string nameStr = x_layer.nameStr(); + int nmodules = x_layer.nmodules(); + double step = x_layer.step(0); // Spacing of modules + + + // Use the correct stave + auto m = *find_if(stave_information_list.cbegin(), stave_information_list.cend(), [&nameStr] (const stave_information& stave) { + return stave.name == nameStr; + }); + + + double motherVolThickness = getAttrOrDefault(x_layer, _Unicode(motherVolThickness), double(5.0)); + double motherVolLength = getAttrOrDefault(x_layer, _Unicode(motherVolLength), double(m.stave_length)); + double motherVolOffset = getAttrOrDefault(x_layer, _Unicode(motherVolOffset), double(0.0)); // In case wafer/stave is asymmetric + + std::string layer_name = det_name+_toString(layer_id,"_layer%d")+_toString(side,"_side%d"); + double motherVolRmin = getAttrOrDefault(x_layer, _Unicode(motherVolRmin), double(x_layer.r())); + Tube whole_layer_tube = Tube(motherVolRmin, motherVolRmin+motherVolThickness, motherVolLength/2.); + + Volume whole_layer_volume = Volume(layer_name, whole_layer_tube, theDetector.material("Air")); + whole_layer_volume.setVisAttributes(theDetector, x_layer.visStr()); + pv = envelope.placeVolume(whole_layer_volume, Position(0., 0., z_offset)); + pv.addPhysVolID("layer", layer_id); + + DetElement layerDE( sdet , _toString(layer_id,"layer_%d")+_toString(side,"_side%d"), x_det.id() ); + layerDE.setPlacement( pv ) ; + + int nLadders = x_layer.attr( _Unicode(nLadders) ) ; + double dphi = 2.*M_PI / double(nLadders); + double phi0 = x_layer.phi0(0); + + //--------- loop over ladders --------------------------- + for(int iStave=0; iStave0.0 && m.motherVolWidth>0.0){ + + r = layer_r + m.motherVolThickness/2.; + x_pos = r*cos(phi) - r_offset_component*sin(phi); + y_pos = r*sin(phi) + r_offset_component*cos(phi); + Box whole_stave_box = Box(m.motherVolThickness/2., m.motherVolWidth/2., m.stave_length/2.); + whole_stave_volume_v = Volume(stave_name, whole_stave_box, theDetector.material("Air")); + whole_stave_volume_v.setVisAttributes(theDetector, m.staveVis); + whole_stave_volume_placed = whole_layer_volume.placeVolume(whole_stave_volume_v, Transform3D(rot,Position(x_pos, y_pos, z_pos))); + } + else{ + //// Use just assembly to avoid overlap between stave volume and other volumes + whole_stave_volume_a = Assembly(stave_name); + whole_stave_volume_placed = whole_layer_volume.placeVolume(whole_stave_volume_a, Transform3D(rot,stave_pos)); + } + + // Place components + for(auto& component : m.components_vec){ + Assembly component_assembly(stave_name + "_" + component.name); + if(m.motherVolThickness>0.0 && m.motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(component_assembly, Position(-m.motherVolThickness/2., 0., 0.)); + else + pv = whole_stave_volume_a.placeVolume(component_assembly); + + for(int i=0; iGetShape()->ComputeBBox(); + } + + // Place end of stave structures + for(auto& endOfStave : m.endOfStaves_vec){ + Assembly endOfStave_assembly(stave_name + "_" + endOfStave.name); + if(m.motherVolThickness>0.0 && m.motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(endOfStave_assembly, Position(-m.motherVolThickness/2., 0., 0.)); + else + pv = whole_stave_volume_a.placeVolume(endOfStave_assembly); + + for(int i=0; i endOfStave_sides = {1,-1}; + if(endOfStave.side[i] != 0) + endOfStave_sides = {endOfStave.side[i]}; + for(auto& endOfStave_side : endOfStave_sides){ // Place it on both sides of the stave + if(endOfStave.isCurved[i]){ + double r_component_curved = 0.0; // endOfStave.r + endOfStave.rs[i] + endOfStave.thicknesses[i]/2; // Correct for the fact that a tube element's origin is offset compared to the origin of a box + r_offset_component = endOfStave.offset + endOfStave.offsets[i]; + x_pos = r_component_curved*cos(phi) - r_offset_component*sin(phi); + y_pos = r_component_curved*sin(phi) + r_offset_component*cos(phi); + z_pos = m.stave_length/2.+endOfStave.lengths[i]/2.+endOfStave.dzs[i] + endOfStave.z_offset + endOfStave.z_offsets[i]; + Position pos = Position(x_pos, y_pos, z_pos*endOfStave_side+motherVolOffset); + endOfStave_assembly.placeVolume(endOfStave.volumes[i], Transform3D(rot,stave_pos).Inverse()*Transform3D(rot,pos)); + } + else{ + x_pos = endOfStave.r + endOfStave.rs[i] + endOfStave.thicknesses[i]/2.; + y_pos = endOfStave.offset + endOfStave.offsets[i]; + z_pos = m.stave_length/2.+endOfStave.lengths[i]/2.+endOfStave.dzs[i] + endOfStave.z_offset + endOfStave.z_offsets[i]; + Position pos(x_pos, y_pos, z_pos*endOfStave_side+motherVolOffset); + endOfStave_assembly.placeVolume(endOfStave.volumes[i], pos); + } + } + } + endOfStave_assembly->GetShape()->ComputeBBox(); + } + + // Place sensor + for(auto& sensor : m.sensorsVec){ + for(int iModule=0; iModule0.0 && m.motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(module_assembly, Position(-m.motherVolThickness/2., 0., 0.)); + else + pv = whole_stave_volume_a.placeVolume(module_assembly); + pv.addPhysVolID("module", iModule_tot); + + DetElement moduleDE(layerDE,module_name,x_det.id()); + moduleDE.setPlacement(pv); + + + // Place all sensor parts + int iSensitive = 0; + for(int i=0; ipush_back(surf); + iSensitive++; + } + } + else{ // not curved + x_pos = 0.0; + y_pos = sensor.xmin[i]+abs(sensor.xmax[i]-sensor.xmin[i])/2.; + z_pos = sensor.ymin[i]+abs(sensor.ymax[i]-sensor.ymin[i])/2.; + Position pos2(x_pos, y_pos, z_pos); + pv = module_assembly.placeVolume(sensor.volumes[i], pos+pos2); + + if(sensor.sensitives[i]) { // Define as sensitive and add sensitive surface + string sensor_name = module_name + _toString(iSensitive,"_sensor%d"); + pv.addPhysVolID("sensor", iSensitive); + DetElement sensorDE(moduleDE,sensor_name,x_det.id()); + sensorDE.setPlacement(pv); + + Vector3D u( 0. , 1. , 0. ) ; + Vector3D v( 0. , 0. , 1. ) ; + Vector3D n( 1. , 0. , 0. ) ; + VolPlane surf( sensor.volumes[i] , dd4hep::rec::SurfaceType::Sensitive , sensor.thickness/2. , sensor.thickness/2. , u,v,n ); + volSurfaceList(sensorDE)->push_back(surf); + iSensitive++; + } + } + } + iModule_tot++; + module_assembly->GetShape()->ComputeBBox(); + } + } + + if(m.motherVolThickness>0.0 && m.motherVolWidth>0.0){} + else{ + whole_stave_volume_a->GetShape()->ComputeBBox(); + } + } + } + + pv.addPhysVolID( "system", x_det.id() ).addPhysVolID("side",0 ) ; + + sdet.setAttributes(theDetector,envelope,x_det.regionStr(),x_det.limitsStr(),x_det.visStr()); + + return sdet; +} + +DECLARE_DETELEMENT(VertexBarrel_detailed_o1_v02,create_element) \ No newline at end of file diff --git a/detector/tracker/VertexEndcap_detailed_o1_v01_geo.cpp b/detector/tracker/VertexEndcap_detailed_o1_v01_geo.cpp index 8d423703f..cccd79233 100644 --- a/detector/tracker/VertexEndcap_detailed_o1_v01_geo.cpp +++ b/detector/tracker/VertexEndcap_detailed_o1_v01_geo.cpp @@ -366,4 +366,4 @@ static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector s return sdet; } -DECLARE_DETELEMENT(VertexDisks_detailed_o1_v01,create_detector) +DECLARE_DETELEMENT(VertexDisks_detailed_o1_v01,create_detector) \ No newline at end of file diff --git a/detector/tracker/VertexEndcap_detailed_o1_v02_geo.cpp b/detector/tracker/VertexEndcap_detailed_o1_v02_geo.cpp new file mode 100644 index 000000000..204d08f8c --- /dev/null +++ b/detector/tracker/VertexEndcap_detailed_o1_v02_geo.cpp @@ -0,0 +1,426 @@ +//==================================================================== +// Vertex Detector implementation for the FCC-ee IDEA detector +//-------------------------------------------------------------------- +// +// Based on VertexEndcap_o2_v06_geo.cpp from M. Petric, which was +// originaly forked form SiTrackerEndcap2 by M. Frank +// +// Author : A. Ilg +// +// This code allows to build a tracker/vertex endcap made out of staves +// as it is used in the IDEA vertex detector design by F. Palla and +// F. Bosi as of mid-2023. +// The staves are arranged in petals, and can feature any number of modules. +// The modules can be built by smaller rectangular structures to represent +// both sensitive and insensitive (periphery) parts so that e.g Quad +// modules can be bult. When using this detector constructor, in addition, +// the DD4hep_GenericSurfaceInstallerPlugin plugin needs to be instantiated +// in the xml compact file to define the sensitive surfaces. +//==================================================================== + +#include "DD4hep/DetFactoryHelper.h" +#include "XML/Utilities.h" +#include "DD4hep/Printout.h" + +using namespace std; + +using dd4hep::Assembly; +using dd4hep::BUILD_ENVELOPE; +using dd4hep::DetElement; +using dd4hep::Detector; +using dd4hep::Material; +using dd4hep::PlacedVolume; +using dd4hep::Position; +using dd4hep::Ref_t; +using dd4hep::RotationZYX; +using dd4hep::SensitiveDetector; +using dd4hep::Transform3D; +using dd4hep::Translation3D; +using dd4hep::Volume; +using dd4hep::_toString; +using dd4hep::getAttrOrDefault; +using dd4hep::Box; +using dd4hep::Tube; + +static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector sens) { + xml_det_t x_det = e; + string det_name = x_det.nameStr(); + bool reflect = x_det.reflect(false); + DetElement sdet (det_name,x_det.id()); + int m_id=0; + PlacedVolume pv; + + // --- create an envelope volume and position it into the world --------------------- + + Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; + dd4hep::xml::setDetectorTypeFlag( e, sdet ) ; + + if( theDetector.buildType() == BUILD_ENVELOPE ) return sdet ; + + envelope.setVisAttributes(theDetector, x_det.visStr()); + sens.setType("tracker"); + + // Struct to support multiple readout or support layers (both using this struct) + struct componentsStruct{ + string name; + double z_offset; + double offset; + vector thicknesses; + vector widths; + vector offsets; + vector z_offsets; + vector materials; + vector viss; + }; + + // Struct to support end-of-stave structures + struct endOfStaveStruct{ + string name; + double z_offset; + double offset; + vector thicknesses; + vector lengths; + vector offsets; + vector z_offsets; + vector dxs; // Distance of end-of-stave structure to stave itself + vector xs; // Indicating whether end of stave struct should be place on pos x side (if x>0) or on neg x side (if x<0). Didn't work with using nsides + vector volumes; + }; + + // --- Module information struct --- + struct module_information{ + string name; + + vector components_vec; + vector endOfStaves; + double sensor_z_offset; + double sensor_offset; + double sensor_thickness; + vector sensor_sensitives; + vector sensor_xmin; + vector sensor_xmax; + vector sensor_ymin; + vector sensor_ymax; + vector sensor_names; + double sensor_width; + double sensor_length; + vector sensor_volumes; + Material sensor_material; + }; + list module_information_list; + + // --- Collect module(s) information + for(xml_coll_t mi(x_det,_U(module)); mi; ++mi, ++m_id) { + xml_comp_t x_mod = mi; + + module_information m; + m.name = x_mod.nameStr(); + + // Components + xml_coll_t c_components(x_mod,_U(components)); + for(c_components.reset(); c_components; ++c_components){ + componentsStruct components; + components.name = xml_comp_t(c_components).nameStr(); + components.z_offset = xml_comp_t(c_components).z_offset(0); + components.offset = xml_comp_t(c_components).offset(0); + xml_coll_t c_component(c_components,_U(component)); + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + components.thicknesses.push_back(component.thickness()); + components.widths.push_back(component.width()); + components.offsets.push_back(component.offset(0)); + components.z_offsets.push_back(component.z_offset(0)); + components.materials.push_back(theDetector.material(component.materialStr())); + components.viss.push_back(component.visStr()); + } + m.components_vec.push_back(components); + } + + // End of stave structures + xml_coll_t c_endOfStave(x_mod,_U(end_z)); + int iEndOfStave = 0; + for(c_endOfStave.reset(); c_endOfStave; ++c_endOfStave,++iEndOfStave){ + endOfStaveStruct endOfStave; + endOfStave.z_offset = xml_comp_t(c_endOfStave).z_offset(0); + endOfStave.offset = xml_comp_t(c_endOfStave).offset(0); + endOfStave.name = xml_comp_t(c_endOfStave).nameStr(); + xml_coll_t c_component = xml_coll_t(c_endOfStave,_U(component)); + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + endOfStave.thicknesses.push_back(component.thickness()); + endOfStave.lengths.push_back(component.length()); + endOfStave.offsets.push_back(component.offset(0)); + endOfStave.z_offsets.push_back(component.z_offset(0)); + endOfStave.dxs.push_back(component.dx()); + endOfStave.xs.push_back(component.x()); + + Box ele_box = Box(component.width()/2., component.length()/2., component.thickness()/2.); + Volume ele_vol = Volume( endOfStave.name + _toString(iEndOfStave, "_%d"), ele_box, theDetector.material(component.materialStr())); + ele_vol.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), component.visStr()); + + endOfStave.volumes.push_back(ele_vol); + } + m.endOfStaves.push_back(endOfStave); + } + + // Sensor + xml_coll_t c_sensor(x_mod,_U(sensor)); + m.sensor_z_offset = xml_comp_t(c_sensor).z_offset(0); + m.sensor_offset = xml_comp_t(c_sensor).offset(0); + m.sensor_thickness = xml_comp_t(c_sensor).thickness(); + m.sensor_material = theDetector.material(xml_comp_t(c_sensor).materialStr()); + xml_coll_t c_component = xml_coll_t(c_sensor,_U(component)); + + int iSensor = 0; + for(c_component.reset(); c_component; ++c_component){ + xml_comp_t component = c_component; + m.sensor_sensitives.push_back(component.isSensitive()); + m.sensor_xmin.push_back(component.xmin()); + m.sensor_xmax.push_back(component.xmax()); + m.sensor_ymin.push_back(component.ymin()); + m.sensor_ymax.push_back(component.ymax()); + m.sensor_names.push_back(component.nameStr("sensor")); + + Box ele_box = Box( abs(component.xmax()-component.xmin())/2., abs(component.ymax()-component.ymin())/2., m.sensor_thickness/2.); + Volume ele_vol = Volume( m.sensor_names.back() + _toString(iSensor, "_%d"), ele_box, m.sensor_material); + ele_vol.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), component.visStr()); + + if(m.sensor_sensitives.back()) + ele_vol.setSensitiveDetector(sens); + m.sensor_volumes.push_back(ele_vol); + iSensor++; + } + m.sensor_width = *max_element(m.sensor_xmax.begin(), m.sensor_xmax.end()) - *min_element(m.sensor_xmin.begin(), m.sensor_xmin.end()); + m.sensor_length = *max_element(m.sensor_ymax.begin(), m.sensor_ymax.end()) - *min_element(m.sensor_ymin.begin(), m.sensor_ymin.end()); + cout << det_name << "Module: " << m.name << ", sensor width: " << to_string(m.sensor_width) << ", sensor length: " << to_string(m.sensor_length) << endl; + module_information_list.push_back(m); + } + + vector sides = {1}; + if(reflect){sides.push_back(-1);} + + for(auto & side : sides){ + string side_name = det_name + _toString(side,"_side%d"); + + Assembly side_assembly(side_name); + pv = envelope.placeVolume(side_assembly); + pv.addPhysVolID("side", side); + + for(xml_coll_t li(x_det,_U(layer)); li; ++li) { + xml_comp_t x_layer(li); + int layer_id = x_layer.id(); + double rmin = x_layer.rmin(); + double rmax = x_layer.rmax(); + double dr = x_layer.dr(0); + double z = x_layer.z(); + double layer_dz = x_layer.dz(0); + int nPetals = x_layer.nphi(); + double phi0_layer = x_layer.phi0(0); + double reflect_rot = x_layer.attr(_Unicode(reflect_rot),0.0); + + string disk_name = side_name + _toString(layer_id,"_layer%d"); + + // Either use assembly or volume, depending on whether motherVolThickness is given + PlacedVolume whole_disk_volume_placed; + Volume whole_disk_volume_v; + Assembly whole_disk_volume_a; + double disk_motherVolThickness = getAttrOrDefault(x_layer, _Unicode(motherVolThickness), double(0.0)); + if(disk_motherVolThickness>0.0){ + Tube whole_disk_tube = Tube(rmin, rmax, disk_motherVolThickness/2.); + whole_disk_volume_v = Volume(disk_name, whole_disk_tube, theDetector.material("Air")); + whole_disk_volume_v.setVisAttributes(theDetector, x_layer.visStr()); + whole_disk_volume_placed = side_assembly.placeVolume(whole_disk_volume_v, Position(0.0, 0.0, side*(z+disk_motherVolThickness/2.))); + } + else{ + //// Use just assembly to avoid overlap between disk volume and other volumes + whole_disk_volume_a = Assembly(disk_name); + whole_disk_volume_placed = side_assembly.placeVolume(whole_disk_volume_a, Position(0.0, 0.0, side*z)); + } + + + whole_disk_volume_placed.addPhysVolID("layer", layer_id); + + DetElement diskDE( sdet , disk_name, layer_id); + diskDE.setPlacement( whole_disk_volume_placed ); + + int iModule_tot = 0; + for(int iPetal=0; iPetal0.) + pv = whole_disk_volume_v.placeVolume(petal_assembly); + else + pv = whole_disk_volume_a.placeVolume(petal_assembly); + + int iStave = 0; + for(xml_coll_t ri(x_layer,_U(stave)); ri; ++ri,++iStave) { + xml_comp_t x_stave = ri; + + int nmodules = x_stave.nmodules(); + double r_stave = x_stave.r(); + double z_offset = x_stave.z_offset(0); + double stave_dz = x_stave.dz(0); + double step = x_stave.step(); // Spacing of modules + string moduleStr = x_stave.moduleStr(); + double phi0_stave = x_stave.phi0(0); + double stave_offset = x_stave.offset(0); // Offset of stave in r-phi + double phi = 2*M_PI/nPetals*iPetal + phi0_layer + phi0_stave + (side == -1 ? reflect_rot : 0.0); + + // Use the correct module + auto m = *find_if(module_information_list.cbegin(), module_information_list.cend(), [&moduleStr] (const module_information& module) { + return module.name == moduleStr; + }); + + + + // Place all components + RotationZYX rot( phi , 0, 0 ); + double stave_length = nmodules*m.sensor_length + (nmodules-1)*step; + double r = rmin + m.sensor_width/2.0 + r_stave + ((iPetal%2 == 0) ? 0.0 : dr); + + double x_pos = r*cos(phi) - stave_offset*sin(phi); + double y_pos = r*sin(phi) + stave_offset*cos(phi); + double z_pos = z_alternate_petal + z_offset; + if(side == -1){z_pos = -z_pos;} + Position stave_pos = Position(x_pos, y_pos, z_pos); + + string stave_name = petal_name + _toString(iStave,"_stave%d"); + + PlacedVolume whole_stave_volume_placed; + Volume whole_stave_volume_v; + Assembly whole_stave_volume_a; + double stave_motherVolThickness = getAttrOrDefault(x_stave, _Unicode(motherVolThickness), double(0.0)); + double stave_motherVolWidth = getAttrOrDefault(x_stave, _Unicode(motherVolWidth), double(0.0)); + if(stave_motherVolThickness>0.0 && stave_motherVolWidth>0.0){ + Box whole_stave_box = Box(stave_motherVolWidth/2., stave_length/2., stave_motherVolThickness/2.); + whole_stave_volume_v = Volume(stave_name, whole_stave_box, theDetector.material("Air")); + whole_stave_volume_v.setVisAttributes(theDetector, x_stave.visStr()); + whole_stave_volume_placed = petal_assembly.placeVolume(whole_stave_volume_v, Transform3D(rot,stave_pos)); + } + else{ + //// Use just assembly to avoid overlap between stave volume and other volumes + whole_stave_volume_a = Assembly(stave_name); + whole_stave_volume_placed = petal_assembly.placeVolume(whole_stave_volume_a, Transform3D(rot,stave_pos)); + } + + // Place components + for(auto& component : m.components_vec){ + Assembly component_assembly(stave_name + "_" + component.name); + + if(stave_motherVolThickness>0.0 && stave_motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(component_assembly); + else + pv = whole_stave_volume_a.placeVolume(component_assembly); + + for(int i=0; iGetShape()->ComputeBBox(); + } + + // Place end of stave structures + int iEndOfStave = 0; + for(auto& endOfStave : m.endOfStaves){ + Assembly endOfStave_assembly(stave_name + "_" + endOfStave.name + _toString(iEndOfStave,"_%d")); + + if(stave_motherVolThickness>0.0 && stave_motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(endOfStave_assembly); + else + pv = whole_stave_volume_a.placeVolume(endOfStave_assembly); + + for(int i=0; i0 ? stave_length/2.+endOfStave.lengths[i]/2.+endOfStave.dxs[i] : -(stave_length/2.+endOfStave.lengths[i]/2.+endOfStave.dxs[i]); + z_pos = endOfStave.z_offset + endOfStave.z_offsets[i] + endOfStave.thicknesses[i]/2.; + + if(side == -1){z_pos = -z_pos;} + Position pos(x_pos, y_pos, z_pos); + + pv = endOfStave_assembly.placeVolume(endOfStave.volumes[i], pos); + iEndOfStave++; + } + endOfStave_assembly->GetShape()->ComputeBBox(); + } + + // Place sensor + for(int iModule=0; iModule0.0 && stave_motherVolWidth>0.0) + pv = whole_stave_volume_v.placeVolume(module_assembly); + else + pv = whole_stave_volume_a.placeVolume(module_assembly); + + pv.addPhysVolID("module", iModule_tot); + DetElement moduleDE(diskDE,module_name,x_det.id()); + moduleDE.setPlacement(pv); + + int iSensitive = 0; + for(int i=0; iGetShape()->ComputeBBox(); + } + if(stave_motherVolThickness>0.0 && stave_motherVolWidth>0.0){} + else{ + whole_stave_volume_a->GetShape()->ComputeBBox(); + } + } + petal_assembly->GetShape()->ComputeBBox(); + } + if(disk_motherVolThickness>0.0){} + else{ + whole_disk_volume_a->GetShape()->ComputeBBox(); + } + } + side_assembly->GetShape()->ComputeBBox(); + } + + cout << "Built disks detector:" << det_name << endl; + sdet.setAttributes(theDetector,envelope,x_det.regionStr(),x_det.limitsStr(),x_det.visStr()); + pv.addPhysVolID("system", x_det.id()); + + return sdet; +} + +DECLARE_DETELEMENT(VertexEndcap_detailed_o1_v02,create_detector) \ No newline at end of file diff --git a/scripts/save_detector_to_root.sh b/scripts/save_detector_to_root.sh index e4307a51e..553a134f9 100644 --- a/scripts/save_detector_to_root.sh +++ b/scripts/save_detector_to_root.sh @@ -5,11 +5,12 @@ script_folder="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # Get the location of this script, to execute correctly other commands xml=$1 # Give xml detector file as input argument! +outputName="${2:-detector}" # Name of output file, saved as $outputName_dd4hep2root.root echo "Running on xml file $xml" if [[ -n "$xml" ]]; then # test to see if not empty - python ${script_folder}/../utils/dd4hep2root.py -c ${xml} -o detector_dd4hep2root.root + python ${script_folder}/../utils/dd4hep2root.py -c ${xml} -o ${outputName}_dd4hep2root.root else echo "argument error, please provide an xml file as input argument!" fi \ No newline at end of file diff --git a/test/compact/DCH_standalone_o1_v02.xml b/test/compact/DCH_standalone_o1_v02.xml index 93a3ec357..c8564735e 100644 --- a/test/compact/DCH_standalone_o1_v02.xml +++ b/test/compact/DCH_standalone_o1_v02.xml @@ -14,7 +14,7 @@ - + diff --git a/test/compact/IDEA_withDRC_o1_v03.xml b/test/compact/IDEA_withDRC_o1_v03.xml index 22ab501bb..6f5e94dfc 100644 --- a/test/compact/IDEA_withDRC_o1_v03.xml +++ b/test/compact/IDEA_withDRC_o1_v03.xml @@ -20,7 +20,7 @@ - + @@ -43,13 +43,13 @@ - + - + diff --git a/utils/material_plots.py b/utils/material_plots.py index bc3e91abe..561ca60f7 100644 --- a/utils/material_plots.py +++ b/utils/material_plots.py @@ -2,9 +2,9 @@ import argparse import sys,os -print(os.path.dirname(os.path.abspath(__file__)) + "/../../FCCSW/Examples/scripts") -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../FCCSW/Examples/scripts") # FCC Style from https://github.com/HEP-FCC/FCCSW/blob/master/Examples/scripts/plotstyle.py +sys.path.append(os.path.expandvars("$FCCSW") + "/Examples/scripts") from plotstyle import FCCStyle + import ROOT def main(): @@ -38,6 +38,8 @@ def main(): if material == "Tungsten": continue if material == "Copper": continue if material == "beam": continue + if material in ["LiquidNDecane", "AlBeMet162", "Gold"]: + continue if material not in histDict.keys(): histDict[material] = { "x0": ROOT.TH1F("", "", (int)((args.angleMax-args.angleMin) / args.angleBinning), args.angleMin, args.angleMax), @@ -91,6 +93,8 @@ def main(): match material: case "CarbonFiber": fillcolor = FCCStyle.fillcolors[0] + case "CarbonFoam": + fillcolor = FCCStyle.fillcolors[0] case "CarbonFleece": fillcolor = ROOT.kBlack case "Rohacell": @@ -105,6 +109,8 @@ def main(): fillcolor = FCCStyle.fillcolors[6] case "Water": fillcolor = FCCStyle.fillcolors[5] + case "PCB": + fillcolor = ROOT.kGreen histDict_ordered[material][plot].SetLineColor(linecolor) histDict_ordered[material][plot].SetFillColor(fillcolor) diff --git a/utils/material_plots_2D.py b/utils/material_plots_2D.py index d050857b5..65babb228 100644 --- a/utils/material_plots_2D.py +++ b/utils/material_plots_2D.py @@ -3,8 +3,7 @@ import math import sys,os -print(os.path.dirname(os.path.abspath(__file__)) + "/../../FCCSW/Examples/scripts") -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../FCCSW/Examples/scripts") # FCC Style from https://github.com/HEP-FCC/FCCSW/blob/master/Examples/scripts/plotstyle.py +sys.path.append(os.path.expandvars("$FCCSW") + "/Examples/scripts") from plotstyle import FCCStyle import ROOT