SpectrumLoader.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 class TFile;
6 
8 
9 namespace ana
10 {
11  class Progress;
12 
13  /// \brief Collaborates with \ref Spectrum and \ref OscillatableSpectrum to
14  /// fill spectra from CAF files.
15  ///
16  /// The outside user should just pass a filename, wildcard, SAM dataset name,
17  /// or query to the constructor. Then construct all the spectra you
18  /// need. They will register with this loader. Finally, calling \ref Go will
19  /// cause all the spectra to be filled at once. After this the loader may not
20  /// be used again.
22  {
23  public:
25  SpectrumLoader(const std::vector<std::string>& fnames);
26  /// Named constructor for SAM projects
28  int fileLimit = -1);
29 
30  // Move operations
31  SpectrumLoader(SpectrumLoader&&) = default;
33 
34  virtual ~SpectrumLoader();
35 
36  virtual void Go() override;
37 
38  protected:
40 
41  // No copy operations because I don't want to deal with pointers
42  SpectrumLoader(const SpectrumLoader&) = delete;
43  SpectrumLoader& operator=(const SpectrumLoader&) = delete;
44 
45  void AccumulateExposures(const caf::SRSpillProxy* spill) override;
46 
47  virtual void HandleFile(TFile* f, Progress* prog = 0);
48 
49  virtual void HandleRecord(caf::SRProxy* sr);
50  };
51 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2085
void AccumulateExposures(const caf::SRSpillProxy *spill) override
SpectrumLoader & operator=(SpectrumLoader &&)=default
std::vector< std::string > wildcard(const std::string &wildcardString)
Definition: convert.C:9
static SpectrumLoader FromSAMProject(const std::string &proj, int fileLimit=-1)
Named constructor for SAM projects.
caf::StandardRecord * sr
virtual void Go() override
Load all the registered spectra.
fileLimit
Definition: ProjMan.py:109
Base class for the various types of spectrum loader.
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
virtual void HandleRecord(caf::SRProxy *sr)
Float_t proj
Definition: plot.C:35
A simple ascii-art progress bar.
Definition: Progress.h:9
virtual void HandleFile(TFile *f, Progress *prog=0)