celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Export LZ/BACCARAT compatible light map

Open sethrj opened this issue 8 months ago • 4 comments

Our tallies for LZ should be able to extract/construct histograms suitable for conversion to ROOT files with the following format.

Use in BACCARAT

From the light map reader using Claude 3.7 Sonnet via Copilot with some adjustment, the file contents are :

Class Field Name Pattern Phase* Map Type
TH3F allPMTs_hits 1 hit
TH3F totalHitProb >1 hit
TH2D topArrayTimeHist1 All time
TH2D topArrayTimeHist2 All time
TH2D bottomArrayTimeHist1 All time
TH2D bottomArrayTimeHist2 All time
TH3F Top_R8520_PMT_Photocathode_{i:d}_hits (i=0-31) 1 hit
TH3F Top_PMT_Photocathode_{i:03d}_I (i=0-252) >1 hit
TH3F Bottom_R11410_PMT_Photocathode_32_hits 1 hit
TH3F Bottom_PMT_Photocathode_{i:d}_I (i=300-540) >1 hit

[*] Experiment configuration; Phase I is test bed with 100 kg of LXe and reduced number of PMTs

Hit maps (TH3F*)

  1. Total Hit Probability (index 0):

    • Used to determine if a photon hits any PMT at all
    • Accessed with hitMaps.at(0)->Interpolate(x, y, z)
  2. Top PMT Maps:

    • Phase >1: Top_PMT_Photocathode_{i:03d}_I (indices 1-253, i=0-252)
    • Phase 1: Top_R8520_PMT_Photocathode_{i:d}_hits (indices 1-32, i=0-31)
    • 3D histograms interpolated at (x,y,z) to get hit probability for specific PMTs
    • Used in binary search to determine which PMT was hit
  3. Bottom PMT Maps:

    • Phase >1: Bottom_PMT_Photocathode_{i:d}_I (indices 254-494, i=300-540)
    • Phase 1: Bottom_R11410_PMT_Photocathode_32_hits (index 33)
    • Same purpose as Top PMT maps

Time maps (TH2D*)

  1. topArrayTimeHist1 (index 0)
  2. topArrayTimeHist2 (index 1)
  3. bottomArrayTimeHist1 (index 2)
  4. bottomArrayTimeHist2 (index 3)
  • Used to determine photon travel time
  • First histogram in pair used until max bin content reached, then second used
  • topOrBottom is either 0 or 2 (top or bottom array)
  • X-axis represents distance from PMT
  • Y-axis represents time
  • Time maps are used for binary search to find time bins
  • Y-bin spacing is extracted from these histograms

Usage Pattern

  1. First check if a photon hits any PMT using total hit probability
  2. Binary search to determine which specific PMT was hit
  3. Get PMT coordinates using mapping arrays (TopPMTArrayXY/BottomPMTArrayXY)
  4. Calculate distance to PMT
  5. Binary search time maps to get time value
  6. Add emission time to get final hit time

The phase1 switch affects:

  • Which histograms are loaded
  • How PMT indices are computed (iPMTIndex = (m > 252 ? m + 47 : m) for Phase>1, direct mapping for Phase 1)
  • PMT coordinates and Z positions

The histograms provide information about light collection, propagation time, and detection probabilities for different detector configurations.

Sampling optical photons for the map

defined in macro file:

  • Optical photons with gaussian energy µ=6.97 eV, σ=0.23 eV
  • Cylindrical volume centered at 0 0 1465 mm from r = 0 to 740mm, dz=4 mm
  • Reject particles outside of InnerGaseousXenon
  • Isotropic

Visualization of the sampling region:

Image

Hit Map Spatial Information

  • Coordinate System: Cartesian (x, y, z) in millimeters
  • Spatial Extent:
    • X: -750mm to 750mm (stretches into weir gap)
    • Y: -750mm to 750mm (stretches into weir gap)
    • Z: 1457.5mm to 1472.5mm (covers the gas gap from 1461 to 1469mm)
  • Bin Resolution:
    • X bin width: 5mm
    • Y bin width: 5mm
    • Z bin width: 1mm (commented code suggests it was originally 5mm)

PMT Array Positions

  • Top PMT Array Z-position: 1539.5mm
  • Bottom PMT Array Z-position: -148mm
  • PMT Numbering Scheme:
    • Top Array: PMT indices 0-251 (252 PMTs total)
    • Bottom Array: PMT indices 300-540 (241 PMTs total)

