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

Loaders for absolute calibration paths/definitions. More...

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

Inheritance diagram for ana::Prod5AbsCalibLoaders:
ana::Prod5NomLoaders ana::Prod5DataLoaders ana::Prod5LoadersBase ana::Loaders

Public Types

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

Public Member Functions

 Prod5AbsCalibLoaders (ECAFType type, FluxType flux, int sign, std::string WhichPeriod="full", std::string WhichNDPeriod="full", EFlatness flat=kNormalCAF)
 
std::string GetSystString () const override
 
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, bool flatCAFsExist) 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

Loaders for absolute calibration paths/definitions.

Definition at line 122 of file Prod5Loaders.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::Prod5AbsCalibLoaders::Prod5AbsCalibLoaders ( ECAFType  type,
FluxType  flux,
int  sign,
std::string  WhichPeriod = "full",
std::string  WhichNDPeriod = "full",
EFlatness  flat = kNormalCAF 
)

Create absolute calibration loaders instance.

sign should be +1 (scale energies up) or -1 (scale energies down)

Parameters
typeECAFType to specify the CAF type.
fluxFluxType to specify the flux (kFHC/kRHC).
signInteger specifying shift up or down.
WhichPeriodString describing the desired range ("full" only).
WhichNDPeriodString describing the desired range ("full" only).

Definition at line 255 of file Prod5Loaders.cxx.

References abs(), ana::assert(), ana::Prod5DataLoaders::cafType, om::cerr, ana::Prod5LoadersBase::ECAFTypeFlatToTier(), allTimeWatchdog::endl, ana::Prod5DataLoaders::fluxType, ana::kDecaf, ana::Loaders::kFHC, ana::kFullCAF, ana::kNueConcat, ana::kNumuConcat, ana::kNusConcat, shutoffs::rel, ana::Prod5LoadersBase::SetLoaderFDMCPaths(), ana::Prod5LoadersBase::SetLoaderNDMCPath(), string, and runNovaSAM::tier.

261  : Prod5NomLoaders(type, flux, WhichPeriod, WhichNDPeriod, flat)
262  {
263  assert(abs(sign) == 1);
264 
265  const bool isFull = ((WhichNDPeriod == "full") && (WhichPeriod == "full"));
266  if(!isFull)
267  {
268  std::cerr << "\nWARNING: loaders not available for individual periods, only full sample" << std::endl << std::endl;
269  abort();
270  }
271 
272  const std::string rel = "l"; // assuming same for FHC/RHC
273  const std::string ndrel = "l"; // assuming same for FHC/RHC
274 
275  const std::string updown = (sign > 0) ? "calibup" : "calibdown";
276 
277  std::string ndsuffix = "";
278  if(flux == kFHC)
279  ndsuffix = "_prod5";
280 
281  const std::string tier = ECAFTypeFlatToTier(type, flat, false);
282 
283  if(type == kNueConcat || type == kNumuConcat || type == kNusConcat)
284  {
285  if(WhichPeriod == "full" && WhichNDPeriod == "full") // only "full"
286  {
288  "prod_" + tier + "_R19-11-18-prod5reco." + rel + "_fd_genie_N1810j0211a_",
289  fluxType + "_nova_v08_" + WhichPeriod + "_" +
290  updown + "_v1_" + cafType, true);
292  "prod_" + tier + "_R19-11-18-prod5reco." + ndrel +
293  "_nd_genie_N1810j0211a_nonswap_" + fluxType + "_nova_v08_" + WhichNDPeriod +
294  "_" + updown + "_v1" + ndsuffix + "_" + cafType);
295  }
296  }
297 
298  if(type == kDecaf)
299  {
300  std::cerr << "\nWARNING: decaf loaders not available, "
301  << "use full CAF instead" << std::endl << std::endl;
302  abort();
303  }
304 
305  if(type == kFullCAF)
306  {
308  "prod_"+tier+"_R19-11-18-prod5reco." + rel + "_fd_genie_N1810j0211a_",
309  fluxType + "_nova_v08_" + WhichPeriod + "_" + updown + "_v1",
310  true);
312  "prod_"+tier+"_R19-11-18-prod5reco." + ndrel + "_nd_genie_N1810j0211a_nonswap_" +
313  fluxType + "_nova_v08_" + WhichNDPeriod + "_" + updown + "_v1" + ndsuffix);
314  }
315  }
void SetLoaderNDMCPath(const std::string &ndmc)
std::string ECAFTypeFlatToTier(ECAFType type, EFlatness flat, bool flatCAFsExist) const
OStream cerr
Definition: OStream.cxx:7
void abs(TH1 *hist)
void SetLoaderFDMCPaths(const std::string &prefix, const std::string &suffix, const bool noTau=false)
Loaders::FluxType flux
string rel
Definition: shutoffs.py:11
const std::string cafType
Definition: Prod5Loaders.h:93
assert(nhit_max >=nhit_nbins)
const std::string fluxType
Definition: Prod5Loaders.h:96
def sign(x)
Definition: canMan.py:197
Prod5NomLoaders(ECAFType type, FluxType flux, std::string WhichPeriod="full", std::string WhichNDPeriod="full", EFlatness flat=kNormalCAF)
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::Prod5LoadersBase::ECAFTypeFlatToTier ( ECAFType  type,
EFlatness  flat,
bool  flatCAFsExist 
) const
protectedinherited

Definition at line 74 of file Prod5Loaders.cxx.

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

