pisa.stages.reco package

Submodules

pisa.stages.reco.resolutions module

Stage for resolution improvement studies

pisa.stages.reco.resolutions.init_test(**param_kwargs)[source]

Instantiation example

class pisa.stages.reco.resolutions.resolutions(**std_kwargs)[source]

Bases: Stage

stage to change the reconstructed information by a given amount This can be used to esimate the impact of improved recosntruction resolutions for instance

Parameters:

params

Expected params ..

energy_improvement : quantity (dimensionless)
   scale the reco error down by this fraction
coszen_improvement : quantity (dimensionless)
    scale the reco error down by this fraction
pid_improvement : quantity (dimensionless)
    applies a shift to the classification parameter

Expected container keys are ..

"true_energy"
"true_coszen"
"reco_energy"
"reco_coszen"
"pid"

setup_function()[source]

Implement in services (subclasses of Stage)

pisa.stages.reco.simple_param module

Create reconstructed and PID variables based on truth information for MC events using simple parameterisations.

pisa.stages.reco.simple_param.dict_lookup_wildcard(dict_obj, key)[source]

Find the object in a dict specified by a key, where the key may include wildcards

Parameters:
  • dict_obj (dict) – The dict (or dict-like) object to search

  • key (str) – The key to search for in the dict (may include wildcards)

Returns:

  • key (str) – The str found in the dict matching the wildcard

  • value (anything) – The value found corresponding to the the requested key

pisa.stages.reco.simple_param.energy_dependent_sigma(energy, energy_0, sigma_0, energy_power)[source]

Returns an energy dependent sigma (standard deviation) value(s), with energy dependence defined as follows:

sigma(E) = sigma(E=E0) * (E/E0)^n

Parameters:
  • energy (array or float) – Energy value to evaluate sigma at

  • energy_0 (float) – Energy at which sigma_0 is defined

  • sigma_0 (float) – The value of sigma at energy_0

  • energy_power (float) – Power/index fo the energy dependence

Returns:

sigma(energy) – The value of sigma at the specified energy (or energies)

Return type:

array or float

pisa.stages.reco.simple_param.has_muon(particle_key)[source]

Function returning True if the particle type has muons in the final state This is numu CC and atmopsheric muons

Parameters:

particle_key (string) – Key identifiying the particle type, e.g. numu_cc, nutau_nc, muon, etc.

Returns:

has_muon – Flag set to try if particle has muon in final state

Return type:

bool

pisa.stages.reco.simple_param.logistic_function(a, b, c, x)[source]

Logistic function as defined here: https://en.wikipedia.org/wiki/Logistic_function. Starts off slowly rising, before steeply rising, then plateaus.

Parameters:
  • a (float) – Normalisation (e.g. plateau height)

  • b (float) – Steepness of rise (larger value means steeper rise)

  • c (float) – x value at half-height of curve

  • x (array) – The continuous parameter

Returns:

f(x) – The results of applying the logistic function to x

Return type:

array

class pisa.stages.reco.simple_param.simple_param(**std_kwargs)[source]

Bases: Stage

Stage to generate reconstructed parameters (energy, coszen, pid) using simple parameterizations. These are not fit to any input data, but are simple and easily understandable and require no input reconstructed events.

Can easily be tuned to any desired physics case, rught now repesent a DeepCore/ICU-like detector.

Parameters:

params (ParamSet) –

Must exclusively have parameters:

perfect_recobool

If True, use “perfect reco”: reco == true, numu(bar)_cc -> tracks, rest to cascades If False, use the parametrised reco energy, coszen and pid functions

reco_energy_paramsdict

Dict defining the params argument to simple_reco_energy_parameterization See simple_reco_energy_parameterization documentatio for more details

reco_coszen_paramsdict

Dict defining the params argument to simple_reco_coszen_parameterization See simple_reco_coszen_parameterization documentatio for more details

pid_track_paramsdict

