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

Provide the data loaders only, base class for other loaders. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/CAFAna/Analysis/Prod4Loaders.h"

Inheritance diagram for ana::Prod4DataLoaders:
ana::Prod4LoadersBase ana::Loaders ana::Prod4AbsCalibLoaders ana::Prod4CalibShapeLoaders ana::Prod4CherenkovLoaders ana::Prod4LightLevelLoaders ana::Prod4NomLoaders

Public Types

enum  DataMC { kData, kMC }
 
enum  SwappingConfig { kNonSwap, kFluxSwap, kTauSwap }
 
enum  FluxType { kFHC, kRHC }
 

Public Member Functions

 Prod4DataLoaders (ECAFType type, FluxType flux, std::string WhichPeriod="full", std::string WhichNDPeriod="full", EFlatness flat=kNormalCAF)
 
virtual std::string GetSystString () const
 
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::stringGetLoaderFiles (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 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, const bool noTau=false)
 
void SetLoaderNDMCPath (const std::string &ndmc)
 
const std::string ECAFTypeToString (ECAFType type)
 
std::string ECAFTypeFlatToTier (ECAFType type, EFlatness flat) const
 

Protected Attributes

const std::string cafType
 
const std::string dataTier
 from "caf" to "flatsumdecaf" More...
 
const std::string fluxType
 
std::map< Key_t, std::stringfLoaderPaths
 
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...
 
bool fND
 Bool to set loader for near detector instead of far detector. More...
 

Detailed Description

Provide the data loaders only, base class for other loaders.

Definition at line 65 of file Prod4Loaders.h.

Member Typedef Documentation

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

Definition at line 78 of file Loaders.h.

Member Enumeration Documentation

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

Definition at line 26 of file Loaders.h.

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

Definition at line 28 of file Loaders.h.

Enumerator
kNonSwap 
kFluxSwap 
kTauSwap 

Definition at line 27 of file Loaders.h.

Constructor & Destructor Documentation

ana::Prod4DataLoaders::Prod4DataLoaders ( ECAFType  type,
FluxType  flux,
std::string  WhichPeriod = "full",
std::string  WhichNDPeriod = "full",
EFlatness  flat = kNormalCAF 
)

Create data loaders instance.

Parameters
typeECAFType to specify the CAF type.
fluxFluxType to specify the flux (kFHC/kRHC).
WhichPeriodString describing the desired range (e.g. "full" - default, "period4", "epoch6a").
WhichNDPeriodString describing the desired range (e.g. "full" - default, "period4", "epoch6a").

Definition at line 109 of file Prod4Loaders.cxx.

References cafType, om::cerr, dataTier, allTimeWatchdog::endl, fluxType, ana::kBeam, ana::Loaders::kData, ana::kDecaf, ana::Loaders::kFHC, ana::kFullCAF, caf::kNEARDET, ana::Loaders::kNonSwap, ana::kNueConcat, ana::kNumuConcat, ana::kNusConcat, ana::Loaders::kRHC, ana::Loaders::SetLoaderPath(), and string.

