source: trunk/FACT++/spectrum/data.sql@ 19882

Last change on this file since 19882 was 19882, checked in by tbretz, 5 years ago
Spectrum program and external query files.
File size: 609 bytes
Line 
1WITH Table0 AS
2(
3 SELECT
4 INTERVAL(LogEnergyEst, %106:bins) AS `.energy`,
5 COUNT(IF(Weight>0, 1, NULL)) AS `Signal`,
6 COUNT(IF(Weight<0, 1, NULL))/5 AS `Background`
7 -- SUM(IF(Weight>0, 1./log10(Size), 0)) AS `Signal`,
8 -- SUM(IF(Weight<0, 1./log10(Size), 0)) AS `Background`
9
10 -- FIXME: Add excess vs theta
11 FROM
12 Excess
13 GROUP BY
14 `.energy`
15 ORDER BY
16 `.energy`
17)
18
19SELECT
20 *,
21 `Signal` - `Background` AS `Excess`,
22 LiMa(`Signal`, `Background`) AS `Significance`,
23 ExcErr(`Signal`, `Background`) AS `ErrExcess`
24FROM
25 Table0
Note: See TracBrowser for help on using the repository browser.