hax.treemakers package

Submodules

hax.treemakers.common module

Standard variables for most analyses

class hax.treemakers.common.Basics[source]

Bases: hax.minitrees.TreeMaker

Basic information needed in most (standard) analyses, mostly on the main interaction.

Provides:
  • s1: The uncorrected area in pe of the main interaction’s S1
  • s2: The uncorrected area in pe of the main interaction’s S2
  • x_pax: The x-position of the main interaction from pax (by TopPatternFit, field-distortion corrected)
  • y_pax: The y-position of the main interaction from pax
  • z: The z-position of the main interaction (computed by pax using configured drift velocity)
  • drift_time: The drift time in ns (pax units) of the main interaction
  • s1_area_fraction_top: The fraction of uncorrected area in the main interaction’s S1 seen by the top array
  • s2_area_fraction_top: The fraction of uncorrected area in the main interaction’s S2 seen by the top array
  • s1_range_50p_area: The width of the s1 (ns), duration of region that contains 50% of the area of the peak
  • s2_range_50p_area: The width of the s2 (ns), duration of region that contains 50% of the area of the peak
  • largest_other_s1: The uncorrected area in pe of the largest S1 in the TPC not in the main interaction
  • largest_other_s2: The uncorrected area in pe of the largest S2 in the TPC not in the main interaction
  • largest_veto: The uncorrected area in pe of the largest non-lone_hit peak in the veto
  • largest_unknown: The largest TPC peak of type ‘unknown’
  • largest_coincidence: The largest TPC peak of type ‘coincidence’. This peak type no longer exists
Notes:
extract_data(event)[source]
class hax.treemakers.common.Extended[source]

Bases: hax.minitrees.TreeMaker

Extra information, mainly motivated by cuts used for the first science run. If there are no interactions in the event, all these values will be NaN.

Provides:
  • s1_range_80p_area: The width of the s1 (ns), duration of region that contains 80% of the area of the peak
  • s1_range_90p_area: The width of the s1 (ns), duration of region that contains 90% of the area of the peak
  • s1_range_100p_area: The width of the s1 (ns), duration of region that contains 100% of the area of the peak
  • s2_range_80p_area: The width of the s2 (ns), duration of region that contains 80% of the area of the peak
  • s1_n_contributing_channels: Number of PMTs contributing to the S1.
  • s2_n_contributing_channels: Number of PMTs contributing to the S2.
  • s1_largest_hit_area: Area of the largest hit in the S1
  • s2_largest_hit_area: Area of the largest hit in the S2
  • s1_largest_hit_channel: PMT channel of the largest hit in the S1
  • s2_largest_hit_channel: PMT channel of the largest hit in the S2
  • s1_rise_time: The time between the 10% and 50% area points of the S1
  • s2_rise_time: The time between the 10% and 50% area points of the S2
  • s1_tight_coincidence: Number of PMTs with a hit close (window defined in pax) to the peak’s sum waveform maximum
  • s1_pattern_fit: Poisson likehood of main S1’s hitpattern (according to MC S1(xyz) per-PMT maps)
  • s2_pattern_fit: Poisson likehood of main S2’s hitpattern (according to MC S2(xy) per-PMT maps)
  • r_pos_correction: r-correction added to the interaction r position to account for field distortion.
  • z_pos_correction: z-correction added to the interaction z position to account for field distortion.
  • x_nn: x-position of the main interaction as reconstructed by neural net. NOT Field-distortion (r,z) corrected!!!
  • y_nn: y-position of the main interaction as reconstructed by neural net. NOT Field-distortion (r,z) corrected!!!
  • x_tpff: x-position of the main interaction as reconstructed by Top Pattern Function Fit algorithm. no FDC
  • y_tpff: y-position of the main interaction as reconstructed by Top Pattern Function Fit algorithm. no FDC
  • sum_s1s_before_main_s2: Sum of all S1 areas before the main S2
  • alt_s1_interaction_drift_time: Drift time of interaction formed with largest other S1 + main S2
  • alt_s1_interaction_z: Z position of interaction formed with largest other S1 + main S2
  • alt_s1_tight_coincidence: S1 tight coincidence of interaction formed with largest other S1 + main S2
  • alt_s2_interaction_x: X position of interaction with main S1 + largest other S2 (field-distortion rz corrected)
  • alt_s2_interaction_y: Y position of interaction with main S1 + largest other S2 (field-distortion rz corrected)
  • alt_s2_interaction_z: Z position of interaction with main S1 + largest other S2 (field-distortion rz corrected)
  • alt_s2_interaction_s2_range_50p_area: S2 50% area width of interaction with main S1 + largest other S2
  • alt_s2_interaction_s2_range_80p_area: S2 80% area width of interaction with main S1 + largest other S2
  • s1_area_fraction_top_probability: probability of s1 area fraction top given its reconstructed position
  • largest_other_s2_delay_main_s1: The hit time mean minus main S1 hit time mean
  • largest_other_s2_delay_main_s2: The hit time mean minus main S2 hit time mean
  • largest_other_s2_pattern_fit: Goodness-of-fit of hit pattern to position provided by PosRecTopPatternFit