116  fluxType(flux==kFHC? "fhc":"rhc")
117  {
118  std::string nddata = "";
119  const std::string ndrel = (flux==kFHC ? "f":"f"); // same at the moment,
120  // but could change
121 
122  // Some period/flux validation checks
123  // Only need to do these once --> in DataLoaders
124  const bool isRHCPeriod = (
125  (WhichNDPeriod == "period4") || (WhichPeriod == "period4") ||
126  (WhichNDPeriod == "epoch6a") || (WhichPeriod == "epoch6a") ||
127  (WhichNDPeriod == "epoch7a") || (WhichPeriod == "epoch7a"));
128 
129  const bool isFull = ((WhichNDPeriod == "full") || (WhichPeriod == "full"));
130 
131  if(flux == kFHC)
132  if(isRHCPeriod && !isFull) // Warn that it's not an FHC period
133  std::cerr << "\nWARNING: ND " << WhichNDPeriod << " and FD "
134  << WhichPeriod << " contains no FHC data" << std::endl << std::endl;
135  if(flux == kRHC)
136  {
137  if(!isRHCPeriod && !isFull) // Now warn that it's not an RHC period
138  std::cerr << "\nWARNING: ND " << WhichNDPeriod << " and FD "
139  << WhichPeriod << " contains no RHC data" << std::endl << std::endl;
140  if(isFull)
141  std::cerr << "\nWARNING: " << WhichPeriod
142  << " does not include RHC data in epoch7a" << std::endl << std::endl;
143  }
144 
145  // Concat definition
146  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat)
147  nddata = "prod_"+dataTier+"_R17-09-05-prod4recopreview." + ndrel +
148  "_nd_numi_" + fluxType + "_" + WhichNDPeriod +
149  "_v1_addShortSimpleCVN_goodruns_" + cafType;
150  // Decaf definition
151  if(type == kDecaf)
152  nddata = "prod_"+dataTier+"_R17-09-05-prod4recopreview." + ndrel +
153  "_nd_numi_" + fluxType + "_" + WhichNDPeriod + "_" +
154  cafType + "_v1_addShortSimpleCVN_goodruns";
155  // CAF definition
156  if(type == kFullCAF)
157  nddata = "prod_"+dataTier+"_R17-09-05-prod4recopreview." + ndrel +
158  "_nd_numi_" + fluxType + "_" + WhichNDPeriod +
159  "_v1_addShortSimpleCVN_goodruns";
160 
163  }
Near Detector underground.
Definition: SREnums.h:10
const std::string cafType
Definition: Prod4Loaders.h:88
OStream cerr
Definition: OStream.cxx:7
const std::string fluxType
Definition: Prod4Loaders.h:91
Loaders::FluxType flux
const std::string ECAFTypeToString(ECAFType type)
std::string ECAFTypeFlatToTier(ECAFType type, EFlatness flat) const
const std::string dataTier
from "caf" to "flatsumdecaf"
Definition: Prod4Loaders.h:90
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
enum BeamMode string

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::assert(), 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(), 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:81
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:78
Far Detector at Ash River.
Definition: SREnums.h:11
set< int >::iterator it
bool datamc
Definition: fnexvscaf.C:20
assert(nhit_max >=nhit_nbins)
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:82
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:84
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
std::string ana::Prod4LoadersBase::ECAFTypeFlatToTier ( ECAFType  type,
EFlatness  flat 
) const
protectedinherited

Definition at line 73 of file Prod4Loaders.cxx.

References om::cerr, om::cout, allTimeWatchdog::endl, ana::kDecaf, ana::kFlatCAF, ana::kFullCAF, ana::kNormalCAF, ana::kNueConcat, ana::kNumuConcat, ana::kNusConcat, runNovaSAM::ret, and string.

75  {
76  // TODO - remove this logic once flatcafs are more widely available
77  if(flat == kFlatCAF){
78  if(type == kFullCAF){
79  std::cerr << "\nWARNING: FlatCAFs not available, using regular CAFs"
80  << std::endl << std::endl;
81  flat = kNormalCAF;
82  }
83  if(type == kDecaf){
84  std::cerr << "\nWARNING: FlatDecafs not available, using regular decafs"
85  << std::endl << std::endl;
86  flat = kNormalCAF;
87  }
88  }
89 
90 
92 
93  switch(type){
94  case ECAFType::kFullCAF: ret = "caf"; break;
95  case ECAFType::kDecaf: ret = "decaf"; break;
96  case ECAFType::kNueConcat: // fallthrough
97  case ECAFType::kNumuConcat: // fallthrough
98  case ECAFType::kNusConcat: ret = "sumdecaf"; break;
99  default:
100  std::cout << "Unknown ECAFType " << type << std::endl;
101  std::cout << "Aborting..." << std::endl;
102  abort();
103  }
104 
105  if(flat == kFlatCAF) return "flat"+ret; else return ret;
106  }
OStream cerr
Definition: OStream.cxx:7
OStream cout
Definition: OStream.cxx:6
enum BeamMode string
const std::string ana::Prod4LoadersBase::ECAFTypeToString ( ECAFType  type)
protectedinherited

