MonteCarlo (mc)
Introduction
Module containing functions to analyze MC data and compute sensitivity curves.
Reference/API
lstchain.mc.mc Module
Functions
|
|
|
For each bin, return the expected number of events for a power-law distribution. |
|
Calculates the rate of events for a power-law distribution, in a given energy range, collection area and solid angle |
|
Calculates the weight of events to transform a power-law distribution with spectral index sim_sp_idx to a power-law distribution with spectral index w_sp_idx |
lstchain.mc.plot_utils Module
Functions
|
Function to fill bin content to be plotted in the case of an optimized figure array |
|
Format axes for the theta2 and gammaness optimization for a figure array with all energy bins together |
|
Format axes for the theta2 and gammaness optimization per energy bin |
Format axes of the sensitivity plot |
|
|
Plot a percentage of the Crab SED |
|
Plot positions of surviving events after cuts |
|
Plot the achieved sensitivity |
|
Plot the sensitivity minimization plots in different energy bins to check that the theta2 and gammaness cuts were properly applied |
|
Main sensitivity plot. |
lstchain.mc.sensitivity Module
Functions
|
Define binning in gammaness and theta2 for the optimization of the sensitivity |
|
Sensitivity calculation using n_excesses/sqrt(n_background) |
|
Sensitivity calculation using the Li & Ma formula eq. |
|
This function calculates the difference between the number of events after the cut in feature and gamma_efficiency*total number of events |
|
Find cut in feature that corresponds to gamma efficiency. |
|
Calculate the weight to transform from MC spectra to target spectra |
|
Process the MC simulated and reconstructed to extract the relevant parameters to compute the sensitivity |
|
|
|
Read MC simulated parameters |
|
Calculate containment of cosmic ray particles with reconstructed positions within a ring of radius=ring_radius and half width=ring_halfwidth |
|
Check if two numbers have the same sign Parameters ---------- a: float b: float |
|
Main function to calculate the sensitivity for cuts based on gamma efficiency |
Main function to calculate the sensitivity for cuts based on gamma efficiency using real data as ON and OFF events |
|
Main function to calculate the sensitivity for cuts based on gamma efficiency using real protons as background events |