Prod4Loaders.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Loaders.h"
4 
5 #include <map>
6 #include <string>
7 
8 namespace ana
9 {
10  /// Base class for prod4 loaders.
11  class Prod4LoadersBase: public Loaders
12  {
13  protected:
14  /// Set a range of FD and ND MC and ND data paths.
15  ///
16  /// Provides this method for all derived classes. Can use this method to
17  /// set any number of paths - any blank paths will be ignored.
18  ///
19  /// \param fdmc_nonswap String describing the path/samweb definition for
20  /// FarDet MC non-swap files.
21  /// \param fdmc_fluxswap String describing the path/samweb definition for
22  /// FarDet MC flux-swap files.
23  /// \param fdmc_tauswap String describing the path/samweb definition for
24  /// FarDet MC tau files (default empty sting).
25  /// \param ndmc String describing the path/samweb definition for
26  /// NearDet MC files (default empty string).
27  /// \param nddata String describing the path/samweb definition for
28  /// NearDet data files (default empty string).
29  void SetLoaderPaths(const std::string& fdmc_nonswap,
30  const std::string& fdmc_fluxswap,
31  const std::string& fdmc_tauswap="",
32  const std::string& ndmc="",
33  const std::string& nddata="");
34 
35  /// Set FarDet MC paths.
36  ///
37  /// Sets nonswap, fluxswap and tau (if applicable) using the format:
38  /// prefix_[nonswap|fluxswap|tau]_suffix.
39  ///
40  /// \param prefix String describing the first part of the file path (e.g.
41  /// "prod_caf_R17-11-14-prod4reco.d_fd_genie").
42  /// \param suffix String describing the second part of the file path (e.g.
43  /// "fhc_nova_v08_full_caf_v1").
44  /// \param noTau Boolean flag not to set tau file path (default is false,
45  /// tau file paths will be set).
47  const std::string& suffix,
48  const bool noTau=false);
49 
50  /// Set NearDet MC paths.
51  ///
52  /// \param ndmc String describing the path/samweb definition for
53  /// NearDet MC files (default empty string).
54  void SetLoaderNDMCPath(const std::string& ndmc);
55 
56  /// Utility to convert CAF type enum to a string description.
57  ///
58  /// \param type ECAFType that specifies the CAF type.
59  /// \return String describing the CAF type.
62  };
63 
64  /// Provide the data loaders only, base class for other loaders
66  {
67  public:
68  /// Create data loaders instance.
69  ///
70  /// \param type ECAFType to specify the CAF type.
71  /// \param flux FluxType to specify the flux (kFHC/kRHC).
72  /// \param WhichPeriod String describing the desired range
73  /// (e.g. "full" - default, "period4", "epoch6a").
74  /// \param WhichNDPeriod String describing the desired range
75  /// (e.g. "full" - default, "period4", "epoch6a").
77  FluxType flux,
78  std::string WhichPeriod="full",
79  std::string WhichNDPeriod="full",
81  /// Get sting describing the associated systematic.
82  ///
83  /// \return String describing the systematic associated with this loader.
84  virtual std::string GetSystString() const {return "Data";}
85 
86  // Some useful protected members
87  protected:
88  const std::string cafType; ///< A string describing the CAF type,
89  ///< e.g nueconcat2018
90  const std::string dataTier; ///< from "caf" to "flatsumdecaf"
91  const std::string fluxType; ///< A string describing the flux,
92  ///< e.g nonswap
93  };
94 
95  /// For nominal spectra and reweighting systs (xsec/flux)
97  {
98  public:
99  /// Create Nominal loaders instance.
100  ///
101  /// \param type ECAFType to specify the CAF type.
102  /// \param flux FluxType to specify the flux (kFHC/kRHC).
103  /// \param WhichPeriod String describing the desired range
104  /// (e.g. "full" - default, "period4", "epoch6a").
105  /// \param WhichNDPeriod String describing the desired range
106  /// (e.g. "full" - default, "period4", "epoch6a").
108  FluxType flux,
109  std::string WhichPeriod="full",
110  std::string WhichNDPeriod="full",
112  /// Get sting describing the associated systematic.
113  ///
114  /// \return String describing the systematic associated with this loader.
115  virtual std::string GetSystString() const {return "Nominal";}
116  };
117 
118  /// Loaders for absolute calibration paths/definitions.
120  {
121  public:
122  /// Create absolute calibration loaders instance.
123  ///
124  /// \a sign should be +1 (scale energies up) or -1 (scale energies down)
125  ///
126  /// \param type ECAFType to specify the CAF type.
127  /// \param flux FluxType to specify the flux (kFHC/kRHC).
128  /// \param sign Integer specifying shift up or down.
129  /// \param WhichPeriod String describing the desired range
130  /// (e.g. "full" - default, "period4", "epoch6a").
131  /// \param WhichNDPeriod String describing the desired range
132  /// (e.g. "full" - default, "period4", "epoch6a").
134  FluxType flux,
135  int sign,
136  std::string WhichPeriod="full",
137  std::string WhichNDPeriod="full");
138  /// Get sting describing the associated systematic.
139  ///
140  /// \return String describing the systematic associated with this loader.
141  virtual std::string GetSystString() const {return "Calibration";}
142  };
143 
144  /// Loaders for light level paths/definitions.
146  {
147  public:
148  /// Create light level loaders instance.
149  ///
150  /// \warning Prod4 light level file definitions do not exist at present.
151  ///
152  /// \param type ECAFType to specify the CAF type.
153  /// \param flux FluxType to specify the flux (kFHC/kRHC).
154  /// \param sign Integer specifying shift up or down: +1 sigma is light
155  /// levels up, calibration down, 0 is no shift photon rewriter.
156  /// \param WhichPeriod String describing the desired range
157  /// (e.g. "full" - default, "period4", "epoch6a").
158  /// \param WhichNDPeriod String describing the desired range
159  /// (e.g. "full" - default, "period4", "epoch6a").
161  FluxType flux,
162  int sign,
163  std::string WhichPeriod="full",
164  std::string WhichNDPeriod="full");
165  /// Get sting describing the associated systematic.
166  ///
167  /// \return String describing the systematic associated with this loader.
168  virtual std::string GetSystString() const {return "Lightlevel";}
169  };
170 
171  /// Loaders for Cherenkov paths/definitions.
173  {
174  public:
175  /// Create Cherenkov loaders instance.
176  ///
177  /// \warning Prod4 Cherenkov file definitions do not exist at present.
178  ///
179  /// \param type ECAFType to specify the CAF type.
180  /// \param flux FluxType to specify the flux (kFHC/kRHC).
181  /// \param WhichPeriod String describing the desired range
182  /// (e.g. "full" - default, "period4", "epoch6a").
183  /// \param WhichNDPeriod String describing the desired range
184  /// (e.g. "full" - default, "period4", "epoch6a").
186  FluxType flux,
187  std::string WhichPeriod="full",
188  std::string WhichNDPeriod="full");
189  /// Get sting describing the associated systematic.
190  ///
191  /// \return String describing the systematic associated with this loader.
192  virtual std::string GetSystString() const {return "Cherenkov";}
193  };
194 
195  /// Loaders for calibration shape paths/definitions.
197  {
198  public:
199  /// Create calibration shape loaders instance.
200  ///
201  /// \param type ECAFType to specify the CAF type
202  /// (e.g. kFullCAF, kNueConcat)
203  /// \param flux FluxType to specify the flux (kFHC/kRHC).
204  /// \param WhichPeriod String describing the desired range
205  /// (e.g. "full" - default, "period4", "epoch6a").
206  /// \param WhichNDPeriod String describing the desired range
207  /// (e.g. "full" - default, "period4", "epoch6a").
209  FluxType flux,
210  std::string WhichPeriod="full",
211  std::string WhichNDPeriod="full");
212  /// Get sting describing the associated systematic.
213  ///
214  /// \return String describing the systematic associated with this loader.
215  virtual std::string GetSystString() const {return "CalibShape";}
216  };
217 
218 } //namespace
void SetLoaderNDMCPath(const std::string &ndmc)
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const std::string cafType
Definition: Prod4Loaders.h:88
EFlatness
Definition: Loaders.h:20
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
Loaders for Cherenkov paths/definitions.
Definition: Prod4Loaders.h:172
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:84
const std::string fluxType
Definition: Prod4Loaders.h:91
Loaders::FluxType flux
Loaders for calibration shape paths/definitions.
Definition: Prod4Loaders.h:196
Loaders for absolute calibration paths/definitions.
Definition: Prod4Loaders.h:119
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:115
Loaders for light level paths/definitions.
Definition: Prod4Loaders.h:145
const XML_Char * prefix
Definition: expat.h:380
const std::string ECAFTypeToString(ECAFType type)
Base class for prod4 loaders.
Definition: Prod4Loaders.h:11
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:168
std::string ECAFTypeFlatToTier(ECAFType type, EFlatness flat) const
Provide the data loaders only, base class for other loaders.
Definition: Prod4Loaders.h:65
const std::string dataTier
from "caf" to "flatsumdecaf"
Definition: Prod4Loaders.h:90
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod4Loaders.h:96
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
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:141
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:192
void SetLoaderFDMCPaths(const std::string &prefix, const std::string &suffix, const bool noTau=false)
virtual std::string GetSystString() const
Definition: Prod4Loaders.h:215
def sign(x)
Definition: canMan.py:197
ECAFType
Definition: Loaders.h:19
enum BeamMode string