Utility to convert CAF type enum to a string description.

Parameters
typeECAFType that specifies the CAF type.
Returns
String describing the CAF type.

Definition at line 53 of file Prod4Loaders.cxx.

References om::cout, allTimeWatchdog::endl, it, ana::kDecaf, ana::kFullCAF, ana::kNueConcat, ana::kNumuConcat, and ana::kNusConcat.

54  {
55  const std::map<ECAFType, std::string> mapStringECAFType {
56  {ECAFType::kFullCAF, "caf"},
57  {ECAFType::kDecaf, "nue_or_numu_or_nus_contain"},
58  {ECAFType::kNueConcat, "nue2018"},
59  {ECAFType::kNumuConcat, "numu2018"},
60  {ECAFType::kNusConcat, "nus2018"}
61  };
62 
63  auto it = mapStringECAFType.find(type);
64  if(it == mapStringECAFType.end()) {
65  std::cout << "Unknown ECAFType " << type << std::endl;
66  std::cout << "Aborting..." << std::endl;
67  abort();
68  }
69  return it->second;
70  }
set< int >::iterator it
OStream cout
Definition: OStream.cxx:6
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::assert(), 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, and ana::Loaders::kNonSwap.

Referenced by NDPredictionHandler::AddVar(), BlessedPlotsLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demoSysts(), ana::FDExtrap::FDExtrap_c(), ana::SterileGenerator::Generate(), generate_fd_fake_events(), ana::Loaders::GetND(), MakeDecomp(), MakeMap(), MakeNus2019CovMxSysts(), MakePPFXRatios(), MakeSystRatios(), MakeSysts(), mec_tuning(), mec_tuning_preds_2020(), ana::ModularExtrapSterile::NCDisappearance(), ana::NDExtrap::NDExtrap_c(), ReifyLoaders(), sterile_demo(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsGENIELoad(), SystsGENIELoad17(), SystsNDRockLoad(), ana::ModularExtrapSterile::TrivialExtrapNC(), TrueNCSpectrum(), and TrueSpectrumFromKaons().

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);
148  if(fSpillCut) fLoaders[key]->SetSpillCut(*fSpillCut);
149  return *fLoaders[key];
150  }
151  auto itFiles = fLoaderFiles.find(key);
152  if(itFiles != fLoaderFiles.end()){
153  fLoaders[key] = new SpectrumLoader(itFiles->second);
154  if(fSpillCut) fLoaders[key]->SetSpillCut(*fSpillCut);
155  return *fLoaders[key];
156  }
157 
158  return fNull;
159  }
Near Detector underground.
Definition: SREnums.h:10
std::map< Key_t, std::string > fLoaderPaths
Definition: Loaders.h:81
const SpillCut * fSpillCut
Definition: Loaders.h:86
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:78
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:89
assert(nhit_max >=nhit_nbins)
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:82
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:84
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
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::assert(), 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:78
Far Detector at Ash River.
Definition: SREnums.h:11
bool datamc
Definition: fnexvscaf.C:20
assert(nhit_max >=nhit_nbins)
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:82
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
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::assert(), 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(), GetLoaders2020(), 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:81
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:78
Far Detector at Ash River.
Definition: SREnums.h:11
bool datamc
Definition: fnexvscaf.C:20
assert(nhit_max >=nhit_nbins)
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
bool ana::Loaders::GetND ( )
inlineinherited

Definition at line 66 of file Loaders.h.

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

66 { return fND; }
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
virtual std::string ana::Prod4DataLoaders::GetSystString ( ) const
inlinevirtual

Get sting describing the associated systematic.

Returns
String describing the systematic associated with this loader.

Reimplemented in ana::Prod4CalibShapeLoaders, ana::Prod4CherenkovLoaders, ana::Prod4LightLevelLoaders, ana::Prod4AbsCalibLoaders, and ana::Prod4NomLoaders.

Definition at line 84 of file Prod4Loaders.h.

84 {return "Data";}
void ana::Loaders::Go ( )
inherited

Call Go() on all the loaders.

Definition at line 162 of file Loaders.cxx.

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

