61 return a.
ID() < b.
ID();
74 const int Nfiles =
NFiles();
84 if(Nfiles >= 0 && !prog){
101 if(Nfiles > 1 && prog) prog->
SetProgress((fileIdx+1.)/Nfiles);
124 fSpectrumSinks.clear();
137 TObject* obj = f->Get(
"recTree");
147 dir = (TDirectory*)obj;
148 tr = (TTree*)dir->Get(
"rec");
159 const long Nentries = tr->GetEntries();
160 for(n = 0; n < Nentries; ++
n){
165 if(prog && n%100 == 0) prog->
SetProgress(
double(n)/Nentries);
caf::Proxy< caf::SRSpill > spill
virtual ~SpectrumLoader()
Cuts and Vars for the 2020 FD DiF Study.
TFile * GetNextFile()
Forwards to fFileSource but also accumulates POT and livetime.
void HandleSpill(const caf::SRSpillProxy *spill) override
bool fGone
Has Go() been called? Can't add more histograms after that.
Proxy for caf::StandardRecord.
double fRunPOT
Crude measure, not including spill cuts.
void AccumulateExposures(const caf::SRSpillProxy *spill) override
int NSinks() const override
void HandleRecord(caf::SRProxy *sr, double wei) override
CAFType GetCAFType(const TDirectory *dir, TTree *tr)
std::unique_ptr< SpillCut > fSpillCut
Cut applied to the spill branch for every event.
std::set< IRecordSink * > fSpectrumSinks
std::vector< std::string > wildcard(const std::string &wildcardString)
ExposureSource fExposureSource
std::unordered_map< int, SystApplier * > fSinksS
bool operator()(const Cut &a, const Cut &b)
int ID() const
Cuts with the same definition will have the same ID.
static SpectrumLoader FromSAMProject(const std::string &proj, int fileLimit=-1)
Named constructor for SAM projects.
virtual void Go() override
Load all the registered spectra.
std::list< SpillHistDef > fSpillHistDefs
std::unordered_map< std::pair< int, int >, CutApplier * > fSinksSC
Base class for the various types of spectrum loader.
std::unique_ptr< IFileSource > fFileSource
void SetProgress(double frac)
Update the progress fraction between zero and one.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
virtual void HandleRecord(caf::SRProxy *sr)
assert(nhit_max >=nhit_nbins)
A simple ascii-art progress bar.
Fetch files from a pre-existing SAM project.
virtual void HandleFile(TFile *f, Progress *prog=0)
std::unordered_map< std::tuple< int, int, int >, WeightApplier * > fSinksSCW
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
int NFiles() const
Forwards to fFileSource.
std::list< NuHistDef > fNuHistDefs
void Done()
Call this when action is completed.
void Finalize()
POT/livetime is not filled into sinks until this is called!
void ReportExposures(double denom=0) const