test_sam_project.C
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
7 
8 #include "CAFAna/Core/Binning.h"
10 #include "CAFAna/Core/Spectrum.h"
11 #include "CAFAna/Vars/Vars.h"
12 
13 #include "TH1.h"
14 
15 using namespace ana;
16 
17 void test_sam_project(std::string projname, int fileLimit = -1)
18 {
20 
21  Spectrum spect("Calorimetric Energy (GeV)", Binning::Simple(40, 0, 10), loader, kCaloE, kNoCut);
22 
23  loader.Go();
24 
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:176
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:39
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.
loader
Definition: demo0.py:10
double POT() const
Definition: Spectrum.h:226
fileLimit
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
Definition: Cut.h:13
enum BeamMode string