Referenced by BlessedPlotsLoad(), cc(), Compare_NoExtrap(), ComparisonPlots_MC(), CutFlow_MC(), CutTableLoad(), DataMCLoad(), DataMCNDLoad_nus17(), demo_flat(), demoSysts(), efficiency(), efficiencySA(), ExampleCode(), FD_Data_PosComp(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), futureSig_getNueNumuSyst(), generate_fd_fake_events(), GenFile(), genie_preds_make(), get_fdmc_spectra(), get_spectra_2dplots(), ana::Loaders::GetND(), getPredictions(), getPredictions_updatedAna(), load_files(), make_DataMCComp_numu(), make_extrap_figure_hists(), make_nue_xsec_pred(), make_nueFDprediction_kinematics_FHC(), make_nueFDprediction_kinematics_FHC_pTExtrap(), make_nueFDprediction_kinematics_FHC_REW(), make_nueFDprediction_kinematics_FHC_REW_pTExtrap(), make_nueFDprediction_kinematics_RHC(), make_nueFDprediction_kinematics_RHC_pTExtrap(), make_nueFDprediction_kinematics_RHC_REW(), make_nueFDprediction_kinematics_RHC_REW_pTExtrap(), make_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_rockpred(), MakeCovarSim(), MakeNus17PredictionSysts(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakeNus18SidebandPred(), MakeNus18Systs(), MakeNus2019CovMxSysts(), MakeNusPredictionSystsAna01(), MakePPFXRatios(), makePred(), MakePrediction(), MakePredictionNoOsc_FHC_FD(), MakePredictionNoOsc_FHC_ND(), MakePredictionNoOsc_RHC_FD(), MakePredictionNoOsc_RHC_ND(), MakeSystRatios(), MakeSysts(), MakeUnoscPlots(), mec_tuning(), mec_tuning_preds_2020(), NoExtrap(), NueExtrap(), NuMu2019_BasicPIDPlots_FD(), NuMu2020_BasicPIDPlots_FD(), NumuExtrap(), nus17_fd_cut_tables2D(), Nus18SystsBeamTranspLoad(), Nus18SystsCalibAbsLoad(), Nus18SystsCalibRelLoad(), Nus18SystsGENIELoad(), Nus18SystsKaonLoad(), Nus18SystsLightLevelLoad(), Nus18SystsLLMethodLoad(), Nus18SystsNeutronLoad(), Nus18SystsPPFXLoad(), Nus18SystsTauLoad(), Nus18SystsXSecOnOffLoad(), resolution2018(), 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_numu_summed_genie_systs(), test_prediction_interp(), TrueNCSpectrum(), TrueSpectrumFromKaons(), and xsec_extrap_plots().

163  {
164  for(auto it: fLoaders)
165  {
166  if (!it.second->Gone())
167  it.second->Go();
168  }
169  }
set< int >::iterator it
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:84
void ana::Prod4LoadersBase::SetLoaderFDMCPaths ( const std::string prefix,
const std::string suffix,
const bool  noTau = false 
)
protectedinherited

Set FarDet MC paths.

Sets nonswap, fluxswap and tau (if applicable) using the format: prefix_[nonswap|fluxswap|tau]_suffix.

Parameters
prefixString describing the first part of the file path (e.g. "prod_caf_R17-11-14-prod4reco.d_fd_genie").
suffixString describing the second part of the file path (e.g. "fhc_nova_v08_full_caf_v1").
noTauBoolean flag not to set tau file path (default is false, tau file paths will be set).

Definition at line 33 of file Prod4Loaders.cxx.

References ana::Prod4LoadersBase::SetLoaderPaths().

Referenced by ana::Prod4AbsCalibLoaders::Prod4AbsCalibLoaders(), ana::Prod4CalibShapeLoaders::Prod4CalibShapeLoaders(), ana::Prod4CherenkovLoaders::Prod4CherenkovLoaders(), ana::Prod4LightLevelLoaders::Prod4LightLevelLoaders(), and ana::Prod4NomLoaders::Prod4NomLoaders().

36  {
37  if(noTau) // don't set tau path
38  SetLoaderPaths(prefix+"_nonswap_"+suffix,
39  prefix+"_fluxswap_"+suffix);
40  else // set all three beam MC paths
41  SetLoaderPaths(prefix+"_nonswap_"+suffix,
42  prefix+"_fluxswap_"+suffix,
43  prefix+"_tau_"+suffix);
44  }
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: Prod4Loaders.cxx:9
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::assert(), 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(), 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:78
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
assert(nhit_max >=nhit_nbins)
std::map< Key_t, std::vector< std::string > > fLoaderFiles
Definition: Loaders.h:82
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
void ana::Prod4LoadersBase::SetLoaderNDMCPath ( const std::string ndmc)
protectedinherited

Set NearDet MC paths.

Parameters
ndmcString describing the path/samweb definition for NearDet MC files (default empty string).

Definition at line 47 of file Prod4Loaders.cxx.

References ana::Prod4LoadersBase::SetLoaderPaths().

Referenced by ana::Prod4AbsCalibLoaders::Prod4AbsCalibLoaders(), ana::Prod4CalibShapeLoaders::Prod4CalibShapeLoaders(), ana::Prod4CherenkovLoaders::Prod4CherenkovLoaders(), ana::Prod4LightLevelLoaders::Prod4LightLevelLoaders(), and ana::Prod4NomLoaders::Prod4NomLoaders().

48  {
49  SetLoaderPaths("", "", "", ndmc);
50  }
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: Prod4Loaders.cxx:9
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::assert(), 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(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), generate_fd_fake_events(), genie_preds_make(), get_spectra_2dplots(), GetLoaders2017(), GetLoaders2017FakeData(), GetLoaders2018(), GetLoaders2020(), getPredictions(), getPredictions_updatedAna(), make_extrap_figure_hists(), make_prediction(), make_prediction_rhc(), make_rockpred(), MakeNus17PredictionSysts(), MakeNusPredictionSystsAna01(), mec_tuning(), mec_tuning_preds_2020(), NueExtrap(), NuMu2019_BasicPIDPlots_FD(), NuMu2020_BasicPIDPlots_FD(), NumuExtrap(), nus17_fd_cut_tables2D(), Nus18SystsLLMethodLoad(), ana::Prod3DataLoaders::Prod3DataLoaders(), Prod4DataLoaders(), ana::Prod5DataLoaders::Prod5DataLoaders(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), set_loaders_ana2018(), ana::Prod3LoadersBase::SetLoaderPaths(), ana::Prod4LoadersBase::SetLoaderPaths(), ana::Prod5LoadersBase::SetLoaderPaths(), SetLoaderPaths2017(), setLoadersPathNumu2017(), setPathsFNALP123b(), setPathsFNALP3c(), setPathsRHC(), 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:81
std::tuple< caf::Det_t, DataMC, DataSource, SwappingConfig > Key_t
Definition: Loaders.h:78
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
assert(nhit_max >=nhit_nbins)
bool fND
Bool to set loader for near detector instead of far detector.
Definition: Loaders.h:91
void ana::Prod4LoadersBase::SetLoaderPaths ( const std::string fdmc_nonswap,
const std::string fdmc_fluxswap,
const std::string fdmc_tauswap = "",
const std::string ndmc = "",
const std::string nddata = "" 
)
protectedinherited

Set a range of FD and ND MC and ND data paths.

Provides this method for all derived classes. Can use this method to set any number of paths - any blank paths will be ignored.

Parameters
fdmc_nonswapString describing the path/samweb definition for FarDet MC non-swap files.
fdmc_fluxswapString describing the path/samweb definition for FarDet MC flux-swap files.
fdmc_tauswapString describing the path/samweb definition for FarDet MC tau files (default empty sting).
ndmcString describing the path/samweb definition for NearDet MC files (default empty string).
nddataString describing the path/samweb definition for NearDet data files (default empty string).

Definition at line 9 of file Prod4Loaders.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 ana::Prod4LoadersBase::SetLoaderFDMCPaths(), and ana::Prod4LoadersBase::SetLoaderNDMCPath().

14  {
15  if(!fdmc_nonswap.empty())
16  SetLoaderPath(fdmc_nonswap, caf::kFARDET,
18  if(!fdmc_fluxswap.empty())
19  SetLoaderPath(fdmc_fluxswap, caf::kFARDET,
21  if(!fdmc_tauswap.empty())
22  SetLoaderPath(fdmc_tauswap, caf::kFARDET,
24  if(!ndmc.empty())
27  if(!nddata.empty())
30  }
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
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(), ExampleCode(), FD_plots(), FDDataMCSystBandLoad(), fiducial_accounting(), FitSystEffectsLoad(), futureSig_getNueNumuSyst(), generate_fd_fake_events(), genie_preds_make(), get_fdmc_spectra(), get_spectra_2dplots(), getPredictions(), getPredictions_updatedAna(), make_DataMCComp_numu(), make_extrap_figure_hists(), make_nueFDprediction_kinematics_FHC(), make_nueFDprediction_kinematics_FHC_pTExtrap(), make_nueFDprediction_kinematics_FHC_REW(), make_nueFDprediction_kinematics_FHC_REW_pTExtrap(), make_nueFDprediction_kinematics_RHC(), make_nueFDprediction_kinematics_RHC_pTExtrap(), make_nueFDprediction_kinematics_RHC_REW(), make_nueFDprediction_kinematics_RHC_REW_pTExtrap(), make_prediction(), make_prediction_extrap(), make_prediction_noextrap(), make_prediction_rhc(), make_rockpred(), MakeCovarSim(), MakeNus17PredictionSysts(), MakeNus18CovarSim(), MakeNus18ExtrapPred(), MakeNus18SidebandPred(), MakeNus18Systs(), MakeNus2019CovMxSysts(), MakeNusPredictionSystsAna01(), MakePPFXRatios(), makePred(), MakePrediction(), MakePredictionNoOsc_FHC_FD(), MakePredictionNoOsc_FHC_ND(), MakePredictionNoOsc_RHC_FD(), MakePredictionNoOsc_RHC_ND(), MakeSystRatios(), MakeSysts(), MakeUnoscPlots(), mec_tuning(), mec_tuning_preds_2020(), NoExtrap(), NueExtrap(), NuMu2019_BasicPIDPlots_FD(), NuMu2020_BasicPIDPlots_FD(), NumuExtrap(), nus17_fd_cut_tables2D(), Nus18SystsBeamTranspLoad(), Nus18SystsCalibAbsLoad(), Nus18SystsCalibRelLoad(), Nus18SystsGENIELoad(), Nus18SystsKaonLoad(), Nus18SystsLightLevelLoad(), Nus18SystsLLMethodLoad(), Nus18SystsNeutronLoad(), Nus18SystsPPFXLoad(), Nus18SystsTauLoad(), Nus18SystsXSecOnOffLoad(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), SystsAcceptanceLoad17(), SystsBeamLoad(), SystsBeamTranspLoad17(), SystsDecompLoad(), SystsDecompLoad17(), SystsFidContLoad(), SystsGENIELoad(), SystsGENIELoad17(), SystsMCStatsLoad(), SystsNDRockLoad(), test_numu_summed_genie_systs(), TrueNCSpectrum(), TrueSpectrumFromKaons(), 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:86
set< int >::iterator it
_Cut< caf::SRSpillProxy > SpillCut
Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts.
Definition: Cut.h:100
const Cut cut
Definition: exporter_fd.C:30
std::map< Key_t, SpectrumLoader * > fLoaders
Definition: Loaders.h:84

Member Data Documentation

const std::string ana::Prod4DataLoaders::cafType
protected
const std::string ana::Prod4DataLoaders::dataTier
protected

from "caf" to "flatsumdecaf"

Definition at line 90 of file Prod4Loaders.h.

Referenced by Prod4DataLoaders(), and ana::Prod4NomLoaders::Prod4NomLoaders().

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
const std::string ana::Prod4DataLoaders::fluxType
protected
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 89 of file Loaders.h.

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

const SpillCut* ana::Loaders::fSpillCut
protectedinherited

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