AnalyzeSysts.C
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////
2 // AnalyzeSysts.C
3 // Jeremy Hewes (jhewes15@fnal.gov)
4 //
5 // Make plots from SystMakers for 2020 FHC NC analysis
6 //////////////////////////////////////////////////////////////
7 
8 #include "TFile.h"
9 
13 
14 using namespace ana;
15 
16 // -------------------------------------------------------------------------------------
17 void AnalyzeSysts(std::string ndFile="/nova/data/users/jhewes15/nus20/systmakers/systsmaker_nus_fhc_neardet.root",
18  std::string fdFile="/nova/data/users/jhewes15/nus20/systmakers/systsmaker_nus_fhc_fardet.root") {
19 
20  DontAddDirectory guard;
21 
22  std::string ofName = "syst_ana.root";
23 
24  TFile* inFile = TFile::Open(ndFile.c_str(), "read");
25  TFile* outFile = TFile::Open(ofName.c_str(), "recreate");
26 
27  // Get the syst maker from the file
28  SystematicsMaker* systsMaker = LoadFromFile<SystematicsMaker>(inFile, "nus_fhc_neardet").release();
29 
30  for (auto systMaker : systsMaker->GetSystMakers()) {
31  std::cout << "Name is " << systMaker.second->GetName() << std::endl;
32  }
33 
34  // Run the syst makers
35  systsMaker->Go(kAna2018SensitivityFHCNDPOT);
36 
37  // Draw plots
38  systsMaker->PrintSysts();
39  systsMaker->DrawSysts(outFile->mkdir("nus_fhc_neardet"));
40 
41  delete systsMaker;
42  delete inFile;
43 
44  // Repeat for far detector
45  inFile = TFile::Open(fdFile.c_str(), "read");
46  systsMaker = LoadFromFile<SystematicsMaker>(inFile, "nus_fhc_fardet").release();
47  systsMaker->Go(kAna2018FHCPOT);
48  systsMaker->PrintSysts();
49  systsMaker->DrawSysts(outFile->mkdir("nus_fhc_fardet"));
50 
51  delete systsMaker;
52  delete inFile;
53  delete outFile;
54 
55 }
56 
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const double kAna2018SensitivityFHCNDPOT
Definition: Exposures.h:210
ifstream inFile
Definition: AnaPlotMaker.h:34
TFile * outFile
Definition: PlotXSec.C:135
void AnalyzeSysts(std::string ndFile="/nova/data/users/jhewes15/nus20/systmakers/systsmaker_nus_fhc_neardet.root", std::string fdFile="/nova/data/users/jhewes15/nus20/systmakers/systsmaker_nus_fhc_fardet.root")
Definition: AnalyzeSysts.C:17
OStream cout
Definition: OStream.cxx:6
const double kAna2018FHCPOT
Definition: Exposures.h:207
Prevent histograms being added to the current directory.
Definition: UtilsExt.h:46
enum BeamMode string