Referenced by Prod5AbsCalibLoaders(), ana::Prod5CalibDriftLoaders::Prod5CalibDriftLoaders(), ana::Prod5CalibShapeLoaders::Prod5CalibShapeLoaders(), ana::Prod5CherenkovLoaders::Prod5CherenkovLoaders(), and ana::Prod5LightLevelLoaders::Prod5LightLevelLoaders().

77  {
78  if(flat == kFlatCAF && !flatCAFsExist){
79  std::cout << "\nWARNING: FlatCAFs not available (yet) for " << GetSystString() << ", falling back to regular CAFs.\nIf they are in fact now available, please change the appropriate 'false' to 'true' in Prod5Loaders.cxx and commit." << std::endl;
80  flat = kNormalCAF;
81  }
82 
83  // TODO - remove this logic once flatcafs are more widely available
84  if(flat == kFlatCAF){
85  if(type == kFullCAF){
86  std::cerr << "\nWARNING: FlatCAFs not available, using regular CAFs"
87  << std::endl << std::endl;
88  flat = kNormalCAF;
89  }
90  if(type == kDecaf){
91  std::cerr << "\nWARNING: FlatDecafs not available, using regular decafs"
92  << std::endl << std::endl;
93  flat = kNormalCAF;
94  }
95  }
96 
97 
99 
100  switch(type){
101  case ECAFType::kFullCAF: ret = "caf"; break;
102  case ECAFType::kDecaf: ret = "decaf"; break;
103  case ECAFType::kNueConcat: // fallthrough
104  case ECAFType::kNumuConcat: // fallthrough
105  case ECAFType::kNusConcat: ret = "sumdecaf"; break;
106  default:
107  std::cout << "Unknown ECAFType " << type << std::endl;
108  std::cout << "Aborting..." << std::endl;
109  abort();
110  }
111 
112  if(flat == kFlatCAF) return "flat"+ret; else return ret;
113  }
OStream cerr
Definition: OStream.cxx:7
OStream cout
Definition: OStream.cxx:6
virtual std::string GetSystString() const =0
enum BeamMode string
const std::string ana::Prod5LoadersBase::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 54 of file Prod5Loaders.cxx.

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

55  {
56  const std::map<ECAFType, std::string> mapStringECAFType {
57  {ECAFType::kFullCAF, "caf"},
58  {ECAFType::kDecaf, "nue_or_numu_or_nus_contain"},
59  {ECAFType::kNueConcat, "nue2020"},
60  {ECAFType::kNumuConcat, "numu2020"},
61  {ECAFType::kNusConcat, "nus2020"}
62  };
63 
64  auto it = mapStringECAFType.find(type);
65  if(it == mapStringECAFType.end()) {
66  std::cout << "Unknown ECAFType " << type << std::endl;
67  std::cout << "Aborting..." << std::endl;
68  abort();
69  }
70  return it->second;
71  }
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
std::string ana::Prod5AbsCalibLoaders::GetSystString ( ) const
inlineoverridevirtual

Get string describing the associated systematic.

Returns
String describing the systematic associated with this loader.

Reimplemented from ana::Prod5NomLoaders.

Definition at line 143 of file Prod5Loaders.h.

143 {return "Calibration";}
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::Prod5LoadersBase::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 Prod5Loaders.cxx.

References ana::Prod5LoadersBase::SetLoaderPaths().

Referenced by Prod5AbsCalibLoaders(), ana::Prod5CalibDriftLoaders::Prod5CalibDriftLoaders(), ana::Prod5CalibShapeLoaders::Prod5CalibShapeLoaders(), ana::Prod5CherenkovLoaders::Prod5CherenkovLoaders(), ana::Prod5LightLevelLoaders::Prod5LightLevelLoaders(), and ana::Prod5NomLoaders::Prod5NomLoaders().

36  {
37  if(noTau) // don't set tau path
38  // the previous way with "_" was rather confusing
39  SetLoaderPaths(prefix+"nonswap_"+suffix,
40  prefix+"fluxswap_"+suffix);
41  else // set all three beam MC paths
42  SetLoaderPaths(prefix+"nonswap_"+suffix,
43  prefix+"fluxswap_"+suffix,
44  prefix+"tau_"+suffix);
45  }
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: Prod5Loaders.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::Prod5LoadersBase::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 48 of file Prod5Loaders.cxx.

References ana::Prod5LoadersBase::SetLoaderPaths().

Referenced by Prod5AbsCalibLoaders(), ana::Prod5CalibDriftLoaders::Prod5CalibDriftLoaders(), ana::Prod5CalibShapeLoaders::Prod5CalibShapeLoaders(), ana::Prod5CherenkovLoaders::Prod5CherenkovLoaders(), ana::Prod5LightLevelLoaders::Prod5LightLevelLoaders(), and ana::Prod5NomLoaders::Prod5NomLoaders().

49  {
50  SetLoaderPaths("", "", "", ndmc);
51  }
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: Prod5Loaders.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(), ana::Prod4DataLoaders::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::Prod5LoadersBase::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 Prod5Loaders.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::Prod5LoadersBase::SetLoaderFDMCPaths(), and ana::Prod5LoadersBase::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::Prod5DataLoaders::cafType
protectedinherited
const std::string ana::Prod5DataLoaders::dataTier
protectedinherited

from "caf" to "flatsumdecaf"

Definition at line 95 of file Prod5Loaders.h.

Referenced by ana::Prod5DataLoaders::Prod5DataLoaders(), and ana::Prod5NomLoaders::Prod5NomLoaders().

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::Prod5DataLoaders::fluxType
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 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: