Back to home page

EIC code displayed by LXR

 
 

    


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   // RICH Endcap - Very light violet-blue
0125   {
0126     name: "RICHEndcapN_Vol_15",
0127     rules: [
0128       {
0129         color: 0xE8EAF6,  // Indigo 50 - extremely light indigo
0130         merge: true,
0131         outline: true
0132       }
0133     ]
0134   },
0135 
0136   // DRICH - Different tone as requested (light peach)
0137   {
0138     name: "DRICH_16",
0139     rules: [
0140       {
0141         color: 0xFFECB3,  // Amber 100 - light warm amber/peach
0142         merge: true,
0143         outline: true
0144       }
0145     ]
0146   },
0147 
0148   // Ecal components - Very light lavender
0149   {
0150     names: ["EcalEndcapP_17", "EcalEndcapPInsert_18", "EcalBarrelImaging_19", "EcalBarrelScFi_20", "B0ECal_43"],
0151     rules: [
0152       {
0153         color: 0xF3E5F5,  // Purple 50 - extremely light purple
0154         merge: true,
0155         outline: true
0156       }
0157     ]
0158   },
0159 
0160   // EcalEndcapN - Light blue crystal
0161   {
0162     name: "EcalEndcapN*",
0163     rules: [
0164       {
0165         patterns: ["**/crystal_vol_0"],
0166         color: 0xE3F2FD  // Blue 50 - extremely light blue
0167       },
0168       {
0169         patterns: ["**/inner_support*", "**/ring*"],
0170         material: new THREE.MeshStandardMaterial({
0171           color: 0xF5F5F5,  // Gray 100 - almost white
0172           roughness: 0.5,
0173           metalness: 0.1,
0174           transparent: true,
0175           opacity: 0.5,
0176           side: THREE.DoubleSide
0177         })
0178       }
0179     ]
0180   },
0181 
0182   // Hcal components - Light blue (biggest components)
0183   {
0184     names: ["LFHCAL_env_22", "HcalEndcapPInsert_23", "HcalBarrel_24", "HcalEndcapN_25"],
0185     rules: [
0186       {
0187         color: 0x90CAF9,  // Blue 200 - light blue with more saturation
0188         merge: true,
0189         outline: true
0190       }
0191     ]
0192   },
0193 
0194   // Flux components - Light blue
0195   {
0196     names: ["FluxBarrel_env_25", "FluxEndcapP_26", "FluxEndcapN_26", "FluxEndcapN_28"],
0197     rules: [
0198       {
0199         color: 0xE3F2FD,  // Blue 50 - extremely light blue
0200         merge: true,
0201         outline: true
0202       }
0203     ]
0204   },
0205 
0206   // Beam Pipe components - Nearly white
0207   {
0208     names: [
0209       "BeamPipe_assembly_27",
0210       "BeamPipeB0_assembly_36",
0211       "B0Window_vol_ExitWindow_37",
0212       "Pipe_cen_to_pos_assembly_38",
0213       "Pipe_Q1eR_to_B2BeR_assembly_53",
0214       "Q0EF_vac_40",
0215       "Q1EF_vac_42"
0216     ],
0217     rules: [
0218       {
0219         color: 0xFAFAFA,  // Gray 50 - almost white
0220         merge: true,
0221         outline: true
0222       }
0223     ]
0224   },
0225 
0226   // Magnet components - Light green as requested (beamline magnets are typically green)
0227   {
0228     names: [
0229       "B0PF_BeamlineMagnet_assembly_28",
0230       "B0APF_BeamlineMagnet_assembly_29",
0231       "Q1APF_BeamlineMagnet_assembly_30",
0232       "Q1BPF_BeamlineMagnet_assembly_31",
0233       "Q0EF_assembly_39",
0234       "Q1EF_assembly_41",
0235       "Magnet_Q1eR_assembly_54",
0236       "Magnet_Q2eR_assembly_55",
0237       "Magnet_B2AeR_assembly_56",
0238       "Magnet_B2BeR_assembly_57",
0239       "Magnets_Q3eR_assembly_58"
0240     ],
0241     rules: [
0242       {
0243         color: 0xC8E6C9,  // Green 100 - light green
0244         merge: true,
0245         outline: true
0246       }
0247     ]
0248   },
0249 
0250   // Vertex Barrel - Warm light amber
0251   {
0252     name: "VertexBarrelSubAssembly_3",
0253     rules: [
0254       {
0255         color: 0xFFF8E1,  // Amber 50 - extremely light amber/peach
0256         merge: true,
0257         outline: true
0258       }
0259     ]
0260   },
0261 
0262   // Default rule for anything not matched above
0263   {
0264     name: "*",
0265     rules: [
0266       {
0267         color: 0xF5F5F5,  // Gray 100 - very light gray
0268         merge: true,
0269         outline: true
0270       }
0271     ]
0272   }
0273 ]