Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ana::Prod3LoadersBase Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N19-06-13/CAFAna/Analysis/Prod3Loaders.h"

Inheritance diagram for ana::Prod3LoadersBase:
ana::Loaders ana::Prod3DataLoaders ana::Prod3AbsCalibLoaders ana::Prod3CalibShapeLoaders ana::Prod3CherenkovLoaders ana::Prod3LightLevelLoaders ana::Prod3NomLoaders

Public Types

enum  DataMC { kData, kMC }
 
enum  SwappingConfig { kNonSwap, kFluxSwap, kTauSwap }
 
enum  FluxType { kFHC, kRHC }
 
typedef voidCallbackFunc_t) ()
 The type of the callback functions. More...
 

Public Member Functions

void SetLoaderPath (const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
 Configure loader via wildcard path. More...
 
std::string GetLoaderPath (caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
 
std::vector< std::string > GetLoaderFiles (caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
 
void SetLoaderFiles (const std::vector< std::string > &files, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
 Configure loader via explicit file list. More...
 
void DisableLoader (caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
 
void SetSpillCut (const SpillCut &cut)
 
void SetND (bool nd)
 
bool GetND ()
 
SpectrumLoaderBaseGetLoader (caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
 Retrieve a specific loader. More...
 
void RegisterCompletionCallback (std::function< CallbackFunc_t > func)
 
template<class T >
void RegisterCompletionCallback (T *obj, void(T::*meth)())
 Register a member function to be called when Go() is finished for all loaders. More...
 
void Go ()
 Call Go() on all the loaders. More...
 

Protected Types

typedef std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfigKey_t
 

Protected Member Functions

void SetLoaderPaths (const std::string &fdmc_nonswap, const std::string &fdmc_fluxswap, const std::string &fdmc_tauswap="", const std::string &ndmc="", const std::string &nddata="")
 
void SetLoaderFDMCPaths (const std::string &prefix, const std::string &suffix)
 
void SetLoaderNDMCPath (const std::string &ndmc)
 
void LoadedCallback ()
 Internal function to keep track if all our loaders have gone yet. More...
 

Protected Attributes

std::map< Key_t, std::string > fLoaderPaths
 
std::map< Key_t, std::vector< std::string > > fLoaderFiles
 
std::map< Key_t, SpectrumLoader * > fLoaders
 
const SpillCutfSpillCut
 
NullLoader fNull
 We give this back when a loader isn't set for some configuration. More...
 
unsigned int fNumChildCallbacks
 Variable for LoadedCallback. More...
 
bool fND
 Bool to set loader for near detector instead of far detector. More...
 
std::vector< std::function< CallbackFunc_t > > fCallbacks
 

Detailed Description

Definition at line 13 of file Prod3Loaders.h.

Member Typedef Documentation

typedef void( ana::Loaders::CallbackFunc_t) ()
inherited

The type of the callback functions.

Definition at line 69 of file Loaders.h.

typedef std::tuple<caf::Det_t, DataMC, DataSource, SwappingConfig> ana::Loaders::Key_t
protectedinherited

Definition at line 95 of file Loaders.h.

Member Enumeration Documentation

enum ana::Loaders::DataMC
inherited
Enumerator
kData 
kMC 

Definition at line 20 of file Loaders.h.

enum ana::Loaders::FluxType
inherited
Enumerator
kFHC 
kRHC 

Definition at line 22 of file Loaders.h.

Enumerator
kNonSwap 
kFluxSwap 
kTauSwap 

Definition at line 21 of file Loaders.h.

Member Function Documentation

void ana::Loaders::DisableLoader ( caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
)
inherited

Definition at line 65 of file Loaders.cxx.

References ana::Loaders::fLoaderFiles, ana::Loaders::fLoaderPaths, ana::Loaders::fLoaders, ana::Loaders::fND, it, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, and ana::Loaders::kNonSwap.

Referenced by GenFile(), GetLoaders2017(), GetLoaders2018(), load_files(), plots_interactionMode(), ana::Loaders::SetLoaderFiles(), ana::Loaders::SetLoaderPath(), setPathsRHC(), and test_ana().

69  {
70  assert(datamc == kMC || swap == kNonSwap);
71  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
72  else assert(det == caf::kNEARDET || swap == kNonSwap);
73  assert(src == kBeam || swap == kNonSwap);
74 
75  const Key_t key(det, datamc, src, swap);
76 
77  // Clear out the current one if possible
78  auto it = fLoaders.find(key);
79  if(it != fLoaders.end()){
80  delete it->second;
81  fLoaders.erase(it);
82  }
83 
84  fLoaderPaths.erase(key);
85  fLoaderFiles.erase(key);
86  }
Near Detector underground.
Definition: SREnums.h:10
std::map< Key_t, std::string > fLoaderPaths
Definition: Loaders.h:98
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
set< int >::iterator it
bool datamc
Definition: fnexvscaf.C:20
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:99
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:101
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
SpectrumLoaderBase & ana::Loaders::GetLoader ( caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
)
inherited

Retrieve a specific loader.

Definition at line 129 of file Loaders.cxx.

References ana::Loaders::fLoaderFiles, ana::Loaders::fLoaderPaths, ana::Loaders::fLoaders, ana::Loaders::fND, ana::Loaders::fNull, ana::Loaders::fSpillCut, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, and ana::Loaders::LoadedCallback().

Referenced by NDPredictionHandler::AddVar(), BlessedPlotsLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demoSysts(), ana::FDExtrap::FDExtrap_c(), ana::SterileGenerator::Generate(), generate_fd_fake_events(), ana::Loaders::GetND(), make_nue_fd_datamc(), make_nue_firstana_extrap(), MakeDecomp(), MakeMap(), MakeNus2019CovMxSysts(), MakeSystRatios(), MakeSysts(), mec_tuning(), ana::ModularExtrapSterile::NCDisappearance(), ana::NDExtrap::NDExtrap_c(), ana::ModularExtrap::Nue(), ana::ModularExtrap::NueFlux(), ana::ModularExtrap::NueRHC(), ana::ModularExtrap::Numu(), plots_interactionMode(), ReifyLoaders(), sterile_demo(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsGENIELoad(), SystsGENIELoad17(), SystsNDRockLoad(), test_micheldecomp(), and ana::ModularExtrapSterile::TrivialExtrapNC().

133  {
134  assert(datamc == kMC || swap == kNonSwap);
135  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
136  else assert(det == caf::kNEARDET || swap == kNonSwap);
137  assert(src == kBeam || swap == kNonSwap);
138 
139  const Key_t key(det, datamc, src, swap);
140 
141  // Look up and return. Use fNull if no loader is set for this config
142  auto itLoader = fLoaders.find(key);
143  if(itLoader != fLoaders.end()) return *itLoader->second;
144 
145  auto itPath = fLoaderPaths.find(key);
146  if(itPath != fLoaderPaths.end()){
147  fLoaders[key] = new SpectrumLoader(itPath->second, src);
148  if(fSpillCut) fLoaders[key]->SetSpillCut(*fSpillCut);
149  fLoaders[key]->RegisterCompletionCallback(this, &Loaders::LoadedCallback);
150  return *fLoaders[key];
151  }
152  auto itFiles = fLoaderFiles.find(key);
153  if(itFiles != fLoaderFiles.end()){
154  fLoaders[key] = new SpectrumLoader(itFiles->second, src);
155  if(fSpillCut) fLoaders[key]->SetSpillCut(*fSpillCut);
156  fLoaders[key]->RegisterCompletionCallback(this, &Loaders::LoadedCallback);
157  return *fLoaders[key];
158  }
159 
160  return fNull;
161  }
Near Detector underground.
Definition: SREnums.h:10
std::map< Key_t, std::string > fLoaderPaths
Definition: Loaders.h:98
const SpillCut * fSpillCut
Definition: Loaders.h:103
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
bool datamc
Definition: fnexvscaf.C:20
NullLoader fNull
We give this back when a loader isn&#39;t set for some configuration.
Definition: Loaders.h:106
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:99
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:101
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
void LoadedCallback()
Internal function to keep track if all our loaders have gone yet.
Definition: Loaders.cxx:186
std::vector< std::string > ana::Loaders::GetLoaderFiles ( caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
) const
inherited

Definition at line 105 of file Loaders.cxx.

References ana::Loaders::fLoaderFiles, ana::Loaders::fND, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, and ana::Loaders::kNonSwap.

109  {
110  assert(datamc == kMC || swap == kNonSwap);
111  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
112  else assert(det == caf::kNEARDET || swap == kNonSwap);
113  assert(src == kBeam || swap == kNonSwap);
114 
115  const Key_t key(det, datamc, src, swap);
116 
117  return fLoaderFiles.at(key);
118  }
Near Detector underground.
Definition: SREnums.h:10
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
bool datamc
Definition: fnexvscaf.C:20
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:99
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
std::string ana::Loaders::GetLoaderPath ( caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
) const
inherited

Definition at line 89 of file Loaders.cxx.

References ana::Loaders::fLoaderPaths, ana::Loaders::fND, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, and ana::Loaders::kNonSwap.

Referenced by generate_fd_fake_events(), GetLoaders2017(), GetLoaders2017FakeData(), GetLoaders2018(), getPredictions(), Nus18SystsLLMethodLoad(), PrintLoaderPaths(), and SwapNDDataLoader().

93  {
94  assert(datamc == kMC || swap == kNonSwap);
95  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
96  else assert(det == caf::kNEARDET || swap == kNonSwap);
97  assert(src == kBeam || swap == kNonSwap);
98 
99  const Key_t key(det, datamc, src, swap);
100 
101  return fLoaderPaths.at(key);
102  }
Near Detector underground.
Definition: SREnums.h:10
std::map< Key_t, std::string > fLoaderPaths
Definition: Loaders.h:98
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
bool datamc
Definition: fnexvscaf.C:20
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
bool ana::Loaders::GetND ( )
inlineinherited

Definition at line 60 of file Loaders.h.

References ana::Loaders::fND, ana::Loaders::GetLoader(), ana::kBeam, ana::Loaders::kNonSwap, and plot_timing_data::swap.

60 { return fND; }
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
void ana::Loaders::Go ( )
inherited

Call Go() on all the loaders.

Definition at line 170 of file Loaders.cxx.

References ana::Loaders::fLoaders, ana::Loaders::fNull, ana::NullLoader::Go(), and it.

Referenced by BlessedPlotsLoad(), cc(), Compare_NoExtrap(), ComparisonPlots_MC(), CutFlow_MC(), CutTableLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demo_flat(), demoSysts(), efficiency(), efficiencySA(), extrap_syst_fa(), fa_fd_data_mc_systs(), fa_numuContours(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), futureSig_getNueNumuSyst(), generate_fd_fake_events(), GenFile(), get_fdmc_spectra(), getPredictions(), getPredictions_updatedAna(), joint_fit_make_sa_pred_numu(), load_files(), make_extrap_figure_hists(), make_fa_pred(), make_nue_fd_datamc(), make_nue_firstana_extrap(), make_nue_xsec_pred(), make_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_quantile_cuts_predictions(), make_sa_pred(), MakeCovarSim(), MakeNus17PredictionSysts(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakeNus18SidebandPred(), MakeNus18Systs(), MakeNus2019CovMxSysts(), MakeNusPredictionSystsAna01(), MakePPFXRatios(), makePred(), MakeSystRatios(), MakeSysts(), mec_tuning(), NoExtrap(), nus17_fd_cut_tables2D(), Nus18SystsBeamTranspLoad(), Nus18SystsCalibAbsLoad(), Nus18SystsCalibRelLoad(), Nus18SystsGENIELoad(), Nus18SystsKaonLoad(), Nus18SystsLightLevelLoad(), Nus18SystsLLMethodLoad(), Nus18SystsNeutronLoad(), Nus18SystsPPFXLoad(), Nus18SystsTauLoad(), Nus18SystsXSecOnOffLoad(), plots_interactionMode(), ana::Loaders::RegisterCompletionCallback(), resolution2018(), saTestContours(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), sterile_demo(), syst_test(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsDecompLoad(), SystsDecompLoad17(), SystsFidContLoad(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsLoad(), SystsNDRockLoad(), template_GENIE_systs(), template_nonGENIE_systs(), test_ana(), test_BENDecomp(), test_micheldecomp(), test_numu_summed_genie_systs(), test_prediction_interp(), test_saloaders(), and xsec_extrap_plots().

171  {
172  for(auto it: fLoaders)
173  {
174  if (!it.second->Gone())
175  it.second->Go();
176  }
177 
178  // Ensure anyone who signed up to one of these gets properly notified
179  fNull.Go();
180 
181  // No need to notify our callbacks here. Our LoadedCallback() should have
182  // noticed we're done and taken care of it.
183  }
set< int >::iterator it
virtual void Go() override
Load all the registered spectra.
NullLoader fNull
We give this back when a loader isn&#39;t set for some configuration.
Definition: Loaders.h:106
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:101
void ana::Loaders::LoadedCallback ( )
protectedinherited

Internal function to keep track if all our loaders have gone yet.

Definition at line 186 of file Loaders.cxx.

References plot_validation_datamc::c, ana::Loaders::fCallbacks, ana::Loaders::fLoaders, and ana::Loaders::fNumChildCallbacks.

Referenced by ana::Loaders::GetLoader(), and ana::Loaders::RegisterCompletionCallback().

187  {
189  // Someone got loaded more than once??
190  assert(fNumChildCallbacks <= fLoaders.size());
191 
192  // Once all of our children have notified, it's time to notify people
193  // waiting on us
194  if(fNumChildCallbacks == fLoaders.size()){
195  for(auto c: fCallbacks) c();
196  }
197  }
std::vector< std::function< CallbackFunc_t > > fCallbacks
Definition: Loaders.h:112
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:101
unsigned int fNumChildCallbacks
Variable for LoadedCallback.
Definition: Loaders.h:108
void ana::Loaders::RegisterCompletionCallback ( std::function< CallbackFunc_t func)
inherited

Register a function to be called when Go() is finished for all loaders

Parameters
funcA global function, lambda, or function object. The signature is a void function with no parameters.

Definition at line 164 of file Loaders.cxx.

References ana::Loaders::fCallbacks.

Referenced by ana::Loaders::RegisterCompletionCallback().

165  {
166  fCallbacks.push_back(func);
167  }
std::vector< std::function< CallbackFunc_t > > fCallbacks
Definition: Loaders.h:112
double func(double x, double y)
template<class T >
void ana::Loaders::RegisterCompletionCallback ( T obj,
void(T::*)()  meth 
)
inlineinherited

Register a member function to be called when Go() is finished for all loaders.

Parameters
objPointer to the object whose method to call
methThe method to call, void, no arguments

Definition at line 81 of file Loaders.h.

References ana::Loaders::Go(), ana::Loaders::LoadedCallback(), and ana::Loaders::RegisterCompletionCallback().

82  {
83  // This has to be inline in the header so that the required versions get
84  // instantiated when used.
85  RegisterCompletionCallback(std::bind(meth, obj));
86  }
void RegisterCompletionCallback(std::function< CallbackFunc_t > func)
Definition: Loaders.cxx:164
void ana::Prod3LoadersBase::SetLoaderFDMCPaths ( const std::string &  prefix,
const std::string &  suffix 
)
protected

Definition at line 22 of file Prod3Loaders.cxx.

References SetLoaderPaths().

Referenced by ana::Prod3AbsCalibLoaders::Prod3AbsCalibLoaders(), ana::Prod3CalibShapeLoaders::Prod3CalibShapeLoaders(), ana::Prod3CherenkovLoaders::Prod3CherenkovLoaders(), ana::Prod3LightLevelLoaders::Prod3LightLevelLoaders(), and ana::Prod3NomLoaders::Prod3NomLoaders().

24  {
25  SetLoaderPaths(prefix+"_nonswap_"+suffix,
26  prefix+"_fluxswap_"+suffix,
27  prefix+"_tau_"+suffix);
28  }
const XML_Char * prefix
Definition: expat.h:380
void SetLoaderPaths(const std::string &fdmc_nonswap, const std::string &fdmc_fluxswap, const std::string &fdmc_tauswap="", const std::string &ndmc="", const std::string &nddata="")
Definition: Prod3Loaders.cxx:8
void ana::Loaders::SetLoaderFiles ( const std::vector< std::string > &  files,
caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
)
inherited

Configure loader via explicit file list.

Definition at line 45 of file Loaders.cxx.

References ana::Loaders::DisableLoader(), compareCafs::files, ana::Loaders::fLoaderFiles, ana::Loaders::fND, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, and ana::Loaders::kNonSwap.

Referenced by FDDataMCSystBandLoad(), FitSystEffectsLoad(), MakeNusPredictionSystsAna01(), setLoadersPathConcat(), and setPathsFNALP123b().

50  {
51  assert(datamc == kMC || swap == kNonSwap);
52  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
53  else assert(det == caf::kNEARDET || swap == kNonSwap);
54  assert(src == kBeam || swap == kNonSwap);
55 
56  const Key_t key(det, datamc, src, swap);
57 
58  // Clear out the old one if necessary
59  DisableLoader(det, datamc, src, swap);
60 
62  }
Near Detector underground.
Definition: SREnums.h:10
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
void DisableLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Definition: Loaders.cxx:65
bool datamc
Definition: fnexvscaf.C:20
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:99
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
void ana::Prod3LoadersBase::SetLoaderNDMCPath ( const std::string &  ndmc)
protected

Definition at line 31 of file Prod3Loaders.cxx.

References SetLoaderPaths().

Referenced by ana::Prod3AbsCalibLoaders::Prod3AbsCalibLoaders(), ana::Prod3CalibShapeLoaders::Prod3CalibShapeLoaders(), ana::Prod3CherenkovLoaders::Prod3CherenkovLoaders(), ana::Prod3LightLevelLoaders::Prod3LightLevelLoaders(), and ana::Prod3NomLoaders::Prod3NomLoaders().

32  {
33  SetLoaderPaths("", "", "", ndmc);
34  }
void SetLoaderPaths(const std::string &fdmc_nonswap, const std::string &fdmc_fluxswap, const std::string &fdmc_tauswap="", const std::string &ndmc="", const std::string &nddata="")
Definition: Prod3Loaders.cxx:8
void ana::Loaders::SetLoaderPath ( const std::string &  path,
caf::Det_t  det,
DataMC  datamc,
DataSource  src = kBeam,
SwappingConfig  swap = kNonSwap 
)
inherited

Configure loader via wildcard path.

Definition at line 25 of file Loaders.cxx.

References ana::Loaders::DisableLoader(), ana::Loaders::fLoaderPaths, ana::Loaders::fND, ana::kBeam, findDuplicateFiles::key, caf::kFARDET, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, and path.

Referenced by BlessedPlotsLoad(), CutTableLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demo_flat(), efficiency(), efficiencySA(), fa_fd_data_mc_systs(), fa_numuContours(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), generate_fd_fake_events(), GetLoaders2017(), GetLoaders2017FakeData(), GetLoaders2018(), getPredictions(), getPredictions_updatedAna(), make_extrap_figure_hists(), make_nue_fd_datamc(), make_nue_firstana_extrap(), make_prediction(), make_prediction_rhc(), MakeNus17PredictionSysts(), MakeNusPredictionSystsAna01(), mec_tuning(), nus17_fd_cut_tables2D(), Nus18SystsLLMethodLoad(), plots_interactionMode(), ana::Prod3DataLoaders::Prod3DataLoaders(), ana::Prod4DataLoaders::Prod4DataLoaders(), ana::SACAFLoaders::SACAFLoaders(), ana::SADecafLoaders::SADecafLoaders(), saTestContours(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), set_loaders_ana2018(), SetLoaderPaths(), ana::Prod4LoadersBase::SetLoaderPaths(), SetLoaderPaths2017(), setLoadersPathNumu2017(), setPathsCaltech(), setPathsFNALP1(), setPathsFNALP123b(), setPathsFNALP2(), setPathsFNALP3(), setPathsFNALP3c(), setPathsFull(), setPathsMatthewHadd(), setPathsRHC(), setPathsTest(), sterile_demo(), SwapNDDataLoader(), syst_test(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsDecompLoad(), SystsDecompLoad17(), SystsFidContLoad(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsLoad(), SystsNDRockLoad(), template_GENIE_systs(), template_nonGENIE_systs(), test_numu_summed_genie_systs(), and test_prediction_interp().

30  {
31  assert(datamc == kMC || swap == kNonSwap);
32  if (!fND) assert(det == caf::kFARDET || swap == kNonSwap);
33  else assert(det == caf::kNEARDET || swap == kNonSwap);
34  assert(src == kBeam || swap == kNonSwap);
35 
36  const Key_t key(det, datamc, src, swap);
37 
38  // Clear out the old one if necessary
39  DisableLoader(det, datamc, src, swap);
40 
42  }
Near Detector underground.
Definition: SREnums.h:10
std::map< Key_t, std::string > fLoaderPaths
Definition: Loaders.h:98
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:95
Far Detector at Ash River.
Definition: SREnums.h:11
void DisableLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Definition: Loaders.cxx:65
bool datamc
Definition: fnexvscaf.C:20
const std::string path
Definition: plot_BEN.C:43
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
void ana::Prod3LoadersBase::SetLoaderPaths ( const std::string &  fdmc_nonswap,
const std::string &  fdmc_fluxswap,
const std::string &  fdmc_tauswap = "",
const std::string &  ndmc = "",
const std::string &  nddata = "" 
)
protected

Definition at line 8 of file Prod3Loaders.cxx.

References ana::kBeam, ana::Loaders::kData, caf::kFARDET, ana::Loaders::kFluxSwap, ana::Loaders::kMC, caf::kNEARDET, ana::Loaders::kNonSwap, ana::Loaders::kTauSwap, and ana::Loaders::SetLoaderPath().

Referenced by SetLoaderFDMCPaths(), and SetLoaderNDMCPath().

13  {
14  if(!fdmc_nonswap.empty()) SetLoaderPath(fdmc_nonswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
15  if(!fdmc_fluxswap.empty()) SetLoaderPath(fdmc_fluxswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kFluxSwap);
16  if(!fdmc_tauswap.empty()) SetLoaderPath(fdmc_tauswap, caf::kFARDET, Loaders::kMC, ana::kBeam, Loaders::kTauSwap);
19  }
Near Detector underground.
Definition: SREnums.h:10
Far Detector at Ash River.
Definition: SREnums.h:11
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
void ana::Loaders::SetND ( bool  nd)
inlineinherited

Definition at line 59 of file Loaders.h.

References ana::Loaders::fND, and nd.

Referenced by MakeCovarSim(), MakeNus18CovarSim(), MakeNus2019CovMxSysts(), MakePPFXRatios(), MakeSystRatios(), and MakeSysts().

59 { fND = nd; }
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:110
void ana::Loaders::SetSpillCut ( const SpillCut cut)
inherited

Definition at line 121 of file Loaders.cxx.

References ana::Loaders::fLoaders, ana::Loaders::fSpillCut, and it.

Referenced by BlessedPlotsLoad(), Compare_NoExtrap(), ComparisonPlots_MC(), CutFlow_MC(), CutTableLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demoSysts(), efficiency(), efficiencySA(), extrap_syst_fa(), fa_fd_data_mc_systs(), fa_numuContours(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), futureSig_getNueNumuSyst(), generate_fd_fake_events(), get_fdmc_spectra(), getPredictions(), getPredictions_updatedAna(), joint_fit_make_sa_pred_numu(), make_extrap_figure_hists(), make_fa_pred(), make_nue_fd_datamc(), make_nue_firstana_extrap(), make_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_quantile_cuts_predictions(), make_sa_pred(), MakeCovarSim(), MakeNus17PredictionSysts(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakeNus18SidebandPred(), MakeNus18Systs(), MakeNus2019CovMxSysts(), MakeNusPredictionSystsAna01(), MakePPFXRatios(), makePred(), MakeSystRatios(), MakeSysts(), mec_tuning(), NoExtrap(), nus17_fd_cut_tables2D(), Nus18SystsBeamTranspLoad(), Nus18SystsCalibAbsLoad(), Nus18SystsCalibRelLoad(), Nus18SystsGENIELoad(), Nus18SystsKaonLoad(), Nus18SystsLightLevelLoad(), Nus18SystsLLMethodLoad(), Nus18SystsNeutronLoad(), Nus18SystsPPFXLoad(), Nus18SystsTauLoad(), Nus18SystsXSecOnOffLoad(), plots_interactionMode(), saTestContours(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsDecompLoad(), SystsDecompLoad17(), SystsFidContLoad(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsLoad(), SystsNDRockLoad(), test_BENDecomp(), test_micheldecomp(), test_numu_summed_genie_systs(), and xsec_extrap_plots().

122  {
123  for(auto it: fLoaders) it.second->SetSpillCut(cut);
124  if(fSpillCut) delete fSpillCut;
125  fSpillCut = new SpillCut(cut);
126  }
const SpillCut * fSpillCut
Definition: Loaders.h:103
set< int >::iterator it
GenericCut< caf::SRSpillProxy > SpillCut
Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts.
Definition: Cut.h:99
const Cut cut
Definition: exporter_fd.C:30
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:101

Member Data Documentation

std::vector<std::function<CallbackFunc_t> > ana::Loaders::fCallbacks
protectedinherited
std::map<Key_t, std::vector<std::string> > ana::Loaders::fLoaderFiles
protectedinherited
std::map<Key_t, std::string> ana::Loaders::fLoaderPaths
protectedinherited
std::map<Key_t, SpectrumLoader*> ana::Loaders::fLoaders
protectedinherited
bool ana::Loaders::fND
protectedinherited
NullLoader ana::Loaders::fNull
protectedinherited

We give this back when a loader isn't set for some configuration.

Definition at line 106 of file Loaders.h.

Referenced by ana::Loaders::GetLoader(), and ana::Loaders::Go().

unsigned int ana::Loaders::fNumChildCallbacks
protectedinherited

Variable for LoadedCallback.

Definition at line 108 of file Loaders.h.

Referenced by ana::Loaders::LoadedCallback().

const SpillCut* ana::Loaders::fSpillCut
protectedinherited

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