wiki:DatabaseBasedAnalysis/Spectrum

Version 221 (modified by tbretz, 5 years ago) ( diff )

--

Spectrum Analysis

The differential flux per area, time and energy interval is defined as

Often is also referred to as as observation time and effective collection area is a constant. The effective area is then defined as . Note that at large distances the efficiency vanishes, so that the effective area is an (energy dependent) constant while and the efficiency are mutually dependent.

For an observation with an effective observation time , this yields in a given Energy interval :

For simplicity, in the following, will be replaced by just but always refers to to a given energy interval. If data is binned in a histogram, the relation between the x-value for the bin and the corresponding interval is not well defined. Resonable definitions are the bin center (usually in logarithmic bins) or the average energy.

The total area and the corresponding efficiency are of course only available for simulated data. For simulated data, is the production area and the corresponding energy dependent efficiency of the analysis chain. For a given energy bin, the efficiency is then defined as

where is the number of simulated events in this energy bin and the number of *excess* events that are produced by the analysis chain.

Note that the exact calculation of the efficiency depends on prior knowledge of the correct source spectrum . Therefore, it is strictly speaking only correct if the simulated spectrum and the real spectrum are identical. As the real spectrum is unknown, special care has to be taken of the systematic introduced by the assumption of .

Zenith Angle Weights and Spectral Weights

While the source spectrum is of course independent of the zenith angle of the observation, the efficiency is not, so that

In addition, the observed differential flux depends on the zenith angle. That means that for a correct calculation of the efficiency, the number of simulated events per zenith angle interval has to match the observation time distribution.

This can be achieved by applying zenith angle dependent weights to each simulated event. Similarly, the discussed requirement of the match between result spectrum and simulated spectrum can be achieved applying energy dependent weights .

As the simulated energy spectrum is independent of zenith angle, it can be expressed as

with the differential energy spectrum and the zenith angle distribution and the normalization

The contents of one energy bin and one zenith angle bin can then be written as

and the normalization

Excess

The number of excess events, for data and simulations, is defined as

where is the number of events identified as potential gammas from the source direction ('on-source') and the number of gamma-like events measured 'off-source'. Note that for Simulations, is not necessarily zero for wobble-mode observations as an event can survive the analysis for on- and off-events, if this is not prevented by the analysis (cuts).

The average number of background events is the total number of background events from all off-regions times the corresponding weight (often referred to as ). For five off-regions, this yields

Assuming Gaussian errors, the statistical error is thus

For data this immediately resolves to

with the Poisson (counting) error .

For the simulations, the error on is the error on the weighted sum

<!--With the error this provides -->

Code

In the following refers to a number of simulated events and to a number of measured (excess) events.

is the number of produced events in the energy interval and the zenith angle interval . The weighted number of events in that interval is then

Since with the spectral weight to adapt the spectral shape of the simulated spectrum to the real (measured) spectrum of the source and the weight to adapt to oberservation time versus zenith angle.

The weighted number of produced events in the total energy interval and the total zenith angle interval is then

with being the total number of produced events.

For a sum of weights, e.g. the corresponding error is

As the energy is well defined, and thus

The weights are defined as follow:

where is the simulated spectrum and the (unknown) real source spectrum. is a normalization constant. The zenith angle weights in the interval are defined as

where is the number of produced events in the interval and is the total observation time in the same zenith angle interval. is the normalization constant.

While is given by the data acquisition and 1s per 5min run, is just the statistical error of the number of events.

As the efficiency for an energy interval is calculated as

and and are both expressed as the sum given above, the constants and cancel.

The differential flux in an energy interval is then given as

Where is total area of production and the total observation time. The number of measured excess events is in that energy interval is .

Using Gaussian error propagation, the error in a given energy interval is then given by

with .

Monte Carlo

Errors

Theta and Spectral Weights

While the source spectrum is of course independent of the zenith angle of the observation, the efficiency is not, so that

In addition, the observed differential flux depends on the zenith angle, so that

That means that for a correct calculation of the efficiency, the number of simulated events per zenith angle interval has to match the observation time distribution. This can be achieved by applying zenith angle dependent weights to each simulated event. Similarly, the discussed requirement of the match between result spectrum and simulated spectrum can be achieved applying energy dependent weights .

As the simulated energy spectrum is independent of zenith angle, it can be expressed as

with the differential energy spectrum and the zenith angle distribution .

consequently

or

with

and the total number of generated Monte Carlo events. For the generated number of events in the energy interval and zenith angle interval this is

with the weights chosen such that the sum over all intervals

Define Binnings

Get Data File List

Get Observation Time

Get Monte Carlo File List

Get Zenith Angle Histogram

Analyze Data

Analyze Monte Carlo Data

Summarize Corsika Production

Result (Spectrum)

Result (Threshold)

Result (Migration)

Note: See TracWiki for help on using the wiki.