Warning, /firebird/firebird-ng/src/app/theme/cool2-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 cool2ColorRules = [
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 - Warm light peach/orange
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: true,
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 // This is when DIRC geometry is standalone
0125 name: "DIRC_0",
0126 rules: [
0127 {
0128 patterns: ["**/*box*", "**/*prism*"],
0129 material: new THREE.MeshPhysicalMaterial({
0130 color: 0xFFF8E1,
0131 metalness: .2,
0132 roughness: .05,
0133 envMapIntensity: 0.3,
0134 clearcoat: 1,
0135 transparent: true,
0136 transmission: .2,
0137 opacity: .25,
0138 reflectivity: 0.2,
0139 //refr: 0.985,
0140 ior: 0.9,
0141 side: THREE.DoubleSide,
0142 }),
0143 merge: false,
0144 outline: true,
0145 newName: "DIRC_barAndPrisms",
0146 },
0147 {
0148 patterns: ["**/*rail*"],
0149 newName: "DIRC_rails",
0150 color: 0xAAAACC
0151 },
0152 {
0153 patterns: ["**/*mcp*"],
0154 newName: "DIRC_mcps"
0155 }
0156 ]
0157
0158 },
0159
0160 // RICH Endcap - Very light violet-blue
0161 {
0162 name: "RICHEndcapN_Vol_15",
0163 rules: [
0164 {
0165 color: 0xE8EAF6, // Indigo 50 - extremely light indigo
0166 merge: true,
0167 outline: true
0168 }
0169 ]
0170 },
0171
0172 // DRICH - Different tone as requested (light peach)
0173 {
0174 name: "DRICH_16",
0175 rules: [
0176 {
0177 color: 0xFFECB3, // Amber 100 - light warm amber/peach
0178 merge: true,
0179 outline: true
0180 }
0181 ]
0182 },
0183
0184 // Ecal components - Very light lavender
0185 {
0186 names: ["EcalEndcapP_17", "EcalEndcapPInsert_18", "EcalBarrelImaging_19", "EcalBarrelScFi_20", "B0ECal_43"],
0187 rules: [
0188 {
0189 color: 0xF3E5F5, // Purple 50 - extremely light purple
0190 merge: true,
0191 outline: true
0192 }
0193 ]
0194 },
0195
0196 // EcalEndcapN - Light blue crystal
0197 {
0198 name: "EcalEndcapN*",
0199 rules: [
0200 {
0201 patterns: ["**/crystal_vol_0"],
0202 color: 0xE3F2FD // Blue 50 - extremely light blue
0203 },
0204 {
0205 patterns: ["**/inner_support*", "**/ring*"],
0206 material: new THREE.MeshStandardMaterial({
0207 color: 0xF5F5F5, // Gray 100 - almost white
0208 roughness: 0.5,
0209 metalness: 0.1,
0210 transparent: true,
0211 opacity: 0.5,
0212 side: THREE.DoubleSide
0213 })
0214 }
0215 ]
0216 },
0217
0218 // Hcal components - Light blue (biggest components)
0219 {
0220 names: ["LFHCAL_env_22", "HcalEndcapPInsert_23", "HcalBarrel_24", "HcalEndcapN_25"],
0221 rules: [
0222 {
0223 color: 0x90CAF9, // Blue 200 - light blue with more saturation
0224 merge: true,
0225 outline: true
0226 }
0227 ]
0228 },
0229
0230 // Flux components - Light blue
0231 {
0232 names: ["FluxBarrel_env_25", "FluxEndcapP_26", "FluxEndcapN_26", "FluxEndcapN_28"],
0233 rules: [
0234 {
0235 color: 0xE3F2FD, // Blue 50 - extremely light blue
0236 merge: true,
0237 outline: true
0238 }
0239 ]
0240 },
0241
0242 // Beam Pipe components - Nearly white
0243 {
0244 names: [
0245 "BeamPipe_assembly_27",
0246 "BeamPipeB0_assembly_36",
0247 "B0Window_vol_ExitWindow_37",
0248 "Pipe_cen_to_pos_assembly_38",
0249 "Pipe_Q1eR_to_B2BeR_assembly_53",
0250 "Q0EF_vac_40",
0251 "Q1EF_vac_42"
0252 ],
0253 rules: [
0254 {
0255 color: 0xFAFAFA, // Gray 50 - almost white
0256 merge: true,
0257 outline: true
0258 }
0259 ]
0260 },
0261
0262 // Magnet components - Light green as requested (beamline magnets are typically green)
0263 {
0264 names: [
0265 "B0PF_BeamlineMagnet_assembly_28",
0266 "B0APF_BeamlineMagnet_assembly_29",
0267 "Q1APF_BeamlineMagnet_assembly_30",
0268 "Q1BPF_BeamlineMagnet_assembly_31",
0269 "Q0EF_assembly_39",
0270 "Q1EF_assembly_41",
0271 "Magnet_Q1eR_assembly_54",
0272 "Magnet_Q2eR_assembly_55",
0273 "Magnet_B2AeR_assembly_56",
0274 "Magnet_B2BeR_assembly_57",
0275 "Magnets_Q3eR_assembly_58"
0276 ],
0277 rules: [
0278 {
0279 color: 0xC8E6C9, // Green 100 - light green
0280 merge: true,
0281 outline: true
0282 }
0283 ]
0284 },
0285
0286 // Vertex Barrel - Warm light amber
0287 {
0288 name: "VertexBarrelSubAssembly_3",
0289 rules: [
0290 {
0291 color: 0xFFF8E1, // Amber 50 - extremely light amber/peach
0292 merge: true,
0293 outline: true
0294 }
0295 ]
0296 },
0297
0298 // Default rule for anything not matched above
0299 {
0300 name: "*",
0301 rules: [
0302 {
0303 color: 0xF5F5F5, // Gray 100 - very light gray
0304 merge: true,
0305 outline: true
0306 }
0307 ]
0308 }
0309 ]