Go to the documentation of this file.
1 // Run me something like:
2 //
3 // PROJNAME=`whoami`_cafana_test_`date +%Y.%m.%d_%H.%M.%S`
4 // samweb -e nova start-project --defname=prod_caf_S14-07-11_fardet_cosmics_p1_7db_good $PROJNAME
5 // cafe test/test_sam_project.C $PROJNAME
6 // samweb -e nova stop-project $PROJNAME
8 #include "CAFAna/Core/Binning.h"
10 #include "CAFAna/Core/Spectrum.h"
11 #include "CAFAna/Vars/Vars.h"
13 #include "TH1.h"
15 using namespace ana;
17 void test_sam_project(std::string projname, int fileLimit = -1)
18 {
21  Spectrum spect("Calorimetric Energy (GeV)", Binning::Simple(40, 0, 10), loader, kCaloE, kNoCut);
23  loader.Go();
25  spect.ToTH1(spect.POT())->Draw("hist");
26 }
void test_sam_project(std::string projname, int fileLimit=-1)
tree Draw("slc.nhit")
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
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.
Definition: Spectrum.cxx:148
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
static SpectrumLoader FromSAMProject(const std::string &proj, int fileLimit=-1)
Named constructor for SAM projects.
virtual void Go() override
Load all the registered spectra.
Definition: demo0.py:10
double POT() const
Definition: Spectrum.h:227
Definition: ProjMan.py:109
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={})
Definition: Binning.cxx:107
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
enum BeamMode string