Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ana::nueccinc::NueCCIncCrossSectionTemplates Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/NDAna/nuecc_inc/NueCCIncCrossSectionAnalysis.h"

Public Member Functions

 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)
 
virtual ~NueCCIncCrossSectionTemplates ()
 
std::vector< TH1F * > getAllTemplates1D (int xbin, int ybin, Binning binningx, Binning binnningy, Binning binningz)
 
std::vector< TH3F * > getAllTemplates3D (Binning binningx, Binning binnningy, Binning binningz)
 
std::vector< TH3F * > getAllAnalysis3D (Binning binningx, Binning binnningy, Binning binningz)
 
std::vector< TH1F * > getFullTemplates1D ()
 
void SaveTo (TDirectory *dir) const
 
 NueCCIncCrossSectionTemplates (std::vector< Spectrum * > sAnalysis, std::vector< Spectrum * > sTemplates, double numTypes, bool loadFromFile)
 
std::vector< Spectrum * > returnTemplates3D ()
 
std::vector< Spectrum * > returnAnalysis3D ()
 

Static Public Member Functions

static std::unique_ptr< NueCCIncCrossSectionTemplatesLoadFrom (TDirectory *dir)
 

Private Member Functions

 NueCCIncCrossSectionTemplates (std::vector< Spectrum * > analysis3D, std::vector< Spectrum * > templates3D, double numTypes)
 
std::vector< Spectrum * > Templates ()
 
std::vector< Spectrum * > Analysis ()
 

Private Attributes

std::vector< Spectrum * > fAnalyses3D
 
std::vector< Spectrum * > fTemplates3D
 
double numCuts
 

Detailed Description

Definition at line 166 of file NueCCIncCrossSectionAnalysis.h.

Constructor & Destructor Documentation

ana::nueccinc::NueCCIncCrossSectionTemplates::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 
)

Definition at line 840 of file NueCCIncCrossSectionAnalysis.cxx.

Referenced by ana::nueccinc::NueCCIncCrossSectionAnalysis::returnFiducialVectors().

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  }
std::vector< float > Spectrum
Definition: Constants.h:610
unsigned int uint
virtual ana::nueccinc::NueCCIncCrossSectionTemplates::~NueCCIncCrossSectionTemplates ( )
inlinevirtual
ana::nueccinc::NueCCIncCrossSectionTemplates::NueCCIncCrossSectionTemplates ( std::vector< Spectrum * >  sAnalysis,
std::vector< Spectrum * >  sTemplates,
double  numTypes,
bool  loadFromFile 
)

Definition at line 865 of file NueCCIncCrossSectionAnalysis.cxx.

868  :
871  numCuts(numTypes)
872  {}
const std::string sTemplates
const std::string sAnalysis
ana::nueccinc::NueCCIncCrossSectionTemplates::NueCCIncCrossSectionTemplates ( std::vector< Spectrum * >  analysis3D,
std::vector< Spectrum * >  templates3D,
double  numTypes 
)
inlineprivate

Definition at line 206 of file NueCCIncCrossSectionAnalysis.h.

Member Function Documentation

std::vector< Spectrum * > ana::nueccinc::NueCCIncCrossSectionTemplates::Analysis ( )
private

Definition at line 883 of file NueCCIncCrossSectionAnalysis.cxx.

Referenced by getAllAnalysis3D(), and returnAnalysis3D().

884  {
885  return fAnalyses3D;
886  }
std::vector< TH3F * > ana::nueccinc::NueCCIncCrossSectionTemplates::getAllAnalysis3D ( Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 956 of file NueCCIncCrossSectionAnalysis.cxx.

References Analysis(), MECModelEnuComparisons::i, ana::kBinContent, ana::kPOT, ana::ToTH3(), and ana::UniqueName().

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  }
Regular histogram.
Definition: UtilsExt.h:30
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
unsigned int uint
std::vector< TH1F * > ana::nueccinc::NueCCIncCrossSectionTemplates::getAllTemplates1D ( int  xbin,
int  ybin,
Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 893 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, ana::kBinContent, ana::kPOT, Templates(), ana::ToTH3(), and ana::UniqueName().

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  }
Regular histogram.
Definition: UtilsExt.h:30
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
unsigned int uint
std::vector< TH3F * > ana::nueccinc::NueCCIncCrossSectionTemplates::getAllTemplates3D ( Binning  binningx,
Binning  binnningy,
Binning  binningz 
)

Definition at line 917 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, ana::kBinContent, ana::kPOT, Templates(), ana::ToTH3(), and ana::UniqueName().

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  }
Regular histogram.
Definition: UtilsExt.h:30
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
unsigned int uint
std::vector< TH1F * > ana::nueccinc::NueCCIncCrossSectionTemplates::getFullTemplates1D ( )

Definition at line 939 of file NueCCIncCrossSectionAnalysis.cxx.

References MECModelEnuComparisons::i, Templates(), and ana::UniqueName().

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  }
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
unsigned int uint
std::unique_ptr< NueCCIncCrossSectionTemplates > ana::nueccinc::NueCCIncCrossSectionTemplates::LoadFrom ( TDirectory *  dir)
static

Definition at line 999 of file NueCCIncCrossSectionAnalysis.cxx.

References string, and art::to_string().

999  {
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  }
std::vector< float > Spectrum
Definition: Constants.h:610
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)
TDirectory * dir
Definition: macro.C:5
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
enum BeamMode string
std::vector< Spectrum * > ana::nueccinc::NueCCIncCrossSectionTemplates::returnAnalysis3D ( )
std::vector< Spectrum * > ana::nueccinc::NueCCIncCrossSectionTemplates::returnTemplates3D ( )

Definition at line 1024 of file NueCCIncCrossSectionAnalysis.cxx.

References fillBadChanDBTables::result, and Templates().

1025  {
1026  std::vector<Spectrum*> result =
1028  return result;
1029  }
void ana::nueccinc::NueCCIncCrossSectionTemplates::SaveTo ( TDirectory *  dir) const

Definition at line 977 of file NueCCIncCrossSectionAnalysis.cxx.

References string, tmp, and art::to_string().

977  {
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  }
Float_t tmp
Definition: plot.C:36
TDirectory * dir
Definition: macro.C:5
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
enum BeamMode string
std::vector< Spectrum * > ana::nueccinc::NueCCIncCrossSectionTemplates::Templates ( )
private

Member Data Documentation

std::vector<Spectrum*> ana::nueccinc::NueCCIncCrossSectionTemplates::fAnalyses3D
private

Definition at line 217 of file NueCCIncCrossSectionAnalysis.h.

std::vector<Spectrum*> ana::nueccinc::NueCCIncCrossSectionTemplates::fTemplates3D
private

Definition at line 218 of file NueCCIncCrossSectionAnalysis.h.

double ana::nueccinc::NueCCIncCrossSectionTemplates::numCuts
private

Definition at line 219 of file NueCCIncCrossSectionAnalysis.h.


The documentation for this class was generated from the following files: