Classes | Functions | Variables
MakeValidCalibPDF.C File Reference
#include "CalibAnaPlot.h"
#include "CalibAnaTypes.h"
#include "TexBuilder.h"
#include <iomanip>
#include <fstream>
#include <sstream>
#include "TF1.h"

Go to the source code of this file.

Classes

class  ValidCalibPDF
 

Functions

void MakeValidCalibPDF (std::string outpath, std::string tex_config, std::string sample, bool justdraw=false, unsigned int stride=0, unsigned int limit=0)
 

Variables

const int wid1 = 17
 
const int wid2 = 13
 
const char sep = ' '
 

Function Documentation

void MakeValidCalibPDF ( std::string  outpath,
std::string  tex_config,
std::string  sample,
bool  justdraw = false,
unsigned int  stride = 0,
unsigned int  limit = 0 
)

Definition at line 91 of file MakeValidCalibPDF.C.

References plotROC::cfg, om::cout, allTimeWatchdog::endl, CalibAnaPlot::GetSamples(), CalibAnaPlot::Initialize(), PandAna.Demos.demo_prong::limit, ValidCalibPDF::MakeTex(), CalibAnaPlot::ProcessTrees(), ValidCalibPDF::SetApplyAbsCutToAll(), ValidCalibPDF::SetPerformAbsCal(), ValidCalibPDF::SetShowRecoMeV(), CalibAnaPlot::SetTreeLoopLimit(), CalibAnaPlot::SetTreeLoopStride(), update_sam_good_runs_metadata::stride, and string.

97 {
98  ValidCalibPDF bigpdf( outpath, tex_config );
99  bigpdf.Initialize();
100  if(stride) bigpdf.SetTreeLoopStride(stride);
101  if(limit) bigpdf.SetTreeLoopLimit(limit);
102 
103  // Unique tag for tex is first line, and a handy way to set cuts
104  std::ifstream cfg(tex_config);
105  if (!cfg.is_open()){ std::cout << "could not find config file " << tex_config << std::endl; return; }
106  std::string tex_tag;
107  std::getline (cfg,tex_tag);
108  bigpdf.SetApplyAbsCutToAll( tex_tag.find("abscal")!=std::string::npos );
109  bigpdf.SetShowRecoMeV( tex_tag.find("withreco")!=std::string::npos );
110 
111  // Enforce that Abs Cal be done all in the same pass
112  // to avoid unknown skews between histogram files
113  //if(sample=="all"&&!justdraw) bigpdf.SetPerformAbsCal(true);
114  if(sample=="all") bigpdf.SetPerformAbsCal(true);
115 
116  if(justdraw){
117  // If histogram files are already made, just make plots and tex...
118  bigpdf.MakeTex(tex_config);
119  } else {
120  // ...Otherwise, fill histograms
121 
122  if(sample=="all"){
123  for( auto& s : bigpdf.GetSamples() ){
124  bigpdf.ProcessTrees(s.first);
125  }
126  bigpdf.MakeTex(tex_config);
127  // may as well make the tex
128  } else {
129  bigpdf.ProcessTrees(sample);
130  // may not have all samples to make tex, so don't
131  }
132 
133  }
134 
135 }
const XML_Char * s
Definition: expat.h:262
OStream cout
Definition: OStream.cxx:6
enum BeamMode string

Variable Documentation

const char sep = ' '
const int wid1 = 17
const int wid2 = 13