(for pax < v6.6.0, field is not stored) See also the DoubleScatter minitree for more properties of alternative interactions.

extra_branches = ['peaks.area_decile_from_midpoint[11]', 'peaks.tight_coincidence', 'peaks.n_contributing_channels', 'peaks.largest_hit_channel', 'interactions.s1_pattern_fit', 'peaks.reconstructed_positions*', 'interactions.r_correction', 'interactions.z_correction', 'interactions.xy_posrec_goodness_of_fit', 'peaks.largest_hit_area', 'peaks.left', 'interactions.s1_area_fraction_top_probability', 'peaks.hit_time_mean']
extract_data(event)[source]
class hax.treemakers.common.Fundamentals[source]

Bases: hax.minitrees.TreeMaker

Simple minitree containing basic information about every event, regardless of its contents. This minitree is always loaded whether you like it or not :-)

Provides:
  • run_number: Run number of the run/dataset this event came from (common to all treemakers)
  • event_number: Event number within the dataset (common to all treemakers)
  • event_time: Unix time (in ns since the unix epoch) of the start of the event window
  • event_duration: duration (in ns) of the event
branch_selection = ['event_number', 'start_time', 'stop_time']
extract_data(event)[source]
pax_version_independent = True
class hax.treemakers.common.LargestPeakProperties[source]

Bases: hax.minitrees.TreeMaker

Largest peak properties for each type and for all peaks. If you’re doing an S1-only or S2-only analysis, you’ll want this info instead of Basics. In other case you may want to combine this and Basics.

extra_branches = ['peaks.n_hits', 'peaks.hit_time_std', 'peaks.center_time', 'peaks.n_saturated_channels', 'peaks.n_contributing_channels', 'peaks.reconstructed_positions*']
extract_data(event)[source]
get_properties(peak=None, prefix='')[source]

Return dictionary with peak properties, keys prefixed with prefix if peak is None, will return nans for all values

peak_properties_to_get = ['area', 'area_fraction_top', 'n_hits', 'hit_time_std', 'center_time', 'n_saturated_channels', 'n_contributing_channels']
peak_types = ['s1', 's2', 'lone_hit', 'unknown']
class hax.treemakers.common.TotalProperties[source]

Bases: hax.minitrees.TreeMaker

Aggregate properties of signals in the entire event

Provides:
  • n_pulses, the total number of raw pulses in the event (for pax versions >6.0.0)
  • n_peaks, the total number of TPC peaks in the event (including lone hits)
  • n_true_peaks, the total number of TPC peaks in the event to which at least two PMTs contribute
  • total_peak_area, the total area (pe) in all TPC peaks in the event
  • area_before_main_s2, same, but including only peaks that occur before the main s2 (if there is one, else 0)
branch_selection = ['peaks.area', 'n_pulses', 'peaks.detector', 'interactions.s2', 'peaks.left', 'peaks.type']
extract_data(event)[source]
hax.treemakers.common.get_largest_indices(peaks, exclude_indices=())[source]

Return a dic with the indices in peaks of the largest peak of each type (s1, s2, etc) excluding the inices in exclude_peak_indices from consideration

hax.treemakers.cut_booleans_examples module

class hax.treemakers.cut_booleans_examples.EnergyCut[source]

Bases: hax.minitrees.TreeMaker

S1 and S2 size cut booleans

Require that the S1 and S2 be large enough.

Provides:
  • pass_s1_area_cut: S1 bigger than 1 pe
  • pass_s2_area_cut: S2 bigger than 150 pe

Notes:

  • This only cuts signals that are too small.
extract_data(event)[source]

hax.treemakers.DoubleScatter module

hax.treemakers.examples module

class hax.treemakers.examples.TimeDifferences[source]

Bases: hax.minitrees.TreeMaker

Compute time differences between S1s and S2s

The convention is that these times are how much later the second largest signal is from the main one. For example, this could be the time of the second largest S2 minus the time of the largest S2. Therefore, you’ll have a positive number if the second largest S2 came after the main S2.

