TestMatrix.C
Go to the documentation of this file.
1 
2 #include "CAFAna/Core/ISyst.h"
5 
7 
8 using namespace ana;
9 
10 void TestMatrix()
11 {
12  size_t jobid;
13  if (RunningOnGrid()) jobid = JobNumber();
14  else jobid = 1;
15 
16  std::vector<covmx::Sample> samples;
19 
20  // Need to figure out systs
21 
22  std::vector<const ISyst*> nd_systs = GetSystsFromFile(samples[0]);
23  std::vector<const ISyst*> fd_systs = GetSystsFromFile(samples[1]);
24 
25  std::vector<std::map<covmx::Sample, const ISyst*>> systs(nd_systs.size());
26 
27  for (size_t i = 0; i < nd_systs.size(); ++i) {
28  systs[i][samples[0]] = nd_systs[i];
29  systs[i][samples[1]] = fd_systs[i];
30  }
31 
32  for (size_t i = 0; i < systs.size(); ++i)
33  std::cout << "ND: " << systs[i][samples[0]]->ShortName()
34  << " FD: " << systs[i][samples[1]]->ShortName() << std::endl;
35 
36  return;
37 
38  // size_t nslices = 30;
39 
40  // size_t syst = jobid / nslices;
41  // size_t slice = jobid % nslices;
42 
43  // this is totally screwed up for drain, so gotta fix it
44  //size_t syst = jobid;
45  //size_t sample = 0;
46 
47  // std::cout << "Running for systematic " << syst << " ("
48  // << systs[syst]->ShortName() << ") and slice "
49  // << slice << " of " << nslices << std::endl;
50 
51  TFile* f = new TFile("mx.root", "recreate");
52  TDirectory* dir = f->mkdir("covmxmanager");
53 
54  TFile* predfile = TFile::Open("pred_nus.root", "read");
55 
56  // CovMxManager* manager = new CovMxManager(dir, samples, predfile, "file",
57  // new NusISyst("base_systs[0], );
58 
59  delete f;
60 
61 }
size_t JobNumber()
What&#39;s the process number for a grid job?
Definition: Utilities.cxx:370
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
bool RunningOnGrid()
Is this a grid (condor) job?
Definition: Utilities.cxx:363
void TestMatrix()
Definition: TestMatrix.C:10
Float_t d
Definition: plot.C:236
OStream cout
Definition: OStream.cxx:6
TDirectory * dir
Definition: macro.C:5
std::vector< const ISyst * > GetSystsFromFile(covmx::Sample sample)
Get systematics for a given sample.