Warning, /firebird/firebird-ng/src/app/theme/cool-geometry-ruleset.ts is written in an unsupported language. File is not indexed.
0001 import {Injectable, signal, WritableSignal} from '@angular/core';
0002 import {openFile} from 'jsroot';
0003 import {
0004 analyzeGeoNodes,
0005 findGeoManager, getGeoNodesByLevel
0006 } from '../../lib-root-geometry/root-geo-navigation';
0007 import {build} from 'jsroot/geom';
0008 import {RootGeometryProcessor} from "../data-pipelines/root-geometry.processor";
0009
0010 import {Subdetector} from "../model/subdetector";
0011 import {Color, DoubleSide, MeshLambertMaterial, NormalBlending, Object3D, Plane} from "three";
0012
0013 import {DetectorThreeRuleSet, ThreeGeometryProcessor} from "../data-pipelines/three-geometry.processor";
0014 import * as THREE from "three";
0015 import {disposeHierarchy, getColorOrDefault} from "../utils/three.utils";
0016
0017 export const coolColorRules = [
0018 // Solenoid components - Very light blue-gray
0019 {
0020 names: ["SolenoidBarrel_assembly_0", "SolenoidEndcapP_1", "SolenoidEndcapN_2"],
0021 rules: [
0022 {
0023 color: 0xECEFF1, // Blue Gray 50 - very light blue-gray
0024 merge: true,
0025 outline: true
0026 }
0027 ]
0028 },
0029
0030 // Trackers - Keep warm light peach/orange as it worked well
0031 {
0032 names: ["InnerSiTrackerSubAssembly_4", "MiddleSiTrackerSubAssembly_5", "OuterSiTrackerSubAssembly_6", "B0TrackerSubAssembly_12"],
0033 rules: [
0034 {
0035 color: 0xFFE0B2, // Orange 100 - very light warm orange/peach
0036 merge: true,
0037 outline: true
0038 }
0039 ]
0040 },
0041
0042 // MPGD Trackers - Light warm yellow
0043 {
0044 names: ["EndcapMPGDSubAssembly_7", "InnerMPGDBarrelSubAssembly_8", "OuterBarrelMPGDSubAssembly_11"],
0045 rules: [
0046 {
0047 color: 0xFFF9C4, // Yellow 100 - very light yellow
0048 merge: true,
0049 outline: true
0050 }
0051 ]
0052 },
0053
0054 // TOF components - Very light blue
0055 {
0056 names: ["EndcapTOFSubAssembly_9", "BarrelTOFSubAssembly_10"],
0057 rules: [
0058 {
0059 color: 0xE1F5FE, // Light Blue 50 - extremely light blue
0060 merge: true,
0061 outline: true
0062 }
0063 ]
0064 },
0065
0066 // Inner tracker support - White with slight blue tint
0067 {
0068 name: "InnerTrackerSupport_assembly_13",
0069 rules: [
0070 {
0071 material: new THREE.MeshStandardMaterial({
0072 color: 0xF5F9FF, // Custom ultra-light blue-white
0073 roughness: 0.5,
0074 metalness: 0.1,
0075 transparent: true,
0076 opacity: 0.5,
0077 blending: THREE.NormalBlending,
0078 depthWrite: false,
0079 polygonOffset: true,
0080 polygonOffsetFactor: 1,
0081 side: THREE.DoubleSide
0082 }),
0083 outline: true,
0084 outlineColor: 0xEEEEEE, // Light gray outline
0085 merge: true,
0086 newName: "InnerTrackerSupport"
0087 }
0088 ]
0089 },
0090
0091 // DIRC - Light cyan/blue
0092 {
0093 name: "DIRC_14",
0094 rules: [
0095 {
0096 patterns: ["**/*box*", "**/*prism*"],
0097 material: new THREE.MeshPhysicalMaterial({
0098 color: 0xE0F7FA, // Cyan 50 - extremely light cyan
0099 metalness: .4,
0100 roughness: .2,
0101 envMapIntensity: 0.5,
0102 clearcoat: 0.8,
0103 transparent: true,
0104 opacity: .5,
0105 reflectivity: 0.2,
0106 ior: 0.9,
0107 side: THREE.DoubleSide,
0108 }),
0109 newName: "DIRC_barAndPrisms"
0110 },
0111 {
0112 patterns: ["**/*rail*"],
0113 newName: "DIRC_rails",
0114 color: 0xF5F5F5 // Gray 100 - almost white
0115 },
0116 {
0117 patterns: ["**/*mcp*"],
0118 newName: "DIRC_mcps",
0119 color: 0xE1F5FE // Light Blue 50 - extremely light blue
0120 }
0121 ]
0122 },
0123
0124 // RICH components - Very light violet-blue
0125 {
0126 names: ["RICHEndcapN_Vol_15", "DRICH_16"],
0127 rules: [
0128 {
0129 color: 0xE8EAF6, // Indigo 50 - extremely light indigo
0130 merge: true,
0131 outline: true
0132 }
0133 ]
0134 },
0135
0136 // Ecal components - Very light lavender
0137 {
0138 names: ["EcalEndcapP_17", "EcalEndcapPInsert_18", "EcalBarrelImaging_19", "EcalBarrelScFi_20", "B0ECal_43"],
0139 rules: [
0140 {
0141 color: 0xF3E5F5, // Purple 50 - extremely light purple
0142 merge: true,
0143 outline: true
0144 }
0145 ]
0146 },
0147
0148 // EcalEndcapN - Light blue crystal
0149 {
0150 name: "EcalEndcapN*",
0151 rules: [
0152 {
0153 patterns: ["**/crystal_vol_0"],
0154 color: 0xE3F2FD, // Blue 50 - extremely light blue
0155 material: new THREE.MeshStandardMaterial({
0156 color: 0xE3F2FD,
0157 roughness: 0.5,
0158 metalness: 0.1,
0159 transparent: true,
0160 opacity: 0.5,
0161 side: THREE.DoubleSide
0162 })
0163 },
0164 {
0165 patterns: ["**/inner_support*", "**/ring*"],
0166 material: new THREE.MeshStandardMaterial({
0167 color: 0xF5F5F5, // Gray 100 - almost white
0168 roughness: 0.5,
0169 metalness: 0.1,
0170 transparent: true,
0171 opacity: 0.5,
0172 side: THREE.DoubleSide
0173 })
0174 }
0175 ]
0176 },
0177
0178 // Hcal components - Slightly more saturated blue (a bit more color as requested)
0179 {
0180 names: ["LFHCAL_env_22", "HcalEndcapPInsert_23", "HcalBarrel_24", "HcalEndcapN_25"],
0181 rules: [
0182 {
0183 color: 0xBBDEFB, // Blue 100 - light blue with slightly more saturation
0184 merge: true,
0185 outline: true
0186 }
0187 ]
0188 },
0189
0190 // Flux components - Now match HcalBarrel blue color (as requested)
0191 {
0192 names: ["FluxBarrel_env_25", "FluxEndcapP_26", "FluxEndcapN_26", "FluxEndcapN_28"],
0193 rules: [
0194 {
0195 color: 0xBBDEFB, // Blue 100 - same as HCALs
0196 merge: true,
0197 outline: true
0198 }
0199 ]
0200 },
0201
0202 // Beam Pipe components - Nearly white
0203 {
0204 names: [
0205 "BeamPipe_assembly_27",
0206 "BeamPipeB0_assembly_36",
0207 "B0Window_vol_ExitWindow_37",
0208 "Pipe_cen_to_pos_assembly_38",
0209 "Pipe_Q1eR_to_B2BeR_assembly_53",
0210 "Q0EF_vac_40",
0211 "Q1EF_vac_42"
0212 ],
0213 rules: [
0214 {
0215 color: 0xFAFAFA, // Gray 50 - almost white
0216 merge: true,
0217 outline: true
0218 }
0219 ]
0220 },
0221
0222 // Magnet components - Light steel blue
0223 {
0224 names: [
0225 "B0PF_BeamlineMagnet_assembly_28",
0226 "B0APF_BeamlineMagnet_assembly_29",
0227 "Q1APF_BeamlineMagnet_assembly_30",
0228 "Q1BPF_BeamlineMagnet_assembly_31",
0229 "Q0EF_assembly_39",
0230 "Q1EF_assembly_41",
0231 "Magnet_Q1eR_assembly_54",
0232 "Magnet_Q2eR_assembly_55",
0233 "Magnet_B2AeR_assembly_56",
0234 "Magnet_B2BeR_assembly_57",
0235 "Magnets_Q3eR_assembly_58"
0236 ],
0237 rules: [
0238 {
0239 color: 0xCFD8DC, // Blue Gray 100 - light blue-gray
0240 merge: true,
0241 outline: true
0242 }
0243 ]
0244 },
0245
0246 // Vertex Barrel - Keep warm amber (looks good with trackers)
0247 {
0248 name: "VertexBarrelSubAssembly_3",
0249 rules: [
0250 {
0251 color: 0xFFF8E1, // Amber 50 - extremely light amber/peach
0252 merge: true,
0253 outline: true
0254 }
0255 ]
0256 },
0257
0258 // Default rule for anything not matched above
0259 {
0260 name: "*",
0261 rules: [
0262 {
0263 color: 0xF5F5F5, // Gray 100 - very light gray
0264 merge: true,
0265 outline: true
0266 }
0267 ]
0268 }
0269 ]