Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

adding total deposited energy in the sensitive volume as a new truth instruction dtype #429

Merged
merged 4 commits into from
Feb 9, 2024
Merged
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
10 changes: 8 additions & 2 deletions wfsim/strax_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from copy import deepcopy
from immutabledict import immutabledict
import sys
import logging
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -30,6 +31,7 @@
(('Number of quanta', 'amp'), np.int32),
(('Recoil type of interaction.', 'recoil'), np.int8),
(('Energy deposit of interaction', 'e_dep'), np.float32),
(('Total energy deposit in the sensitive volume', 'tot_e'), np.float32),
(('Eventid like in geant4 output rootfile', 'g4id'), np.int32),
(('Volume id giving the detector subvolume', 'vol_id'), np.int32),
(('Local field [ V / cm ]', 'local_field'), np.float64),
Expand Down Expand Up @@ -799,8 +801,12 @@ def get_instructions(self):
epix.run_epix.setup(epix_config),
return_wfsim_instructions=True)

if len(self.instructions_epix)==0 and not 'nveto' in self.config['targets']:
print("The instructions are empty for TPC interactions")
sys.exit(0)

self.g4id.append(self.instructions_epix['g4id'])
log.debug("Epix produced %d instructions in tpc" % (len(self.instructions_epix)))
log.debug("Epix produced %d instructions in TPC" % (len(self.instructions_epix)))

if 'nveto' in self.config['targets']:
self.instructions_nveto, self.nveto_channels, self.nveto_timings =\
Expand All @@ -810,7 +816,7 @@ def get_instructions(self):

self.instructions_nveto = self.instructions_nveto[nv_inst_to_keep]
self.g4id.append(self.instructions_nveto['g4id'])
log.debug("%d instructions were produced in nv" % (len(self.instructions_nveto)))
log.debug("%d instructions were produced in nVeto" % (len(self.instructions_nveto)))

self.g4id = np.unique(np.concatenate(self.g4id))
self.set_timing()
Expand Down
Loading