icebrk

B-physics analysis classes.

icebrk.common

icebrk.cutstats

apply_cuts(d, evt_index, cutflow)[source]

Selection cuts function.

Parameters:
  • d

  • evt_index

  • cutflow

Returns:

True or False

collect_info_stats(d, evt_index, infostats)[source]

Collect event information.

Parameters:
  • d

  • evt_index

  • infostats

collect_mcinfo_stats(d, evt_index, y, qsets, MAXT3, mcinfostats)[source]

Collect MC only information.

Args:

Returns:

init_stat_objects()[source]

Initialize cutflow and statistics objects.

Args:

Returns:

infostats_BC: mcinfostats_BC:

Return type:

cutflow

triplet_cuts(d, evt_index, cutflow)[source]

Triplet cuts

icebrk.fasthistos

initialize()[source]

Initialize histogram dictionaries.

Args:

Returns:

obj

icebrk.features

construct_new_branches(d)[source]

Construct new feature branches.

Parameters:

d

Returns:

generate_feature_names(N=1)[source]
getdimension()[source]

Count the number of features per input triplet.

icebrk.histos

calc_MC_observables(evt_index, d, l1_p4, l2_p4, k_p4, sets, MAXT3)[source]

MC ONLY observables.

Parameters:
  • evt_index

  • d

  • l1_p4

  • l2_p4

  • k_p4

  • sets

  • MAXT3

Returns:

Observables

Return type:

x

calc_batch_MC_observables(d, l1_p4, l2_p4, k_p4)[source]

MC ONLY batch observables.

Parameters:
  • d

  • l1_p4

  • l2_p4

  • k_p4

Returns:

x

calc_batch_observables(l1_p4, l2_p4, k_p4)[source]

JAGGED + VECTORIZED (operates on event batch) observables.

Parameters:
  • l1_p4

  • l2_p4

  • k_p4

Returns:

Observables

Return type:

x

calc_observables(evt_index, d, l1_p4, l2_p4, k_p4, sets, MAXT3)[source]

NON-JAGGED (NORMAL) observables.

Parameters:
  • l1_p4

  • l2_p4

  • k_p4

Returns:

Observables

Return type:

x

pickle_files(iodir, N_algo, label, mode='rb')[source]

Open pickle files.

Parameters:
  • iodir

  • N_algo

  • label

  • mode – mode = ‘rb’ (read binary), ‘ab’ (append binary), ‘wb’ (write binary)

Returns:

Observables

Return type:

x

icebrk.loop

hdf5_append(datasets, key, chunk)[source]

Append chunk of data to HDF5 file.

Parameters:
  • datasets

  • key

  • chunk

Returns:

datasets

Return type:

f

hdf5_write_handles(filename, N_weights, rwmode='w')[source]

Create HDF5 file handles.

Parameters:
  • filename

  • N_weights

  • rwmode

Returns:

datasets

Return type:

f

hist_flush(reco, hobj, h5datasets=None)[source]

Histogram observables with accumulation of previous histograms, and flush buffer arrays

Parameters:
  • reco

  • hobj

  • h5datasets

Return type:

w

initarrays(BUFFER, func_predict, isMC)[source]

Init histogramming arrays and objects

Parameters:
  • BUFFER

  • func_predict

  • isMC

Returns:

hobj:

Return type:

reco

poweranalysis(evt_index, batch_obs, obs, func_predict, x, y, qsets, MAXT3, MAXN, isMC, reco, BMAT, WNORM)[source]

Powerset analysis of the event N.B.this is already CONDITIONED that we select a maximum MAXT3 triplets!

Parameters:
  • evt_index

  • batch_obs

  • obs

  • func_predict

  • x

  • y

  • qsets

  • MAXT3

  • MAXN

  • isMC

  • reco

  • BMAT

  • WNORM

Return type:

w

process(paths=[], func_predict=None, isMC=True, MAXT3=5, MAXN=2, maxevents=10000000000, EVTGROUPSIZE=1024, CHUNKBUFFER=512, VERBOSE=False, BMAT=[], WNORM=[], SUPERSETS=True, hd5dir=None, outputXY=False, outputP=False, **kwargs)[source]

Main event processing loop

Args:

Returns:

icebrk.PDG

icebrk.tools

construct_MC_tree(d)[source]

Construct decay tree branches @[JAGGED].

Parameters:

d

Returns:

construct_MC_truth(d)[source]

Set MC signal truth into a new branch @[JAGGED].

Parameters:

d

Returns:

construct_input_vec(evt_index, d, l1_p4, l2_p4, k_p4, qsets, MAXT3)[source]

Construct MVA input vector x.

feature 1 for all triplets 0 <possible zeros> .. 0 0, feature 2 for all triplets 0 <possible zeros> .. 0 0,

feature D for all triplets 0 <possible zeros> .. 0 0] where zeros are padded after each feature if no enough triplets are found

Args: Returns:

construct_kinematics(d, l1_p4, l2_p4, k_p4)[source]

Construct kinematics of the triplet @[JAGGED].

Parameters:
  • d

  • l1_p4

  • l2_p4

  • k_p4

Returns:

construct_output_vec(evt_index, d, qsets, MAXT3)[source]

Construct MVA output vector y (binary with multilabel).

Args: Returns:

deltar_3(eta1, eta2, eta3, phi1, phi2, phi3, dR_MATCH)[source]

Match vector triplets by their DeltaR.

Args: Returns:

find_connected_triplets(evt_index, l1_p4, l2_p4, k_p4, dR_MATCH=0.01)[source]

Find all qsets of triplets connected together via DeltaR matching of their vectors.

Args: Returns:

get_first_indices(qsets, MAXT3)[source]

Get the first evt_index from a list of list, where sublists encode e.g. different reconstruction chains of triplets.

Args: Returns:

index_of_first_signal(evt_index, d, qsets, MAXT3)[source]

Check the evt_index of the last signal triplet (MC truth).

Args: Returns:

index_of_last_signal(evt_index, d, qsets, MAXT3)[source]

Check the evt_index of the last signal triplet (MC truth).

Args: Returns:

print_MC_event(evt_index, d, l1_p4, l2_p4, k_p4, qsets, PRINTMAX=10000)[source]

Print MC event info.

Args: Returns: