NueCCIncCrossSectionAnalysis.cxx
Go to the documentation of this file.
2 
3 #include "CAFAna/Core/Spectrum.h"
7 #include "TObjString.h"
8 #include "TVectorD.h"
9 #include "TVector3.h"
10 #include "TH1F.h"
11 #include "TH3F.h"
12 #include "TH3.h"
13 #include <cassert>
14 #include <vector>
15 #include <string>
16 #include <iostream>
17 //#include "TSVDUnfold.h"
18 
19 #include "/cvmfs/nova.opensciencegrid.org/externals/roounfold/v1_1_1b/NULL-e17--prof/NULL/src/RooUnfoldResponse.h"
20 #include "/cvmfs/nova.opensciencegrid.org/externals/roounfold/v1_1_1b/NULL-e17--prof/NULL/src/RooUnfoldBayes.h"
21 #include "/cvmfs/nova.opensciencegrid.org/externals/roounfold/v1_1_1b/NULL-e17--prof/NULL/src/RooUnfoldErrors.h"
22 #include "/cvmfs/nova.opensciencegrid.org/externals/roounfold/v1_1_1b/NULL-e17--prof/NULL/src/RooUnfoldSvd.h"
23 
24 namespace ana{
25  namespace nueccinc{
26 
28  (
29  SpectrumLoaderBase &lLoad,
30  HistAxis yAxis,
31  HistAxis xAxis,
32  HistAxis zAxis,
33  HistAxis recoAxis2D,
34  NuTruthHistAxis efficiencyAxis2D,
35  NuTruthHistAxis efficiencyAxis1D,
36  HistAxis pidAxis,
37  Binning fluxBins,
38  Cut selection,
39  NuTruthCut isSig,
40  TVector3 min,
41  TVector3 max,
42  SystShifts shift,
43  NuTruthVar weiNT,
44  Var wei)
45  :
46  fAnalysis3D(lLoad, xAxis,yAxis,zAxis,selection,shift,wei),
47  fTemplate3D(lLoad, xAxis,yAxis,pidAxis,selection,shift,wei),
48  fAnalysisSig1D(lLoad,
49  HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
50  selection && CutFromNuTruthCut(isSig),
51  shift, wei),
52  fAnalysisSigNuTree1D(lLoad,
53  efficiencyAxis1D,
54  isSig,
55  shift, weiNT),
56  fAnalysisSig2D(lLoad,HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
57  selection && CutFromNuTruthCut(isSig),
58  shift, wei),
59  fAnalysisSigNuTree2D(lLoad,efficiencyAxis2D,
60  isSig,
61  shift, weiNT),
62  fUnfolding1D(lLoad,zAxis,HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
63  selection && CutFromNuTruthCut(isSig),shift,wei),
64  fUnfolding2D(lLoad,recoAxis2D,
65  HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
66  selection && CutFromNuTruthCut(isSig),shift,wei),
67  fFidMin(min),
68  fFidMax(max)
69  {
70  fFlux =
71  (Spectrum*)DeriveFlux(lLoad, fluxBins, 12, &fFidMin,
72  &fFidMax, shift, weiNT);
73  }
74 
76  (Spectrum sAnalysis3D,
77  Spectrum sTemplate3D,
78  Spectrum sAnalysisSig1D,
79  Spectrum sAnalysisSigNuTree1D,
80  Spectrum sAnalysisSig2D,
81  Spectrum sAnalysisSigNuTree2D,
82  Spectrum sUnfolding1D,
83  Spectrum sUnfolding2D,
84  TVector3 sFidMin,
85  TVector3 sFidMax,
86  Spectrum* sFlux,
87  bool loadFromFile)
88  :
89  fAnalysis3D(sAnalysis3D),
90  fTemplate3D(sTemplate3D),
91  fAnalysisSig1D(sAnalysisSig1D),
92  fAnalysisSigNuTree1D(sAnalysisSigNuTree1D),
93  fAnalysisSig2D(sAnalysisSig2D),
94  fAnalysisSigNuTree2D(sAnalysisSigNuTree2D),
95  fUnfolding1D(sUnfolding1D),
96  fUnfolding2D(sUnfolding2D),
97  fFidMin(sFidMin),
98  fFidMax(sFidMax),
99  fFlux(sFlux)
100  {}
101 
102 
103  //////////// //////////// //////////// //////////// ////////////
104  //Protected Functions///////////////////////////////////////////////
105  //////////// //////////// //////////// //////////// ////////////
106 
108  {
109  return &fTemplate3D;
110  }
111 
112  std::vector<Spectrum*>
114  {
115  std::vector<Spectrum*> vResult;
116  if(dimension == "1D"){
117  vResult.push_back(&fAnalysisSig1D);
118  vResult.push_back(&fAnalysisSigNuTree1D);
119  }
120  if(dimension == "2D"){
121  vResult.push_back(&fAnalysisSig2D);
122  vResult.push_back(&fAnalysisSigNuTree2D);
123  }
124  return vResult;
125  }
126 
128  {
129  return &fAnalysis3D;
130  }
131 
133  {
134  return fFlux;
135  }
136 
137  Spectrum*
139  {
140  if( dimension == "1D")
141  return &fUnfolding1D;
142  if( dimension == "2D")
143  return &fUnfolding2D;
144  else{
145  std::cout << dimension << "\tNot a supported option\n" <<
146  "Returning the 2D Unfolding Matrix Regardless" << std::endl;
147  return &fUnfolding2D;
148  }
149  }
150 
152  {
153  return {fFidMin,fFidMax};
154  }
155 
156  //////////// //////////// //////////// //////////// ////////////
157  //Public Functions//////////////////////////////////////////////////
158  //////////// //////////// //////////// //////////// ////////////
159 
161  Binning binningx,
162  Binning binningy,
163  Binning binningz)
164  {
165  const Spectrum* template3D =
167  TH3F* hResult3D = (TH3F*)ana::ToTH3(*template3D,8.09e20,
169  binningx,binningy,
170  binningz,ana::EBinType::kBinContent);
171  TH1F* hResult = (TH1F*)hResult3D->ProjectionZ(ana::UniqueName().c_str(),
172  xbin,xbin,ybin,ybin);
173  hResult->SetTitle("");
174  hResult->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
175  hResult->GetXaxis()->SetTitle("Electron PID Bins");
176  hResult->GetYaxis()->CenterTitle();
177  hResult->GetXaxis()->CenterTitle();
178  return hResult;
179  }
180 
182  const Spectrum* template3D =
184  TH1F* hResult = (TH1F*)template3D->ToTH1(8.09e20);
185  hResult->SetTitle("");
186  hResult->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
187  hResult->GetXaxis()->SetTitle("Electron Kinematic * Electron PID Bins");
188  hResult->GetYaxis()->CenterTitle();
189  hResult->GetXaxis()->CenterTitle();
190  return hResult;
191  }
192 
194  Binning binningy,
195  Binning binningz)
196  {
197  const Spectrum* template3D =
199  TH3F* hResult3D = (TH3F*)ana::ToTH3(*template3D,8.09e20,
201  binningx,binningy,
202  binningz,ana::EBinType::kBinContent);
203  return hResult3D;
204  }
205 
207  Binning binningy,
208  Binning binningz,
209  double integral)
210  {
211  const Spectrum* template3D =
213  TH1* h1D = template3D->ToTH1(template3D->POT());
214  h1D->SetName(ana::UniqueName().c_str());
215  Spectrum hHolder = ana::Spectrum(h1D,
216  template3D->GetLabels(),
217  template3D->GetBinnings(),
218  template3D->POT(),
219  0);
220  //_Spectrum (TH1 *h, const std::vector< std::string > &labels, const std::vector< Binning > &bins, double pot, double livetime)
221 
222  hHolder.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
223 
224  TH3F* hResult3D =
225  (TH3F*)ana::ToTH3(hHolder,
226  8.09e20,
228  binningx,binningy,
229  binningz,ana::EBinType::kBinContent);
230 
231  hResult3D->SetName(ana::UniqueName().c_str());
232  std::cout << template3D->Integral(8.09e20) << "\t"
233  << hHolder.Integral(8.09e20) << std::endl;
234  return hResult3D;
235  }
236 
238  {
239  const Spectrum* template3D =
241 
242  TH1* h1D = template3D->ToTH1(template3D->POT());
243  h1D->SetName(ana::UniqueName().c_str());
244  Spectrum hHolder = ana::Spectrum(h1D,
245  template3D->GetLabels(),
246  template3D->GetBinnings(),
247  template3D->POT(),
248  0);
249 
250  hHolder.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
251 
252  TH1F* hResult1D = (TH1F*)hHolder.ToTH1(8.09e20);
253  hResult1D->SetName(ana::UniqueName().c_str());
254 
255  // Spectrum spect = *template3D;
256  //spect.OverridePOT(template3D->POT() * template3D->Integral(1)/integral);
257  //TH1F* hResult1D = (TH1F*)spect.ToTH1(8.09e20);
258  return hResult1D;
259  }
260 
261 
263  {
265  return *(result);
266  }
267 
268 
269 
271  {
272  std::vector<Spectrum*> calc_efficiency =
274 
275  TH1F* hNumerator = (TH1F*)calc_efficiency[0]->ToTH1(8.09e20);
276  TH1F* hDenominator = (TH1F*)calc_efficiency[1]->ToTH1(8.09e20);
277 
278  hNumerator->Divide(hDenominator);
279  hNumerator->SetTitle("");
280  hNumerator->GetYaxis()->SetTitle("Efficiency");
281  hNumerator->GetYaxis()->CenterTitle();
282  hNumerator->GetXaxis()->CenterTitle();
283 
284  return hNumerator;
285  }
286 
288  Binning binningy,
289  std::string outaxis)
290  {
291  std::vector<Spectrum*> calc_efficiency =
293 
294  TH2F* hNumerator = (TH2F*)ana::ToTH2(*calc_efficiency[0],8.09e20,
296  binningx,binningy,
298  TH2F* hDenominator = (TH2F*)ana::ToTH2(*calc_efficiency[1],8.09e20,
300  binningx,binningy,
302 
303  hNumerator->Divide(hDenominator);
304  hNumerator->SetTitle("");
305  hNumerator->GetYaxis()->SetTitle("Efficiency");
306  hNumerator->GetYaxis()->CenterTitle();
307  hNumerator->GetXaxis()->CenterTitle();
308 
309  if(outaxis == "Y")
310  return (TH1F*)hNumerator->ProjectionY(ana::UniqueName().c_str());
311  if(outaxis == "X")
312  return (TH1F*)hNumerator->ProjectionX(ana::UniqueName().c_str());
313  else
314  return (TH1F*)hNumerator->ProjectionY(ana::UniqueName().c_str());
315  }
316 
317 
319  Binning binningy)
320  {
321  std::vector<Spectrum*> calc_efficiency =
323 
324  TH2F* hNumerator = (TH2F*)ana::ToTH2(*calc_efficiency[0],8.09e20,
326  binningx,binningy,
328  TH2F* hDenominator = (TH2F*)ana::ToTH2(*calc_efficiency[1],8.09e20,
330  binningx,binningy,
332 
333  hNumerator->Divide(hDenominator);
334  hNumerator->SetTitle("");
335  hNumerator->GetZaxis()->SetTitle("Efficiency");
336  hNumerator->GetYaxis()->CenterTitle();
337  hNumerator->GetXaxis()->CenterTitle();
338 
339  return hNumerator;
340  }
341 
343  Binning binningy,
344  Binning binningz)
345  {
347  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
349  binningx,binningy,
350  binningz,ana::EBinType::kBinContent);
351  hResult3D->SetTitle("");
352  hResult3D->GetYaxis()->CenterTitle();
353  hResult3D->GetXaxis()->CenterTitle();
354  hResult3D->GetZaxis()->CenterTitle();
355  return hResult3D;
356  }
357 
359  Binning binningy,
360  Binning binningz)
361  {
363  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
365  binningx,binningy,
366  binningz,ana::EBinType::kBinContent);
367  TH2F* hResult2D = (TH2F*)hResult3D->Project3D("yx");
368  hResult2D->SetName(ana::UniqueName().c_str());
369  hResult3D->SetTitle("");
370  hResult3D->GetYaxis()->CenterTitle();
371  hResult3D->GetXaxis()->CenterTitle();
372  return hResult2D;
373  }
374 
376  Binning binningy,
377  Binning binningz,
378  std::string outaxis)
379  {
380  //outaxis == "X", "Y", "Z"
382  TH3F* hResult3D = (TH3F*)ana::ToTH3(*analysis3D,8.09e20,
384  binningx,binningy,
385  binningz,ana::EBinType::kBinContent);
386  std::vector<TH1F*> hResult;
387  std::string axis_name;
388  if(outaxis == "X"){
389  hResult.push_back((TH1F*)hResult3D->ProjectionX
390  (ana::UniqueName().c_str()));
391  axis_name = "Reco. cos #theta_{e}";
392  }
393  else if(outaxis == "Y"){
394  hResult.push_back((TH1F*)hResult3D->ProjectionY
395  (ana::UniqueName().c_str()));
396  axis_name = "Reco. Electron Energy, E_{e} (GeV)";
397  }
398  else if(outaxis == "Z"){
399  hResult.push_back((TH1F*)hResult3D->ProjectionZ
400  (ana::UniqueName().c_str()));
401  axis_name = "Reco. Neutrino Energy, E_{#nu} (GeV)";
402  }
403  hResult[0]->SetName(ana::UniqueName().c_str());
404  hResult[0]->SetTitle("");
405  hResult[0]->GetYaxis()->SetTitle("Events/8.09 #times 10^{20} POT");
406  hResult[0]->GetYaxis()->CenterTitle();
407  hResult[0]->GetXaxis()->SetTitle(axis_name.c_str());
408  hResult[0]->GetXaxis()->CenterTitle();
409  return hResult[0];
410  }
411 
412 
415  TH1F* hResult = (TH1F*)flux->ToTH1(8.09e20);
416  hResult->GetYaxis()->SetTitle("Flux / 8.09 #times 10^{20} POT / m^{2}");
417  hResult->GetYaxis()->CenterTitle();
418  hResult->GetXaxis()->CenterTitle();
419  return hResult;
420  }
421 
423  {
424  Spectrum* unfolding =
426 
427  TH2F* hResult = (TH2F*)unfolding->ToTH2(8.09e20);
428 
429  if(dimension == "1D"){
430  hResult->GetXaxis()->SetTitle("Reco. Neutrino Energy (GeV)");
431  hResult->GetXaxis()->SetTitle("True Neutrino Energy (GeV)");
432  }
433  if(dimension == "2D"){
434  hResult->GetXaxis()->SetTitle("Reco. Electron Kinematics");
435  hResult->GetXaxis()->SetTitle("True Electron Kinematics");
436  }
437 
438  hResult->GetYaxis()->CenterTitle();
439  hResult->GetXaxis()->CenterTitle();
440 
441  return hResult;
442  }
443 
445  {
446  std::vector<Spectrum*> efficiency =
448 
449  TH1F* hResult = (TH1F*)efficiency[0]->ToTH1(8.09e20);
450  hResult->SetTitle("");
451  hResult->GetYaxis()->SetTitle("Selected Signal Events/8.09 #times 10^{20}POT");
452  hResult->GetYaxis()->CenterTitle();
453  hResult->GetXaxis()->CenterTitle();
454 
455  return hResult;
456  }
457 
458  TH2F*
460  Binning binningy)
461  {
462  std::vector<Spectrum*> efficiency =
464 
465  TH2F* hResult = (TH2F*)ana::ToTH2(*efficiency[0],8.09e20,
467  binningx,binningy,
469 
470  hResult->SetTitle("");
471  hResult->GetYaxis()->SetTitle("Selected Signal Events/8.09 #times 10^{20}POT");
472  hResult->GetYaxis()->CenterTitle();
473  hResult->GetXaxis()->CenterTitle();
474 
475  return hResult;
476  }
477 
479  {
480  std::vector<Spectrum*> efficiency =
482 
483  TH1F* hResult = (TH1F*)efficiency[1]->ToTH1(8.09e20);
484  hResult->SetTitle("");
485  hResult->GetYaxis()->SetTitle("True Signal Events/8.09 #times 10^{20}POT");
486  hResult->GetYaxis()->CenterTitle();
487  hResult->GetXaxis()->CenterTitle();
488 
489  return hResult;
490  }
491 
492  TH2F*
494  Binning binningy)
495  {
496  std::vector<Spectrum*> efficiency =
498 
499  TH2F* hResult = (TH2F*)ana::ToTH2(*efficiency[1],8.09e20,
501  binningx,binningy,
503 
504  hResult->SetTitle("");
505  hResult->GetYaxis()->SetTitle("True Signal Events/8.09 #times 10^{20}POT");
506  hResult->GetYaxis()->CenterTitle();
507  hResult->GetXaxis()->CenterTitle();
508 
509  return hResult;
510  }
511 
512 
513 
515  {
516  int numBins = hist->GetYaxis()->GetNbins() *
517  hist->GetXaxis()->GetNbins();
518 
519  TH1F* hHolder = new TH1F(ana::UniqueName().c_str(),"",
520  numBins,0,numBins);
521  for(int i = 0; i < hHolder->GetNbinsX() ;++i){
522  const int ix = i/ hist->GetYaxis()->GetNbins();
523  const int iy = i % hist->GetYaxis()->GetNbins();
524  const double val = hist->GetBinContent(ix+1, iy+1);
525  const double err = hist->GetBinError (ix+1, iy+1);
526  hHolder->SetBinContent(i+1,val);
527  hHolder->SetBinError(i+1,err);
528  }//loop over all kinematic bins
529  return hHolder;
530  }
531 
533  TH1F* hist)
534  {
535  TH2F* hResult = (TH2F*)hSample2D->Clone(ana::UniqueName().c_str());
536 
537  for(int i = 0; i < hist->GetNbinsX(); ++i){
538  const double val = hist->GetBinContent(i+1);
539  const double err = hist->GetBinError(i+1);
540  const int ix = i/ hResult->GetYaxis()->GetNbins();
541  const int iy = i % hResult->GetYaxis()->GetNbins();
542 
543  hResult->SetBinContent(ix+1, iy+1, val);
544  hResult->SetBinError (ix+1, iy+1, err);
545  }
546 
547  return hResult;
548  }
549 
550 
552  TH2F* hUnfoldingMatrix,
553  int iterations)
554  {
555  //Holder until I can figure out what is wrong with including RooUnfold
556  TH1D* true_mc_spect =
557  (TH1D*)hUnfoldingMatrix->ProjectionY(ana::UniqueName().c_str());
558  TH1D* reco_mc_spect =
559  (TH1D*)hUnfoldingMatrix->ProjectionX(ana::UniqueName().c_str());
560  TH1D* data_in = (TH1D*)data_hist_1D->Clone(ana::UniqueName().c_str());
561  TH2D* hResponse = (TH2D*)hUnfoldingMatrix->Clone(ana::UniqueName().c_str());
562  /*
563  RooUnfoldResponse ResponseMatrix(0,0,hUnfoldingMatrix, "ResponseMatrix");
564  ResponseMatrix.UseOverflow(0);
565  RooUnfoldSvd unfold(&ResponseMatrix, data_hist_1D, iterations);
566  TH1F* hResult = (TH1F*)unfold.Hreco();
567 
568  return hResult;
569  */
570 
571  TSVDUnfold *tsvdunf = new TSVDUnfold( data_in,reco_mc_spect,
572  true_mc_spect,hResponse);
573  TH1F* hResult = (TH1F*)tsvdunf->Unfold(iterations);
574  TH2D* hCovMat = tsvdunf->GetBCov();
575 
576  for(int i = 1; i < hResult->GetNbinsX(); i++){
577  hResult->SetBinError(i,sqrt(hCovMat->GetBinContent(i,i)));
578  }
579 
580 
581  delete true_mc_spect;
582  delete reco_mc_spect;
583  delete data_in;
584  delete hResponse;
585  delete tsvdunf;
586 
587  return hResult;
588 
589  }
590 
591  TH1F*
593  {
594  Spectrum* unfolding =
596 
597  TH2F* hUnfoldingMatrix = (TH2F*)unfolding->ToTH2(8.09e20);
598 
599  TH1F* unfolded_data_hist_1D =
600  NueCCIncCrossSectionAnalysis::UnfoldHist(datahist,hUnfoldingMatrix,
601  iterations);
602 
603  return unfolded_data_hist_1D;
604  }
605 
606 
607  TH2F*
609  {
610  Spectrum* unfolding =
612 
613  TH2F* hUnfoldingMatrix = (TH2F*)unfolding->ToTH2(8.09e20);
614 
615  TH1F* data_hist_1D =
617 
618  TH1F* unfolded_data_hist_1D =
619  NueCCIncCrossSectionAnalysis::UnfoldHist(data_hist_1D,hUnfoldingMatrix,
620  iterations);
621 
622  TH2F* hResult =
624  unfolded_data_hist_1D);
625 
626  return hResult;
627 
628  }
629 
630 
631  //Only Useful for adding the enhaced Nue Samples into the nominal samples
632  // and creating a new CrossSectionAnalysis object
633  std::unique_ptr<NueCCIncCrossSectionAnalysis>
635  Binning xbins,
636  Binning ybins,
637  Binning zbins,
638  Binning bins2D,
640  {
643  std::vector<Spectrum*> vEff1D =
645  std::vector<Spectrum*> vEff2D =
647  Spectrum unfolding1D =
649  Spectrum unfolding2D =
651 
652  std::vector<Spectrum> vEfficiency1D = {*(vEff1D[0]),*(vEff1D[1])};
653  std::vector<Spectrum> vEfficiency2D = {*(vEff2D[0]),*(vEff2D[1])};
654 
656  std::vector<TVector3> fidvol =
658 
659  double pot_nominal = analysis3D.POT();
660  double pot_enhanced = sample[0].POT();
661 
662  //order for the sample vector is
663  //{analysis_spectra, template_spectra,fAnalysisSig1D,fAnalysisSigNuTree1D,
664  // fAnalysisSig2D,fAnalysisSigNuTree2D,fUnfolding1D,fUnfolding2D}
665 
666  TH1F* hAnalysis3D = (TH1F*)analysis3D.ToTH1(pot_nominal);
667  TH1F* hTemplate3D = (TH1F*)template3D.ToTH1(pot_nominal);
668  TH1F* vEffNum1D = (TH1F*)vEfficiency1D[0].ToTH1(pot_nominal);
669  TH1F* vEffDenom1D = (TH1F*)vEfficiency1D[1].ToTH1(pot_nominal);
670  TH1F* vEffNum2D = (TH1F*)vEfficiency2D[0].ToTH1(pot_nominal);
671  TH1F* vEffDenom2D = (TH1F*)vEfficiency2D[1].ToTH1(pot_nominal);
672  TH1F* hUnfolding1D= (TH1F*)unfolding1D.ToTH1(pot_nominal);
673  TH1F* hUnfolding2D= (TH1F*)unfolding2D.ToTH1(pot_nominal);
674 
675  vEffNum1D->Add((TH1F*)sample[0].ToTH1(pot_enhanced));
676  vEffDenom1D->Add((TH1F*)sample[1].ToTH1(pot_enhanced));
677  vEffNum2D->Add((TH1F*)sample[2].ToTH1(pot_enhanced));
678  vEffDenom2D->Add((TH1F*)sample[3].ToTH1(pot_enhanced));
679  hUnfolding1D->Add((TH1F*)sample[4].ToTH1(pot_enhanced));
680  hUnfolding2D->Add((TH1F*)sample[5].ToTH1(pot_enhanced));
681 
682  Spectrum* sAnalysis3D = new Spectrum(hAnalysis3D,{"","",""},
683  {xbins,ybins,zbins},
684  pot_nominal,0);
685  Spectrum* sTemplate3D = new Spectrum(hTemplate3D,{"","",""},
686  {xbins,ybins,pidbins},
687  pot_nominal,0);
688  Spectrum* sEffNum1D = new Spectrum(vEffNum1D,pot_nominal,0);
689  Spectrum* sEffDenom1D = new Spectrum(vEffDenom1D,pot_nominal,0);
690  Spectrum* sEffNum2D = new Spectrum(vEffNum2D,{"",""},
691  {xbins,ybins},
692  pot_nominal,0);
693  Spectrum* sEffDenom2D = new Spectrum(vEffDenom2D,{"",""},
694  {xbins,ybins},
695  pot_nominal,0);
696  Spectrum* sUnfolding1D = new Spectrum(hUnfolding1D,pot_nominal,0);
697  Spectrum* sUnfolding2D = new Spectrum(hUnfolding2D,
698  {"",""},
699  {bins2D,bins2D},pot_nominal,0);
700 
701  return std::unique_ptr<NueCCIncCrossSectionAnalysis>
702  (new NueCCIncCrossSectionAnalysis(*sAnalysis3D, *sTemplate3D,
703  *sEffNum1D,*sEffDenom1D,
704  *sEffNum2D,*sEffDenom2D,
705  *sUnfolding1D,*sUnfolding2D,
706  fidvol[0],fidvol[1],flux));
707 
708  }
709 
710 
711 
712 
713 
714  void NueCCIncCrossSectionAnalysis::SaveTo(TDirectory* dir) const {
715  TDirectory *tmp = gDirectory;
716  dir->cd();
717  TObjString("NueCCIncCrossSectionAnalysis").Write("type");
718 
719 
720  fAnalysis3D.SaveTo(dir->mkdir("fAnalysis3D"));
721  fTemplate3D.SaveTo(dir->mkdir("fTemplate3D"));
722  fAnalysisSig1D.SaveTo(dir->mkdir("fAnalysisSig1D"));
723  fAnalysisSigNuTree1D.SaveTo(dir->mkdir("fAnalysisSigNuTree1D"));
724  fAnalysisSig2D.SaveTo(dir->mkdir("fAnalysisSig2D"));
725  fAnalysisSigNuTree2D.SaveTo(dir->mkdir("fAnalysisSigNuTree2D"));
726  fUnfolding1D.SaveTo(dir->mkdir("fUnfolding1D"));
727  fUnfolding2D.SaveTo(dir->mkdir("fUnfolding2D"));
728  fFidMin.Write("fFidMin");
729  fFidMax.Write("fFidMax");
730  fFlux->SaveTo(dir->mkdir("fFlux"));
731  tmp->cd();
732  return;
733  }
734 
735  std::unique_ptr<NueCCIncCrossSectionAnalysis>
737  {
738  Spectrum* analysis = ana::LoadFrom<Spectrum>
739  (dir->GetDirectory("fAnalysis3D")).release();
740 
741  Spectrum* templates = ana::LoadFrom<Spectrum>
742  (dir->GetDirectory("fTemplate3D")).release();
743 
744  Spectrum* mcsig1D= ana::LoadFrom<Spectrum>
745  (dir->GetDirectory("fAnalysisSig1D")).release();
746 
747  Spectrum* mcsignutree1D = ana::LoadFrom<Spectrum>
748  (dir->GetDirectory("fAnalysisSigNuTree1D")).release();
749 
750  Spectrum* mcsig2D= ana::LoadFrom<Spectrum>
751  (dir->GetDirectory("fAnalysisSig2D")).release();
752 
753  Spectrum* mcsignutree2D = ana::LoadFrom<Spectrum>
754  (dir->GetDirectory("fAnalysisSigNuTree2D")).release();
755 
756  Spectrum* unfolding1D = ana::LoadFrom<Spectrum>
757  (dir->GetDirectory("fUnfolding1D")).release();
758 
759  Spectrum* unfolding2D = ana::LoadFrom<Spectrum>
760  (dir->GetDirectory("fUnfolding2D")).release();
761 
762  TVector3* min = (TVector3*)dir->Get("fFidMin");
763 
764  TVector3* max = (TVector3*)dir->Get("fFidMax");
765 
766  Spectrum* flux = ana::LoadFrom<Spectrum>
767  (dir->GetDirectory("fFlux")).release();
768 
769  return std::unique_ptr<NueCCIncCrossSectionAnalysis>(
770  new NueCCIncCrossSectionAnalysis(*analysis,*templates,*mcsig1D,*mcsignutree1D,*mcsig2D,*mcsignutree2D,*unfolding1D,*unfolding2D,*min, *max, flux));
771  }
772 
773 
775  {
777  return(*result);
778  }
780  {
782  return(*result);
783  }
785  {
786  std::vector<Spectrum*> result =
788  std::cout << result.size() << std::endl;
789  return(*(result[0]));
790  }
792  {
793  std::vector<Spectrum*> result =
795  return(*(result[1]));
796  }
798  {
799  std::vector<Spectrum*> result =
801  return(*(result[0]));
802  }
804  {
805  std::vector<Spectrum*> result =
807  return(*(result[1]));
808  }
810  {
811  Spectrum* result =
813  return(*result);
814  }
816  {
817  Spectrum* result =
819  return(*result);
820  }
822  {
823  Spectrum* result =
825  return(*result);
826  }
827  std::vector<TVector3>
829  {
830  std::vector<TVector3> result =
832  return result;
833  }
834 
835 
836  //////////// //////////// //////////// //////////// ////////////
837  //Templates Generator///////////////////////////////////////////////
838  //////////// //////////// //////////// //////////// ////////////
841  HistAxis yAxis,
842  HistAxis xAxis,
843  HistAxis zAxis,
844  HistAxis pidAxis,
845  Cut selection,
846  std::vector<Cut> templateCuts,
847  double numberTemplates,
848  const SystShifts shift,
849  const Var wei)
850  :numCuts(numberTemplates)
851  {
852  for(uint iCuts = 0; iCuts < templateCuts.size(); iCuts++){
853  fAnalyses3D.push_back(new Spectrum(lLoad, xAxis,yAxis,
854  zAxis,
855  selection &&
856  templateCuts[iCuts],shift,wei));
857  fTemplates3D.push_back(new Spectrum(lLoad, xAxis,yAxis,
858  pidAxis,
859  selection && templateCuts[iCuts],
860  shift,wei));
861  }
862  }
863 
865  (std::vector<Spectrum*> sAnalysis,
866  std::vector<Spectrum*> sTemplates,
867  double numTypes, bool loadFromFile)
868  :
869  fAnalyses3D(sAnalysis),
870  fTemplates3D(sTemplates),
871  numCuts(numTypes)
872  {}
873 
874 
875  //////////// //////////// //////////// //////////// ////////////
876  //Protected Functions///////////////////////////////////////////////
877  //////////// //////////// //////////// //////////// ////////////
879  {
880  return fTemplates3D;
881  }
882 
884  {
885  return fAnalyses3D;
886  }
887 
888  //////////// //////////// //////////// //////////// ////////////
889  //Public Functions//////////////////////////////////////////////////
890  //////////// //////////// //////////// //////////// ////////////
891 
892  std::vector<TH1F*>
894  Binning binningx,
895  Binning binningy,
896  Binning binningz)
897  {
898  std::vector<Spectrum*> templates_all =
900 
901  std::vector<TH1F*> hResult;
902 
903  for(uint i = 0; i < templates_all.size(); i++){
904  TH3F* hHolder3D = (TH3F*)ana::ToTH3(*templates_all[i],8.09e20,
906  binningx,binningy,
907  binningz,ana::EBinType::kBinContent);
908  TH1F* hHolder1D = (TH1F*)hHolder3D->ProjectionZ(ana::UniqueName().c_str(),
909  xbin,xbin,ybin,ybin);
910  hResult.push_back((TH1F*)hHolder1D->Clone(ana::UniqueName().c_str()));
911  }
912 
913  return hResult;
914  }
915 
916  std::vector<TH3F*>
918  Binning binningy,
919  Binning binningz)
920  {
921  std::vector<Spectrum*> templates_all =
923 
924  std::vector<TH3F*> hResult;
925 
926  for(uint i = 0; i < templates_all.size(); i++){
927  TH3F* hHolder3D = (TH3F*)ana::ToTH3(*templates_all[i],8.09e20,
929  binningx,binningy,
930  binningz,
932  hResult.push_back((TH3F*)hHolder3D->Clone(ana::UniqueName().c_str()));
933  }
934 
935  return hResult;
936  }
937 
938  std::vector<TH1F*>
940  {
941  std::vector<Spectrum*> templates_all =
943 
944  std::vector<TH1F*> hResult;
945 
946  for(uint i = 0; i < templates_all.size(); i++){
947  TH1F* hHolder = (TH1F*)templates_all[i]->ToTH1(8.09e20);
948  hResult.push_back((TH1F*)hHolder->Clone(ana::UniqueName().c_str()));
949  }
950 
951  return hResult;
952  }
953 
954 
955  std::vector<TH3F*>
957  Binning binningy,
958  Binning binningz)
959  {
960  std::vector<Spectrum*> analysis_all =
962 
963  std::vector<TH3F*> hResult;
964 
965  for(uint i = 0; i < analysis_all.size(); i++){
966  TH3F* hHolder3D = (TH3F*)ana::ToTH3(*analysis_all[i],8.09e20,
968  binningx,binningy,
969  binningz,
971  hResult.push_back((TH3F*)hHolder3D->Clone(ana::UniqueName().c_str()));
972  }
973 
974  return hResult;
975  }
976 
977  void NueCCIncCrossSectionTemplates::SaveTo(TDirectory* dir) const{
978  TDirectory *tmp = gDirectory;
979  dir->cd();
980 
981  TObjString("NueCCIncCrossSectionTemplates").Write("type");
982 
983  TVectorD numTemplateCuts(1);
984  numTemplateCuts[0]=numCuts;
985 
986  numTemplateCuts.Write("fTemplateCount");
987 
988  for(int iCuts = 0; iCuts < numCuts; iCuts++){
989  std::string analysis_name = "fAnalysis3D_" + std::to_string(iCuts);
990  std::string template_name = "fTemplate3D_" + std::to_string(iCuts);
991  fAnalyses3D[iCuts]->SaveTo(dir->mkdir(analysis_name.c_str()));
992  fTemplates3D[iCuts]->SaveTo(dir->mkdir(template_name.c_str()));
993  }
994 
995  tmp->cd();
996  }
997 
998  std::unique_ptr<NueCCIncCrossSectionTemplates>
1000 
1001  TVectorD* numTemplateCuts = (TVectorD*)dir->Get("fTemplateCount");
1002 
1003  std::vector<Spectrum*> analysis_out;
1004  std::vector<Spectrum*> template_out;
1005 
1006  for(int iCuts = 0; iCuts < (*numTemplateCuts)[0]; iCuts++){
1007  std::string analysis_name = "fAnalysis3D_" + std::to_string(iCuts);
1008  std::string template_name = "fTemplate3D_" + std::to_string(iCuts);
1009  Spectrum* analysis = ana::LoadFrom<Spectrum>
1010  (dir->GetDirectory(analysis_name.c_str())).release();
1011  Spectrum* templates = ana::LoadFrom<Spectrum>
1012  (dir->GetDirectory(template_name.c_str())).release();
1013  analysis_out.push_back(analysis);
1014  template_out.push_back(templates);
1015  }
1016 
1017  return std::unique_ptr<NueCCIncCrossSectionTemplates>
1018  (
1019  new NueCCIncCrossSectionTemplates(analysis_out,template_out,
1020  (*numTemplateCuts)[0]));
1021 
1022  }
1023 
1025  {
1026  std::vector<Spectrum*> result =
1028  return result;
1029  }
1030 
1032  {
1033  std::vector<Spectrum*> result =
1035  return result;
1036  }
1037 
1038 
1039  //////////// //////////// //////////// //////////// ////////////
1040  //Enhanced Samples///////////////////////////////////////////////
1041  //////////// //////////// //////////// //////////// ////////////
1042 
1044  (
1045  SpectrumLoaderBase &lLoad,
1046  HistAxis yAxis,
1047  HistAxis xAxis,
1048  HistAxis zAxis,
1049  HistAxis recoAxis2D,
1050  NuTruthHistAxis efficiencyAxis2D,
1051  NuTruthHistAxis efficiencyAxis1D,
1052  HistAxis pidAxis,
1053  Cut selection,
1054  std::vector<Cut> templateCuts,
1055  double numberTemplates,
1056  NuTruthCut isSig,
1057  SystShifts shift,
1058  NuTruthVar weiNT,
1059  Var wei,
1060  Var weiNue,
1061  NuTruthVar weiNueNT)
1062  :
1063  fAnalysisSig1D(lLoad,
1064  HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
1065  selection && CutFromNuTruthCut(isSig),
1066  shift, wei*weiNue),
1067  fAnalysisSigNuTree1D(lLoad,
1068  efficiencyAxis1D,
1069  isSig,
1070  shift, weiNT*weiNueNT),
1071  fAnalysisSig2D(lLoad,HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
1072  selection && CutFromNuTruthCut(isSig),
1073  shift, wei*weiNue),
1074  fAnalysisSigNuTree2D(lLoad,efficiencyAxis2D,
1075  isSig,
1076  shift, weiNT*weiNueNT),
1077  fUnfolding1D(lLoad,zAxis,HistAxisFromNuTruthHistAxis(efficiencyAxis1D),
1078  selection && CutFromNuTruthCut(isSig),shift,wei*weiNue),
1079  fUnfolding2D(lLoad,recoAxis2D,HistAxisFromNuTruthHistAxis(efficiencyAxis2D),
1080  selection && CutFromNuTruthCut(isSig),shift,wei*weiNue),
1081  numCuts(numberTemplates)
1082  {
1083  for(uint iCuts = 0; iCuts < templateCuts.size(); iCuts++){
1084  fAnalyses3D.push_back(new Spectrum(lLoad, xAxis,yAxis,
1085  zAxis,selection
1086  && templateCuts[iCuts],
1087  shift,wei*weiNue));
1088  fTemplates3D.push_back(new Spectrum(lLoad, xAxis,yAxis,
1089  pidAxis,
1090  selection && templateCuts[iCuts],
1091  shift,wei*weiNue));
1092  }
1093 
1094  }
1095 
1096  ///////Protected
1097 
1099  return fAnalyses3D;
1100  }
1101 
1103  return fTemplates3D;
1104  }
1105 
1109  }
1110 
1111  ///////Public
1112  std::vector<Spectrum>
1114 
1115  std::vector<Spectrum*> templates =
1117  std::vector<Spectrum*> analysis =
1119  std::vector<Spectrum> others =
1121 
1122  std::vector<Spectrum> results;
1123  //Only passing the efficiency and unfolding related spectra
1124  for(uint i = 0; i < others.size(); i++)
1125  results.push_back(others[i]);
1126 
1127 
1128  return results;
1129  }
1130 
1132  {
1134  }
1135 
1137  {
1139  }
1140 
1141  void NueCCIncEnhancedSamples::SaveTo(TDirectory* dir) const{
1142  TDirectory *tmp = gDirectory;
1143  dir->cd();
1144 
1145  TObjString("NueCCIncEnhancedSamples").Write("type");
1146 
1147  TVectorD numTemplateCuts(1);
1148  numTemplateCuts[0]=numCuts;
1149 
1150  numTemplateCuts.Write("fTemplateCount");
1151 
1152  for(int iCuts = 0; iCuts < numCuts; iCuts++){
1153  std::string analysis_name = "fAnalysis3D_" + std::to_string(iCuts);
1154  std::string template_name = "fTemplate3D_" + std::to_string(iCuts);
1155  fAnalyses3D[iCuts]->SaveTo(dir->mkdir(analysis_name.c_str()));
1156  fTemplates3D[iCuts]->SaveTo(dir->mkdir(template_name.c_str()));
1157  }
1158 
1159  fAnalysisSig1D.SaveTo(dir->mkdir("fAnalysisSig1D"));
1160  fAnalysisSigNuTree1D.SaveTo(dir->mkdir("fAnalysisSigNuTree1D"));
1161  fAnalysisSig2D.SaveTo(dir->mkdir("fAnalysisSig2D"));
1162  fAnalysisSigNuTree2D.SaveTo(dir->mkdir("fAnalysisSigNuTree2D"));
1163  fUnfolding1D.SaveTo(dir->mkdir("fUnfolding1D"));
1164  fUnfolding2D.SaveTo(dir->mkdir("fUnfolding2D"));
1165 
1166  tmp->cd();
1167  return;
1168  }
1169 
1170  std::unique_ptr<NueCCIncEnhancedSamples>
1172 
1173  Spectrum* mcsig1D= ana::LoadFrom<Spectrum>
1174  (dir->GetDirectory("fAnalysisSig1D")).release();
1175 
1176  Spectrum* mcsignutree1D = ana::LoadFrom<Spectrum>
1177  (dir->GetDirectory("fAnalysisSigNuTree1D")).release();
1178 
1179  Spectrum* mcsig2D= ana::LoadFrom<Spectrum>
1180  (dir->GetDirectory("fAnalysisSig2D")).release();
1181 
1182  Spectrum* mcsignutree2D = ana::LoadFrom<Spectrum>
1183  (dir->GetDirectory("fAnalysisSigNuTree2D")).release();
1184 
1185  Spectrum* unfolding1D = ana::LoadFrom<Spectrum>
1186  (dir->GetDirectory("fUnfolding1D")).release();
1187 
1188  Spectrum* unfolding2D = ana::LoadFrom<Spectrum>
1189  (dir->GetDirectory("fUnfolding2D")).release();
1190 
1191  TVectorD* numTemplateCuts = (TVectorD*)dir->Get("fTemplateCount");
1192 
1193  std::vector<Spectrum*> analysis_out;
1194  std::vector<Spectrum*> template_out;
1195 
1196  for(int iCuts = 0; iCuts < (*numTemplateCuts)[0]; iCuts++){
1197  std::string analysis_name = "fAnalysis3D_" + std::to_string(iCuts);
1198  std::string template_name = "fTemplate3D_" + std::to_string(iCuts);
1199  Spectrum* analysis = ana::LoadFrom<Spectrum>
1200  (dir->GetDirectory(analysis_name.c_str())).release();
1201  Spectrum* templates = ana::LoadFrom<Spectrum>
1202  (dir->GetDirectory(template_name.c_str())).release();
1203  analysis_out.push_back(analysis);
1204  template_out.push_back(templates);
1205  }
1206 
1207  return std::unique_ptr<NueCCIncEnhancedSamples>
1208  (
1209  new NueCCIncEnhancedSamples(analysis_out,template_out,
1210  *mcsig1D,
1211  *mcsignutree1D,
1212  *mcsig2D,
1213  *mcsignutree2D,
1214  *unfolding1D,
1215  *unfolding2D,
1216  (*numTemplateCuts)[0]));
1217 
1218  }
1219 
1220  }//end namespace nueccinc
1221 }//end namespace ana
TH1F * doUnfolding1D(TH1F *datahist, int iterations)
const std::vector< Binning > & GetBinnings() const
Definition: Spectrum.h:264
TH3F * getAnalysis3D(Binning binningx, Binning binnningy, Binning binningz)
TH1F * getTemplate(int xbin, int ybin, Binning binningx, Binning binnningy, Binning binningz)
const std::string sTemplates
TH2F * doUnfolding2D(TH2F *datahist, int iterations)
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
Definition: Spectrum.cxx:165
TH2F * getAnalysis2D(Binning binningx, Binning binnningy, Binning binningz)
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
NueCCIncCrossSectionAnalysis(SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis recoAxis2D, NuTruthHistAxis efficiencyAxis2D, NuTruthHistAxis efficiencyAxis1D, HistAxis pidAxis, Binning fluxBins, Cut selection, NuTruthCut isSig, TVector3 min, TVector3 max, SystShifts shift, NuTruthVar weiNT, Var wei)
const Binning zbins
Definition: NumuCCIncBins.h:21
std::vector< TH1F * > getAllTemplates1D(int xbin, int ybin, Binning binningx, Binning binnningy, Binning binningz)
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
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
void OverridePOT(double newpot)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN&#39;T A BETTER WAY!
Definition: Spectrum.h:233
T sqrt(T number)
Definition: d0nt_math.hpp:156
Float_t tmp
Definition: plot.C:36
std::vector< TH3F * > getAllTemplates3D(Binning binningx, Binning binnningy, Binning binningz)
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Definition: Spectrum.cxx:249
static std::unique_ptr< NueCCIncCrossSectionAnalysis > LoadFrom(TDirectory *dir)
Loaders::FluxType flux
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Binning pidbins
Definition: NueCCIncBins.h:38
std::vector< TH3F * > getAllAnalysis3D(Binning binningx, Binning binnningy, Binning binningz)
TH3F * getTemplate3D(Binning binningx, Binning binnningy, Binning binningz)
const int xbins
Definition: MakePlots.C:82
static std::unique_ptr< NueCCIncCrossSectionTemplates > LoadFrom(TDirectory *dir)
static std::unique_ptr< NueCCIncEnhancedSamples > LoadFrom(TDirectory *dir)
TH2F * getEfficiency2D(Binning binningx, Binning binningy)
HistAxis HistAxisFromNuTruthHistAxis(NuTruthHistAxis ntha, double _default)
Definition: HistAxis.cxx:9
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
TH2F * ConvertTo2DHistFrom1DHist(TH2F *hSample2D, TH1F *hist)
TH2F * getSelectedSignalPrediction2D(Binning binningx, Binning binningy)
TH1F * UnfoldHist(TH1F *data_hist_1D, TH2F *hUnfoldingMatrix, int iterations)
std::vector< float > Spectrum
Definition: Constants.h:610
Regular histogram.
Definition: UtilsExt.h:30
double POT() const
Definition: Spectrum.h:227
std::unique_ptr< NueCCIncCrossSectionAnalysis > AddEnhancedSample(std::vector< Spectrum > sample, Binning xbins, Binning ybins, Binning zbins, Binning bins2D, Binning pidbins)
OStream cout
Definition: OStream.cxx:6
const std::string sAnalysis
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
TH3F * getTemplateShapeOnly3D(Binning binningx, Binning binningy, Binning binningz, double integral)
const int ybins
Base class for the various types of spectrum loader.
NueCCIncCrossSectionTemplates(SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis pidAxis, Cut selection, std::vector< Cut > templateCuts, double numberTemplates, const SystShifts shift, const Var wei)
std::vector< Spectrum * > SpectrumEfficiency(std::string dimension)
TH2F * getTrueSignalPrediction2D(Binning binningx, Binning binningy)
Spectrum * DeriveFlux(SpectrumLoaderBase &loader, const Binning &bins, int pdg, const TVector3 *min, const TVector3 *max, const SystShifts &shift, const NuTruthVar weight)
Definition: Flux.cxx:58
TDirectory * dir
Definition: macro.C:5
NueCCIncEnhancedSamples(SpectrumLoaderBase &lLoad, HistAxis yAxis, HistAxis xAxis, HistAxis zAxis, HistAxis recoAxis2D, NuTruthHistAxis efficiencyAxis2D, NuTruthHistAxis efficiencyAxis1D, HistAxis pidAxis, Cut selection, std::vector< Cut > templateCuts, double numberTemplates, NuTruthCut isSig, SystShifts shift, NuTruthVar weiNT, Var wei, Var weiNue, NuTruthVar weiNueNT)
TH1F * getAnalysis1D(Binning binningx, Binning binnningy, Binning binningz, std::string outaxis)
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
const std::vector< std::string > & GetLabels() const
Definition: Spectrum.h:263
Template for Var and SpillVar.
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
void efficiency()
Definition: efficiency.C:58
TH3 * ToTH3(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, const Binning &binsz, ana::EBinType bintype)
Same as ToTH2, but with 3 dimensions.
Definition: UtilsExt.cxx:162
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
TH2 * ToTH2(const Spectrum &s, double exposure, ana::EExposureType expotype, const Binning &binsx, const Binning &binsy, ana::EBinType bintype)
For use with Var2D.
Definition: UtilsExt.cxx:115
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
Long64_t iterations[nThreads]
Definition: PhotonSim_mp.C:71
enum BeamMode string
unsigned int uint