# Changes between Version 256 and Version 257 of DatabaseBasedAnalysis/Spectrum

Ignore:
Timestamp:
Dec 10, 2019, 3:29:56 PM (11 months ago)
Comment:

--

### Legend:

Unmodified
 v256 === Analysis Query === The analysis of Data and !MontaCarlo files must be done totally identical to produce reasonable results. Therefore, the exact same query (or code) should be used for the analysis of both. In this example, the query has to provide two columns, Weight and LogEnergyEst for all gamma-line events. The weight must be +1 for events in the on-region and -0.2 for an event in the off-region (corresponding to the number of five wobble positions). !LogEnergyEst must contain $$\log_{10}$$ of the estimated energy for each event. Only events surviving background suppression and spatial (theta) cuts should be considered. The analysis of Data and !MontaCarlo files must be done totally identical to produce reasonable results. Therefore, the exact same query (or code) should be used for the analysis of both. In this example, the query has to provide two columns, Weight and LogEnergyEst for all gamma-line events. The weight must be +1 for events in the on-region and -0.2 for an event in the off-region (corresponding to the number of five wobble positions). !LogEnergyEst must contain $$\log_{10}$$ of the estimated energy for each event. Only events surviving background suppression and spatial (theta) cuts should be considered. {{{#!Spoiler === Analyze Monte Carlo Data === Similarly to the analysis of Data, another query summarizes the !MonteCarlo Analysis. Similarly to the analysis of Data, another query summarizes the !MonteCarlo Analysis. The result is stored in a temporary table (AnalysisMC). {{{#!Spoiler === Summarize Corsika Production === The following queries produces a summary of the events simulated at first by Corsika. The result is stored in a temporary table (SimulatedSpectrum). {{{#!Spoiler {{{#!sql INTERVAL(LOG10(Energy), %0:energyest) AS .energy, COUNT(*) AS CountN, SUM(    (%2:spectrum)/pow(Energy, SpectralIndex)   ) AS CountW, SUM(POW((%2:spectrum)/pow(Energy, SpectralIndex),2)) AS CountW2 SUM(    (%1:spectrum)/pow(Energy, SpectralIndex)   ) AS CountW, SUM(POW((%1:spectrum)/pow(Energy, SpectralIndex),2)) AS CountW2 FROM MonteCarloFiles }}} The placeholder %0:energyest is the binnings (as used previously) for the logarithm (base 10) of the estimated energy. %1:spectrum is the (unknown) 'true' source spectrum, for example POW(Energy, -2.4). === Result (Spectrum) ===