Time Map Details

  • Top Array Time Maps:

    • Distance range: 0-1500mm (1500 bins)
    • First time map: 0-10ns (100 bins)
    • Second time map: 10-550ns (540 bins)
    • Bin width changes between maps for better resolution
  • Bottom Array Time Maps:

    • Distance range: 1606-2176mm (570 bins)
    • First time map: 0-2ns (20 bins)
    • Second time map: 2-650ns (648 bins)
    • Bin width changes between maps for better resolution

Selection Logic

  • Only photons hitting PMT photocathodes in the Top or Bottom arrays are tracked
  • PMT skin hits are explicitly excluded
  • The component name must contain "PMT_Photocathode" and either "Top" or "Bottom" but not "Skin"
  • PMT identification is extracted from the last 3 characters of the component name

Histogram Types

  • Histograms for positions use TH3I or TH3F (3D integer or float)
  • Time histograms use TH2I (2D integer)
  • "allPMTHits" is a composite histogram that includes all PMT hits

Proposed storage/tallying

The map is generated from an independent simulation of optical photons:

Possible tally bins:

  • PMT detector ID (mapped during preprocessing using LV title)
  • Primary optical photon position (uniform along each of x, y, z)
  • Time (nonuniform bin: two concatenated uniform segments)
  • Custom function of {primary, detector id}: hypot(detector center - primary position) with uniform bins

The two tallies are:

  • Hit map: [source x][source y][source z][detector id]
  • Time map: [detector id][distance][time]

Requirements

  • [ ] Standalone exe to run the optical photon loop
  • [ ] Photon generator action: geometry-truncated cylinder described above
    • [ ] Prototype #1390 but don't refactor everything
    • [ ] Prototype composable source definition, but hardcode gaussian energy, cyl space with single volume rejection, isotropic
  • [ ] Surface physics (#1512)
  • [ ] Tallies described above, hard-coded (#1752):
    • [ ] Time grid
    • [ ] Concatenated grids
    • [ ] Uniform XYZ grid
    • [ ] Source position
    • [ ] Interacting detector ID
    • [ ] Distance to detector
    • [ ] Just accumulate mean, no variance
  • [ ] MPI global sum? (Future work: partition spatially, write decomposed output using ADIOS)
  • [ ] Output format: ROOT (TH3F) or intermediate (RNTuple, HDF5, ADIOS, bin, ...?)

sethrj avatar Apr 18 '25 11:04 sethrj

@seriksen: can you check the work above? And just to confirm, the PMT hits on the bottom are still due to photon emissions in the top xenon gas layer?

sethrj avatar Apr 18 '25 12:04 sethrj

@sethrj yes the above is correct, and yes the photons seen in the bottom PMTs in this map are from the photon emission in the gas.

I'll add a bit more information for clarity.

The final map

You can see the file we use at /cvmfs/lz.opensciencegrid.org/BACCARAT/S2photonMaps/S2PhotonMaps-Projected-16Oct21.root

For clarity, within the file are a series of histograms

  • 1 for each PMT in the top and bottom PMT arrays in the TPC
  • 4 for time (2 for top array, 2 for bottom array)
  • 1 for hit probability

Hit probability = P(photon hitting any PMT from starting volume) = $\frac{\sum_x \text{N. photon hitting PMT}_x}{\text{N. photons originating in volume}}$ where volume is a cube of {5, 5, 5} mm

Each PMT = P(photon hitting this PMT given a PMT was hit) = $\frac{\sum_x \text{N. photon hitting PMT}_x}{\text{N. photons which hit any PMT}}$

Time = P(hit a PMT from r away in time t) = $\frac{\sum_x \text{N. photon which hit any PMT in time t}}{\text{N. photons which hit any PMT from r (mm) away}}$

This histograms contain the cumulative probability which allows for the binary search.

The simulation

The start positions are set to encompass the gas region between the Anode and the gate grid (top two grids). All photons are in the gas phase.

Image

The sampling

The numbering of the PMTs is what sets whether the PMTs are in the top array or the bottom array, and there's always a gap to the next hundredth. In the histograms

Image

seriksen avatar May 07 '25 10:05 seriksen

Awesome @seriksen , thanks! Although we now have the PMT coordinates extracted from your LZDetectorPMTBankCoordinates.hh into JSON, I'm curious how the numbering system was created? Is it ordered first by centerpoint radius, then counterclockwise by angle (as opposed to a hexagonal ring numbering with (u,v) coordinates)?

lz.json

sethrj avatar May 08 '25 06:05 sethrj

Yep it's exactly that. Closest to the center and counter clockwise!

seriksen avatar May 08 '25 11:05 seriksen