25 #include "TGraphAsymmErrors.h" 26 #include "TGraphErrors.h" 33 #include "TPaveLabel.h" 36 #include "TTimeStamp.h" 42 const std::string fFiles =
"defname: " + samdef + Form(
" and online.subrunendtime >= '%u' and online.subrunendtime <= '%u'", timestamp - 86400*nDays, timestamp);
46 TH1D* hLiveTime =
new TH1D(
"hLiveTime",
";Livetime (s)", 1, 0, 1);
85 hSig->SetName((
"sig_"+plots[
i].
fname).c_str());
90 hSig->SetLineColor(
kBlue);
91 hSig->SetLineWidth(1);
92 hSig->SetMarkerColor(
kBlue);
101 int fSignal = (
int) hSig->GetBinContent(30);
102 double fBKG = (hSig->Integral() - fSignal)*1./(44);
103 double prob = TMath::PoissonI(fSignal,fBKG);
105 TLatex
p1(0.15,0.80,Form(
"Evts. in time peak: %i",fSignal));
106 TLatex
p2(0.15,0.75,Form(
"BKG. estimate: %6.2g", fBKG));
107 TLatex
p3(0.15,0.70,Form(
"Probability: %6.2g", prob));
110 p1.SetTextSize(0.04);
113 p2.SetTextSize(0.04);
116 p3.SetTextSize(0.04);
120 g1.SetPoint(0,315,0);
121 g1.SetPoint(1,315,1e99);
122 g2.SetPoint(0,325,0);
123 g2.SetPoint(1,325,1e99);
124 g3.SetPoint(0,0,fBKG);
125 g3.SetPoint(1,500,fBKG);
127 g1.SetLineColor(
kRed);
128 g2.SetLineColor(
kRed);
129 g3.SetLineColor(kPink);
138 gPad->SaveAs((
"/nova/ana/users/novadq/TimePeak/BNB/plots/" + plots[
i].fname +
"_" + naming +
".root").c_str());
139 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 timingPeak(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.
void lastUpdated(unsigned int timestamp)
const Var kSpillLivetime
Return the Livetime for the spill.