Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added non-ionizing energy from edep-sim, subtracted from total for ch… #155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cli/dumpTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
("dx", "f4"), ("long_diff", "f4"),
("pixel_plane", "i4"), ("t_end", "f4"),
("dEdx", "f4"), ("dE", "f4"), ("t", "f4"),
("dEdx_nonIonizing", "f4"), ("dE_nonIonizing", "f4"),
("y", "f4"), ("x", "f4"), ("z", "f4"),
("n_photons","f4")], align=True)

Expand Down Expand Up @@ -302,6 +303,7 @@ def dump(input_file, output_file):
segment[iHit]["t0_end"] = hitSegment.GetStop().T() * edep2us
segment[iHit]["t_end"] = 0
segment[iHit]["dE"] = hitSegment.GetEnergyDeposit()
segment[iHit]["dE_nonIonizing"] = hitSegment.GetSecondaryDeposit()
xd = segment[iHit]["x_end"] - segment[iHit]["x_start"]
yd = segment[iHit]["y_end"] - segment[iHit]["y_start"]
zd = segment[iHit]["z_end"] - segment[iHit]["z_start"]
Expand All @@ -313,6 +315,7 @@ def dump(input_file, output_file):
segment[iHit]["t0"] = (segment[iHit]["t0_start"] + segment[iHit]["t0_end"]) / 2.
segment[iHit]["t"] = 0
segment[iHit]["dEdx"] = hitSegment.GetEnergyDeposit() / dx if dx > 0 else 0
segment[iHit]["dEdx_nonIonizing"] = hitSegment.GetSecondaryDeposit() / dx if dx > 0 else 0
segment[iHit]["pdgId"] = trajectories[hitSegment.Contrib[0]]["pdgId"]
segment[iHit]["n_electrons"] = 0
segment[iHit]["long_diff"] = 0
Expand Down
12 changes: 9 additions & 3 deletions larndsim/quenching.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,25 @@ def quench(tracks, mode):
dEdx = tracks[itrk]["dEdx"]
dE = tracks[itrk]["dE"]

dEdx_nonIonizing = tracks[itrk]["dEdx_secondary"]
dE_nonIonizing = tracks[itrk]["dE_secondary"]

dEdx_ionizing = dEdx - dEdx_nonIonizing
dE_ionizing = dE - dE_nonIonizing

recomb = 0
if mode == physics.BOX:
# Baller, 2013 JINST 8 P08005
csi = physics.BOX_BETA * dEdx / (detector.E_FIELD * detector.LAR_DENSITY)
csi = physics.BOX_BETA * dEdx_ionizing / (detector.E_FIELD * detector.LAR_DENSITY)
recomb = max(0, log(physics.BOX_ALPHA + csi)/csi)
elif mode == physics.BIRKS:
# Amoruso, et al NIM A 523 (2004) 275
recomb = physics.BIRKS_Ab / (1 + physics.BIRKS_kb * dEdx / (detector.E_FIELD * detector.LAR_DENSITY))
recomb = physics.BIRKS_Ab / (1 + physics.BIRKS_kb * dEdx_ionizing / (detector.E_FIELD * detector.LAR_DENSITY))
else:
raise ValueError("Invalid recombination mode: must be 'physics.BOX' or 'physics.BIRKS'")

if isnan(recomb):
raise RuntimeError("Invalid recombination value")

tracks[itrk]["n_electrons"] = recomb * dE / physics.W_ION
tracks[itrk]["n_electrons"] = recomb * dE_ionizing / physics.W_ION
tracks[itrk]["n_photons"] = (dE/light.W_PH - tracks[itrk]["n_electrons"]) * light.SCINT_PRESCALE