Dict defining the params argument to simple_pid_parameterization See simple_pid_parameterization documentatio for more details

track_pidfloat

The numerical ‘pid’ variable value to assign for tracks

cascade_pidfloat

The numerical ‘pid’ variable value to assign for cascades

Expected container keys are ..

"true_energy"
"true_coszen"

setup_function()[source]

Implement in services (subclasses of Stage)

pisa.stages.reco.simple_param.simple_pid_parameterization(particle_key, true_energy, params, track_pid, cascade_pid, random_state)[source]

Function to assign a PID based on truth information. Is particle-, interaction- and energy-dependent Approximating energy dependence using a logistic function. Can use as a placeholder if real reconstructions are not currently available.

Parameters:
  • particle_key (string) – Key identifiying the particle type, e.g. numu_cc, nutau_nc, muon, etc.

  • true_energy (array) – True energy array.

  • params (dict) – keys : particle key (wilcards accepted) values : Logistic function params for track ID (list) : [ normalisation (plateau height), steepness of rise, true_energy at half-height ] (example: params = {‘nue*_cc’:[0.05,0.2,15.],})

  • track_pid (float) – A PID value to assign to track-like events

  • cascade_pid (float) – A PID value to assign to cascade-like events

  • random_state (np.random.RandomState) – User must provide the random state, meaning that reproducible results can be obtained when calling multiple times.

Returns:

pid – PID values.

Return type:

array

pisa.stages.reco.simple_param.simple_reco_coszen_parameterization(particle_key, true_energy, true_coszen, params, random_state)[source]

Function to produce a smeared reconstructed cos(zenith) distribution. Resolution is particle- and energy-dependent Use as a placeholder if real reconstructions are not currently available. Keep within the rotational bounds

Parameters:
  • true_coszen (array) – True cos(zenith angle) array.

  • true_energy (array) – True energy array.

  • params (dict) – keys : particle key (wilcards accepted) values : list : [ E0 (reference true_energy), median reco error at E0, index/power of energy dependence ] (example: params = {‘nue*_cc’:[10.,0.2,0.5],})

  • random_state (np.random.RandomState) – User must provide the random state, meaning that reproducible results can be obtained when calling multiple times.

Returns:

reco_coszen – Reconstructed cos(zenith angle) array.

Return type:

array

pisa.stages.reco.simple_param.simple_reco_energy_parameterization(particle_key, true_energy, params, random_state)[source]

Function to produce a smeared reconstructed energy distribution. Resolution is particle- and energy-dependent Use as a placeholder if real reconstructions are not currently available.

Parameters:
  • particle_key (string) – Key identifiying the particle type, e.g. numu_cc, nutau_nc, muon, etc.

  • true_energy (array) – True energy array.

  • params (dict) – keys : particle key (wilcards accepted) values : list : [ E0 (reference true_energy), median reco error at E0, index/power of energy dependence ] (example: params = {‘nue*_cc’:[10.,0.2,0.2],})

  • random_state (np.random.RandomState) – User must provide the random state, meaning that reproducible results can be obtained when calling multiple times.

Returns:

reco_energy – Reconstructed energy array.

Return type:

array

pisa.stages.reco.simple_param.visible_energy_correction(particle_key)[source]

Simple way to estimate the amount of visible energy in the event.

Right now considering cases with final state neutrinos, such as NC events, and nutau CC events (where the tau decays to a tau neutrino).

Neglecting the much lower losses due to muon decay for numu CC. Also neglecting fact that different particle types produce differing photon yields.

I’ve tuned these by eye due to the biases seen in GRECO pegleg, which to first order I’m assuming are due to this missing energy. There is also a bias in numu CC in GRECO, but suspect this is due to containment or stochastics, but either way not reproducing this here.

Parameters:

particle_key (string) – Key identifiying the particle type, e.g. numu_cc, nutau_nc, muon, etc.

Returns:

visible_energy – Estimated visible energy in each event

Return type:

array

Module contents