Detector Signal Yield
Several parts of an analysis will require the calculation of the detector signal yield, which is the mean number of expected signal events in the detector for a given source hypothesis, i.e. source flux function \(\Phi(\alpha,\delta,E,t)\).
SkyLLH provides two abstract base classes for creating a detector signal yield
instance, DetSigYieldBuilder
and
DetSigYield
. The first is the builder
class, which will build a DetSigYield
class
instance.
The builder class has the abstract method
construct_detsigyield()
,
which will take a Dataset
,
DatasetData
,
FluxModel
instance, and live-time to
construct a DetSigYield
class instance,
which will provide an evaluation method to calculate the detector signal yield
for a given source, for the given dataset. Hence, the detector signal yield is
dataset and source model dependent.
The DetSigYield
class has two abstract
methods, source_to_array()
and
__call__()
.
The source_to_array()
method takes
a sequence of source models and converts it into a numpy record array suitable
for the __call__()
method to
evaluate the detector signal yield efficiently for a list of sources.
The __call__()
method evaluates
the DetSigYield
instance. As arguments it
takes the source record array created by the
source_to_array()
method, and the
numpy record array holding the (local) source parameter values.
The record array holding the local source parameter values can be generated
through the
create_src_params_recarray
of the ParameterModelMapper
instance of the
analysis. See also the Parameter to Model mapping section.