5 #include "TGraphErrors.h" 6 #include "TGraphAsymmErrors.h" 14 #include "TPaveLabel.h" 17 #include "TTimeStamp.h" 24 #include "CAFAna/Core/Binning.h" 75 TH1D *hSpill =
new TH1D(
"hSpill",
"hSpill", 2, -0.5, 1.5);
86 {
"Time",
"time",
Binning::Simple(nDays<3 ? 24*nDays : nDays,timestamp - 86400*nDays,timestamp),
SIMPLEVAR(hdr.unixtime)},
118 TFile *
file = TFile::Open(fileName.c_str(),
"RECREATE");
126 potTime.
SaveTo(file,
"potTime");
127 massDenom.
SaveTo(file,
"massDenom");
128 massNum.
SaveTo(file,
"massNum");
129 hSig_time->
SaveTo(file,
"sig_time");
130 hBkg_time->
SaveTo(file,
"BKG_time");
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
void getTimePeakTotal(std::string samdef="", std::string s_Period="")
const Var kMassFracPOT([](const caf::SRProxy *sr){return sr->spill.spillpot *(sr->hdr.diblast-sr->hdr.dibfirst+1)/14.;})
const Var kDirZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].dir.Z();})
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Representation of a spectrum in any variable, with associated POT.
Track finder for cosmic rays.
const Var kPtP
Transverse momentum fraction in slice.
====================================================================== ///
caf::Proxy< bool > isgoodspill
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 Var kSpillPOT
Return the POT for the spill.
const Var kBoxMaxY([](const caf::SRProxy *sr){return sr->slc.boxmax.Y()/100;})
const std::vector< Plot > plots
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
std::vector< float > Spectrum
const SpillCut kNoSpillCut
The simplest possible cut: pass everything, used as a default.
const SystShifts kNoShift
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={})
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.