26 #include "TGraphAsymmErrors.h" 27 #include "TGraphErrors.h" 34 #include "TPaveLabel.h" 37 #include "TTimeStamp.h" 43 unsigned int fhcStart = 1551204000;
44 const std::string fFiles =
"defname: " + samdef + Form(
" and online.subrunendtime >= '%u' and online.subrunendtime <= '%u' and online.subrunendtime >= '%u'", timestamp - 86400*nDays, timestamp, fhcStart);
48 TH1D* hLiveTime =
new TH1D(
"hLiveTime",
";Livetime (s)", 1, 0, 1);
84 hSig->SetName((
"sig_"+plots[
i].
fname).c_str());
88 hSig->SetLineColor(
kBlue);
89 hSig->SetLineWidth(1);
90 hSig->SetMarkerColor(
kBlue);
99 int fSignal = (
int) hSig->GetBinContent(30);
100 double fBKG = (hSig->Integral() - fSignal)*1./(44);
101 double prob = TMath::PoissonI(fSignal,fBKG);
103 TLatex
p1(0.15,0.80,Form(
"Evts. in time peak: %i",fSignal));
104 TLatex
p2(0.15,0.75,Form(
"BKG. estimate: %6.2g", fBKG));
105 TLatex
p3(0.15,0.70,Form(
"Probability: %6.2g", prob));
108 p1.SetTextSize(0.04);
111 p2.SetTextSize(0.04);
114 p3.SetTextSize(0.04);
118 g1.SetPoint(0,315,0);
119 g1.SetPoint(1,315,1e99);
120 g2.SetPoint(0,325,0);
121 g2.SetPoint(1,325,1e99);
122 g3.SetPoint(0,0,fBKG);
123 g3.SetPoint(1,500,fBKG);
125 g1.SetLineColor(
kRed);
126 g2.SetLineColor(
kRed);
127 g3.SetLineColor(kPink);
136 gPad->SaveAs((
"/nova/ana/users/novadq/TimePeak/BNB/plots/" + plots[
i].fname +
"_" + naming +
".root").c_str());
137 gPad->SaveAs((
"/nova/ana/users/novadq/TimePeak/BNB/plots/" + plots[
i].fname +
"_" + naming +
".png").c_str());
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
void lastUpdated(unsigned int timestamp)
void getBNBPlots(std::string samdef, unsigned int timestamp, unsigned int nDays, std::string naming)
Representation of a spectrum in any variable, with associated POT.
const SpillVar kSpillUnweighted
====================================================================== ///
virtual void AddSpillHistogram(TH1 *h, const SpillVar &var, const SpillCut &cut, const SpillVar &wei=kSpillUnweighted)
Uses include counting the total POT or spills in a run.
const std::vector< Plot > plots
virtual void Go() override
Load all the registered spectra.
void OverrideLivetime(double newlive)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY!
std::vector< float > Spectrum
const SpillCut kNoSpillCut
The simplest possible cut: pass everything, used as a default.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
const Var kSpillLivetime
Return the Livetime for the spill.