Provides:
  • dt_s1s: Time difference between two largest S1s
  • dt_s2s: Time difference between two largest S2s

Notes:

  • Positive times means the second largest signal is later.
  • The code is intentionally not general for clarity.
  • This code does not use the interaction concept in any way!
  • ‘Largest’ refers to uncorrected area
extra_branches = ['peaks.hit_time_mean']
extract_data(event)[source]

hax.treemakers.peak_treemakers module

Tree makers for studying peaks on their own

Treemakers used for analyses such as the single-electron shape in time and stability.

class hax.treemakers.peak_treemakers.IsolatedPeaks[source]

Bases: hax.minitrees.MultipleRowExtractor

Returns one row per peak isolated in time

Specifically returns properties of each individual peak.

extra_branches = ['peaks.left', 'peaks.right', 'peaks.n_hits', 'peaks.n_contributing_channels', 'peaks.reconstructed_positions*', 'peaks.area_decile_from_midpoint*']
extract_data(event)[source]
nhits_bounds = (0, inf)
width_bounds = (0, inf)
static yield_peak(event, nhits_bounds, width_bounds)[source]

Extracts a row per peak

The peak type can be single electron and have some selection. This is a generator, and yields (peak, time_to_nearest).

class hax.treemakers.peak_treemakers.PeakExtractor(*args, **kwargs)[source]

Bases: hax.minitrees.MultipleRowExtractor

Base class for reading peak data in minitrees. For more information, check out example 10 in hax/examples.

build_cut_string(cut_list, obj)[source]

Build a string of cuts that can be applied using eval() function.

detectors = {'busy_off': 4, 'busy_on': 3, 'sum_wv': 2, 'tpc': 0, 'veto': 1}
event_cut_list = []
event_cut_string = 'True'
extra_branches = ['peaks.*']
extract_data(event)[source]
peak_cut_list = []
peak_cut_string = 'True'
peak_fields = ['area']
peaktypes = {'lone_hit': 0, 's1': 1, 's2': 2, 'unknown': 3}
stop_after = <MagicMock name='mock.inf' id='140355900206352'>
class hax.treemakers.peak_treemakers.SingleElectrons[source]

Bases: hax.treemakers.peak_treemakers.IsolatedPeaks

nhits_bounds = (15, 26.01)
width_bounds = (50, 450)

hax.treemakers.trigger

class hax.treemakers.trigger.LargestTriggeringSignal[source]

Bases: hax.minitrees.TreeMaker

Information on the largest trigger signal with the trigger flag set in the event

Provides:
  • trigger_*, where * is any of the attributes of datastructure.TriggerSignal
branch_selection = ['trigger_signals*', 'event_number']
extract_data(event)[source]
pax_version_independent = True
class hax.treemakers.trigger.Proximity[source]

Bases: hax.minitrees.TreeMaker

Information on the proximity of other events and acquisition monitor signals (e.g. busy and muon veto trigger) Provides:

  • previous_x: Time (in ns) between the time center of the event and the previous x (see below for various x). This also considers any x inside the event.
  • next_x: same, for time to next x
  • nearest_x: Time to the nearest x. NB: If the nearest x is in the past, this time is negative!
    x denotes the object of interest, and could be either:
  • muon_veto_trigger.
  • busy_x: a busy-on or busy-off signal
  • hev_x: a high-energy veto on or -off signal
  • event: any event (excluding itself :-)
  • 1e5_pe_event: any event with total peak area > 1e5 pe (excluding itself)
  • 3e5_pe_event: “” 3e5 pe “
  • 1e6_pe_event: “” 1e6 pe “
  • s2_area: Area of main s2 in event
  • All the information about the muon_veto_trigger are calculated with respect to the TPC trigger and
  • not to the middle of the event.
aqm_labels = ['muon_veto_trigger', 'busy_on', 'hev_on', 'busy_off', 'hev_off', 'busy', 'hev']
bad_mv_triggers(aqm_pulses, min_time=500)[source]

get me the indices of the sync signal in the MV_trigger sent to the TPC

extract_data(event)[source]
get_data(dataset, event_list=None)[source]

Return data extracted from running over dataset

pax_version_independent = False
select_physical_pulses(aqm_pulses, ap_time=20000)[source]

get rid of afterpulses from the MV data of course!!!!!

class hax.treemakers.trigger.TailCut[source]

Bases: hax.minitrees.TreeMaker

get_data(dataset, event_list=None)[source]

Return data extracted from running over dataset

never_store = True

Module contents