- Timestamp:
- 12/15/19 00:34:27 (5 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/spectrum/display.C
r19897 r19900 199 199 c->cd(4); 200 200 gPad->SetLogy(); 201 file.GetObject("Data/Energy/ Excess", h1);201 file.GetObject("Data/Energy/Differential/Excess", h1); 202 202 h1->SetTitle("Measured Signal (blue) / Simulated Excess (black)"); 203 203 h1->SetLineColor(kBlue); … … 214 214 c = new TCanvas("Integral Spectrum", "Integral Spectrum"); 215 215 c->SetLogy(); 216 file.GetObject("Data/Energy/ IntegratedSpectrum", h1);216 file.GetObject("Data/Energy/Differential/IntegratedSpectrum", h1); 217 217 h1->SetLineColor(kGray); 218 218 h1->SetMarkerColor(kGray); 219 219 h1->DrawCopy("P"); 220 file.GetObject("Data/Energy/Integral Spectrum", h1);220 file.GetObject("Data/Energy/Integral/Spectrum", h1); 221 221 h1->DrawCopy("P same"); 222 222 … … 230 230 cout << endl; 231 231 232 file.GetObject("Data/Energy/ RolkeIntegralUL", h1);232 file.GetObject("Data/Energy/Integral/RolkeUL", h1); 233 233 h1->SetMarkerStyle(23); 234 234 h1->DrawCopy("P same"); … … 242 242 c = new TCanvas("Differential Spectrum", "Differential Spectrum"); 243 243 c->SetLogy(); 244 file.GetObject("Data/Energy/ Spectrum", h1);244 file.GetObject("Data/Energy/Differential/Spectrum", h1); 245 245 h1->DrawCopy("P"); 246 246 … … 254 254 cout << endl; 255 255 256 file.GetObject("Data/Energy/ RolkeUL", h1);256 file.GetObject("Data/Energy/Differential/RolkeUL", h1); 257 257 h1->SetMarkerStyle(23); 258 258 h1->DrawCopy("P same"); -
trunk/FACT++/spectrum/spectrum.sql
r19897 r19900 17 17 SELECT 18 18 *, 19 SUM(`Signal`) OVER Integral AS IntegralSignal,20 SUM(`Background`) OVER Integral /5 AS IntegralBackground,21 SUM(SumEnergyEst) OVER Integral AS IntegralEnergyEst,22 SUM(SumW) OVER Integral AS IntegralSumW19 SUM(`Signal`) OVER Integral AS SignalI, 20 SUM(`Background`) OVER Integral /5 AS BackgroundI, 21 SUM(SumEnergyEst) OVER Integral AS EnergyEstI, 22 SUM(SumW) OVER Integral AS SumWI 23 23 FROM 24 24 BinnedData … … 39 39 `Background`, 40 40 41 IntegralSignal,42 IntegralBackground,41 SignalI, 42 BackgroundI, 43 43 44 `Signal` - `Background` 45 SQRT(`Signal`) 46 SQRT(`Background`) 47 ExcErr(`Signal`, `Background`) 48 LiMa( `Signal`, `Background`) 44 `Signal` - `Background` AS Excess, 45 SQRT(`Signal`) AS ErrSignal, 46 SQRT(`Background`) AS ErrBackground, 47 ExcErr(`Signal`, `Background`) AS ErrExcess, 48 LiMa( `Signal`, `Background`) AS Significance, 49 49 50 IntegralSignal - IntegralBackground AS IntegralExcess,51 SQRT( IntegralSignal) AS ErrIntegralSignal,52 SQRT( IntegralBackground) AS ErrIntegralBackground,53 ExcErr( IntegralSignal, IntegralBackground) AS ErrIntegralExcess,54 LiMa( IntegralSignal, IntegralBackground) AS IntegralSignificance,50 SignalI - BackgroundI AS ExcessI, 51 SQRT(SignalI) AS ErrSignalI, 52 SQRT(BackgroundI) AS ErrBackgroundI, 53 ExcErr(SignalI, BackgroundI) AS ErrExcessI, 54 LiMa( SignalI, BackgroundI) AS SignificanceI, 55 55 56 SumEnergyEst/SumW AS AvgEnergyEst,57 IntegralEnergyEst/IntegralSumW AS IntegralAvgEnergyEst,56 SumEnergyEst/SumW AS AvgEnergyEst, 57 EnergyEstI/SumWI AS AvgEnergyEstI, 58 58 59 %102:id.ExcessFluxW AS SimExcess,60 %102:id.ErrExcessFluxW AS ErrSimExcess,61 %102:id.IntegralExcessFluxW AS IntegralSimExcess,62 %102:id.ErrIntegralExcessFluxW AS ErrIntegralSimExcess,59 %102:id.ExcessFluxW AS SimExcess, 60 %102:id.ErrExcessFluxW AS ErrSimExcess, 61 %102:id.IntegralExcessFluxW AS SimExcessI, 62 %102:id.ErrIntegralExcessFluxW AS ErrSimExcessI, 63 63 64 64 -- For flux-vs-theta: Correction for already applied ZdWeights 65 65 Sim.SimFluxW/%103:weight AS SimFluxW, 66 66 Sim.ErrSimFluxW/%104:errweight AS ErrSimFluxW, 67 Sim.IntegralSimFluxW/%103:weight AS IntegralSimFluxW,68 Sim.ErrIntegralSimFluxW/%104:errweight AS Err IntegralSimFluxW67 Sim.IntegralSimFluxW/%103:weight AS SimFluxI, 68 Sim.ErrIntegralSimFluxW/%104:errweight AS ErrSimFluxI 69 69 FROM 70 70 Data … … 101 101 -- Integral Spectrum 102 102 103 IntegralSimExcess/IntegralSimFluxW AS IntegralEfficiency,103 SimExcessI/SimFluxI AS EfficiencyI, 104 104 105 IntegralExcess/IntegralSimExcess/AreaTime AS IntegralExcessRatio,106 IntegralExcess/IntegralSimExcess/AreaTime105 ExcessI/SimExcessI/AreaTime AS ExcessRatioI, 106 ExcessI/SimExcessI/AreaTime 107 107 * SQRT( 108 + POW(Err IntegralExcess / IntegralExcess, 2)109 + POW(Err IntegralSimExcess / IntegralSimExcess, 2)110 ) AS Err IntegralExcessRatio,108 + POW(ErrExcessI / ExcessI, 2) 109 + POW(ErrSimExcessI / SimExcessI, 2) 110 ) AS ErrExcessRatioI, 111 111 112 112 113 IntegralExcess/IntegralSimExcess*IntegralSimFluxW/AreaTime AS IntegralFlux,114 IntegralExcess/IntegralSimExcess*IntegralSimFluxW/AreaTime113 ExcessI/SimExcessI*SimFluxI/AreaTime AS FluxI, 114 ExcessI/SimExcessI*SimFluxI/AreaTime 115 115 * SQRT( 116 + POW(Err IntegralExcess / IntegralExcess, 2)117 + POW(Err IntegralSimExcess / IntegralSimExcess, 2)118 + POW(Err IntegralSimFluxW / IntegralSimFluxW,2)119 ) AS Err IntegralFlux116 + POW(ErrExcessI / ExcessI, 2) 117 + POW(ErrSimExcessI / SimExcessI, 2) 118 + POW(ErrSimFluxI / SimFluxI, 2) 119 ) AS ErrFluxI 120 120 121 121 FROM -
trunk/FACT++/src/spectrum.cc
r19899 r19900 1895 1895 const mysqlpp::Row &row = *ir; 1896 1896 1897 const size_t bin = row[*ib=="Theta" ? ".theta" : ".sparse_est"]; 1898 const double flux = row["Flux"]; 1899 const double error = row["ErrFlux"]; 1897 const size_t bin = row[*ib=="Theta" ? ".theta" : ".sparse_est"]; 1900 1898 1901 1899 #ifdef HAVE_ROOT … … 1903 1901 const double dat_bg = row["Background"]; 1904 1902 1905 const double dat_isig = row[" IntegralSignal"];1906 const double dat_ibg = row[" IntegralBackground"];1903 const double dat_isig = row["SignalI"]; 1904 const double dat_ibg = row["BackgroundI"]; 1907 1905 1908 1906 const double eff = row["Efficiency"]; 1909 const double ieff = row[" IntegralEfficiency"];1907 const double ieff = row["EfficiencyI"]; 1910 1908 1911 1909 const double areatime = row["AreaTime"]; … … 1926 1924 if (verbose>0) 1927 1925 { 1928 cout << setw(5) << row["center"] << ": ";1929 cout << setw(10) << row["Excess"] << " ";1930 cout << setw(10) << flux<< " ";1931 cout << setw(10) << error<< " ";1926 cout << setw(5) << row["center"] << ": "; 1927 cout << setw(10) << row["Excess"] << " "; 1928 cout << setw(10) << row["Flux"] << " "; 1929 cout << setw(10) << row["ErrFlux"] << " "; 1932 1930 cout << setw(10) << row["Significance"] << '\n'; 1933 1931 } … … 1935 1933 1936 1934 Histogram hist; 1937 hist.dir = "Data/"+*ib;1938 1935 hist.table = table; 1939 1936 hist.binningx = *ib=="Theta" ? binning_theta : binning_sparse; … … 1942 1939 hist.stats = false; 1943 1940 1944 const vector<string> types = *ib=="Theta" ? vector<string>{ "" } : vector<string>{ "", "I ntegral" };1941 const vector<string> types = *ib=="Theta" ? vector<string>{ "" } : vector<string>{ "", "I" }; 1945 1942 for (auto it=types.cbegin(); it!=types.cend(); it++) 1946 1943 { 1944 hist.dir = *ib=="Theta" ? "Data/Theta" : (it->empty() ? "Data/Energy/Differential" : "Data/Energy/Integral"); 1945 1947 1946 hist.axisy = "Counts"; 1948 1947 if (*ib=="Energy") … … 1950 1949 1951 1950 hist.title = ""; 1952 hist.v = *it+"Signal";1953 hist.err = "Err "+*it+"Signal";1951 hist.v = "Signal"+*it; 1952 hist.err = "ErrSignal"+*it; 1954 1953 WriteHistogram(connection, hist); 1955 1954 1956 1955 hist.title = ""; 1957 hist.v = *it+"Background";1958 hist.err = "Err "+*it+"Background";1956 hist.v = "Background"+*it; 1957 hist.err = "ErrBackground"+*it; 1959 1958 WriteHistogram(connection, hist); 1960 1959 1961 1960 hist.title = ""; 1962 hist.v = *it+"Excess";1963 hist.err = "Err "+*it+"Excess";1961 hist.v = "Excess"+*it; 1962 hist.err = "ErrExcess"+*it; 1964 1963 WriteHistogram(connection, hist); 1965 1964 1966 1965 hist.title = ""; 1967 hist.v = *it+"Significance";1966 hist.v = "Significance"+*it; 1968 1967 hist.err = ""; 1969 1968 hist.axisy = "#sigma"; … … 1973 1972 1974 1973 hist.title = ""; 1975 hist.v = *it+"AvgEnergyEst";1974 hist.v = "AvgEnergyEst"+*it; 1976 1975 hist.err = ""; 1977 1976 hist.axisy = "<E_{est}>/GeV"; … … 1981 1980 1982 1981 hist.title = ""; 1983 hist.v = *it+"ExcessRatio";1984 hist.err = "Err "+*it+"ExcessRatio";1982 hist.v = "ExcessRatio"+*it; 1983 hist.err = "ErrExcessRatio"+*it; 1985 1984 hist.axisy = "Ratio"; 1986 1985 if (*ib=="Energy") … … 1989 1988 } 1990 1989 1990 hist.dir = *ib=="Theta" ? "Data/Theta" : "Data/Energy/Differential"; 1991 1991 hist.axisy = "dN/dE "; 1992 1992 if (*ib=="Energy") … … 2003 2003 hist.axisy = "dN/dE (E>E_{lo}) [cm^{-2} s^{-1}]"; 2004 2004 2005 hist.name = "IntegralSpectrum"; 2006 hist.v = "IntegralFlux"; 2007 hist.err = "ErrIntegralFlux"; 2005 hist.dir = "Data/Energy/Integral"; 2006 hist.name = "Spectrum"; 2007 hist.v = "FluxI"; 2008 hist.err = "ErrFluxI"; 2008 2009 WriteHistogram(connection, hist); 2009 2010 2011 hist.dir = "Data/Energy/Differential"; 2010 2012 hist.name = "IntegratedSpectrum"; 2011 2013 hist.v = "IntegratedFlux"; … … 2015 2017 2016 2018 #ifdef HAVE_ROOT 2019 hist.dir = *ib=="Theta" ? "Data/Theta" : "Data/Energy/Differential"; 2017 2020 hist.axisy = *ib=="Theta" ? "UL [cm^{-2} s^{-1}]" : "UL [cm^{-2} s^{-1} TeV^{-1}]"; 2018 2021 … … 2031 2034 if (*ib=="Energy") 2032 2035 { 2033 hist.name = "IntegralRolkeUL"; 2036 hist.dir = "Data/Energy/Integral"; 2037 hist.name = "RolkeUL"; 2034 2038 WriteHistogram(connection, hist, rolke_int); 2035 2039 }
Note:
See TracChangeset
for help on using the changeset viewer.