icemc

Simple Monte Carlo routines.

icemc.icemc

Gamma2tau(Gamma)[source]

Width to mean lifetime

U(a, b, size=(1,))[source]

Uniform random numbers from [a,b]

annotate_heatmap(x, y, Z, ax)[source]

Annotate heatmap with text (broken function, fix TBD).

outer_sim_loop(M_values, ctau_values, pt2, rap, acc_func, N)[source]

Simulation helper (wrapper) loop

Returns:

Acceptance probability matrix

Return type:

Z

outer_sim_loop_2(M, ctau, pt2_values, rap_values, acc_func, N)[source]

Simulation helper (wrapper) loop

Returns:

Acceptance probability matrix

Return type:

Z

produce_acceptance_sim(N=1000)[source]

Simulate fiducial (geometric) acceptance by looping over (M,ctau) or (Pt,Rap) pairs, others being fixed.

randexp(u, size=(1,))[source]

Exponential random variables pdf(x) ~ 1/u exp(-x/u) with mean u

randpow(a, b, g, size=(1,))[source]

Power-law random numbers for pdf(x) ~ x^{g-1} for a <= x <= b

resonance_generator(M, ctau, pt2, rap, N=1000)[source]

Simulation massive resonance with (M, ctau) parameters, having production kinematics (pt2, rapidity, phi ~ flat)

Returns:

Array of 4-momentum (resonance 4-momentum) x4 : Array of 4-position (resonance decay 4-position)

Return type:

p4

set_aspect_true_equal(ax)[source]

Set plot square sized.

spherical_acceptance(p4, x4)[source]

Spherical (geometric) acceptance function.

Parameters:
  • p4 – Array of 4-momentum

  • x4 – Array of 4-position

Params:

R : Spherical detector radius (extend to more complex) [global]

Returns:

Array of True/False for each event (accepted or not)

tau2Gamma(tau)[source]

Mean lifetime to width

test()[source]
test_toy_pt_spectrum()[source]
twobody(p, m1, m2)[source]

2-body isotropic decay routine according to dLIPS_2 flat phase space

Parameters:

p

4-momentum of the mother (in the lab frame, usually)

m1 : Daughter 1 invariant mass m2 : Daughter 2 invariant mass

Returns:

Daughter 4-momentum

in the the same frame as the mother was defined

Return type:

p1,p2